Changeset 82e93c9


Ignore:
Timestamp:
Jun 28, 2011, 1:45:29 PM (10 years ago)
Author:
Anders Kaseorg <andersk@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
863f4c4, bc1d648
Parents:
bad4496
git-author:
Anders Kaseorg <andersk@mit.edu> (06/25/11 17:20:16)
git-committer:
Anders Kaseorg <andersk@mit.edu> (06/28/11 13:45:29)
Message:
AX_CHECK_FLAG: Fix to work with autoconf 2.59

• AS_VAR_PUSHDEF([FLAGS], [something containing FLAGS]) caused an
  infinite loop before v2.65~21.
• AS_VAR_APPEND was new in v2.63b~224.
• AS_VAR_IF was new in v2.63~27.
• AS_ECHO was new in AUTOCONF-2.61a~45, and AC_PROG_GREP in
  AUTOCONF-2.59c~744, but their use here is more idiomatically
  replaced with a case pattern anyway.
• Before AUTOCONF-2.60b~8, the variable name passed to AC_CACHE_CHECK,
  AS_VAR_GET, AS_VAR_SET, and AS_VAR_SET_IF must be left unquoted.

Signed-off-by: Anders Kaseorg <andersk@mit.edu>

(cherry picked from autoconf-archive commit f5ed01f0ce1d9b3be7c0cd92db192bf5c44d7fcb)
File:
1 edited

Legend:

Unmodified
Added
Removed
  • m4/ax_check_flag.m4

    rf2a96c0 r82e93c9  
    7272#   exception to the GPL to apply to your modified version as well.
    7373
    74 #serial 2
     74#serial 3
    7575
    7676AC_DEFUN([AX_CHECK_PREPROC_FLAG],
     
    8181  CPPFLAGS="$CPPFLAGS $4 $1"
    8282  AC_PREPROC_IFELSE([AC_LANG_PROGRAM()],
    83     [AS_VAR_SET([CACHEVAR],[yes])],
    84     [AS_VAR_SET([CACHEVAR],[no])])
     83    [AS_VAR_SET(CACHEVAR,[yes])],
     84    [AS_VAR_SET(CACHEVAR,[no])])
    8585  CPPFLAGS=$ax_check_save_flags])
    86 AS_VAR_IF([CACHEVAR], "yes",
     86AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
    8787  [m4_default([$2], :)],
    8888  [m4_default([$3], :)])
     
    9797  _AC_LANG_PREFIX[]FLAGS="$[]_AC_LANG_PREFIX[]FLAGS $4 $1"
    9898  AC_COMPILE_IFELSE([AC_LANG_PROGRAM()],
    99     [AS_VAR_SET([CACHEVAR],[yes])],
    100     [AS_VAR_SET([CACHEVAR],[no])])
     99    [AS_VAR_SET(CACHEVAR,[yes])],
     100    [AS_VAR_SET(CACHEVAR,[no])])
    101101  _AC_LANG_PREFIX[]FLAGS=$ax_check_save_flags])
    102 AS_VAR_IF([CACHEVAR], "yes",
     102AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
    103103  [m4_default([$2], :)],
    104104  [m4_default([$3], :)])
     
    112112  LDFLAGS="$LDFLAGS $4 $1"
    113113  AC_LINK_IFELSE([AC_LANG_PROGRAM()],
    114     [AS_VAR_SET([CACHEVAR],[yes])],
    115     [AS_VAR_SET([CACHEVAR],[no])])
     114    [AS_VAR_SET(CACHEVAR,[yes])],
     115    [AS_VAR_SET(CACHEVAR,[no])])
    116116  LDFLAGS=$ax_check_save_flags])
    117 AS_VAR_IF([CACHEVAR], "yes",
     117AS_IF([test x"AS_VAR_GET(CACHEVAR)" = xyes],
    118118  [m4_default([$2], :)],
    119119  [m4_default([$3], :)])
     
    124124AC_DEFUN([AX_APPEND_FLAG],
    125125[AC_PREREQ(2.59) dnl for _AC_LANG_PREFIX
    126 AC_REQUIRE([AC_PROG_GREP])
    127 AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[]FLAGS)])dnl
    128 AS_VAR_SET_IF([FLAGS],
    129   [AS_IF([AS_ECHO(" $[]FLAGS ") | $GREP " $1 " 2>&1 >/dev/null],
    130     [AC_RUN_LOG([: FLAGS already contains $1])],
    131     [AC_RUN_LOG([: FLAGS="$FLAGS $1"])
    132     AS_VAR_APPEND([FLAGS], [" $1"])])],
    133   [AS_VAR_SET([FLAGS],[$1])])
     126AS_VAR_PUSHDEF([FLAGS], [m4_default($2,_AC_LANG_PREFIX[FLAGS])])dnl
     127AS_VAR_SET_IF(FLAGS,
     128  [case " AS_VAR_GET(FLAGS) " in
     129    *" $1 "*)
     130      AC_RUN_LOG([: FLAGS already contains $1])
     131      ;;
     132    *)
     133      AC_RUN_LOG([: FLAGS="$FLAGS $1"])
     134      AS_VAR_SET(FLAGS, ["AS_VAR_GET(FLAGS) $1"])
     135      ;;
     136   esac],
     137  [AS_VAR_SET(FLAGS,["$1"])])
    134138AS_VAR_POPDEF([FLAGS])dnl
    135139])dnl AX_APPEND_FLAG
Note: See TracChangeset for help on using the changeset viewer.