Ignore:
Timestamp:
Nov 30, 2008, 12:46:12 AM (13 years ago)
Author:
Peter Johansson
Message:

avoid setting CPPFLAGS and friends in configure.ac
and updating Makefile.ams accordingly

File:
1 edited

Legend:

Unmodified
Added
Removed
  • plugins/base1/se.lu.thep.wenni/trunk/configure.ac

    r840 r841  
    4141# Set default programming language
    4242AC_LANG(C++)
     43
     44# Let user overide default CXXFLAGS
     45if test "${CXXFLAGS+set}" != set; then
     46  CXXFLAGS=""  # Setting CXXFLAGS here to prevent expansion in AC_PROG_CXX
     47fi
    4348
    4449# Checks for programs.
     
    5055AC_PROG_SED
    5156
    52 CXXFLAGS="-Wall -pedantic"
    53 CPPFLAGS="-DHAVE_INLINE=1"
     57AM_CXXFLAGS="-Wall -pedantic"
     58AM_CPPFLAGS="-DHAVE_INLINE=1"
    5459AC_ARG_ENABLE(debug,
    5560              [ AS_HELP_STRING([--enable-debug],
    5661                               [turn on debug options and code]) ],
    57               [ CXXFLAGS="$CXXFLAGS -g -O" ],
    58               [ CXXFLAGS="$CXXFLAGS -O3"
    59                 CPPFLAGS="$CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF" ])
     62              [AM_CXXFLAGS="$AM_CXXFLAGS -g -O"],
     63              [AM_CXXFLAGS="$AM_CXXFLAGS -O3"
     64               AM_CPPFLAGS="$AM_CPPFLAGS -DNDEBUG -DGSL_RANGE_CHECK_OFF"])
    6065
    6166AC_ARG_ENABLE(state,
     
    95100  OLD_CPPFLAGS=$CPPFLAGS;
    96101  OLD_LDFLAGS=$LDFLAGS;
    97   LDFLAGS="-L$BASEDIR/lib"
    98   AC_CHECK_LIB([base], [base_finite], [BASELDFLAGS="-L$BASEDIR/lib -lbase"],
     102  LDFLAGS="$LDFLAGS -L$BASEDIR/lib"
     103  AC_CHECK_LIB([base], [base_finite], [BASELDFLAGS="-L$BASEDIR/lib"],
    99104               [AC_MSG_FAILURE([cannot find base library])])
    100105  CPPFLAGS="-I$BASEDIR/include/cxx $CPPFLAGS"
     
    120125fi
    121126
    122 AC_ARG_WITH(gsl,[AS_HELP_STRING([--with-gsl=DIR], [prefix for gsl files])],
    123             [CPPFLAGS="-I$withval/include $CPPFLAGS"
    124              LDFLAGS="-L$withval/lib $LDFLAGS"], [])
    125 
    126127AC_SEARCH_LIBS([sqrt], [m],, AC_MSG_FAILURE([cannot find math library]))
    127128AC_SEARCH_LIBS([ATL_ctrsv], [atlas],,
    128129               AC_SEARCH_LIBS(cblas_sdsdot, gslcblas,,
    129130                        AC_MSG_FAILURE([cannot find cblas library])))
     131
     132save_LDFLAGS="$LDFLAGS"
     133AC_ARG_WITH(gsl,[AS_HELP_STRING([--with-gsl=DIR], [prefix for gsl files])],
     134            [GSL_CPPFLAGS="-I$withval/include"; GSL_LDFLAGS="-L$withval/lib"])
     135LDFLAGS="$LDFLAGS $GSL_LDFLAGS"
    130136AC_SEARCH_LIBS([gsl_vector_alloc], [gsl],,
    131137               AC_MSG_FAILURE([cannot find library GSL]))
     138LDFLAGS="$save_LDFLAGS"
     139
     140AC_SUBST(GSL_LDFLAGS)
     141AM_CPPFLAGS="-I\$(top_srcdir)/lib $GSL_CPPFLAGS $AM_CPPFLAGS"
     142AC_SUBST(AM_CPPFLAGS)
     143AC_SUBST(AM_CXXFLAGS)
    132144
    133145CPP_TOOLS_LIBPATH="lib/c++_tools"
Note: See TracChangeset for help on using the changeset viewer.