1 AC_DEFUN([AX_SUBMODULE],
5 [AS_HELP_STRING([--with-$1=$2],
10 [AS_HELP_STRING([--with-$1-prefix=DIR],
11 [Prefix of $1 installation])])
12 AC_ARG_WITH($1_exec_prefix,
13 [AS_HELP_STRING([--with-$1-exec-prefix=DIR],
14 [Exec prefix of $1 installation])])
18 AC_ARG_WITH($1_builddir,
19 [AS_HELP_STRING([--with-$1-builddir=DIR],
20 [Location of $1 builddir])])
22 if test "x$with_$1_prefix" != "x" -a "x$with_$1_exec_prefix" = "x"; then
23 with_$1_exec_prefix=$with_$1_prefix
25 if test "x$with_$1_prefix" != "x" -o "x$with_$1_exec_prefix" != "x"; then
26 if test "x$with_$1" != "x" -a "x$with_$1" != "xsystem"; then
27 AC_MSG_ERROR([Setting $with_$1_prefix implies use of system $1])
31 if test "x$with_$1_builddir" != "x"; then
32 if test "x$with_$1" != "x" -a "x$with_$1" != "xbuild"; then
33 AC_MSG_ERROR([Setting $with_$1_builddir implies use of build $1])
36 $1_srcdir=`echo @abs_srcdir@ | $with_$1_builddir/config.status --file=-`
37 AC_MSG_NOTICE($1 sources in $$1_srcdir)
43 if test -d $srcdir/.git -a \
45 ! -d $srcdir/$1/.git; then
47 [git repo detected, but submodule $1 not initialized])
48 AC_MSG_WARN([You may want to run])
49 AC_MSG_WARN([ git submodule init])
50 AC_MSG_WARN([ git submodule update])
51 AC_MSG_WARN([ sh autogen.sh])
53 if test -f $srcdir/$1/configure -a "$3" != "no"; then
60 AC_MSG_CHECKING([which $1 to use])
61 AC_MSG_RESULT($with_$1)