(OT) autoconf and CFLAGS

(OT) autoconf and CFLAGS

Post by kid jo » Fri, 05 Jun 2009 05:50:17

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


...................... o _______________ _,
` Good Evening! , /\_ _| | .-'_|
`................, _\__`[_______________| _| (_|
] [ \, ][ ][ (_|

(OT) autoconf and CFLAGS

Post by Eric Fishe » Fri, 05 Jun 2009 15:52:22

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.