Skip to content

Commit

Permalink
GNU build: Set up Ant in configure
Browse files Browse the repository at this point in the history
git-svn-id: https://valelab.ucsf.edu/svn/micromanager2/trunk@14001 d0ab736e-dc22-4aeb-8dc9-08def0aa14fd
  • Loading branch information
mark committed Aug 1, 2014
1 parent f4261e6 commit 1b3260a
Show file tree
Hide file tree
Showing 2 changed files with 67 additions and 0 deletions.
48 changes: 48 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -110,9 +110,52 @@ MM_JNI_LIBRARY_PREFIX_SUFFIX
AM_CONDITIONAL([NONSTD_JNI_PREFIX], [test "x$JNI_PREFIX" != xlib])


AC_ARG_VAR([ANT], [Ant command])
AC_ARG_VAR([ANTFLAGS], [Ant flags])
MM_ARG_WITH_ANT
AS_IF([test "x$want_ant" != xno],
[
AS_IF([test -z "$ANT"],
[
AS_IF([test -z "$JAVA_HOME"],
[
AC_MSG_ERROR([Cannot determine JAVA_HOME, needed to determine how to run Ant. Either supply --with-java=JAVA_HOME, set the JAVA_HOME variable, or set the ANT variable])
])
AS_IF([test -z "$ANTCMD"],
[
AC_PATH_PROG([ANTCMD], [ant])
])
AS_IF([test -z "$ANTCMD"],
[
have_ant=no
],
[
have_ant=yes
ANT="JAVA_HOME=$JAVA_HOME $ANTCMD"
])
AS_IF([test "x$want_ant" = xyes],
[
AS_IF([test "x$have_ant" = xno],
[
AC_MSG_FAILURE([--with-ant was given, but test for Ant failed])
])
])
],
[
have_ant=yes
])
use_ant=$have_ant
],
[
use_ant=no
])


build_mmcorej=yes
test "x$can_build_mmcore" = xno && build_mmcorej=no
test "x$use_java" = xno && build_mmcorej=no
test "x$use_ant" = xno && build_mmcorej=no
test -z "$SWIG" && build_mmcorej=no
AM_CONDITIONAL([BUILD_MMCOREJ], [test "x$build_mmcorej" = xyes])

Expand Down Expand Up @@ -380,6 +423,11 @@ echo " JAVAC = $JAVAC"
echo ""
fi

if test "x$use_ant" = xyes; then
echo " ANT = $ANT"
echo ""
fi

if test "x$use_python" = xyes; then
echo " PYTHON = $PYTHON"
echo " PYTHON_CPPFLAGS = $PYTHON_CPPFLAGS"
Expand Down
19 changes: 19 additions & 0 deletions m4/mm_ant.m4
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@

# MM_ARG_WITH_ANT (no args)
# Sets want_ant to yes or no; sets ANTCMD to empty or path.
AC_DEFUN([MM_ARG_WITH_ANT], [
AC_MSG_CHECKING([if use of Ant was requested])
AC_ARG_WITH([ant], [AS_HELP_STRING([--with-ant=[[yes|no|CMD]]],
[use Ant command at CMD (default: auto)])],
[],
[with_ant=auto])
case $with_ant in
yes | no | auto) want_ant="$with_ant" ;;
*) ANTCMD="$want_ant"
want_ant=yes ;;
esac
AS_IF([test -n "$ANTCMD"],
[AC_MSG_RESULT([yes ($ANTCMD)])],
[AC_MSG_RESULT([$want_ant])])
])

0 comments on commit 1b3260a

Please sign in to comment.