]> git.sesse.net Git - ffmpeg/blobdiff - configure
Protect config.mak against multiple inclusion
[ffmpeg] / configure
index 244d272fff330880e6dd8c7d4777ae2fadab064d..eab577d23156d3b9bb99825969800d5da0347b63 100755 (executable)
--- a/configure
+++ b/configure
@@ -548,7 +548,7 @@ check_cpp(){
     log check_cpp "$@"
     cat > $TMPC
     log_file $TMPC
-    check_cmd $cc $CPPFLAGS "$@" -E -o $TMPO $TMPC
+    check_cmd $cc $CPPFLAGS $CFLAGS "$@" -E -o $TMPO $TMPC
 }
 
 check_as(){
@@ -1277,7 +1277,7 @@ target_path='.'
 
 # gcc stupidly only outputs the basename of targets with -MM, but we need the
 # full relative path for objects in subdirectories for non-recursive Make.
-DEPEND_CMD='$(DEPCC) $(CPPFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
+DEPEND_CMD='$(DEPCC) $(CPPFLAGS) $(CFLAGS) -MM $< | sed -e "/^\#.*/d" -e "s,^[[:space:]]*$(*F)\\.o,$(@D)/$(*F).o,"'
 
 # find source path
 source_path="$(dirname "$0")"
@@ -2479,6 +2479,9 @@ echo "#define FFMPEG_CONFIG_H" >> $TMPH
 echo "#define FFMPEG_CONFIGURATION \"$(c_escape $FFMPEG_CONFIGURATION)\"" >> $TMPH
 echo "#define FFMPEG_DATADIR \"$(eval c_escape $datadir)\"" >> $TMPH
 
+echo "ifndef FFMPEG_CONFIG_MAK" >> config.mak
+echo "FFMPEG_CONFIG_MAK=1" >> config.mak
+
 echo "FFMPEG_CONFIGURATION=$FFMPEG_CONFIGURATION" >> config.mak
 echo "prefix=$prefix" >> config.mak
 echo "LIBDIR=\$(DESTDIR)$libdir" >> config.mak
@@ -2609,6 +2612,7 @@ enabled asmalign_pot &&
 echo "#define EXTERN_PREFIX \"${extern_prefix}\"" >> $TMPH
 
 echo "#endif /* FFMPEG_CONFIG_H */" >> $TMPH
+echo "endif # FFMPEG_CONFIG_MAK" >> config.mak
 
 # Do not overwrite an unchanged config.h to avoid superfluous rebuilds.
 cmp -s $TMPH config.h &&