Permalink
Browse files

make autoconf 2.65 work.

  • Loading branch information...
1 parent eb89551 commit 7ef4b1c2266ef9a70c67d37c5e8ec164aa541e99 @novas0x2a novas0x2a committed Jan 6, 2010
View
16 m4/ax_arg.m4
@@ -4,6 +4,7 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
dnl AX_ARG_(ENABLE|WITH)(<arg>, <default>, <tags>, <description>)
dnl possible tags are:
@@ -19,9 +20,10 @@ dnl variable in question is ether ENABLE_ARG or ARG (the "with" is dropped)
dnl AX_ARG(<type>, <arg>, <default>, <tags>, <description>)
AC_DEFUN([AX_ARG],
[
- m4_define([lower], [m4_tolower([[$2]])])dnl lower-case arg name
- m4_define([type], [m4_toupper([[$1]])])dnl WITH or ENABLE
- AS_VAR_PUSHDEF([value], [m4_if(type, [WITH], [], type[_])[]m4_toupper([[$2]])])dnl
+ m4_pushdef([lower], my_tolower([$2]))dnl lower-case arg name
+ m4_pushdef([type], my_toupper([$1]))dnl WITH or ENABLE
+ AS_VAR_PUSHDEF([value], m4_if(type, [WITH], [], type[_])[]m4_toupper([[$2]]))dnl
+
m4_divert_once([INIT_PREPARE], [dnl
dnl switch between AC_ARG_(WITH|ENABLE), since I don't think you can indirect
@@ -53,15 +55,15 @@ AC_DEFUN([AX_ARG],
dnl check for cpp-bool tag.
m4_bmatch([$4], [cpp-bool], [dnl
- AS_VAR_PUSHDEF([int], m4_tolower(value))
+ AS_VAR_PUSHDEF([int], my_tolower(value))
AS_IF([test x"$value" = x"yes"], int=1, int=0)
AC_DEFINE_UNQUOTED(AS_TR_CPP(value), [$int], [$5])
AS_VAR_POPDEF([int])dnl
])dnl
dnl check for cpp-int tag.
m4_bmatch([$4], [cpp-int], [dnl
- AS_VAR_PUSHDEF([int], m4_tolower(value))dnl
+ AS_VAR_PUSHDEF([int], my_tolower(value))dnl
int=$value dnl
AC_DEFINE_UNQUOTED(AS_TR_CPP(value), [$int], [$5])dnl
AS_VAR_POPDEF([int])dnl
@@ -75,8 +77,8 @@ AC_DEFUN([AX_ARG],
dnl clean up after myself
AS_VAR_POPDEF([value])dnl
- m4_undefine([type])dnl
- m4_undefine([lower])dnl
+ m4_popdef([type])dnl
+ m4_popdef([lower])dnl
])
AC_DEFUN([AX_ARG_ENABLE], [AX_ARG([enable], [$1], [$2], [$3], [$4])])
View
2 m4/ax_extract_cpp_symbol.m4
@@ -16,7 +16,7 @@ __ac_extract_cpp_symbol_delimiter $1 __ac_extract_cpp_symbol_delimiter])])
old_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$5 $CPPFLAGS"
AS_VAR_PUSHDEF([output], [ax_extract_cpp_symbol_$1])dnl
-if (eval "$ac_cpp conftest.$ac_ext") >conftest.out 2>&AC_FD_CC; then
+if (eval "$ac_cpp conftest.$ac_ext") >conftest.out 2>&AS_MESSAGE_LOG_FD; then
output="`${SED} -n -e 's/^.*"__ac_extract_cpp_symbol_delimiter" \(.*\) "__ac_extract_cpp_symbol_delimiter".*$/\1/p' conftest.out 2>/dev/null`"
if test x"${output}" != x"$1"; then
ifelse([$3], , :, [$3])
View
11 m4/ax_group_pkg.m4
@@ -4,6 +4,7 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
dnl AX_GROUP_PKG(<pkg> [, <dep1> .. <depn>])
dnl A stripped-down AX_PKG that copies the vars from one pkg to another without
@@ -14,21 +15,21 @@ dnl Also, to help other macros: if there are no deps, pkg is marked NOT FOUND.
AC_DEFUN([AX_GROUP_PKG],
[AC_MSG_CHECKING([for package $1])
- m4_define([pkg], m4_toupper([[$1]]))
+ m4_pushdef([pkg], my_toupper([$1]))
AS_VAR_PUSHDEF([have_pkg], [HAVE_PKG_]pkg)
AS_VAR_PUSHDEF([pkg_c], [PKG_]pkg[_CPPFLAGS])
AS_VAR_PUSHDEF([pkg_l], [PKG_]pkg[_LIBS])
AS_VAR_PUSHDEF([missing], [ax_group_pkg_missing_deps])
AS_VAR_PUSHDEF([bool], [ax_group_pkg_have_pkg_bool])
m4_divert_once([INIT_PREPARE], [dnl
- AC_ARG_WITH(m4_tolower([[$1]]),
- AS_HELP_STRING([--with-]m4_tolower([[$1]]), [enable searching for the $1 package @<:@auto@:>@]),
+ AC_ARG_WITH(my_tolower([$1]),
+ AS_HELP_STRING([--with-]my_tolower([$1]), [enable searching for the $1 package @<:@auto@:>@]),
[ have_pkg=$withval ]
)])
missing=""
- m4_if([$2], [], [have_pkg=[no_deps]], AX_LOAD_DEPS(pkg, m4_toupper([[$2]]), missing))
+ m4_if([$2], [], [have_pkg=[no_deps]], AX_LOAD_DEPS(pkg, my_toupper([$2]), missing))
AS_IF([test x"$have_pkg" = "xno"], [AS_VAR_SET([bool], 0); AC_MSG_RESULT([no (disabled by user)])],
[AS_IF([test x"$have_pkg" = "xno_deps"], [AS_VAR_SET([bool], 0); AC_MSG_RESULT([no])],
@@ -47,7 +48,7 @@ AC_DEFUN([AX_GROUP_PKG],
AS_VAR_POPDEF([pkg_l])
AS_VAR_POPDEF([pkg_c])
AS_VAR_POPDEF([have_pkg])
- m4_undefine([pkg])
+ m4_popdef([pkg])
])
AC_DEFUN([AX_DISABLE_PKG], [AX_GROUP_PKG([$1])])
View
19 m4/ax_load_deps.m4
@@ -4,28 +4,21 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
dnl AX_LOAD_DEPS(<pkg>, <deps>[, <missing>])
dnl copies deps into the pkg CPPFLAGS/LIBS
dnl missing could be a shell var name in which to store
dnl the names of the missing deps. missing is NOT cleared
-dnl this was introduced in autoconf 2.6, i think.
-m4_ifset([m4_foreach_w], [],
-[m4_define([m4_foreach_w],[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])])
-
AC_DEFUN([AX_LOAD_DEPS],
- [AS_VAR_PUSHDEF([pkg_c], [PKG_]m4_toupper([[$1]])[_CPPFLAGS])
- AS_VAR_PUSHDEF([pkg_l], [PKG_]m4_toupper([[$1]])[_LIBS])
- AS_VAR_PUSHDEF([missing], m4_default([$3], [ax_load_deps_missing_deps]))
+ [m4_pushdef([missing], m4_default([$3], [ax_load_deps_missing_deps]))
- m4_foreach_w(dep, m4_toupper([[$2]]),
+ m4_foreach_w(dep, [$2],
[AS_IF([test x"$HAVE_PKG_]dep[" != "xyes"], [missing="$missing dep"],
- [pkg_c="$PKG_]dep[_CPPFLAGS $pkg_c"
- pkg_l="$pkg_l $PKG_]dep[_LIBS"])
+ [PKG_$1_CPPFLAGS="$PKG_]dep[_CPPFLAGS $PKG_$1_CPPFLAGS"
+ PKG_$1_LIBS="$PKG_$1_LIBS $PKG_]dep[_LIBS"])
])
- AS_VAR_POPDEF([missing])
- AS_VAR_POPDEF([pkg_l])
- AS_VAR_POPDEF([pkg_c])
+ m4_popdef([missing])
])
View
5 m4/ax_module.m4
@@ -4,6 +4,7 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
# Usage: AX_MODULE(<name>, <directory>, <library>, <default>, <prerequisites>, <required dependencies>[, <optional dependencies>])
AC_DEFUN([AX_MODULE],
@@ -48,8 +49,8 @@ AC_DEFUN([AX_MODULE],
fi
fi
- AC_ARG_ENABLE([module-]m4_tolower([[$1]]),
- AS_HELP_STRING([--enable-module-]m4_tolower([[$1]]), [enable the $1 module @<:@$4@:>@]),
+ AC_ARG_ENABLE([module-]my_tolower([$1]),
+ AS_HELP_STRING([--enable-module-]my_tolower([$1]), [enable the $1 module @<:@$4@:>@]),
[ ENABLE_MODULE_$1=$enableval; WANT_MODULE_$1=$enableval; ],
[ if test x"$ENABLE_MODULE_$1" = x; then ENABLE_MODULE_$1=`/bin/echo -n $4 | tr [A-Z] [a-z]` ; fi ]
)])
View
5 m4/ax_pkg.m4
@@ -4,14 +4,15 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
dnl Usage: AX_PKG(<name>, <dependencies>, <libraries>, <headers>[, <relative include path>, <relative lib path>, <required-functions>])
AC_DEFUN([AX_PKG],
[
m4_divert_once([INIT_PREPARE], [dnl
- AC_ARG_WITH(m4_tolower([[$1]]),
- AS_HELP_STRING([--with-]m4_tolower([[$1]]), [enable searching for the $1 package @<:@auto@:>@]),
+ AC_ARG_WITH(my_tolower([$1]),
+ AS_HELP_STRING([--with-]my_tolower([$1]), [enable searching for the $1 package @<:@auto@:>@]),
[ HAVE_PKG_$1=$withval ]
)])
View
9 m4/ax_pkg_apple.m4
@@ -4,28 +4,29 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
dnl Usage: AX_PKG_APPLE(<name>, <dependencies>, <ldflags>)
dnl This is an AX_PKG for apple-specific packages.
AC_DEFUN([AX_PKG_APPLE],
[
- AS_VAR_PUSHDEF([pkg], [APPLE_]m4_toupper([[$1]]))
+ AS_VAR_PUSHDEF([pkg], [APPLE_]my_toupper([$1]))
AS_VAR_PUSHDEF([have_pkg], [HAVE_PKG_]pkg)
AS_VAR_PUSHDEF([pkg_c], [PKG_]pkg[_CPPFLAGS])
AS_VAR_PUSHDEF([pkg_l], [PKG_]pkg[_LIBS])
AS_VAR_PUSHDEF([bool], [ax_pkg_apple_have_pkg_bool])
m4_divert_once([INIT_PREPARE], [dnl
- AC_ARG_WITH([apple_]m4_tolower([[$1]]),
- AS_HELP_STRING([--with-apple_]m4_tolower([[$1]]), [enable searching for the APPLE_$1 package @<:@auto@:>@]),
+ AC_ARG_WITH([apple_]my_tolower([$1]),
+ AS_HELP_STRING([--with-apple_]my_tolower([$1]), [enable searching for the APPLE_$1 package @<:@auto@:>@]),
[ HAVE_PKG_pkg=$withval ]
)])
AC_MSG_CHECKING(for package pkg)
AS_IF([test x"$host_vendor" != "xapple"], [ bool=0; AC_MSG_RESULT([no]) ],
[AS_VAR_PUSHDEF([missing], [ax_pkg_apple_missing_deps])
- AX_LOAD_DEPS(pkg, m4_toupper([[$2]]), missing)
+ AX_LOAD_DEPS(pkg, my_toupper([$2]), missing)
pkg_l="$pkg_l $3"
View
5 m4/ax_pkg_boost.m4
@@ -4,10 +4,7 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
-
-m4_ifset([m4_argn], [],
-[m4_define([m4_argn],
-[m4_car(m4_shiftn($1, $@))])])
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
# Usage: AX_PKG_BOOST(<required boost libs> [,boost_lib, how-to-detect-lib]*)
AC_DEFUN([AX_PKG_BOOST],
View
4 m4/ax_pkg_boost_lib.m4
@@ -4,9 +4,7 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
-dnl this was introduced in autoconf 2.6, i think.
-m4_ifset([m4_foreach_w], [],
-[m4_define([m4_foreach_w],[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])])
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
m4_pattern_allow([^PKG_BOOST_SAME_SUFFIX])
View
9 m4/ax_pkg_check_function.m4
@@ -4,20 +4,21 @@ dnl the Administrator of the National Aeronautics and Space Administration.
dnl All Rights Reserved.
dnl __END_LICENSE__
+m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
dnl usage: PKG_CHECK_FUNCTION(pkg, function, alias, define-in-c)
dnl check a pkg for an optional function, and call it by a different name
AC_DEFUN([PKG_CHECK_FUNCTION],
-[AS_VAR_PUSHDEF([var], [m4_tolower([[$1]])[_has_]m4_tolower(m4_default([$3],[$2]))])
+[m4_pushdef([var], my_tolower([$1])[_has_]m4_tolower(m4_default([$3],[$2])))
var=0
- if test x"$HAVE_PKG_[]m4_toupper([[$1]])" = x"yes"; then
- AX_CHECK_FUNCTIONS([$2], [$PKG_[]m4_toupper([[$1]])[]_LIBS], [var=1], [], [for $3 in $1])
+ if test x"$HAVE_PKG_[]my_toupper([$1])" = x"yes"; then
+ AX_CHECK_FUNCTIONS([$2], [$PKG_[]my_toupper([$1])[]_LIBS], [var=1], [], [for $3 in $1])
fi
if test x"$var" = "x1"; then
m4_toupper(var)=yes
else
m4_toupper(var)=no
fi
m4_if([$4], [yes], [AC_DEFINE_UNQUOTED(AS_TR_CPP(m4_toupper(var)), [$var], [Define to 1 if $1 has $3 support])])
- AS_VAR_POPDEF([var])
+ m4_popdef([var])
])
View
26 m4/fixups.m4
@@ -0,0 +1,26 @@
+dnl caller must protect themselves from multiple inclusion, like:
+dnl m4_ifdef([_AX_FIXUPS], [], [m4_include([m4/fixups.m4])])
+
+dnl 2.65 added an additional level of quoting for upper and lower
+m4_pushdef([AAA],[---])dnl
+m4_if(m4_tolower([aaa]), [---],
+ [m4_define([my_tolower], [m4_tolower([[$1]])])],
+ [m4_copy([m4_tolower], [my_tolower])])
+m4_popdef([AAA])
+
+m4_pushdef([AAA],[---])dnl
+m4_if(m4_toupper([aaa]), [---],
+ [m4_define([my_toupper], [m4_toupper([[$1]])])],
+ [m4_copy([m4_toupper], [my_toupper])])
+m4_popdef([AAA])
+
+dnl this was introduced in autoconf 2.6, i think.
+m4_ifset([m4_foreach_w], [],
+[m4_define([m4_foreach_w],[m4_foreach([$1], m4_split(m4_normalize([$2])), [$3])])])
+
+m4_ifset([m4_argn], [],
+[m4_define([m4_argn],
+[m4_car(m4_shiftn($1, $@))])])
+
+
+m4_define([_AX_FIXUPS], [1])

0 comments on commit 7ef4b1c

Please sign in to comment.