AC_DEFUN([AX_SUBMODULE],
[
-AC_ARG_WITH($1,
- [AS_HELP_STRING([--with-$1=$2],
- [Which $1 to use [default=$3]])])
+m4_if(m4_bregexp($2,|,choice),choice,
+ [AC_ARG_WITH($1,
+ [AS_HELP_STRING([--with-$1=$2],
+ [Which $1 to use [default=$3]])])])
case "system" in
$2)
AC_ARG_WITH($1_prefix,
[AS_HELP_STRING([--with-$1-exec-prefix=DIR],
[Exec prefix of $1 installation])])
esac
-case "build" in
-$2)
- AC_ARG_WITH($1_builddir,
- [AS_HELP_STRING([--with-$1-builddir=DIR],
- [Location of $1 builddir])])
-esac
+m4_if(m4_bregexp($2,build,build),build,
+ [AC_ARG_WITH($1_builddir,
+ [AS_HELP_STRING([--with-$1-builddir=DIR],
+ [Location of $1 builddir])])])
if test "x$with_$1_prefix" != "x" -a "x$with_$1_exec_prefix" = "x"; then
with_$1_exec_prefix=$with_$1_prefix
fi
if test "x$with_$1_prefix" != "x" -o "x$with_$1_exec_prefix" != "x"; then
- if test "x$with_$1" != "x" -a "x$with_$1" != "xsystem"; then
+ if test "x$with_$1" != "x" -a "x$with_$1" != "xyes" -a "x$with_$1" != "xsystem"; then
AC_MSG_ERROR([Setting $with_$1_prefix implies use of system $1])
fi
with_$1="system"
fi
if test "x$with_$1_builddir" != "x"; then
- if test "x$with_$1" != "x" -a "x$with_$1" != "xbuild"; then
+ if test "x$with_$1" != "x" -a "x$with_$1" != "xyes" -a "x$with_$1" != "xbuild"; then
AC_MSG_ERROR([Setting $with_$1_builddir implies use of build $1])
fi
with_$1="build"
$1_srcdir=`echo @abs_srcdir@ | $with_$1_builddir/config.status --file=-`
AC_MSG_NOTICE($1 sources in $$1_srcdir)
fi
+if test "x$with_$1_exec_prefix" != "x"; then
+ export PKG_CONFIG_PATH="$with_$1_exec_prefix/lib/pkgconfig${PKG_CONFIG_PATH+:$PKG_CONFIG_PATH}"
+fi
case "$with_$1" in
$2)
;;