From 453a03a8099162d4bc92a648c443816c6da39276 Mon Sep 17 00:00:00 2001 From: Alex Lin Date: Tue, 18 Jun 2019 11:00:42 -0500 Subject: [PATCH] Get configure with no java and no X to work #735 (#817) Found if --without-x was specified, that automatically caused an error condition in the configure script. Fixed that and only tested for X windows headers and libs if X is included. Excluded a couple of directories from compiling if X is not included. Didn't seem to be a problem with java. --- autoconf/configure.ac | 20 ++++++++++--- configure | 38 ++++++++++++++++++------- share/trick/makefiles/config_user.mk.in | 2 ++ trick_source/data_products/DPX/makefile | 3 +- trick_source/data_products/makefile | 2 ++ 5 files changed, 49 insertions(+), 16 deletions(-) diff --git a/autoconf/configure.ac b/autoconf/configure.ac index 0a71c7a4..69027f1b 100755 --- a/autoconf/configure.ac +++ b/autoconf/configure.ac @@ -271,12 +271,24 @@ AX_PKG_SWIG(2.0, [], [AC_MSG_ERROR([Trick requires SWIG version >= 2.0])]) 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]),[]) -AC_CHECK_HEADER([X11/Intrinsic.h],[],AC_MSG_ERROR([could not find libxt development headers])) -AS_IF([test "x$x_libraries" = "x"],[X_LIB_DIR=],[X_LIB_DIR=-L$x_libraries]) +AS_IF([test "$no_x" = "yes"], + [ + USE_X_WINDOWS=0 + ], + [ + USE_X_WINDOWS=1 + AS_IF([test "x$x_includes" = "x"],[],[X_INCLUDE_DIR=-I$x_includes]) + AS_IF([test "x$x_libraries" = "x"],[],[X_LIB_DIR=-L$x_libraries]) + AC_CHECK_HEADER([X11/Intrinsic.h],[],AC_MSG_ERROR([could not find libxt development headers])) + AX_JSC_DIRS([]) + ] +) +dnl AS_IF([test "x$x_libraries" = "x"],[X_LIB_DIR=],[X_LIB_DIR=-L$x_libraries]) dnl X_LIBRARIES=$x_libraries +AC_SUBST([USE_X_WINDOWS]) AC_SUBST([X_LIB_DIR]) -AX_JSC_DIRS([]) + + AC_CHECK_LIB(xml2, main, [LIBXML=-lxml2 AC_SUBST([LIBXML])] diff --git a/configure b/configure index a3af6ab3..dcd45122 100755 --- a/configure +++ b/configure @@ -647,8 +647,9 @@ PTHREAD_CC ax_pthread_config CPP LIBXML -MOTIF_HOME X_LIB_DIR +USE_X_WINDOWS +MOTIF_HOME EGREP CXXCPP XMKMF @@ -5062,9 +5063,6 @@ else $as_echo "libraries $x_libraries, headers $x_includes" >&6; } fi -if test "$no_x" = "yes"; then : - as_fn_error $? "could not find Xwindows development libraries and/or headers" "$LINENO" 5 -fi { $as_echo "$as_me:${as_lineno-$LINENO}: checking for egrep" >&5 $as_echo_n "checking for egrep... " >&6; } if ${ac_cv_path_EGREP+:} false; then : @@ -5261,7 +5259,24 @@ fi done -ac_fn_cxx_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default" +if test "$no_x" = "yes"; then : + + USE_X_WINDOWS=0 + +else + + USE_X_WINDOWS=1 + if test "x$x_includes" = "x"; then : + +else + X_INCLUDE_DIR=-I$x_includes +fi + if test "x$x_libraries" = "x"; then : + +else + X_LIB_DIR=-L$x_libraries +fi + ac_fn_cxx_check_header_mongrel "$LINENO" "X11/Intrinsic.h" "ac_cv_header_X11_Intrinsic_h" "$ac_includes_default" if test "x$ac_cv_header_X11_Intrinsic_h" = xyes; then : else @@ -5269,12 +5284,6 @@ else fi -if test "x$x_libraries" = "x"; then : - X_LIB_DIR= -else - X_LIB_DIR=-L$x_libraries -fi - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for trick_source/data_products/fermi-ware" >&5 $as_echo_n "checking for trick_source/data_products/fermi-ware... " >&6; } @@ -5351,6 +5360,13 @@ fi + + +fi + + + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for main in -lxml2" >&5 $as_echo_n "checking for main in -lxml2... " >&6; } if ${ac_cv_lib_xml2_main+:} false; then : diff --git a/share/trick/makefiles/config_user.mk.in b/share/trick/makefiles/config_user.mk.in index c35fec92..72784491 100644 --- a/share/trick/makefiles/config_user.mk.in +++ b/share/trick/makefiles/config_user.mk.in @@ -13,6 +13,8 @@ TEE = @TEE@ USE_JAVA = @USE_JAVA@ JAVAC = @JAVA_CC@ +USE_X_WINDOWS = @USE_X_WINDOWS@ + LLVM_HOME = @LLVM_HOME@ PYTHON_INCLUDES = @PYTHON_CPPFLAGS@ diff --git a/trick_source/data_products/DPX/makefile b/trick_source/data_products/DPX/makefile index 8692c8b9..ab140972 100644 --- a/trick_source/data_products/DPX/makefile +++ b/trick_source/data_products/DPX/makefile @@ -10,11 +10,12 @@ LIBDIRS = DPM \ DPC \ DPV/UTILS +ifeq ($(USE_X_WINDOWS),1) APPDIRS = APPS/GXPLOT - ifneq ("$(wildcard ${TRICK_HOME}/trick_source/data_products/fermi-ware)","") APPDIRS += APPS/FXPLOT endif +endif all: $(LIBDIRS) $(APPDIRS) diff --git a/trick_source/data_products/makefile b/trick_source/data_products/makefile index 6c82f872..2a618450 100644 --- a/trick_source/data_products/makefile +++ b/trick_source/data_products/makefile @@ -15,9 +15,11 @@ LIBDIRS = Var \ EQParse \ units +ifeq ($(USE_X_WINDOWS),1) ifneq ("$(wildcard fermi-ware)","") LIBDIRS += fermi-ware endif +endif APPDIRS = DPX \ Apps/Trk2csv \