add --with-swig=<path to swig> option to configure

This commit is contained in:
Scott Fennell 2018-07-11 15:11:02 -05:00
parent d42f75c507
commit 2a13bf34af
2 changed files with 73 additions and 51 deletions

16
autoconf/configure.ac Normal file → Executable file
View File

@ -121,6 +121,15 @@ AC_DEFUN([AX_GTEST_HOME],[
[AC_CHECK_HEADER(gtest/gtest.h, [GTEST_HOME="/usr"], [GTEST_HOME=""])]
)
AC_SUBST([GTEST_HOME])
])
AC_DEFUN([AX_SWIG_HOME],[
AC_ARG_WITH([swig],
AS_HELP_STRING([--with-swig@<:@=DIR@:>@], [SWIG root directory]),
SWIG_HOME="$withval",
SWIG_HOME=/bin:/usr/bin:/usr/local/bin:/sw/bin
)
AC_SUBST([SWIG_HOME])
])
AC_DEFUN([AX_UDUNITS_HOME],[
@ -244,13 +253,12 @@ AC_PATH_PROG(PERL, perl, noperl)
AS_IF([test "$ac_cv_path_PERL" = "noperl"],AC_MSG_ERROR([could not find perl]),[])
AC_PATH_PROG(PYTHON, python${PYTHON_VERSION}, nopython)
AS_IF([test "$ac_cv_path_PYTHON" = "nopython"],AC_MSG_ERROR([could not find python]),[])
AC_PATH_PROG(SWIG, swig, noswig, "/bin:/usr/bin:/usr/local/bin:/sw/bin")
AS_IF([test "$ac_cv_path_SWIG" = "noswig"],AC_MSG_ERROR([could not find swig]),[])
AC_PATH_PROG(GNUPLOT, gnuplot, nognuplot)
AS_IF([test "$ac_cv_path_GNUPLOT" = "nognuplot"],AC_MSG_NOTICE([could not find gnuplot]),[])
AX_SWIG_HOME([])
AC_PATH_PROG(SWIG, swig, noswig, $SWIG_HOME)
AS_IF([test "$ac_cv_path_SWIG" = "noswig"],AC_MSG_ERROR([could not find swig]),[])
AX_JAVA
dnl look for libraries and headers we need to compile
AC_PATH_X
AS_IF([test "$no_x" = "yes"],AC_MSG_ERROR([could not find Xwindows development libraries and/or headers]),[])

108
configure vendored
View File

@ -660,8 +660,9 @@ ac_ct_JAVA_CC
JAVA_CC_FLAGS
JAVA_CC
USE_JAVA
GNUPLOT
SWIG
SWIG_HOME
GNUPLOT
PYTHON
PERL
CURL
@ -732,6 +733,7 @@ SHELL'
ac_subst_files=''
ac_user_opts='
enable_option_checking
with_swig
enable_java
with_x
with_llvm
@ -1385,6 +1387,7 @@ Optional Features:
Optional Packages:
--with-PACKAGE[=ARG] use PACKAGE [ARG=yes]
--without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no)
--with-swig[=DIR] SWIG root directory
--with-x use the X Window System
--with-llvm[=DIR] LLVM root directory
--with-zlib=DIR root directory path of zlib installation [defaults to
@ -2397,6 +2400,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var.
@ -4082,51 +4087,6 @@ fi
if test "$ac_cv_path_PYTHON" = "nopython"; then :
as_fn_error $? "could not find python" "$LINENO" 5
fi
# Extract the first word of "swig", so it can be a program name with args.
set dummy swig; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_SWIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SWIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
as_dummy=""/bin:/usr/bin:/usr/local/bin:/sw/bin""
for as_dir in $as_dummy
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_SWIG" && ac_cv_path_SWIG="noswig"
;;
esac
fi
SWIG=$ac_cv_path_SWIG
if test -n "$SWIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
$as_echo "$SWIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$ac_cv_path_SWIG" = "noswig"; then :
as_fn_error $? "could not find swig" "$LINENO" 5
fi
# Extract the first word of "gnuplot", so it can be a program name with args.
set dummy gnuplot; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@ -4174,6 +4134,61 @@ $as_echo "$as_me: could not find gnuplot" >&6;}
fi
# Check whether --with-swig was given.
if test "${with_swig+set}" = set; then :
withval=$with_swig; SWIG_HOME="$withval"
else
SWIG_HOME=/bin:/usr/bin:/usr/local/bin:/sw/bin
fi
# Extract the first word of "swig", so it can be a program name with args.
set dummy swig; ac_word=$2
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
$as_echo_n "checking for $ac_word... " >&6; }
if ${ac_cv_path_SWIG+:} false; then :
$as_echo_n "(cached) " >&6
else
case $SWIG in
[\\/]* | ?:[\\/]*)
ac_cv_path_SWIG="$SWIG" # Let the user override the test with a path.
;;
*)
as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
for as_dir in $SWIG_HOME
do
IFS=$as_save_IFS
test -z "$as_dir" && as_dir=.
for ac_exec_ext in '' $ac_executable_extensions; do
if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
ac_cv_path_SWIG="$as_dir/$ac_word$ac_exec_ext"
$as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
break 2
fi
done
done
IFS=$as_save_IFS
test -z "$ac_cv_path_SWIG" && ac_cv_path_SWIG="noswig"
;;
esac
fi
SWIG=$ac_cv_path_SWIG
if test -n "$SWIG"; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $SWIG" >&5
$as_echo "$SWIG" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
$as_echo "no" >&6; }
fi
if test "$ac_cv_path_SWIG" = "noswig"; then :
as_fn_error $? "could not find swig" "$LINENO" 5
fi
# Check whether --enable-java was given.
if test "${enable_java+set}" = set; then :
enableval=$enable_java; if test "x$enable_java" = xyes; then :
@ -4388,7 +4403,6 @@ $as_echo "no" >&6; }
fi
ac_ext=cpp
ac_cpp='$CXXCPP $CPPFLAGS'
ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5'