[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
C Compiler dependency-file generation
From: |
Jeff Dubrule |
Subject: |
C Compiler dependency-file generation |
Date: |
Fri, 18 May 2001 11:40:51 -0400 |
User-agent: |
Mutt/1.2.5i |
Is there currently an accepted mechanism for determining whether a C
compiler is going to be able to generate dependencies the way automake
likes?
I'm currently using this function def in my acinclude.m4 file:
AC_DEFUN(AC_PROG_CC_DEPENDENCIES, [
AC_CACHE_CHECK(
[whether the C compilers($CC $CFLAGS $LDFLAGS) can generate dependencies],
cc_does_dependencies, [
AC_LANG_SAVE
AC_LANG_C
OLDCFLAGS="$CFLAGS"
CFLAGS="$CFLAGS -Wp,-MD,foo.pp"
AC_TRY_COMPILE(,[], cc_does_dependencies=yes, cc_does_dependencies=no)
CFLAGS="$OLDCFLAGS"
AC_LANG_RESTORE
CC_DOES_DEPENDENCIES=$cc_does_dependencies
AC_SUBST(CC_DOES_DEPENDENCIES)
])
])
Is there a better way? Should something like this go into autoconf?
Thanks!
-jeff
- C Compiler dependency-file generation,
Jeff Dubrule <=