automake
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

AM 1.4 depend2.am: GNU cc/cpp dependency?


From: Mike Whitson
Subject: AM 1.4 depend2.am: GNU cc/cpp dependency?
Date: 12 Feb 2001 14:09:03 -0500
User-agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7

So, either I'm missing something here, or the depend2.am distributed
with automake 1.4 depends on having a GNU C preprocessor to generate
dependency information:

> ## There are various ways to get dependency output from gcc.  Here's
> ## why we pick this rather obscure method:
> ## - Don't want to use -MD because we'd like the dependencies to end
> ##   up in a subdir.  Having to rename by hand is ugly.
> ##   (We might end up doing this anyway to support other compilers.)
> ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like
> ##   -MM, not -M (despite what the docs say).
> ## - Using -M directly means running the compiler twice (even worse
> ##   than renaming).
>         $(@address@hidden) -Wp,-MD,.deps/$(*F).pp -c $<

Of the OSes I have easy access to which don't use the GNU toolchain by
default:

Digital Unix 4.0 cpp:    -MD exists, but doesn't take a file argument
HP-UX 11i cpp:   -MD is not recognized
Solaris 7 cpp:   -MD is not recognized
Irix 6.5 cpp:    -MD is not recognized, though "-MDupdate filename"
                        does something similar.

Am I missing something obvious, or was this simply an oversight?  It
seems like it should be possible to conditionalize this behaviour on
the result of the autoconf gcc test, althought I confess that I
haven't had the time to prepare a proposed patch.  Alternatively, one
might write a macro which checked for the following, in order:

        - ${COMPILE} -Wp,-MD,filename   # gcc, one compiler run
        - ${COMPILE} -Wp,-MDupdate,filename   # irix cpp, one run
        - ${CPP} -M                     # semi-portable, two runs
        - makedepend                    # semi-portable, two runs

Apologies if this is an already-known issue.

Mike Whitson



reply via email to

[Prev in Thread] Current Thread [Next in Thread]