Changeset 1756


Ignore:
Timestamp:
Jan 27, 2009, 11:35:10 PM (12 years ago)
Author:
Peter
Message:

improved YAT_*_ADD_FLAG - if contains several words, loop over the words and try each one of them rather than try whole sentance in one shot, which implies subset of words might get accepted

Location:
trunk
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/build_support/yat_add_flag.m4

    r1623 r1756  
    2121# COPYLEFT
    2222#
    23 #   Copyright (C) 2008 Peter Johansson
     23#   Copyright (C) 2008, 2009 Peter Johansson
    2424#
    2525#   This file is part of the yat library, http://dev.thep.lu.se/yat
     
    4040
    4141#
    42 # serial 0 
     42# serial 1 
    4343#
    4444# see http://www.gnu.org/software/automake/manual/automake.html#Serials
     
    4747[
    4848  AC_REQUIRE([AX_CXXCPP_CHECK_FLAG])
    49   YAT_FIND_STR([$1], [$2], , [AX_CXXCPP_CHECK_FLAG([$2], ,, [$1="$$1 $2"])])
     49  for i in $2; do
     50    YAT_FIND_STR([$1], [$i], , [AX_CXXCPP_CHECK_FLAG([$i], ,, [$1="$$1 $i"])])
     51  done
    5052]) # YAT_CPP_ADD_FLAG
    5153
     
    5456[
    5557  AC_REQUIRE([AX_CXX_CHECK_FLAG])
    56   YAT_FIND_STR([$1], [$2], , [AX_CXX_CHECK_FLAG([$2], ,, [$1="$$1 $2"])])
     58  for i in $2; do
     59    YAT_FIND_STR([$1], [$i], , [AX_CXX_CHECK_FLAG([$i], ,, [$1="$$1 $i"])])
     60  done
    5761]) # YAT_CXX_ADD_FLAG
    5862
     
    6064[
    6165  AC_REQUIRE([AX_LD_CHECK_FLAG])
    62   YAT_FIND_STR([$1], [$2], , [AX_LD_CHECK_FLAG([$2], ,, [$1="$$1 $2"])])
     66  for i in $2; do
     67    YAT_FIND_STR([$1], [$i], , [AX_LD_CHECK_FLAG([$i], ,, [$1="$$1 $i"])])
     68  done
    6369]) # YAT_LD_ADD_FLAG
    6470
     
    6874  found=no;       
    6975  for a in $$1; do
    70     if test "x$a" = "x$2"; then
    71       found=yes;
    72     fi
     76    AS_IF([test "x$a" = "x$2"],[found=yes])
    7377  done
    7478
    7579  # ACTION
    76   if test "$found" = "yes" ; then
    77     m4_default([$3], [:])
    78   else
    79     m4_default([$4], [:])
    80   fi 
     80  AS_IF([test "$found" = "yes"], [m4_default([$3], [:])],
     81        [m4_default([$4], [:])])
    8182
    8283]) # YAT_FIND_STR
  • trunk/configure.ac

    r1701 r1756  
    191191# i.e., they are not needed for a user of yat and are not propagated
    192192# to yat-config or yat.m4.
    193 YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-Wall])
    194 YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-pedantic])
     193YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-Wall -pedantic])
    195194YAT_CPP_ADD_FLAG([CPPFLAGS], [-DHAVE_INLINE=1])
    196195AC_ARG_ENABLE([debug],
     
    198197if test "${enable_debug}" = "yes" ; then
    199198  YAT_CPP_ADD_FLAG([AM_CPPFLAGS], [-DYAT_DEBUG=1])
    200   YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-g])
    201   YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-O])
     199  YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-g -O])
    202200else
    203   YAT_CPP_ADD_FLAG([CPPFLAGS], [-DGSL_RANGE_CHECK_OFF])
    204   YAT_CPP_ADD_FLAG([AM_CPPFLAGS], [-DNDEBUG])
     201  YAT_CPP_ADD_FLAG([CPPFLAGS], [-DGSL_RANGE_CHECK_OFF -DNDEBUG])
    205202  YAT_CXX_ADD_FLAG([AM_CXXFLAGS], [-O3])
    206203fi
Note: See TracChangeset for help on using the changeset viewer.