File: ax_save_flags.m4

package info (click to toggle)
xmltooling 1.6.0-4+deb9u2
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 4,928 kB
  • sloc: cpp: 22,289; sh: 11,065; makefile: 337; xml: 170; ansic: 49
file content (71 lines) | stat: -rw-r--r-- 2,001 bytes parent folder | download | duplicates (28)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# ===========================================================================
#       http://www.gnu.org/software/autoconf-archive/ax_save_flags.html
# ===========================================================================
#
# SYNOPSIS
#
#   AX_SAVE_FLAGS([NAMESPACE])
#
# DESCRIPTION
#
#   Save common compilation flags into temporary variables.
#
#   Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
#   OBJCFLAGS.
#
#   By default these flags are saved to a global (empty) namespace, but user
#   could specify a specific NAMESPACE to AX_SAVE_FLAGS macro and latter
#   restore it by using AX_RESTORE_FLAGS(NAMESPACE).
#
#     AX_SAVE_FLAGS(mypackage)
#     CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
#     dnl .. do some detection ...
#     AX_RESTORE_FLAGS(mypackage)
#
# LICENSE
#
#   Copyright (c) 2009 Filippo Giunchedi <filippo@esaurito.net>
#   Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University
#   Copyright (c) 2011 Russ Allbery <rra@stanford.edu>
#   Copyright (c) 2013 Bastien ROUCARIES <roucaries.bastien+autoconf@gmail.com>
#
#   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

# list of flag to save
AC_DEFUN([_AX_SAVE_FLAGS_LIST],[dnl
[CCASFLAGS],dnl
[CFLAGS],dnl
[CPPFLAGS],dnl
[CXXFLAGS],dnl
[ERLCFLAGS],dnl
[FCFLAGS],dnl
[FCLIBS],dnl
[FFLAGS],dnl
[FLIBS],dnl
[GCJFLAGS],dnl
[JAVACFLAGS],dnl
[LDFLAGS],dnl
[LIBS],dnl
[OBJCFLAGS],dnl
[OBJCXXFLAGS],dnl
[UPCFLAGS],dnl
[VALAFLAGS]dnl
])

# save one flag in name space
AC_DEFUN([_AX_SAVE_ONE_FLAG],[
  AS_VAR_PUSHDEF([_ax_save_flag_var], [$2[]_$1[]_ax_save_flags])
  AS_VAR_COPY(_ax_save_flag_var, $2[])
  AS_VAR_POPDEF([_ax_save_flag_var])
])

AC_DEFUN([AX_SAVE_FLAGS],[dnl
   m4_foreach([FLAG], dnl
	      [_AX_SAVE_FLAGS_LIST()], dnl
	      [_AX_SAVE_ONE_FLAG([$1],FLAG)])
])