automake
[Top][All Lists]
Advanced

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

adding to CFLAGS for all objects in subdir


From: Jeremy Slade
Subject: adding to CFLAGS for all objects in subdir
Date: Tue, 13 Mar 2001 16:23:12 -0700 (MST)

In a project, I want all objects (both C and C++) in a certain
subdirectory to include additional flags (defined by PERL_CFLAGS) in
the compile line, but I don't want those flags used to build object in
other directories.  I'm not sure how to accomplish this.

If I do this in the Makefile.am:

CFLAGS = $(PERL_CFLAGS)

Doesn't that clobber the standard CFLAGS, such as '-g -O2'?


What I'm ultimately trying to do is build a shared library that can be
dynamically loaded into a perl interpreter -- perhaps this is a
problem someone has already solved?  If anyone has pointers, I'd
appreciate it.

I currently have a Makefile.am that looks something like this:
--------------------------------------------------
perllib_DATA = Module.pm
perllibarch_DATA = Module.sl

# Do noinst libtool library to handle building the objects
noinst_LTLIBRARIES = lib_Module.la
lib_Module_la_SOURCES = Module.C

INCLUDES = -I$(PERL_ARCHLIBCORE)
CPPFLAGS=$(PERL_CFLAGS)

Module.sl: Module.lo
        ld -b -E -o $@ $^ ....

# Must create the $perllibarchdir/auto directory to enable auto-loading
# Also have to chmod Module.sl to be executable after install --
# not initially made executable since it is a _DATA object.
install-data-local:
        $(mkinstalldirs) $(DESTDIR)$(perllibarchdir)/auto
        chmod +x $(DESTDIR)$(perllibarchdir)/Module.sl
--------------------------------------------------
I have other macros defined that set perllib, perllibarch,
PERL_CFLAGS, etc.  Ideally, those same macros would change the CFLAGS,
INCLUDES, etc for this specific directory to include all of the
perl-related stuff.

My platform is HP-UX 10.20, gcc-2.95.2, perl 5.6.0, autoconf-2.49c,
automake-1.4b, libtool-1.3.5

Please tell me there's an easier way to do this...

Thanks,
Jeremy
-- 
Jeremy Slade
Hewlett-Packard Company  VLSI Technology Center - http://cpus.hp.com/
address@hidden            (970) 898-7881




reply via email to

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