Hello,
I've been integrating libyuv into our build system, but I encountered a couple of issues with the linux.mk makefile. I'd prefer not setup a Google+ account, so I thought I would email you as the owner of libyuv. Please let me know if there is a mailing list where you'd prefer I submit these changes. I've attached a gzipped patch to address these issues within our environment, but I think the changes make sense for all users. I have also pasted the contents of this patch below, for further explanation.
CC is commonly reserved for GCC, and your wiki instructions even specify to export CC=CROSS_TOOL-gcc. Using CC=gcc would cause linker errors trying to link stdc++. I switched to using CXX and CXXFLAGS--as it seems more standard.
I modifed these CC and CCFLAGS assignments to be conditional, except for -Iinclude, which seems to be necessary for building all the objects in the project.
I removed linux.mk as a dependency for the recipes, because that really doesn't make much sense, since the makefile has no recipe, and is not generated. If it were an included/generated makefile, I think having that dep could be correct.
Lastly, I added libyuv.a as a dependency for the convert utility recipe. This fixes issues with parallel make.
I hope these changes are helpful to you! Thanks for doing open source work! I also plan to create an 'install' make target, please let me know if you would like a patch for that as well.
diff -Nuar libyuv-r634-orig/linux.mk libyuv-r634/linux.mk
--- libyuv-r634-orig/linux.mk 2014-01-28 15:00:05.348272143 -0500
+++ libyuv-r634/linux.mk 2014-01-28 15:01:13.536270622 -0500
@@ -1,8 +1,9 @@
# This is a generic makefile for libyuv for gcc.
# make -f linux.mk CC=clang++
-CC=g++
-CCFLAGS=-O2 -fomit-frame-pointer -Iinclude/
+CXX?=g++
+CXXFLAGS?=-O2 -fomit-frame-pointer
+CXXFLAGS+=-Iinclude/
LOCAL_OBJ_FILES := \
source/compare.o \
@@ -32,16 +33,16 @@
source/video_common.o
.cc.o:
- $(CC) -c $(CCFLAGS) $*.cc -o $*.o
+ $(CXX) -c $(CXXFLAGS) $*.cc -o $*.o
-all: libyuv.a convert linux.mk
+all: libyuv.a convert
-libyuv.a: $(LOCAL_OBJ_FILES) linux.mk
+libyuv.a: $(LOCAL_OBJ_FILES)
$(AR) $(ARFLAGS) -o $@ $(LOCAL_OBJ_FILES)
# A test utility that uses libyuv conversion.
-convert: util/convert.cc linux.mk
- $(CC) $(CCFLAGS) -Iutil/ -o $@ util/convert.cc libyuv.a
+convert: util/convert.cc libyuv.a
+ $(CXX) $(CXXFLAGS) -Iutil/ -o $@ util/convert.cc libyuv.a
clean:
/bin/rm -f source/*.o *.ii *.s libyuv.a convert
Regards
--
Andy Voltz
Timesys Corporation