7
# AX_SAVE_FLAGS([NAMESPACE])
11
# Save common compilation flags into temporary variables
11
# Save common compilation flags into temporary variables.
13
# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
16
# By default these flags are saved to a global (empty) namespace, but user
17
# could specify a specific NAMESPACE to AX_SAVE_FLAGS macro and latter
18
# restore it by using AX_RESTORE_FLAGS(NAMESPACE).
20
# AX_SAVE_FLAGS(mypackage)
21
# CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
22
# dnl .. do some detection ...
23
# AX_RESTORE_FLAGS(mypackage)
15
27
# Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
28
# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University
29
# Copyright (c) 2011 Russ Allbery <rra@stanford.edu>
30
# Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com>
17
32
# Copying and distribution of this file, with or without modification, are
18
33
# permitted in any medium without royalty provided the copyright notice
19
34
# and this notice are preserved. This file is offered as-is, without any
24
AC_DEFUN([AX_SAVE_FLAGS], [
25
CPPFLAGS_save="${CPPFLAGS}"
26
CFLAGS_save="${CFLAGS}"
27
CXXFLAGS_save="${CXXFLAGS}"
28
OBJCFLAGS_save="${OBJCFLAGS}"
29
LDFLAGS_save="${LDFLAGS}"
39
# list of flag to save
40
AC_DEFUN([_AX_SAVE_FLAGS_LIST],[dnl
60
# save one flag in name space
61
AC_DEFUN([_AX_SAVE_ONE_FLAG],[
62
AS_VAR_PUSHDEF([_ax_save_flag_var], [$2[]_$1[]_ax_save_flags])
63
AS_VAR_COPY(_ax_save_flag_var, $2[])
64
AS_VAR_POPDEF([_ax_save_flag_var])
67
AC_DEFUN([AX_SAVE_FLAGS],[dnl
68
m4_foreach([FLAG], dnl
69
[_AX_SAVE_FLAGS_LIST()], dnl
70
[_AX_SAVE_ONE_FLAG([$1],FLAG)])