From 0aa230434b3a4449548dddd4e389176cb6eeeb9a Mon Sep 17 00:00:00 2001 From: Dan Dennedy Date: Sat, 8 Sep 2012 22:15:38 -0700 Subject: [PATCH] allow env CC to override hard-coded gcc in configure scripts patch by Alberto Villa --- configure | 5 ++++- src/framework/configure | 2 +- src/modules/avformat/configure | 4 ++-- src/modules/frei0r/configure | 2 +- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/configure b/configure index 46531d94..c9c6e00f 100755 --- a/configure +++ b/configure @@ -195,6 +195,9 @@ export targetos=$(uname -s) export targetarch= export amd64=false +# Define the compiler used in tests (gcc is not installed everywhere) +: ${CC:=gcc} + # Iterate through arguments for i in "$@" do @@ -327,7 +330,7 @@ do [ $help = 0 ] && echo "Configuring `basename $i`:" olddir=`pwd` cd src/$i - ./configure "$@" + CC="$CC" ./configure "$@" [ $? != 0 ] && exit 1 cd $olddir fi diff --git a/src/framework/configure b/src/framework/configure index 7cb01d58..49ab5810 100755 --- a/src/framework/configure +++ b/src/framework/configure @@ -4,7 +4,7 @@ echo "framework -I$prefix/include -I$prefix/include/mlt -D_REENTRANT -L$libdir - echo > config.mak if [ "$(uname -s)" = "FreeBSD" ] then - printf "#include \n int main(){ return 0;}" | gcc -c -x c - >/dev/null 2>&1 + printf "#include \n int main(){ return 0;}" | $CC -c -x c - >/dev/null 2>&1 [ "$?" -eq 0 ] && echo "HAVE_SYS_PARAM_H=1" >> config.mak fi exit 0 diff --git a/src/modules/avformat/configure b/src/modules/avformat/configure index 16e23cf1..c11b6798 100755 --- a/src/modules/avformat/configure +++ b/src/modules/avformat/configure @@ -105,7 +105,7 @@ else if [ "$vdpau" = "true" ] then - printf "#include \n int main(){ VdpBitstreamBuffer test; test.struct_version; return 0;}" | gcc -I"$static_ffmpeg" $CFLAGS -c -x c - >/dev/null 2>&1 + printf "#include \n int main(){ VdpBitstreamBuffer test; test.struct_version; return 0;}" | $CC -I"$static_ffmpeg" $CFLAGS -c -x c - >/dev/null 2>&1 [ "$x11" = "0" -a "$?" = "0" ] && echo "VDPAU=1" >> config.mak fi else @@ -141,7 +141,7 @@ else if [ "$vdpau" = "true" ] then - printf "#include \n int main(){ VdpBitstreamBuffer test; test.struct_version; return 0;}" | gcc -I"$(pkg-config --cflags libavformat)" -I"$shared_ffmpeg/include" $CFLAGS -c -x c - >/dev/null 2>&1 + printf "#include \n int main(){ VdpBitstreamBuffer test; test.struct_version; return 0;}" | $CC -I"$(pkg-config --cflags libavformat)" -I"$shared_ffmpeg/include" $CFLAGS -c -x c - >/dev/null 2>&1 [ "$x11" = "0" -a "$?" = "0" ] && echo "VDPAU=1" >> config.mak fi else diff --git a/src/modules/frei0r/configure b/src/modules/frei0r/configure index 73757a46..9c11952f 100755 --- a/src/modules/frei0r/configure +++ b/src/modules/frei0r/configure @@ -3,7 +3,7 @@ if [ "$help" != "1" ] then - echo "#include int main(){ f0r_plugin_info_t test; test.name;return 0;}"| gcc $CFLAGS -c -x c - >/dev/null 2>&1 + echo "#include int main(){ f0r_plugin_info_t test; test.name;return 0;}"| $CC $CFLAGS -c -x c - >/dev/null 2>&1 if [ "$?" = "1" ] then -- 2.39.2