7
# AX_RESTORE_FLAGS([namespace])
11
# Restore common compilation flags from temporary variables
11
# Restore common compilation flags from temporary variables.
13
# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
16
# By default these flags are restored to a global (empty) namespace, but
17
# user could restore from specific NAMESPACE by using
18
# AX_RESTORE_FLAGS(NAMESPACE) macro.
20
# Typical usage is like:
22
# AX_SAVE_FLAGS(mypackage)
23
# CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
24
# dnl ... do some detection ...
25
# AX_RESTORE_FLAGS(mypackage)
15
29
# Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
30
# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University
31
# Copyright (c) 2011 Russ Allbery <rra@stanford.edu>
32
# Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com>
17
34
# Copying and distribution of this file, with or without modification, are
18
35
# permitted in any medium without royalty provided the copyright notice
19
36
# and this notice are preserved. This file is offered as-is, without any
24
AC_DEFUN([AX_RESTORE_FLAGS], [
25
CPPFLAGS="${CPPFLAGS_save}"
26
CFLAGS="${CFLAGS_save}"
27
CXXFLAGS="${CXXFLAGS_save}"
28
OBJCFLAGS="${OBJCFLAGS_save}"
29
LDFLAGS="${LDFLAGS_save}"
41
# save one flag in name space
42
AC_DEFUN([_AX_RESTORE_ONE_FLAG],[dnl
43
AS_VAR_PUSHDEF([_ax_restore_flag_var], [$2[]_$1[]_ax_save_flags])
44
AS_VAR_COPY($2[],_ax_restore_flag_var)
45
AS_VAR_POPDEF([_ax_restore_flag_var])
48
AC_DEFUN([AX_RESTORE_FLAGS], [dnl
49
m4_foreach([FLAG], dnl
50
[_AX_SAVE_FLAGS_LIST()], dnl
51
[_AX_RESTORE_ONE_FLAG([$1],FLAG)])