Fixed bug #828
authorSam Lantinga <slouken@libsdl.org>
Thu, 08 Oct 2009 09:07:58 +0000
changeset 335498c5b421426e
parent 3353 6b14223dd5c7
child 3355 3c9e6f2f3c58
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 @@ -109,6 +109,29 @@
     1.4  AC_C_INLINE
     1.5  AC_C_VOLATILE
     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  dnl See whether we are allowed to use the system C library
    1.31  AC_ARG_ENABLE(libc,
    1.32  AC_HELP_STRING([--enable-libc], [Use the system C library [[default=yes]]]),
    1.33 @@ -2781,7 +2804,7 @@
    1.34      OBJECTS=`echo "$OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.'$EXT',$(objects)/\1.lo,g'`
    1.35      DEPENDS=`echo "$DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.'$EXT',\\
    1.36  $(objects)/\2.lo: \1/\2.'$EXT'\\
    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  done
    1.40  
    1.41  VERSION_OBJECTS=`echo $VERSION_SOURCES`
    1.42 @@ -2796,7 +2819,7 @@
    1.43  SDLMAIN_OBJECTS=`echo "$SDLMAIN_OBJECTS" | sed 's,[[^ ]]*/\([[^ ]]*\)\.c,$(objects)/\1.o,g'`
    1.44  SDLMAIN_DEPENDS=`echo "$SDLMAIN_DEPENDS" | sed 's,\([[^ ]]*\)/\([[^ ]]*\)\.c,\\
    1.45  $(objects)/\2.o: \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  # Set runtime shared library paths as needed
    1.50