diff --git a/Makefile b/Makefile index 1334796e..0c2a4b91 100644 --- a/Makefile +++ b/Makefile @@ -140,9 +140,13 @@ ICG_EXE := ${TRICK_HOME}/bin/trick-ICG ################################################################################ # DEFAULT TARGET # 1 Build Trick-core and Trick Data-products. -all: no_dp dp java +all: no_dp dp @ echo ; echo "Trick compilation complete:" ; date +ifeq ($(USE_JAVA), 1) +all: java +endif + #------------------------------------------------------------------------------- # 1.1 Build Trick-core no_dp: $(TRICK_LIB) $(TRICK_SWIG_LIB) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 17516749..62a5752c 100644 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -129,6 +129,26 @@ AC_DEFUN([AX_UDUNITS_HOME],[ AC_SUBST([UDUNITS_HOME]) ]) +dnl test if we want to use java, default to yes +AC_DEFUN([AX_JAVA],[ + AC_ARG_ENABLE([java], + AS_HELP_STRING([--enable-java], [use java (default is yes)]), + AS_IF([test "x$enable_java" = xyes], [USE_JAVA="1"], [USE_JAVA="0"]), + [USE_JAVA="1"] + ) + AC_SUBST([USE_JAVA]) + AS_IF([test "$USE_JAVA" = "1"],[ + AC_PROG_AWK + AX_PROG_JAVA_CC(javac) + JAVA_VER=`$JAVA_CC -version 2>&1 | $ac_cv_path_PERL -ne 'print $& if /\d+\.\d+/'` + AC_MSG_CHECKING([$JAVA_CC version >= 1.8]) + AX_COMPARE_VERSION([$JAVA_VER],[ge],[1.8], [AC_MSG_RESULT([yes])], + [AC_MSG_RESULT([no]) + AC_MSG_ERROR([Trick requires javac version >= 1.8]) + ]) + ],[]) +]) + dnl test if we want to use er7_utils, default to yes AC_DEFUN([AX_ER7_UTILS],[ AC_ARG_ENABLE([er7utils], @@ -154,8 +174,9 @@ AC_DEFUN([AX_JSC_DIRS],[ AC_SUBST([MOTIF_HOME]) ]) -dnl add extra paths to find xml headers and X headers on the mac. +dnl add extra paths to find gcc on RHEL 6 systems PATH="/opt/rh/devtoolset-3/root/usr/bin:${PATH}" +dnl add extra paths to find xml headers and X headers on the mac. XTRAINCPATHS="-I/usr/include/libxml2/ -I/usr/X11/include" CFLAGS="$CFLAGS $XTRAINCPATHS" CPPFLAGS="$CPPFLAGS $XTRAINCPATHS" @@ -191,15 +212,8 @@ 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]),[]) -dnl AX_COMPARE_VERSION requires awk. -AC_PROG_AWK -AX_PROG_JAVA_CC(javac) -JAVA_VER=`$JAVA_CC -version 2>&1 | $ac_cv_path_PERL -ne 'print $& if /\d+\.\d+/'` -AC_MSG_CHECKING([$JAVA_CC version >= 1.8]) -AX_COMPARE_VERSION([$JAVA_VER],[ge],[1.8], [AC_MSG_RESULT([yes])], - [AC_MSG_RESULT([no]) - AC_MSG_ERROR([Trick requires javac version >= 1.8]) - ]) + +AX_JAVA dnl look for libraries and headers we need to compile AC_PATH_X diff --git a/configure b/configure index c30dbc54..9d559793 100755 --- a/configure +++ b/configure @@ -663,6 +663,7 @@ GCJ_OPTS ac_ct_JAVA_CC JAVA_CC_FLAGS JAVA_CC +USE_JAVA GNUPLOT SWIG PYTHON @@ -726,6 +727,7 @@ SHELL' ac_subst_files='' ac_user_opts=' enable_option_checking +enable_java with_x with_llvm with_udunits @@ -1370,6 +1372,7 @@ Optional Features: --disable-option-checking ignore unrecognized --enable/--with options --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] + --enable-java use java (default is yes) --enable-er7utils use er7_utils (default is yes) Optional Packages: @@ -2480,6 +2483,8 @@ ac_configure="$SHELL $ac_aux_dir/configure" # Please don't use this var. + + @@ -5118,7 +5123,24 @@ if test "$ac_cv_path_GNUPLOT" = "nognuplot"; then : { $as_echo "$as_me:${as_lineno-$LINENO}: could not find gnuplot" >&5 $as_echo "$as_me: could not find gnuplot" >&6;} fi -for ac_prog in gawk mawk nawk awk + + + # Check whether --enable-java was given. +if test "${enable_java+set}" = set; then : + enableval=$enable_java; if test "x$enable_java" = xyes; then : + USE_JAVA="1" +else + USE_JAVA="0" +fi +else + USE_JAVA="1" + +fi + + + if test "$USE_JAVA" = "1"; then : + + for ac_prog in gawk mawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 @@ -5160,7 +5182,7 @@ fi test -n "$AWK" && break done -if test -n "$ac_tool_prefix"; then + if test -n "$ac_tool_prefix"; then for ac_prog in javac do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. @@ -5271,8 +5293,8 @@ if test "$JAVA_CC" = "gcj"; then fi test -z "$JAVA_CC" && as_fn_error $? "no acceptable java compiler found in \$PATH" "$LINENO" 5 -JAVA_VER=`$JAVA_CC -version 2>&1 | $ac_cv_path_PERL -ne 'print $& if /\d+\.\d+/'` -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking $JAVA_CC version >= 1.8" >&5 + JAVA_VER=`$JAVA_CC -version 2>&1 | $ac_cv_path_PERL -ne 'print $& if /\d+\.\d+/'` + { $as_echo "$as_me:${as_lineno-$LINENO}: checking $JAVA_CC version >= 1.8" >&5 $as_echo_n "checking $JAVA_CC version >= 1.8... " >&6; } @@ -5310,11 +5332,14 @@ x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_version $as_echo "yes" >&6; } else { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 $as_echo "no" >&6; } - as_fn_error $? "Trick requires javac version >= 1.8" "$LINENO" 5 + as_fn_error $? "Trick requires javac version >= 1.8" "$LINENO" 5 fi +fi + + ac_ext=cpp ac_cpp='$CXXCPP $CPPFLAGS' ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' diff --git a/share/trick/makefiles/config_user.mk.in b/share/trick/makefiles/config_user.mk.in index c2f2aa03..26c8d3af 100644 --- a/share/trick/makefiles/config_user.mk.in +++ b/share/trick/makefiles/config_user.mk.in @@ -7,9 +7,11 @@ LEX = @LEX@ YACC = @BISON@ SWIG = @SWIG@ PYTHON = @PYTHON@ -JAVAC = @JAVA_CC@ CLANG = @CLANG@ +USE_JAVA = @USE_JAVA@ +JAVAC = @JAVA_CC@ + LLVM_HOME = @LLVM_HOME@ PYTHON_INCLUDES = @PYTHON_CPPFLAGS@