[FFmpeg-devel] [PATCH] Support building dependency files with non-GCC compilers

Diego 'Flameeyes' Pettenò flameeyes
Thu Oct 2 18:00:21 CEST 2008


When not building with GCC, the dependency creation command has to be
adapted to the compiler used.

When using the Intel C Compiler no further editing through sed of the
output is needed.

When using the Sun Studio compiler, a different command-line syntax
has to be used.
---

 configure |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)

diff --git a/configure b/configure
index b66a515..339d08e 100755
--- a/configure
+++ b/configure
@@ -997,9 +997,6 @@ SLIBNAME_WITH_VERSION='$(SLIBNAME).$(LIBVERSION)'
 SLIBNAME_WITH_MAJOR='$(SLIBNAME).$(LIBMAJOR)'
 LIB_INSTALL_EXTRA_CMD='$(RANLIB) "$(LIBDIR)/$(LIBNAME)"'
 
-# gcc stupidly only outputs the basename of targets with -MM
-DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
-
 # find source path
 source_path="`dirname \"$0\"`"
 enable source_path_used
@@ -1133,6 +1130,17 @@ TMPO="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.o"
 TMPS="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.S"
 TMPSH="${TMPDIR1}/ffmpeg-conf-${RANDOM}-$$-${RANDOM}.sh"
 
+if $cc -v 2>&1 | grep -q gcc; then
+    # gcc stupidly only outputs the basename of targets with -MM
+    DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $< | sed -e "/^\#.*/d" -e "1s,^,$(@D)/," -e "s,\\([[:space:]]\\)\\(version\\.h\\),\\1\$$(BUILD_ROOT_REL)/\\2,"'
+elif $cc --version 2>&1 | grep -q Intel; then
+    DEPEND_CMD='$(CC) $(CFLAGS) -MM -MG $<'
+elif $cc -V 2>&1 | grep -q Sun; then
+    DEPEND_CMD='$(CC) $(CFLAGS) -xM1 $<'
+else
+    DEPEND_CMD="false"
+fi
+
 check_cflags -fasm
 check_cflags -std=c99
 





More information about the ffmpeg-devel mailing list