BZ #180: Do not use CFLAGS/CXXFLAGS/etc. in configure/automake

Status fields:

creation_ts:2013-02-21 10:38
component:build system
version:unspecified
rep_platform:All
op_sys:Linux
bug_status:RESOLVED
resolution:FIXED
reporter:zapster@complang.tuwien.ac.at
Users should be able to use CFLAGS and friends for handing additional flags to the build
system. This is the GNU standard behavior. Citing the autoconf manual[1]:

"However, remember that some Makefile variables are reserved by the GNU Coding Standards
for the use of the “user”—the person building the package. For instance, CFLAGS is one
such variable.

Sometimes package developers are tempted to set user variables such as CFLAGS because it
appears to make their job easier. However, the package itself should never set a user
variable, particularly not to include switches that are required for proper compilation
of the package."

automake offers some alternatives[2].

[1]: http://www.gnu.org/software/autoconf/manual/html_node/Preset-Output-Variables.html
[2]: http://www.gnu.org/software/automake/manual/html_node/Flag-Variables-Ordering.html

Comment #1 by zapster@complang.tuwien.ac.at on 2013-05-20 16:28:37

Looks like that this was never an issue. The current version is not 100% clean but it
works.

Comment #2 by zapster@complang.tuwien.ac.at on 2013-09-08 20:17:57

There are still issues related to the abuse of user variables:
  1) some flags are redundant, which makes the output unreadable and
  2) Makefile.am can not overrule configure.ac flags.

Comment #3 by zapster@complang.tuwien.ac.at on 2013-09-18 16:10:14

fixed in 09ec74d145f797249b6f6160b35b25e3120dc1c6