From 9e0151070f847eb37f2ec6a9e6057376d429bf96 Mon Sep 17 00:00:00 2001 From: vsc Date: Tue, 7 Sep 2004 16:29:16 +0000 Subject: [PATCH] updates git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@1123 b08c6af1-5177-4d33-ba66-4b1c6b8b522a --- Makefile.in | 34 ++++++++++++++++++----- config.h.in | 1 + configure | 77 ++++++++++++++++++++++++++++++++-------------------- configure.in | 61 +++++++++++++++++++++++++---------------- 4 files changed, 113 insertions(+), 60 deletions(-) diff --git a/Makefile.in b/Makefile.in index f58bb3df5..fbd69f835 100644 --- a/Makefile.in +++ b/Makefile.in @@ -481,6 +481,14 @@ c_interface.i: $(srcdir)/C/c_interface.c $(srcdir)/include/c_interface.h mycb: $(srcdir)/mycb.c $(CC) $(CFLAGS) $(srcdir)/mycb.c -o mycb +all: startup + @INSTALL_DLLS@ (cd library/random; make) + @INSTALL_DLLS@ (cd library/regex; make) + @INSTALL_DLLS@ (cd library/system; make) + @INSTALL_DLLS@ (cd library/yap2swi; make) + @INSTALL_DLLS@ (cd library/Tries; make) + @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; make) + startup: yap@EXEC_SUFFIX@ $(PL_SOURCES) -rm -f startup echo "['$(srcdir)/pl/init.yap']. module(user). save_program(startup)." | @CROSS_SIMULATOR@ ./yap -b $(srcdir)/pl/boot.yap @@ -493,14 +501,14 @@ libYap.a: $(LIB_OBJECTS) $(AR) rc libYap.a $(LIB_OBJECTS) $(RANLIB) libYap.a -@DO_SECOND_LD@libYap@SHLIB_SUFFIX@: $(LIB_OBJECTS) -@DO_SECOND_LD@ @SHLIB_LD@ -o libYap@SHLIB_SUFFIX@ $(LIB_OBJECTS) $(LIBS) +@IN_UNIX@@DO_SECOND_LD@libYap@SHLIB_SUFFIX@: $(LIB_OBJECTS) +@IN_UNIX@@DO_SECOND_LD@ @SHLIB_LD@ -o libYap@SHLIB_SUFFIX@ $(LIB_OBJECTS) $(LIBS) install: install_bin install_data install_bin: @INSTALL_COMMAND@ -install_unix: startup +install_unix: startup libYap.a mkdir -p $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) -m 755 yap@EXEC_SUFFIX@ $(DESTDIR)$(BINDIR)/yap mkdir -p $(DESTDIR)$(YAPLIBDIR) @@ -509,12 +517,13 @@ install_unix: startup mkdir -p $(DESTDIR)$(SHAREDIR)/Yap mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done + @INSTALL_DLLS@ $(INSTALL_PROGRAM) -m 755 @YAPLIB@ $(DESTDIR)$(LIBDIR) @INSTALL_DLLS@ (cd library/random; make install) @INSTALL_DLLS@ (cd library/regex; make install) @INSTALL_DLLS@ (cd library/system; make install) @INSTALL_DLLS@ (cd library/yap2swi; make install) @INSTALL_DLLS@ (cd library/Tries; make install) - @ENABLE_JAVA@ @INSTALL_DLLS@ (cd LGPL/JPL_from_Prolog/src; make install) + @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; make install) mkdir -p $(DESTDIR)$(INCLUDEDIR) for h in $(INTERFACE_HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done @@ -527,6 +536,9 @@ install_win32: startup $(INSTALL_PROGRAM) -m 755 yap.dll $(DESTDIR)$(BINDIR)/yap.dll $(INSTALL_PROGRAM) -m 755 libWYap.a $(DESTDIR)$(YAPLIBDIR)/libWYap.a $(INSTALL_PROGRAM) -m 755 startup $(DESTDIR)$(YAPLIBDIR)/startup + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap + mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl + for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done $(INSTALL) $(HEADERS) $(DESTDIR)$(INCLUDEDIR) $(INSTALL) $(srcdir)/include/c_interface.h $(DESTDIR)$(INCLUDEDIR)/c_interface.h $(INSTALL) config.h $(INCLUDEDIR)/config.h @@ -534,16 +546,17 @@ install_win32: startup (cd library/regex; make install) (cd library/system; make install) (cd library/yap2swi; make install) - (cd library/Tries; make install) + @# (cd library/Tries; make install) install_library: @YAPLIB@ $(INSTALL_DATA) libYap.a $(DESTDIR)$(LIBDIR)/libYap.a mkdir -p $(DESTDIR)$(INCLUDEDIR) for h in $(HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done + @ENABLE_JPL@ (cd LGPL/JPL/java; make install) install_data: (cd library ; make install) - @ENABLE_JAVA@ (cd LGPL/JPL_from_Prolog ; make install) + @ENABLE_JPL@ (cd LGPL/JPL ; make install) $(INSTALL_DATA) $(srcdir)/LGPL/pillow/icon_address.pl $(DESTDIR)$(SHAREDIR)/Yap/ $(INSTALL_DATA) $(srcdir)/LGPL/pillow/pillow.pl $(DESTDIR)$(SHAREDIR)/Yap/ (cd CLPQR ; make install) @@ -564,7 +577,14 @@ depend: $(HEADERS) $(C_SOURCES) fi clean: clean_docs - rm -f *.o *~ $(GHEADERS) *.BAK + rm -f *.o *~ $(GHEADERS) *.BAK *.a + @INSTALL_DLLS@ (cd library/random; make clean) + @INSTALL_DLLS@ (cd library/regex; make clean) + @INSTALL_DLLS@ (cd library/system; make clean) + @INSTALL_DLLS@ (cd library/yap2swi; make clean) + @INSTALL_DLLS@ (cd library/Tries; make clean) + @ENABLE_JPL@ @INSTALL_DLLS@ (cd LGPL/JPL/src; make clean) + realclean: clean realclean_docs rm -f yap@EXEC_SUFFIX@ startup config.log config.cache config.h diff --git a/config.h.in b/config.h.in index 3910483de..25ce11d32 100644 --- a/config.h.in +++ b/config.h.in @@ -172,6 +172,7 @@ #undef HAVE_MEMMOVE #undef HAVE_MKSTEMP #undef HAVE_MKTEMP +#undef HAVE_MKTIME #undef HAVE_MMAP #undef HAVE_NSLINKMODULE #undef HAVE_OPENDIR diff --git a/configure b/configure index 6a589d51c..fd2c33abc 100755 --- a/configure +++ b/configure @@ -309,7 +309,7 @@ ac_includes_default="\ # include #endif" -ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GCC C_INTERF_FLAGS C_PARSER_FLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INDENT ac_ct_INDENT AR ac_ct_AR MPI_CC ac_ct_MPI_CC INSTALL_INFO INSTALL_COMMAND CROSS_SIMULATOR CPP EGREP YAPMPILIB MPI_OBJS MPI_LIBS INSTALL_DLLS MERGE_DLL_OBJS SHLIB_CFLAGS SHLIB_SUFFIX EXEC_SUFFIX DO_SECOND_LD SHLIB_LD YAPLIB YAP_EXTRAS NO_BUILTIN_REGEXP ENABLE_JAVA JAVA_HOME M4 M4GENHDRS M4GENABSMI LIBOBJS LTLIBOBJS' +ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT GCC C_INTERF_FLAGS C_PARSER_FLAGS build build_cpu build_vendor build_os host host_cpu host_vendor host_os target target_cpu target_vendor target_os LN_S INSTALL_PROGRAM INSTALL_SCRIPT INSTALL_DATA RANLIB ac_ct_RANLIB INDENT ac_ct_INDENT AR ac_ct_AR MPI_CC ac_ct_MPI_CC INSTALL_INFO INSTALL_COMMAND CROSS_SIMULATOR CPP EGREP YAPMPILIB MPI_OBJS MPI_LIBS INSTALL_DLLS MERGE_DLL_OBJS SHLIB_CFLAGS SHLIB_SUFFIX EXEC_SUFFIX DO_SECOND_LD SHLIB_LD YAPLIB YAP_EXTRAS NO_BUILTIN_REGEXP ENABLE_JPL JAVA_HOME JAVAC JAR IN_UNIX M4 M4GENHDRS M4GENABSMI LIBOBJS LTLIBOBJS' ac_subst_files='' # Initialize some variables set by options. @@ -867,7 +867,7 @@ Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) --with-gmp=DIR use GNU Multiple Precision in DIR - --with-java=JAVA_HOME use Java instalation in JAVA_HOME + --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME --with-readline=DIR use GNU Readline Library in DIR --with-mpi=DIR use MPI library in DIR --with-mpe=DIR use MPE library in DIR @@ -2399,22 +2399,22 @@ else fi; -# Check whether --with-java or --without-java was given. -if test "${with_java+set}" = set; then - withval="$with_java" +# Check whether --with-jpl or --without-jpl was given. +if test "${with_jpl+set}" = set; then + withval="$with_jpl" if test "$withval" = yes; then - yap_cv_java="$JAVA_HOME" + yap_cv_jpl="$JAVA_HOME" dynamic_loading=yes threads=yes elif test "$withval" = no; then - yap_cv_java=no + yap_cv_jpl=no else - yap_cv_java=$with_java + yap_cv_jpl=$with_jpl dynamic_loading=yes threads=yes fi else - yap_cv_java=no + yap_cv_jpl=no fi; @@ -3341,6 +3341,7 @@ fi prefix="c:/Program\\ Files/Yap" fi else + use_malloc="yes" LIBS="-lcygwin" fi elif test "$target_os" = "mingw32" @@ -4829,14 +4830,17 @@ done _ACEOF fi + use_malloc=yes fi -if test "$yap_cv_java" = no +if test "$yap_cv_jpl" = no then - ENABLE_JAVA="@#" + ENABLE_JPL="@#" else - ENABLE_JAVA="" - JAVA_HOME="$yap_cv_java" + ENABLE_JPL="" + JAVA_HOME="$yap_cv_jpl" + JAVAC="$yap_cv_jpl"/bin/javac + JAR="$yap_cv_jpl"/bin/jar fi MPI_OBJS= @@ -5679,11 +5683,25 @@ EXEC_SUFFIX="" + + + INSTALL_DLLS="#" SHLIB_LD="@#" DO_SECOND_LD="#" M4="m4" MERGE_DLL_OBJS="#" +IN_UNIX="" + +if test "$dynamic_loading" = "yes" +then +echo VSCCCCC $dynamic_loading + YAP_EXTRAS="$SHLIB_CFLAGS $YAP_EXTRAS" + YAPLIB=libYap"$SHLIB_SUFFIX" +else +echo VSCCCCC + YAPLIB="libYap.a" +fi case "$target_os" in *linux*) @@ -5778,7 +5796,7 @@ fi ;; esac fi - if test "$CC" = gcc + if test "$ac_cv_c_compiler_gnu" = "yes" then SHLIB_CFLAGS="-shared -fPIC" INSTALL_DLLS="" @@ -6051,6 +6069,7 @@ fi INSTALL_DLLS="" DO_SECOND_LD="" MERGE_DLL_OBJS="" + IN_UNIX="#" ;; *) echo "$as_me:$LINENO: checking for dlopen in -ldl" >&5 @@ -6141,14 +6160,6 @@ fi ;; esac -if test "$dynamic_loading" = "yes" -then - YAP_EXTRAS="$SHLIB_CFLAGS $YAP_EXTRAS" - YAPLIB=libYap"$SHLIB_SUFFIX" -else - YAPLIB="libYap.a" -fi - if test "$coroutining" = "yes" then YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1" @@ -13342,7 +13353,8 @@ done -for ac_func in memcpy memmove mkstemp mktemp opendir + +for ac_func in memcpy memmove mkstemp mktemp mktime opendir do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_func" >&5 @@ -14663,10 +14675,13 @@ mkdir -p CHR mkdir -p CLPQR mkdir -p CLPBN mkdir -p LGPL -mkdir -p LGPL/JPL_from_Prolog -mkdir -p LGPL/JPL_from_Prolog/src +mkdir -p LGPL/JPL +mkdir -p LGPL/JPL/java +mkdir -p LGPL/JPL/java/jpl +mkdir -p LGPL/JPL/java/jpl/fli +mkdir -p LGPL/JPL/src - ac_config_files="$ac_config_files Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile CHR/Makefile CLPBN/Makefile CLPQR/Makefile library/Tries/Makefile LGPL/JPL_from_Prolog/Makefile LGPL/JPL_from_Prolog/src/Makefile" + ac_config_files="$ac_config_files Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile CHR/Makefile CLPBN/Makefile CLPQR/Makefile library/Tries/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure @@ -15204,8 +15219,9 @@ do "CLPBN/Makefile" ) CONFIG_FILES="$CONFIG_FILES CLPBN/Makefile" ;; "CLPQR/Makefile" ) CONFIG_FILES="$CONFIG_FILES CLPQR/Makefile" ;; "library/Tries/Makefile" ) CONFIG_FILES="$CONFIG_FILES library/Tries/Makefile" ;; - "LGPL/JPL_from_Prolog/Makefile" ) CONFIG_FILES="$CONFIG_FILES LGPL/JPL_from_Prolog/Makefile" ;; - "LGPL/JPL_from_Prolog/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES LGPL/JPL_from_Prolog/src/Makefile" ;; + "LGPL/JPL/Makefile" ) CONFIG_FILES="$CONFIG_FILES LGPL/JPL/Makefile" ;; + "LGPL/JPL/src/Makefile" ) CONFIG_FILES="$CONFIG_FILES LGPL/JPL/src/Makefile" ;; + "LGPL/JPL/java/Makefile" ) CONFIG_FILES="$CONFIG_FILES LGPL/JPL/java/Makefile" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} @@ -15343,8 +15359,11 @@ s,@SHLIB_LD@,$SHLIB_LD,;t t s,@YAPLIB@,$YAPLIB,;t t s,@YAP_EXTRAS@,$YAP_EXTRAS,;t t s,@NO_BUILTIN_REGEXP@,$NO_BUILTIN_REGEXP,;t t -s,@ENABLE_JAVA@,$ENABLE_JAVA,;t t +s,@ENABLE_JPL@,$ENABLE_JPL,;t t s,@JAVA_HOME@,$JAVA_HOME,;t t +s,@JAVAC@,$JAVAC,;t t +s,@JAR@,$JAR,;t t +s,@IN_UNIX@,$IN_UNIX,;t t s,@M4@,$M4,;t t s,@M4GENHDRS@,$M4GENHDRS,;t t s,@M4GENABSMI@,$M4GENABSMI,;t t diff --git a/configure.in b/configure.in index de08a2206..035712cd5 100644 --- a/configure.in +++ b/configure.in @@ -82,20 +82,20 @@ AC_ARG_WITH(gmp, fi, [yap_cv_gmp=yes]) -AC_ARG_WITH(java, - [ --with-java=JAVA_HOME use Java instalation in JAVA_HOME], +AC_ARG_WITH(jpl, + [ --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME], if test "$withval" = yes; then - yap_cv_java="$JAVA_HOME" + yap_cv_jpl="$JAVA_HOME" dynamic_loading=yes threads=yes elif test "$withval" = no; then - yap_cv_java=no + yap_cv_jpl=no else - yap_cv_java=$with_java + yap_cv_jpl=$with_jpl dynamic_loading=yes threads=yes fi, - [yap_cv_java=no]) + [yap_cv_jpl=no]) AC_ARG_WITH(readline, [ --with-readline[=DIR] use GNU Readline Library in DIR], @@ -317,6 +317,7 @@ then prefix="c:/Program\\ Files/Yap" fi else + use_malloc="yes" LIBS="-lcygwin" fi elif test "$target_os" = "mingw32" @@ -361,14 +362,17 @@ then then AC_DEFINE(USE_PTHREAD_LOCKING, 1) fi + use_malloc=yes fi -if test "$yap_cv_java" = no +if test "$yap_cv_jpl" = no then - ENABLE_JAVA="@#" + ENABLE_JPL="@#" else - ENABLE_JAVA="" - JAVA_HOME="$yap_cv_java" + ENABLE_JPL="" + JAVA_HOME="$yap_cv_jpl" + JAVAC="$yap_cv_jpl"/bin/javac + JAR="$yap_cv_jpl"/bin/jar fi MPI_OBJS= @@ -455,8 +459,11 @@ AC_SUBST(INSTALL_INFO) dnl let YAP_EXTRAS fall through configure, from the env into Makefile AC_SUBST(YAP_EXTRAS) AC_SUBST(NO_BUILTIN_REGEXP) -AC_SUBST(ENABLE_JAVA) +AC_SUBST(ENABLE_JPL) AC_SUBST(JAVA_HOME) +AC_SUBST(JAVAC) +AC_SUBST(JAR) +AC_SUBST(IN_UNIX) dnl defaults INSTALL_DLLS="#" @@ -464,6 +471,16 @@ SHLIB_LD="@#" DO_SECOND_LD="#" M4="m4" MERGE_DLL_OBJS="#" +IN_UNIX="" + +dnl This has to be before $target_os +if test "$dynamic_loading" = "yes" +then + YAP_EXTRAS="$SHLIB_CFLAGS $YAP_EXTRAS" + YAPLIB=libYap"$SHLIB_SUFFIX" +else + YAPLIB="libYap.a" +fi case "$target_os" in *linux*) @@ -491,7 +508,7 @@ case "$target_os" in ;; esac fi - if test "$CC" = gcc + if test "$ac_cv_prog_gcc" = "yes" then SHLIB_CFLAGS="-shared -fPIC" INSTALL_DLLS="" @@ -619,6 +636,7 @@ dnl Linux has both elf and a.out, in this case we found elf INSTALL_DLLS="" DO_SECOND_LD="" MERGE_DLL_OBJS="" + IN_UNIX="#" ;; *) AC_CHECK_LIB(dl,dlopen, @@ -642,14 +660,6 @@ dnl Linux has both elf and a.out, in this case we found elf ;; esac -if test "$dynamic_loading" = "yes" -then - YAP_EXTRAS="$SHLIB_CFLAGS $YAP_EXTRAS" - YAPLIB=libYap"$SHLIB_SUFFIX" -else - YAPLIB="libYap.a" -fi - if test "$coroutining" = "yes" then YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1" @@ -951,7 +961,7 @@ AC_CHECK_FUNCS(fesettrapenable finite getcwd getenv) AC_CHECK_FUNCS(gethostbyname gethostid gethostname) AC_CHECK_FUNCS(gethrtime getpwnam getrusage gettimeofday getwd) AC_CHECK_FUNCS(isatty isnan kill labs link localtime lstat) -AC_CHECK_FUNCS(memcpy memmove mkstemp mktemp opendir) +AC_CHECK_FUNCS(memcpy memmove mkstemp mktemp mktime opendir) AC_CHECK_FUNCS(putenv rand random readlink regexec) AC_CHECK_FUNCS(rename rint rl_set_prompt sbrk select) AC_CHECK_FUNCS(setbuf setlinebuf sigaction siggetmask siginterrupt) @@ -1064,10 +1074,13 @@ mkdir -p CHR mkdir -p CLPQR mkdir -p CLPBN mkdir -p LGPL -mkdir -p LGPL/JPL_from_Prolog -mkdir -p LGPL/JPL_from_Prolog/src +mkdir -p LGPL/JPL +mkdir -p LGPL/JPL/java +mkdir -p LGPL/JPL/java/jpl +mkdir -p LGPL/JPL/java/jpl/fli +mkdir -p LGPL/JPL/src -AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile CHR/Makefile CLPBN/Makefile CLPQR/Makefile library/Tries/Makefile LGPL/JPL_from_Prolog/Makefile LGPL/JPL_from_Prolog/src/Makefile) +AC_OUTPUT(Makefile library/regex/Makefile library/system/Makefile library/random/Makefile library/yap2swi/Makefile library/mpi/Makefile .depend library/Makefile CHR/Makefile CLPBN/Makefile CLPQR/Makefile library/Tries/Makefile LGPL/JPL/Makefile LGPL/JPL/src/Makefile LGPL/JPL/java/Makefile) make depend