(OT) autoconf and CFLAGS

K

kid joe

Hi all,

I originally posted this to colda but got no answer, so Im trying the
broader groups cup and clc. Apologies to anyone for who this is off topic.

If Im distributing source packaged with autoconf/automake/libtool, whats
the "right" way to deal with CFLAGS/CPPFLAGS/LDFLAGS?

Id like to respect any flags the user of my programs has got set up,
but also add some of my own (eg -std=c99, and an optimization flag if none
is set).

Also I found out today that its possible to use gcc as a 2 pass compiler,
where first you compile with a -fprofile-gen option, then run the program,
then recompile making use of the profile data. If I have a library and
some test programs, is there a nice way to set up autoconf/automake to

1) build the library with -fprofile-gen
2) run the test programs to generate profile data for the library
3) rebuild the library with -fprofile-use

Cheers,
Joe
 
E

Eric Fisher

If Im distributing source packaged with autoconf/automake/libtool, whats
the "right" way to deal with CFLAGS/CPPFLAGS/LDFLAGS?

Anyway, I think these standard flags should be kept as default. You can
define other variables such as ADDITIONAL_CFLAGS, to add them to CFLAGS.

Cheers
Eric âˆâˆâˆ
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top