Changeset 1479


Ignore:
Timestamp:
Sep 9, 2008, 1:11:27 PM (15 years ago)
Author:
Peter
Message:

fixes #405

Setting AM_*FLAGS in configure. There are two paths to end up in
AM_*FLAGS. 1) you are set through corresponding *FLAGS, then swapped
into EXTRA_*FLAGS, and finally concatenated into AM_*FLAGS. These
flags are also stored in EXTRA_*FLAGS and are used in yat-config to
let the user of yat know which flags are important when using
yat. Flags that are not important for using yat, but mostly useful
when building yat, are set directly to AM_*FLAGS.

It is, of course, an open question which flags should be propagated to
a user, but for now I chose to propagate, on top of those that are
essential, gsl flags -DHAVE_INLINE and -DGSL_RANGE_CHECK_OFF.

This probably makes yat.am obsolete, but I keep it for now.

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build_support/yat.am

    r1469 r1479  
    2525##
    2626
    27 AM_CPPFLAGS = -I$(top_srcdir) $(EXTRA_CPPFLAGS)
    28 AM_CXXFLAGS = $(EXTRA_CXXFLAGS)
    29 AM_LDFLAGS = $(EXTRA_LDFLAGS)
     27#AM_CPPFLAGS = -I$(top_srcdir) $(EXTRA_CPPFLAGS)
     28#AM_CXXFLAGS = $(EXTRA_CXXFLAGS)
     29#AM_LDFLAGS = $(EXTRA_LDFLAGS)
  • trunk/configure.ac

    r1459 r1479  
    167167fi
    168168
    169 CXXFLAGS="$CXXFLAGS -Wall -pedantic"
     169# we use AM_* for variables that are solely needed for building yat,
     170# i.e., they are not needed for a user of yat and are not propagated
     171# to yat-config or yat.m4.
     172AM_CXXFLAGS="$AM_CXXFLAGS -Wall -pedantic"
    170173CPPFLAGS="$CPPFLAGS -DHAVE_INLINE=1"
    171174AC_ARG_ENABLE(debug,
    172175  [AS_HELP_STRING([--enable-debug],[turn on debug options and code])])
    173176if test "${enable_debug}" = "yes" ; then
    174   CXXFLAGS="$CXXFLAGS -g -O"
    175   CPPFLAGS="$CPPFLAGS -DYAT_DEBUG=1"
     177  AM_CXXFLAGS="$AM_CXXFLAGS -g -O"
     178  AM_CPPFLAGS="$AM_CPPFLAGS -DYAT_DEBUG=1"
    176179else
    177   CXXFLAGS="$CXXFLAGS -O3"
    178   CPPFLAGS="$CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF"
     180  AM_CXXFLAGS="$CXXFLAGS -O3"
     181  CPPFLAGS="$CPPFLAGS -DGSL_RANGE_CHECK_OFF"
     182  AM_CPPFLAGS="$CPPFLAGS -DNDEBUG"
    179183fi
    180184
     
    347351APR_RESTORE_THE_ENVIRONMENT(LDFLAGS, EXTRA_)
    348352
     353AM_CPPFLAGS="-I\$(top_srcdir) $AM_CPPFLAGS $EXTRA_CPPFLAGS"
     354AM_CXXFLAGS="$AM_CXXFLAGS $EXTRA_CXXFLAGS"
     355AM_LDFLAGS="$AM_LDFLAGS $EXTRA_LDFLAGS"
     356
     357AC_SUBST(AM_CPPFLAGS)
     358AC_SUBST(AM_CXXFLAGS)
     359AC_SUBST(AM_LDFLAGS)
     360
    349361# Create output.
    350362AC_OUTPUT
     
    356368AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
    357369AC_MSG_NOTICE([  CPPFLAGS=\"$CPPFLAGS\"])
    358 AC_MSG_NOTICE([  EXTRA_CPPFLAGS=\"$EXTRA_CPPFLAGS\"])
     370AC_MSG_NOTICE([  AM_CPPFLAGS=\"$AM_CPPFLAGS\"])
    359371AC_MSG_NOTICE([  CXXFLAGS=\"$CXXFLAGS\"])
    360 AC_MSG_NOTICE([  EXTRA_CXXFLAGS=\"$EXTRA_CXXFLAGS\"])
     372AC_MSG_NOTICE([  AM_CXXFLAGS=\"$AM_CXXFLAGS\"])
    361373AC_MSG_NOTICE([  LDFLAGS=\"$LDFLAGS\"])
    362 AC_MSG_NOTICE([  EXTRA_LDFLAGS=\"$EXTRA_LDFLAGS\"])
     374AC_MSG_NOTICE([  AM_LDFLAGS=\"$AM_LDFLAGS\"])
    363375AC_MSG_NOTICE([  LIBS=\"$LIBS\"])
    364376AC_MSG_NOTICE([ +++++++++++++++++++++++++++++++++++++++++++++++])
Note: See TracChangeset for help on using the changeset viewer.