Changeset 2083


Ignore:
Timestamp:
Oct 20, 2009, 12:33:30 AM (13 years ago)
Author:
Peter
Message:

Let user override the -D* flags that are set in configure. User can,
e.g, issue ./configure -DGSL_RANGE_CHECK=1 if he wants range check in
gsl but doesn't want the whole package that comes with --enable-debug.

serial in yat_add_flag.m4 is not updated because no point updating
serial multiple times between releases.

Location:
trunk
Files:
1 added
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/configure.ac

    r2030 r2083  
    170170  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-g -O])
    171171else
    172   YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DGSL_RANGE_CHECK_OFF -DNDEBUG])
     172  # avoid defining GSL_RANGE_CHECK_OFF if GSL_RANGE_CHECK is already defined
     173  AX_C_IFDEF([GSL_RANGE_CHECK],[],
     174             [YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DGSL_RANGE_CHECK_OFF])
     175  YAT_CPP_ADD_FLAG([INTERNAL_CPPFLAGS], [-DNDEBUG])
    173176  YAT_CXX_ADD_FLAG([INTERNAL_CXXFLAGS], [-O3])
    174177fi
  • trunk/m4/yat_add_flag.m4

    r2016 r2083  
    4646AC_DEFUN([YAT_CPP_ADD_FLAG],
    4747[
     48  AC_REQUIRE([AC_PROG_SED])
    4849  for yat_flag in $2; do
    4950    # ignore flag if
    5051    # 1) it is -I/usr/include
    5152    # 2) it is -I/usr/local/include and CXX is g++
    52     AS_IF([test "x$yat_flag" = "x-I/usr/include"],,
    53           [test "x$CXX" = "xg++" &&
    54            test "x$yat_flag" = "x-I/usr/local/include"],,
     53    # 3) it is -D* and * is already defined
     54    ignore=no
     55    AS_CASE([$yat_flag],
     56            [-I/usr/include], [ignore=yes],
     57            [-I/usr/local/include],[AS_IF([test "x$CXX" = "xg++"],[ignore=yes])],
     58            [-D*], [yat_def=`AS_ECHO([$yat_flag]) | $SED 's,^-D,,;s,=.*,,'`;
     59                    AX_C_IFDEF([$yat_def],[ignore=yes])])
     60
     61    AS_VAR_IF([ignore], [no],
    5562          [YAT_FIND_STR([$1], [$yat_flag], ,
    5663                        [AX_CXXCPP_CHECK_FLAG([$yat_flag], ,,
Note: See TracChangeset for help on using the changeset viewer.