Changeset 1042


Ignore:
Timestamp:
Mar 23, 2010, 1:09:34 AM (12 years ago)
Author:
Peter Johansson
Message:

updating to yat 0.6.1

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/m4/yat_add_flag.m4

    r777 r1042  
    1 ## $Id: yat_add_flag.m4 1780 2009-02-06 18:13:22Z peter $
     1## $Id: yat_add_flag.m4 2107 2009-11-07 15:53:27Z peter $
    22
    33# SYNOPSIS
     
    1717# LAST MODIFICATION
    1818#
    19 #   $Date: 2009-02-06 13:13:22 -0500 (Fri, 06 Feb 2009) $
     19#   $Date: 2009-11-07 10:53:27 -0500 (Sat, 07 Nov 2009) $
    2020#
    2121# COPYLEFT
     
    4040
    4141#
    42 # serial 2 
     42# serial 5 
    4343#
    4444# see http://www.gnu.org/software/automake/manual/automake.html#Serials
     
    4646AC_DEFUN([YAT_CPP_ADD_FLAG],
    4747[
    48   for i in $2; do
    49     YAT_FIND_STR([$1], [$i], , [AX_CXXCPP_CHECK_FLAG([$i], ,, [$1="$$1 $i"])])
     48  AC_PREREQ([2.63]) dnl we use AS_VAR_IF
     49  AC_REQUIRE([AC_PROG_SED])
     50  for yat_flag in $2; do
     51    # ignore flag if
     52    # 1) it is -I/usr/include
     53    # 2) it is -I/usr/local/include and CXX is g++
     54    # 3) it is -D* and * is already defined in $1, $CPPFLAGS, or AC_DEFINE
     55    ignore=no
     56    AS_CASE([$yat_flag],
     57            [-I/usr/include], [ignore=yes],
     58            [-I/usr/local/include],[AS_IF([test "x$CXX" = "xg++"],[ignore=yes])],
     59            [-D*], [yat_def=`AS_ECHO([$yat_flag]) | $SED 's,^-D,,;s,=.*,,'`;
     60                    yat_save_CPPFLAGS="$CPPFLAGS"
     61                    m4_if([$1], [CPPFLAGS], [], [CPPFLAGS="$$1 $CPPFLAGS"])
     62                    AC_CHECK_DECL([$yat_def],[ignore=yes])
     63                    CPPFLAGS="$yat_save_CPPFLAGS"])
     64
     65    AS_VAR_IF([ignore], [no],
     66          [YAT_FIND_STR([$1], [$yat_flag], ,
     67                        [AX_CXXCPP_CHECK_FLAG([$yat_flag], ,,
     68                                              [$1="$$1 $yat_flag"])])])
    5069  done
    5170]) # YAT_CPP_ADD_FLAG
     
    5473AC_DEFUN([YAT_CXX_ADD_FLAG],
    5574[
    56   for i in $2; do
    57     YAT_FIND_STR([$1], [$i], , [AX_CXX_CHECK_FLAG([$i], ,, [$1="$$1 $i"])])
     75  AC_PREREQ([2.61]) dnl we use AX_CXX_CHECK_FLAG
     76  for yat_flag in $2; do
     77    YAT_FIND_STR([$1], [$yat_flag], ,
     78                 [AX_CXX_CHECK_FLAG([$yat_flag], ,, [$1="$$1 $yat_flag"])])
    5879  done
    5980]) # YAT_CXX_ADD_FLAG
     
    6182AC_DEFUN([YAT_LD_ADD_FLAG],
    6283[
    63   for i in $2; do
    64     YAT_FIND_STR([$1], [$i], , [AX_LD_CHECK_FLAG([$i], ,, [$1="$$1 $i"])])
     84  AC_PREREQ([2.61]) dnl we use AX_LD_CHECK_FLAG
     85  for yat_flag in $2; do
     86    # ignore flag if
     87    # 1) it is -L/usr/lib
     88    # 2) it is -L/usr/local/lib and CXX is g++
     89    AS_IF([test "x$yat_flag" = "x-L/usr/lib"],,
     90          [test "x$CXX" = "xg++" && test "x$yat_flag" = "x-L/usr/local/lib"],,
     91          [YAT_FIND_STR([$1], [$yat_flag], ,
     92                        [AX_LD_CHECK_FLAG([$yat_flag], ,,
     93                                          [$1="$$1 $yat_flag"])])])
    6594  done
    6695]) # YAT_LD_ADD_FLAG
Note: See TracChangeset for help on using the changeset viewer.