[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: C Compiler dependency-file generation
From: |
autoconf |
Subject: |
Re: C Compiler dependency-file generation |
Date: |
Fri, 18 May 2001 12:09:08 -0500 |
User-agent: |
Mutt/1.1.12i |
On Fri, May 18, 2001 at 11:40:51AM -0400, Jeff Dubrule wrote:
> 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 think you'll lose with CVS automake which I think supports more than
GCC for auto-dependency generation (check out lib/depcomp in the
automake CVS tree). Anyway, why not automake with --include-deps and
be done with it?
> 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?
--
albert chin (address@hidden)