1 # ===========================================================================
2 # http://www.gnu.org/software/autoconf-archive/ax_switch_flags.html
3 # ===========================================================================
7 # AX_SWITCH_FLAGS(newnamespace,[oldnamespace])
11 # Switch common compilation flags from temporary variables between two
12 # compilation namespace.
14 # Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
17 # By default these flags are restored to a global (empty) namespace, but
18 # user could restore from specific NAMESPACE by using
19 # AX_RESTORE_FLAGS(NAMESPACE) macro.
21 # Typical usage is like:
23 # AX_SAVE_FLAGS(beginprogram)
24 # CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
25 # AX_SWITCH_FLAGS(mypackage,beginprogram)
29 # Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
30 # Copyright (c) 2011 Russ Allbery <rra@stanford.edu>
31 # Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com>
33 # Copying and distribution of this file, with or without modification, are
34 # permitted in any medium without royalty provided the copyright notice
35 # and this notice are preserved. This file is offered as-is, without any
40 AC_DEFUN([AX_SWITCH_FLAGS], [
41 AC_REQUIRE(AX_SAVE_FLAGS)
42 AC_REQUIRE(AX_RESTORE_FLAGS)
43 AS_IF([test "X$1" = "X"], AC_MSG_ERROR(newnamespace is empty)]
45 AX_RESTORE_FLAGS($2[])