Fixed bug #828
authorSam Lantinga <slouken@libsdl.org>
Thu, 08 Oct 2009 09:07:58 +0000
changeset 432e32ef89a6816
parent 431 cb8e112983d3
child 433 01f8ced21da6
Fixed bug #828

Added support for --disable-dependency-tracking to configure.in
configure.in
     1.1 --- a/configure.in	Thu Oct 08 07:08:45 2009 +0000
     1.2 +++ b/configure.in	Thu Oct 08 09:07:58 2009 +0000
     1.3 @@ -87,6 +87,29 @@
     1.4  dnl Check for compiler characteristics
     1.5  AC_C_CONST
     1.6  
     1.7 +dnl See whether we can use gcc style dependency tracking
     1.8 +AC_ARG_ENABLE(dependency-tracking,
     1.9 +AC_HELP_STRING([--enable-dependency-tracking],
    1.10 +               [Use gcc -MMD -MT dependency tracking [[default=yes]]]),
    1.11 +              , enable_dependency_tracking=yes)
    1.12 +if test x$enable_dependency_tracking = xyes; then
    1.13 +    have_gcc_mmd_mt=no
    1.14 +    AC_MSG_CHECKING(for GCC -MMD -MT option)
    1.15 +    AC_TRY_COMPILE([
    1.16 +    #if !defined(__GNUC__) || __GNUC__ < 3
    1.17 +    #error Dependency tracking requires GCC 3.0 or newer
    1.18 +    #endif
    1.19 +    ],[
    1.20 +    ],[
    1.21 +    have_gcc_mmd_mt=yes
    1.22 +    ])
    1.23 +    AC_MSG_RESULT($have_gcc_mmd_mt)
    1.24 +
    1.25 +    if test x$have_gcc_mmd_mt = xyes; then
    1.26 +        DEPENDENCY_TRACKING_OPTIONS="-MMD -MT \$@"
    1.27 +    fi
    1.28 +fi
    1.29 +    
    1.30  case "$host" in
    1.31      *-*-cygwin* | *-*-mingw32*)
    1.32          VERSION_SOURCES="$srcdir/version.rc"
    1.33 @@ -493,7 +516,7 @@
    1.34  OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
    1.35  DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
    1.36  $(objects)/\2.lo: \1/\2.c\\
    1.37 -	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -MMD -MT \$@ -c \$< -o \$@,g'`
    1.38 +	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
    1.39  
    1.40  VERSION_OBJECTS=`echo $VERSION_SOURCES`
    1.41  VERSION_DEPENDS=`echo $VERSION_SOURCES`
    1.42 @@ -508,7 +531,7 @@
    1.43  PLAYWAVE_OBJECTS=`echo "$PLAYWAVE_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
    1.44  PLAYWAVE_DEPENDS=`echo "$PLAYWAVE_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
    1.45  $(objects)/\2.lo: \1/\2.c\\
    1.46 -	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -MMD -MT \$@ -c \$< -o \$@,g'`
    1.47 +	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
    1.48  
    1.49  PLAYMUS_SOURCES="$srcdir/playmus.c"
    1.50  PLAYMUS_OBJECTS=`echo $PLAYMUS_SOURCES`
    1.51 @@ -516,7 +539,7 @@
    1.52  PLAYMUS_OBJECTS=`echo "$PLAYMUS_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.lo,g'`
    1.53  PLAYMUS_DEPENDS=`echo "$PLAYMUS_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
    1.54  $(objects)/\2.lo: \1/\2.c\\
    1.55 -	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) -MMD -MT \$@ -c \$< -o \$@,g'`
    1.56 +	\$(LIBTOOL) --mode=compile \$(CC) \$(CFLAGS) \$(EXTRA_CFLAGS) '"$DEPENDENCY_TRACKING_OPTIONS"' -c \$< -o \$@,g'`
    1.57  
    1.58  dnl Expand the sources and objects needed to build the library
    1.59  AC_SUBST(ac_aux_dir)