[Top][All Lists]

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

Implicitly specify compiler flags based on library dependencies

From: Daniel Neuberger
Subject: Implicitly specify compiler flags based on library dependencies
Date: Wed, 20 Apr 2011 09:56:15 -0400
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv: Gecko/20101207 Thunderbird/3.1.7

Is there any way to make a dependent library implicitly use any
compiler flags used by a library on which it depends?  I'm running
into two problems that this would solve.

The first is illustrated by these Makefile.amS:

# libfoo
AM_CPPFLAGS = -I/some/include_path
libfoo_la_SOURCES = foo.cpp
libegfconfig_la_LIBADD = -lxml2

# libbar
AM_CPPFLAGS = -I/some/include_path # I want this to happen implicitly
libbar_la_SOURCES = bar.cpp
libbar_la_LIBADD = $(top_builddir)/some/path/

The second file has to specify the additional include path because
bar.cpp includes foo.hpp which includes something from
/some/include_path.  I would like this to happen implicitly based on
the fact that libbar depends on libfoo.

I also have a similar problem with the -mcx16 compiler option.  I
currently have to specify it manually for all dependent libraries, but
would like the flag to be specified implicitly.

Thanks for any help.

- Daniel

P.S. I apologize in advance if this comes through twice. I sent it yesterday, but it never showed up.

reply via email to

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