~tangent-trunk/libmemcached/1.2

« back to all changes in this revision

Viewing changes to m4/ax_restore_flags.m4

  • Committer: Continuous Integration
  • Date: 2014-02-06 09:21:14 UTC
  • mfrom: (1110.1.2 libmemcached-1.2)
  • Revision ID: ci@tangent.org-20140206092114-cp72onmoikv5huli
Merge bzr://10.0.3.21/ Build: jenkins-Libmemcached-454

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
#
5
5
# SYNOPSIS
6
6
#
7
 
#   AX_RESTORE_FLAGS()
 
7
#   AX_RESTORE_FLAGS([namespace])
8
8
#
9
9
# DESCRIPTION
10
10
#
11
 
#   Restore common compilation flags from temporary variables
 
11
#   Restore common compilation flags from temporary variables.
 
12
#
 
13
#   Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS,
 
14
#   OBJCFLAGS.
 
15
#
 
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.
 
19
#
 
20
#   Typical usage is like:
 
21
#
 
22
#     AX_SAVE_FLAGS(mypackage)
 
23
#     CPPFLAGS="-Imypackagespath ${CPPFLAGS}"
 
24
#     dnl ... do some detection ...
 
25
#     AX_RESTORE_FLAGS(mypackage)
12
26
#
13
27
# LICENSE
14
28
#
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>
16
33
#
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
20
37
#   warranty.
21
38
 
22
 
#serial 3
23
 
 
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}"
30
 
  LIBS="${LIBS_save}"
 
39
#serial 6
 
40
 
 
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])
 
46
])
 
47
 
 
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)])
31
52
])