announce: module-init-tools to be replaced with new library-based tools
[module-init-tools.git] / m4 / ax_configure_args.m4
blob2099cf9c0d22dabf525325f9889c5f2aa51b662f
1 # ===========================================================================
2 #           http://autoconf-archive.cryp.to/ax_configure_args.html
3 # ===========================================================================
5 # SYNOPSIS
7 #   AX_CONFIGURE_ARGS
9 # DESCRIPTION
11 #   Helper macro for AX_ENABLE_BUILDDIR.
13 #   The traditional way of starting a subdir-configure is running the script
14 #   with ${1+"$@"} but since autoconf 2.60 this is broken. Instead we have
15 #   to rely on eval'ing $ac_configure_args however some old autoconf
16 #   versions do not provide that. To ensure maximum portability of autoconf
17 #   extension macros this helper can be AC_REQUIRE'd so that
18 #   $ac_configure_args will alsways be present.
20 #   Sadly, the traditional "exec $SHELL" of the enable_builddir macros is
21 #   spoiled now and must be replaced by "eval + exit $?".
23 #   Example:
25 #      AC_DEFUN([AX_ENABLE_SUBDIR],[dnl
26 #        AC_REQUIRE([AX_CONFIGURE_ARGS])dnl
27 #        eval $SHELL $ac_configure_args || exit $?
28 #        ...])
30 # LAST MODIFICATION
32 #   2008-04-12
34 # COPYLEFT
36 #   Copyright (c) 2008 Guido U. Draheim <guidod@gmx.de>
38 #   This program is free software; you can redistribute it and/or modify it
39 #   under the terms of the GNU General Public License as published by the
40 #   Free Software Foundation; either version 2 of the License, or (at your
41 #   option) any later version.
43 #   This program is distributed in the hope that it will be useful, but
44 #   WITHOUT ANY WARRANTY; without even the implied warranty of
45 #   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
46 #   Public License for more details.
48 #   You should have received a copy of the GNU General Public License along
49 #   with this program. If not, see <http://www.gnu.org/licenses/>.
51 #   As a special exception, the respective Autoconf Macro's copyright owner
52 #   gives unlimited permission to copy, distribute and modify the configure
53 #   scripts that are the output of Autoconf when processing the Macro. You
54 #   need not follow the terms of the GNU General Public License when using
55 #   or distributing such scripts, even though portions of the text of the
56 #   Macro appear in them. The GNU General Public License (GPL) does govern
57 #   all other use of the material that constitutes the Autoconf Macro.
59 #   This special exception to the GPL applies to versions of the Autoconf
60 #   Macro released by the Autoconf Macro Archive. When you make and
61 #   distribute a modified version of the Autoconf Macro, you may extend this
62 #   special exception to the GPL to apply to your modified version as well.
64 AC_DEFUN([AX_CONFIGURE_ARGS],[
65    # [$]@ is unsable in 2.60+ but earlier autoconf had no ac_configure_args
66    if test "${ac_configure_args+set}" != "set" ; then
67       ac_configure_args=
68       for ac_arg in ${1+"[$]@"}; do
69          ac_configure_args="$ac_configure_args '$ac_arg'"
70       done
71    fi