Another fix for dep flags.
authorMarko Kreen <markokr@gmail.com>
Thu, 1 Nov 2012 16:33:20 +0000 (18:33 +0200)
committerMarko Kreen <markokr@gmail.com>
Fri, 2 Nov 2012 09:30:40 +0000 (11:30 +0200)
Just test the exact flags that antimake will use.

For unknown reasons, autoconf corrupts $@ so it's
hard to pass the flags down.  Currently just keep
them in sync with antimake.

m4/usual.m4

index 1758f8d766d8203f3668554c601341cbdd34ece5..ada48270897218a70c07d7c0e4bca8f3251a6958 100644 (file)
@@ -85,22 +85,13 @@ fi
 dnl Check if compiler supports gcc-style dependencies
 AC_MSG_CHECKING([whether compiler supports dependency generation])
 old_CFLAGS="$CFLAGS"
-HAVE_CC_DEPFLAG=no
-DEPFLAG=""
-for flg in '-Wp,-MMD,' '-Wp,-MD,'; do
-  CFLAGS="$flg,conftest.d"
-  AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo(void){}])],
-     [HAVE_CC_DEPFLAG=yes])
-  if test "$HAVE_CC_DEPFLAG" = "yes"; then
-    DEPFLAG="$flg"
-    break
-  fi
-done
+CFLAGS="$CFLAGS -MD -MP -MT conftest.o -MF conftest.o.d"
+AC_COMPILE_IFELSE([AC_LANG_SOURCE([void foo(void){}])],
+     [HAVE_CC_DEPFLAG=yes], [HAVE_CC_DEPFLAG=no])
 rm -f conftest.d
 CFLAGS="$old_CFLAGS"
 AC_MSG_RESULT([$HAVE_CC_DEPFLAG])
 AC_SUBST(HAVE_CC_DEPFLAG)
-AC_SUBST(DEPFLAG)
 
 dnl Pick good warning flags for gcc
 WFLAGS=""