Skip to content

Commit

Permalink
output the option-handling code later in the process
Browse files Browse the repository at this point in the history
  • Loading branch information
novas0x2a committed Dec 3, 2009
1 parent fd1e4c2 commit 298cc32
Show file tree
Hide file tree
Showing 8 changed files with 19 additions and 14 deletions.
2 changes: 1 addition & 1 deletion configure.ac
Expand Up @@ -49,7 +49,7 @@ dnl LIBTOOL_VERSION=current:revision:age
LIBTOOL_VERSION=4:0:0
AC_SUBST(LIBTOOL_VERSION)

m4_divert_text([DEFAULTS], [dnl
m4_divert_text([INIT_PREPARE], [dnl
# load the config.options
if test -f ./config.options; then
AX_LOG([using config.options << EOF])
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_arg.m4
Expand Up @@ -23,6 +23,7 @@ AC_DEFUN([AX_ARG],
m4_define([type], [m4_toupper([[$1]])])dnl WITH or ENABLE
AS_VAR_PUSHDEF([value], [m4_if(type, [WITH], [], type[_])[]m4_toupper([[$2]])])dnl
m4_divert_once([INIT_PREPARE], [dnl
dnl switch between AC_ARG_(WITH|ENABLE), since I don't think you can indirect
m4_if(type, [WITH],
dnl WITH case.
Expand All @@ -35,7 +36,7 @@ AC_DEFUN([AX_ARG],
[AC_ARG_ENABLE(lower,
AC_HELP_STRING([--][]m4_if(yes, [$3], disable, enable)-lower, [$5][ ]m4_ifval([$3],[@<:@$3@:>@])),
[ value=[$enableval] ],
[ AS_VAR_SET_IF([value], [], [value="[$3]"]) ])])
[ AS_VAR_SET_IF([value], [], [value="[$3]"]) ])])])
dnl if the tag is none, generate no configure code here
m4_bmatch([$4], [none], [], [dnl
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_group_pkg.m4
Expand Up @@ -21,10 +21,11 @@ AC_DEFUN([AX_GROUP_PKG],
AS_VAR_PUSHDEF([missing], [ax_group_pkg_missing_deps])
AS_VAR_PUSHDEF([bool], [ax_group_pkg_have_pkg_bool])
m4_divert_once([INIT_PREPARE], [dnl
AC_ARG_WITH(m4_tolower([[$1]]),
AC_HELP_STRING([--with-]m4_tolower([[$1]]), [enable searching for the $1 package @<:@auto@:>@]),
[ have_pkg=$withval ]
)
)])
missing=""
m4_if([$2], [], [have_pkg=[no_deps]], AX_LOAD_DEPS(pkg, m4_toupper([[$2]]), missing))
Expand Down
13 changes: 6 additions & 7 deletions m4/ax_module.m4
Expand Up @@ -38,7 +38,7 @@ AC_DEFUN([AX_MODULE],
HAVE_PKG_$1_SRC=yes
m4_divert_once([DEFAULTS], [dnl
m4_divert_once([INIT_PREPARE], [dnl
# Silently ignore modules that don't exist in this distribution
# I'm diverting the output, so i need to do this twice.
if test -d "$srcdir/$2" ; then
Expand All @@ -47,13 +47,12 @@ AC_DEFUN([AX_MODULE],
WANT_MODULE_$1="$ENABLE_MODULE_$1"
fi
fi
])
AC_ARG_ENABLE([module-]m4_tolower([[$1]]),
AC_HELP_STRING([--enable-module-]m4_tolower([[$1]]), [enable the $1 module @<:@$4@:>@]),
[ ENABLE_MODULE_$1=$enableval; WANT_MODULE_$1=$enableval; ],
[ if test x"$ENABLE_MODULE_$1" = x; then ENABLE_MODULE_$1=`/bin/echo -n $4 | tr [A-Z] [a-z]` ; fi ]
)
AC_ARG_ENABLE([module-]m4_tolower([[$1]]),
AC_HELP_STRING([--enable-module-]m4_tolower([[$1]]), [enable the $1 module @<:@$4@:>@]),
[ ENABLE_MODULE_$1=$enableval; WANT_MODULE_$1=$enableval; ],
[ if test x"$ENABLE_MODULE_$1" = x; then ENABLE_MODULE_$1=`/bin/echo -n $4 | tr [A-Z] [a-z]` ; fi ]
)])
AC_MSG_CHECKING([whether to build module $1])
ax_module_enable=$ENABLE_MODULE_$1
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_module_python.m4
Expand Up @@ -13,11 +13,12 @@ AC_DEFUN([AX_MODULE_PYTHON],
HAVE_PKG_PYTHON_SRC=yes
m4_divert_once([INIT_PREPARE], [dnl
AC_ARG_ENABLE([module-python],
AC_HELP_STRING([--enable-module-python], [enable the python bindings @<:@$2@:>@]),
[ ENABLE_MODULE_PYTHON=$enableval ],
[ if test x"$ENABLE_MODULE_PYTHON" = x""; then ENABLE_MODULE_PYTHON=`/bin/echo -n $2 | tr [A-Z] [a-z]` ; fi ]
)
)])
AC_MSG_CHECKING([whether to build module Python])
ax_module_enable=$ENABLE_MODULE_PYTHON
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_pkg.m4
Expand Up @@ -9,10 +9,11 @@ dnl Usage: AX_PKG(<name>, <dependencies>, <libraries>, <headers>[, <relative inc
AC_DEFUN([AX_PKG],
[
m4_divert_once([INIT_PREPARE], [dnl
AC_ARG_WITH(m4_tolower([[$1]]),
AC_HELP_STRING([--with-]m4_tolower([[$1]]), [enable searching for the $1 package @<:@auto@:>@]),
[ HAVE_PKG_$1=$withval ]
)
)])
ADD_$1_CPPFLAGS="$PKG_$1_CPPFLAGS"
PKG_$1_CPPFLAGS=""
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_pkg_apple.m4
Expand Up @@ -15,10 +15,11 @@ AC_DEFUN([AX_PKG_APPLE],
AS_VAR_PUSHDEF([pkg_l], [PKG_]pkg[_LIBS])
AS_VAR_PUSHDEF([bool], [ax_pkg_apple_have_pkg_bool])
m4_divert_once([INIT_PREPARE], [dnl
AC_ARG_WITH([apple_]m4_tolower([[$1]]),
AC_HELP_STRING([--with-apple_]m4_tolower([[$1]]), [enable searching for the APPLE_$1 package @<:@auto@:>@]),
[ HAVE_PKG_pkg=$withval ]
)
)])
AC_MSG_CHECKING(for package pkg)
Expand Down
3 changes: 2 additions & 1 deletion m4/ax_pkg_boost.m4
Expand Up @@ -8,10 +8,11 @@ dnl __END_LICENSE__
# Usage: AX_PKG_BOOST
AC_DEFUN([AX_PKG_BOOST],
[
m4_divert_once([INIT_PREPARE], [dnl
AC_ARG_WITH(boost,
AC_HELP_STRING([--with-boost], [enable searching for the boost package @<:@auto@:>@]),
[ HAVE_PKG_BOOST=$withval ]
)
)])
AC_MSG_CHECKING(for package BOOST)
Expand Down

0 comments on commit 298cc32

Please sign in to comment.