X-Git-Url: https://git.m6w6.name/?a=blobdiff_plain;f=m4%2Fax_restore_flags.m4;h=8f2adf27c218b9ad39239d464b02af817194d1bc;hb=24d604ebd655a7e3afe584d3dc4a25f5eca372c3;hp=cf03cae790154a1f7d11b874925b488cbe57e310;hpb=27bed94f9adf2d67670daf8a237be68f5bb7a076;p=awesomized%2Flibmemcached diff --git a/m4/ax_restore_flags.m4 b/m4/ax_restore_flags.m4 index cf03cae7..8f2adf27 100644 --- a/m4/ax_restore_flags.m4 +++ b/m4/ax_restore_flags.m4 @@ -1,31 +1,52 @@ # =========================================================================== -# http://www.gnu.org/software/autoconf-archive/ax_restore_flags.html +# https://www.gnu.org/software/autoconf-archive/ax_restore_flags.html # =========================================================================== # # SYNOPSIS # -# AX_RESTORE_FLAGS() +# AX_RESTORE_FLAGS([namespace]) # # DESCRIPTION # -# Restore common compilation flags from temporary variables +# Restore common compilation flags from temporary variables. +# +# Compilation flags includes: CPPFLAGS, CFLAGS, CXXFLAGS, LDFLAGS, LIBS, +# OBJCFLAGS. +# +# By default these flags are restored to a global (empty) namespace, but +# user could restore from specific NAMESPACE by using +# AX_RESTORE_FLAGS(NAMESPACE) macro. +# +# Typical usage is like: +# +# AX_SAVE_FLAGS(mypackage) +# CPPFLAGS="-Imypackagespath ${CPPFLAGS}" +# dnl ... do some detection ... +# AX_RESTORE_FLAGS(mypackage) # # LICENSE # # Copyright (c) 2009 Filippo Giunchedi +# Copyright (c) 2011 The Board of Trustees of the Leland Stanford Junior University +# Copyright (c) 2011 Russ Allbery +# Copyright (c) 2013 Bastien ROUCARIES # # 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 3 +#serial 7 + +# save one flag in name space +AC_DEFUN([_AX_RESTORE_ONE_FLAG],[dnl + AS_VAR_PUSHDEF([_ax_restore_flag_var], [$2[]_$1[]_ax_save_flags]) + AS_VAR_COPY($2[],_ax_restore_flag_var) + AS_VAR_POPDEF([_ax_restore_flag_var]) +]) -AC_DEFUN([AX_RESTORE_FLAGS], [ - CPPFLAGS="${CPPFLAGS_save}" - CFLAGS="${CFLAGS_save}" - CXXFLAGS="${CXXFLAGS_save}" - OBJCFLAGS="${OBJCFLAGS_save}" - LDFLAGS="${LDFLAGS_save}" - LIBS="${LIBS_save}" +AC_DEFUN([AX_RESTORE_FLAGS], [dnl + m4_foreach([FLAG], dnl + [_AX_SAVE_FLAGS_LIST()], dnl + [_AX_RESTORE_ONE_FLAG([$1],FLAG)]) ])