Update with job builder.
authorBrian Aker <brian@tangent.org>
Tue, 9 Oct 2012 05:01:35 +0000 (01:01 -0400)
committerBrian Aker <brian@tangent.org>
Tue, 9 Oct 2012 05:01:35 +0000 (01:01 -0400)
15 files changed:
.bzrignore
Makefile.am
bootstrap.sh
configure.ac
example/include.am
m4/ax_add_am_macro.m4 [new file with mode: 0644]
m4/ax_am_jobserver.m4 [new file with mode: 0644]
m4/ax_am_macros.m4 [new file with mode: 0644]
m4/ax_append_to_file.m4 [new file with mode: 0644]
m4/ax_count_cpus.m4 [new file with mode: 0644]
m4/ax_file_escapes.m4 [new file with mode: 0644]
m4/ax_libevent.m4 [new file with mode: 0644]
m4/ax_print_to_file.m4 [new file with mode: 0644]
m4/ax_restore_flags.m4 [new file with mode: 0644]
m4/ax_save_flags.m4 [new file with mode: 0644]

index 866ad77963300c1ac05e6da986d7bb82628ade4e..ed1adb826d185f9af99c4d618bc5b4aafa652ec4 100644 (file)
@@ -155,3 +155,4 @@ tests/testudp
 tests/var/
 tmp_chroot
 unittests/unittests
 tests/var/
 tmp_chroot
 unittests/unittests
+aminclude.am
index 5b1fcd21ebe3ff6a7614a96a4df0bf0f4b445b64..aaebd1c32dca13a39cfe2a317abb039b66779462 100644 (file)
@@ -1,6 +1,6 @@
 # vim:ft=automake
 
 # vim:ft=automake
 
-ACLOCAL_AMFLAGS = -I m4 -I libtest/m4
+ACLOCAL_AMFLAGS = -I m4 -I libtest/m4 --install -Wall -Werror
 
 # includes append to these:
 SUFFIXES =
 
 # includes append to these:
 SUFFIXES =
@@ -21,6 +21,9 @@ EXTRA_HEADERS =
 BUILT_SOURCES=
 EXTRA_DIST=
 
 BUILT_SOURCES=
 EXTRA_DIST=
 
+#includes additional rules from aminclude.am
+@INC_AMINCLUDE@
+
 EXTRA_DIST+= ${srcdir}/m4/pandora_*.m4
 EXTRA_DIST+= .quickly
 EXTRA_DIST+= README.FIRST
 EXTRA_DIST+= ${srcdir}/m4/pandora_*.m4
 EXTRA_DIST+= .quickly
 EXTRA_DIST+= README.FIRST
index 9c46ab791316447e4bfecfa19b724ab1fe9251f3..b6da38cdf62ec250d7ca90f8a45eb6c92138e675 100755 (executable)
@@ -76,8 +76,8 @@ configure_target_platform () {
 
 setup_gdb_command () {
   GDB_TMPFILE=$(mktemp /tmp/gdb.XXXXXXXXXX)
 
 setup_gdb_command () {
   GDB_TMPFILE=$(mktemp /tmp/gdb.XXXXXXXXXX)
-  echo "set logging on" > $GDB_TMPFILE
-  echo "set logging overwrite on" >> $GDB_TMPFILE
+  echo "set logging overwrite on" > $GDB_TMPFILE
+  echo "set logging on" >> $GDB_TMPFILE
   echo "set environment LIBTEST_IN_GDB=1" >> $GDB_TMPFILE
   echo "run" >> $GDB_TMPFILE
   echo "thread apply all bt" >> $GDB_TMPFILE
   echo "set environment LIBTEST_IN_GDB=1" >> $GDB_TMPFILE
   echo "run" >> $GDB_TMPFILE
   echo "thread apply all bt" >> $GDB_TMPFILE
@@ -246,7 +246,7 @@ make_target () {
   fi
 
   MAKE_TARGET=$1
   fi
 
   MAKE_TARGET=$1
-  run $MAKE $MAKE_J $MAKE_TARGET || die "Cannot execute $MAKE $MAKE_TARGET"
+  run $MAKE $MAKE_TARGET || die "Cannot execute $MAKE $MAKE_TARGET"
 
   if [ -n "$MAKE_TARGET" ]; then
     MAKE_TARGET=$OLD_MAKE_TARGET
 
   if [ -n "$MAKE_TARGET" ]; then
     MAKE_TARGET=$OLD_MAKE_TARGET
@@ -265,6 +265,10 @@ make_distclean () {
   make_target distclean
 }
 
   make_target distclean
 }
 
+make_maintainer_clean () {
+  make_target maintainer-clean
+}
+
 make_check () {
   make_target check
 }
 make_check () {
   make_target check
 }
@@ -355,18 +359,15 @@ bootstrap() {
     MAKE="make"
   fi
 
     MAKE="make"
   fi
 
-  # Set ENV MAKE_J in order to override "-j2"
-  if [ -z "$MAKE_J" ]; then
-    MAKE_J="-j2"
-  fi
-
   # Set ENV PREFIX in order to set --prefix for ./configure
   if [ -n "$PREFIX" ]; then 
     PREFIX_ARG="--prefix=$PREFIX"
   fi
 
   if [ -f Makefile ]; then
   # Set ENV PREFIX in order to set --prefix for ./configure
   if [ -n "$PREFIX" ]; then 
     PREFIX_ARG="--prefix=$PREFIX"
   fi
 
   if [ -f Makefile ]; then
-    $MAKE $MAKE_J maintainer-clean
+    make_maintainer_clean
+    rm -f Makefile.in
+    rm -f aminclude.am
   fi
 
   run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Cannot execute $LIBTOOLIZE $LIBTOOLIZE_FLAGS"
   fi
 
   run $LIBTOOLIZE $LIBTOOLIZE_FLAGS || die "Cannot execute $LIBTOOLIZE $LIBTOOLIZE_FLAGS"
index dc7b8ca70bda407e7a38169f07a26e8e07a0ee95..ee2d417cb2adbe3a8a1e57b98bc4b52892e0f9ab 100644 (file)
@@ -177,6 +177,7 @@ AC_C_RESTRICT
 AX_CXX_GCC_ABI_DEMANGLE
 
 AX_SASL_CHECK
 AX_CXX_GCC_ABI_DEMANGLE
 
 AX_SASL_CHECK
+AX_LIBEVENT
 
 dnl
 dnl The sasl functions should only be visible if we build with sasl support
 
 dnl
 dnl The sasl functions should only be visible if we build with sasl support
@@ -249,11 +250,6 @@ AS_IF(test "x$ac_cv_header_winsock2_h" = "xyes",
       ])
 SOCKET_SEND_FLAGS
 
       ])
 SOCKET_SEND_FLAGS
 
-AX_CHECK_LIBRARY([LIBEVENT], [event.h], [event], 
-                 [LIBEVENT_LDFLAGS="-levent"],
-                 [AC_MSG_WARN([Unable to find libevent])])
-AM_CONDITIONAL(HAVE_LIBEVENT, test "x${ax_cv_have_LIBEVENT}" = "xyes")
-
 AX_UUID_GENERATE_TIME_SAFE
 
 
 AX_UUID_GENERATE_TIME_SAFE
 
 
@@ -267,6 +263,8 @@ AX_ASSERT
 AX_CXX_COMPILER_VERSION
 AX_HARDEN_COMPILER_FLAGS
 
 AX_CXX_COMPILER_VERSION
 AX_HARDEN_COMPILER_FLAGS
 
+AX_AM_JOBSERVER([yes])
+
 AC_CONFIG_FILES([
   Makefile
   docs/conf.py
 AC_CONFIG_FILES([
   Makefile
   docs/conf.py
@@ -290,8 +288,8 @@ echo "   * C Flags:                   $CFLAGS"
 echo "   * C++ Compiler:              $CXX_VERSION"
 echo "   * C++ Flags:                 $CXXFLAGS"
 echo "   * CPP Flags:                 $CPPFLAGS"
 echo "   * C++ Compiler:              $CXX_VERSION"
 echo "   * C++ Flags:                 $CXXFLAGS"
 echo "   * CPP Flags:                 $CPPFLAGS"
-echo "   * Assertions enabled:        $ac_cv_assert"
-echo "   * Debug enabled:             $with_debug"
+echo "   * Assertions enabled:        $ax_enable_assert"
+echo "   * Debug enabled:             $ax_enable_debug"
 echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
 echo "   * SASL support:              $ac_enable_sasl"
 echo ""
 echo "   * Warnings as failure:       $ac_cv_warnings_as_errors"
 echo "   * SASL support:              $ac_enable_sasl"
 echo ""
index 80e446ebeb88f86a5c270b656fbcaf8b950f0f39..8dfa5f4a5f24e545a061e93b25bf130cc77a31ef 100644 (file)
@@ -12,6 +12,7 @@ noinst_HEADERS+= example/storage.h
 
 example_memcached_light_SOURCES=
 example_memcached_light_LDADD= 
 
 example_memcached_light_SOURCES=
 example_memcached_light_LDADD= 
+example_memcached_light_LDFLAGS=
 
 example_memcached_light_SOURCES+= example/byteorder.cc
 example_memcached_light_SOURCES+= example/interface_v0.cc
 
 example_memcached_light_SOURCES+= example/byteorder.cc
 example_memcached_light_SOURCES+= example/interface_v0.cc
@@ -22,6 +23,6 @@ example_memcached_light_SOURCES+= util/daemon.cc
 example_memcached_light_SOURCES+= util/pidfile.cc
 
 example_memcached_light_LDADD+= libmemcached/libmemcachedprotocol.la
 example_memcached_light_SOURCES+= util/pidfile.cc
 
 example_memcached_light_LDADD+= libmemcached/libmemcachedprotocol.la
-example_memcached_light_LDADD+= $(LIBEVENT_LDFLAGS)
+example_memcached_light_LDFLAGS+= @LIBEVENT_LDFLAGS@
 
 include example/t/include.am
 
 include example/t/include.am
diff --git a/m4/ax_add_am_macro.m4 b/m4/ax_add_am_macro.m4
new file mode 100644 (file)
index 0000000..51ce0d0
--- /dev/null
@@ -0,0 +1,29 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_add_am_macro.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_ADD_AM_MACRO([RULE])
+#
+# DESCRIPTION
+#
+#   Adds the specified rule to $AMINCLUDE. This macro will only work
+#   properly with implementations of Make which allow include statements.
+#   See also AX_ADD_AM_MACRO_STATIC.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 9
+
+AC_DEFUN([AX_ADD_AM_MACRO],[
+  AC_REQUIRE([AX_AM_MACROS])
+  AX_APPEND_TO_FILE([$AMINCLUDE],[$1])
+])
diff --git a/m4/ax_am_jobserver.m4 b/m4/ax_am_jobserver.m4
new file mode 100644 (file)
index 0000000..0bee7ab
--- /dev/null
@@ -0,0 +1,55 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_am_jobserver.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_AM_JOBSERVER([default_value])
+#
+# DESCRIPTION
+#
+#   Enables the use of make's jobserver for the purpose of parallel building
+#   by passing the -j option to make.
+#
+#   The option --enable-jobserver is added to configure which can accept a
+#   yes, no, or an integer. The integer is the number of separate jobs to
+#   allow. If 'yes' is given, then the is assumed to be one more than the
+#   number of CPUs (determined through AX_COUNT_CPUS). If the value of no is
+#   given, then the jobserver is disabled. The default value is given by the
+#   first argument of the macro, or 'yes' if the argument is omitted.
+#
+#   This macro makes use of AX_AM_MACROS, so you must add the following line
+#
+#     @INC_AMINCLUDE@
+#
+#   to your Makefile.am files.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 7
+
+AC_DEFUN([AX_AM_JOBSERVER], [
+    AC_REQUIRE([AX_COUNT_CPUS])
+    AC_REQUIRE([AX_AM_MACROS])
+    AC_ARG_ENABLE( jobserver,
+    [  --enable-jobserver@<:@=no/yes/@%:@@:>@ default=m4_ifval([$1],[$1],[yes])
+                        Enable up to @%:@ make jobs
+                        yes: enable one more than CPU count
+    ],, [enable_jobserver=m4_ifval([$1],[$1],[yes])])
+    if test "x$enable_jobserver" = "xyes"; then
+        enable_jobserver=$CPU_COUNT
+        ((enable_jobserver++))
+    fi
+    m4_pattern_allow(AM_MAKEFLAGS)
+    if test "x$enable_jobserver" != "xno"; then
+        AC_MSG_NOTICE([added jobserver support to make for $enable_jobserver jobs])
+        AX_ADD_AM_MACRO( AM_MAKEFLAGS += -j$enable_jobserver )
+    fi
+])
diff --git a/m4/ax_am_macros.m4 b/m4/ax_am_macros.m4
new file mode 100644 (file)
index 0000000..6b4bd22
--- /dev/null
@@ -0,0 +1,44 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_am_macros.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_AM_MACROS
+#
+# DESCRIPTION
+#
+#   Adds support for macros that create Make rules. You must manually add
+#   the following line
+#
+#     @INC_AMINCLUDE@
+#
+#   to your Makefile.in (or Makefile.am if you use Automake) files.
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Tom Howard <tomhoward@users.sf.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 9
+
+AC_DEFUN([AX_AM_MACROS],
+[
+AC_MSG_NOTICE([adding automake macro support])
+AMINCLUDE="aminclude.am"
+AC_SUBST(AMINCLUDE)
+AC_MSG_NOTICE([creating $AMINCLUDE])
+AMINCLUDE_TIME=`date`
+AX_PRINT_TO_FILE([$AMINCLUDE],[[
+# generated automatically by configure from AX_AUTOMAKE_MACROS
+# on $AMINCLUDE_TIME
+
+]])
+
+INC_AMINCLUDE="include \$(top_builddir)/$AMINCLUDE"
+AC_SUBST(INC_AMINCLUDE)
+])
diff --git a/m4/ax_append_to_file.m4 b/m4/ax_append_to_file.m4
new file mode 100644 (file)
index 0000000..c88affb
--- /dev/null
@@ -0,0 +1,27 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_append_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_APPEND_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+#   Appends the specified data to the specified file.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 7
+
+AC_DEFUN([AX_APPEND_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+printf "$2" >> "$1"
+])
diff --git a/m4/ax_count_cpus.m4 b/m4/ax_count_cpus.m4
new file mode 100644 (file)
index 0000000..d4f3d29
--- /dev/null
@@ -0,0 +1,57 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_count_cpus.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_COUNT_CPUS
+#
+# DESCRIPTION
+#
+#   Attempt to count the number of processors present on the machine. If the
+#   detection fails, then a value of 1 is assumed.
+#
+#   The value is placed in the CPU_COUNT variable.
+#
+# LICENSE
+#
+#   Copyright (c) 2012 Brian Aker <brian@tangent.org>
+#   Copyright (c) 2008 Michael Paul Bailey <jinxidoru@byu.net>
+#   Copyright (c) 2008 Christophe Tournayre <turn3r@users.sourceforge.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 10
+
+  AC_DEFUN([AX_COUNT_CPUS],[
+      AC_REQUIRE([AC_CANONICAL_HOST])
+      AC_REQUIRE([AC_PROG_EGREP])
+      AC_MSG_CHECKING([the number of available CPUs])
+      CPU_COUNT="0"
+
+      AS_CASE([$host_os],[
+        *darwin*],[
+        AS_IF([test -x /usr/sbin/sysctl],[
+          sysctl_a=`/usr/sbin/sysctl -a 2>/dev/null| grep -c hw.cpu`
+          AS_IF([test sysctl_a],[
+            CPU_COUNT=`/usr/sbin/sysctl -n hw.ncpu`
+            ])
+          ])],[
+        *linux*],[
+        AS_IF([test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo],[
+          AS_IF([test "x$CPU_COUNT" = "x0" -a -e /proc/cpuinfo],[
+            CPU_COUNT=`$EGREP -c '^processor' /proc/cpuinfo`
+            ])
+          ])
+        ])
+
+      AS_IF([test "x$CPU_COUNT" = "x0"],[
+        CPU_COUNT="1"
+        AC_MSG_RESULT( [unable to detect (assuming 1)] )
+        ],[
+        AC_MSG_RESULT( $CPU_COUNT )
+        ])
+      ])
diff --git a/m4/ax_file_escapes.m4 b/m4/ax_file_escapes.m4
new file mode 100644 (file)
index 0000000..f4c6a06
--- /dev/null
@@ -0,0 +1,30 @@
+# ===========================================================================
+#      http://www.gnu.org/software/autoconf-archive/ax_file_escapes.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_FILE_ESCAPES
+#
+# DESCRIPTION
+#
+#   Writes the specified data to the specified file.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 7
+
+AC_DEFUN([AX_FILE_ESCAPES],[
+AX_DOLLAR="\$"
+AX_SRB="\\135"
+AX_SLB="\\133"
+AX_BS="\\\\"
+AX_DQ="\""
+])
diff --git a/m4/ax_libevent.m4 b/m4/ax_libevent.m4
new file mode 100644 (file)
index 0000000..79999ef
--- /dev/null
@@ -0,0 +1,49 @@
+# https://github.com/BrianAker/ddm4
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_LIBEVENT()
+#
+# DESCRIPTION
+#
+#   libevent library
+#
+# LICENSE
+#
+#   Copyright (c) 2012 Brian Aker <brian@tangent.org>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 1
+  AC_DEFUN([AX_LIBEVENT],[
+      AC_CACHE_CHECK([test for a working libevent], [ax_cv_libevent], [
+        AX_SAVE_FLAGS
+        LIBS="-levent $LIBS"
+        AC_LANG_PUSH([C])
+        AC_RUN_IFELSE([
+          AC_LANG_PROGRAM([#include <event.h>], [
+            struct event_base *tmp_event= event_init();
+            event_base_free(tmp_event);
+            ])],
+          [ax_cv_libevent=yes],
+          [ax_cv_libevent=no],
+          [AC_MSG_WARN([test program execution failed])])
+        AC_LANG_POP
+        AX_RESTORE_FLAGS
+        ])
+
+      AS_IF([test "x$ax_cv_libevent" = "xyes"],[
+        LIBEVENT_LDFLAGS="-levent"
+        AC_SUBST(LIBEVENT_LDFLAGS)
+        AC_DEFINE([HAVE_LIBEVENT],[1],[Define if event_init is present in event.h.])],[
+        AC_DEFINE([HAVE_LIBEVENT],[0],[Define if event_init is present in event_init.h.])
+        ])
+
+      AM_CONDITIONAL(HAVE_LIBEVENT, test "x$ax_cv_libevent" = "xyes")
+      ])
+
diff --git a/m4/ax_print_to_file.m4 b/m4/ax_print_to_file.m4
new file mode 100644 (file)
index 0000000..5b9d1c3
--- /dev/null
@@ -0,0 +1,27 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_print_to_file.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_PRINT_TO_FILE([FILE],[DATA])
+#
+# DESCRIPTION
+#
+#   Writes the specified data to the specified file.
+#
+# LICENSE
+#
+#   Copyright (c) 2008 Tom Howard <tomhoward@users.sf.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 7
+
+AC_DEFUN([AX_PRINT_TO_FILE],[
+AC_REQUIRE([AX_FILE_ESCAPES])
+printf "$2" > "$1"
+])
diff --git a/m4/ax_restore_flags.m4 b/m4/ax_restore_flags.m4
new file mode 100644 (file)
index 0000000..cf03cae
--- /dev/null
@@ -0,0 +1,31 @@
+# ===========================================================================
+#     http://www.gnu.org/software/autoconf-archive/ax_restore_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_RESTORE_FLAGS()
+#
+# DESCRIPTION
+#
+#   Restore common compilation flags from temporary variables
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 3
+
+AC_DEFUN([AX_RESTORE_FLAGS], [
+  CPPFLAGS="${CPPFLAGS_save}"
+  CFLAGS="${CFLAGS_save}"
+  CXXFLAGS="${CXXFLAGS_save}"
+  OBJCFLAGS="${OBJCFLAGS_save}"
+  LDFLAGS="${LDFLAGS_save}"
+  LIBS="${LIBS_save}"
+])
diff --git a/m4/ax_save_flags.m4 b/m4/ax_save_flags.m4
new file mode 100644 (file)
index 0000000..d2a0542
--- /dev/null
@@ -0,0 +1,31 @@
+# ===========================================================================
+#       http://www.gnu.org/software/autoconf-archive/ax_save_flags.html
+# ===========================================================================
+#
+# SYNOPSIS
+#
+#   AX_SAVE_FLAGS()
+#
+# DESCRIPTION
+#
+#   Save common compilation flags into temporary variables
+#
+# LICENSE
+#
+#   Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
+#
+#   Copying and distribution of this file, with or without modification, are
+#   permitted in any medium without royalty provided the copyright notice
+#   and this notice are preserved. This file is offered as-is, without any
+#   warranty.
+
+#serial 3
+
+AC_DEFUN([AX_SAVE_FLAGS], [
+  CPPFLAGS_save="${CPPFLAGS}"
+  CFLAGS_save="${CFLAGS}"
+  CXXFLAGS_save="${CXXFLAGS}"
+  OBJCFLAGS_save="${OBJCFLAGS}"
+  LDFLAGS_save="${LDFLAGS}"
+  LIBS_save="${LIBS}"
+])