From 9ebf1e46f9766c665b126e0845d219d45d9f71a7 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 19 Jul 2010 14:54:51 +0100 Subject: [PATCH] support tai --- Makefile.in | 4 ++ config.h.in | 4 ++ configure | 130 ++++++++++++++++++++++++++++++++++++++++++++++++--- configure.in | 51 +++++++++++++++++--- 4 files changed, 177 insertions(+), 12 deletions(-) diff --git a/Makefile.in b/Makefile.in index b798a589e..a27876160 100755 --- a/Makefile.in +++ b/Makefile.in @@ -497,6 +497,7 @@ mycb: $(srcdir)/mycb.c all: startup.yss @INSTALL_DLLS@ (cd packages/PLStream; $(MAKE)) + @INSTALL_DLLS@ (cd packages/tai; $(MAKE)) @INSTALL_DLLS@ (cd library/random; $(MAKE)) @INSTALL_DLLS@ (cd library/regex; $(MAKE)) @INSTALL_DLLS@ (cd library/rltree; $(MAKE)) @@ -547,6 +548,7 @@ install_unix: startup.yss libYap.a $(INSTALL) $(srcdir)/COPYING $(DESTDIR)$(DOCSDIR) for f in $(PL_SOURCES); do $(INSTALL) $$f $(DESTDIR)$(SHAREDIR)/Yap/pl; done @INSTALL_DLLS@ (cd packages/PLStream; $(MAKE) install) + @INSTALL_DLLS@ (cd packages/tai; $(MAKE) install) @INSTALL_DLLS@ (cd packages/plunit; $(MAKE) install) #@INSTALL_DLLS@ (cd packages/http; $(MAKE) install) @INSTALL_DLLS@ (cd packages/sgml; $(MAKE) install) @@ -595,6 +597,7 @@ install_win32: startup.yss $(INSTALL) config.h $(DESTDIR)$(INCLUDEDIR)/config.h $(INSTALL) parms.h $(DESTDIR)$(INCLUDEDIR)/parms.h (cd packages/PLStream; $(MAKE) install) + (cd packages/tai; $(MAKE) install) (cd packages/plunit; $(MAKE) install) (cd packages/http; $(MAKE) install) (cd packages/sgml; $(MAKE) install) @@ -646,6 +649,7 @@ depend: $(HEADERS) $(C_SOURCES) clean: clean_docs rm -f *.o *~ *.BAK *.a @INSTALL_DLLS@ (cd packages/PLStream; $(MAKE) clean) + @INSTALL_DLLS@ (cd packages/tai; $(MAKE) clean) @INSTALL_DLLS@ (cd packages/plunit; $(MAKE) clean) @INSTALL_DLLS@ (cd library/matrix; $(MAKE) clean) @INSTALL_DLLS@ (cd library/random; $(MAKE) clean) diff --git a/config.h.in b/config.h.in index 9c1341c81..124486ea3 100755 --- a/config.h.in +++ b/config.h.in @@ -264,6 +264,10 @@ #undef HAVE_ENVIRON +#undef HAVE_VAR_TIMEZONE + +#undef HAVE_STRUCT_TIME_TM_GMTOFF + #define SELECT_TYPE_ARG1 #define SELECT_TYPE_ARG234 #define SELECT_TYPE_ARG5 diff --git a/configure b/configure index 3f366cb52..9ebcbc738 100755 --- a/configure +++ b/configure @@ -2163,6 +2163,63 @@ $as_echo "$ac_res" >&6; } eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} } # ac_fn_c_check_type + +# ac_fn_c_check_member LINENO AGGR MEMBER VAR INCLUDES +# ---------------------------------------------------- +# Tries to find if the field MEMBER exists in type AGGR, after including +# INCLUDES, setting cache variable VAR accordingly. +ac_fn_c_check_member () +{ + as_lineno=${as_lineno-"$1"} as_lineno_stack=as_lineno_stack=$as_lineno_stack + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $2.$3" >&5 +$as_echo_n "checking for $2.$3... " >&6; } +if { as_var=$4; eval "test \"\${$as_var+set}\" = set"; }; then : + $as_echo_n "(cached) " >&6 +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ +$5 +int +main () +{ +static $2 ac_aggr; +if (sizeof ac_aggr.$3) +return 0; + ; + return 0; +} +_ACEOF +if ac_fn_c_try_compile "$LINENO"; then : + eval "$4=yes" +else + eval "$4=no" +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext +fi +eval ac_res=\$$4 + { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 +$as_echo "$ac_res" >&6; } + eval $as_lineno_stack; test "x$as_lineno_stack" = x && { as_lineno=; unset as_lineno;} + +} # ac_fn_c_check_member cat >config.log <<_ACEOF This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. @@ -3789,6 +3846,7 @@ if test "${with_gmp+set}" = set; then : yap_cv_gmp=$with_gmp LDFLAGS="$LDFLAGS -L${yap_cv_gmp}/lib" CPPFLAGS="$CPPFLAGS -I${yap_cv_gmp}/include" + CFLAGS="$CFLAGS -I${yap_cv_gmp}/include" fi else yap_cv_gmp=yes @@ -4303,17 +4361,17 @@ then then if test "$debugyap" = "yes" then - CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes" + CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CXXFLAGS="-O -g -Wall" - C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes" + C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" else - CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes" - CXXFLAGS="-O3 -fomit-frame-pointer -Wall" + CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" + CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS" case "`$CC --version < /dev/null`" in *3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;; esac - C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes" - C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes" + C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" + C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" case "$target_cpu" in i*86*) CFLAGS="-DBP_FREE $CFLAGS" @@ -9409,6 +9467,58 @@ _ACEOF fi + +{ $as_echo "$as_me:${as_lineno-$LINENO}: checking \"variable timezone in tzset\"" >&5 +$as_echo_n "checking \"variable timezone in tzset\"... " >&6; } +if test "$cross_compiling" = yes; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: assuming no" >&5 +$as_echo "assuming no" >&6; } +else + cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + #include + #include + #ifdef __CYGWIN__ + #define timezone _timezone + #endif + extern long timezone; + + main() + { tzset(); + + if ( timezone > -15*3600 && + timezone < 15*3600 && + timezone % 60 == 0 ) + return 0; + + exit(1); + } + +_ACEOF +if ac_fn_c_try_run "$LINENO"; then : + { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5 +$as_echo "yes" >&6; } + +$as_echo "#define HAVE_VAR_TIMEZONE 1" >>confdefs.h + +else + { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5 +$as_echo "no" >&6; } +fi +rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext \ + conftest.$ac_objext conftest.beam conftest.$ac_ext +fi + + +ac_fn_c_check_member "$LINENO" "struct tm" "tm_gmtoff" "ac_cv_member_struct_tm_tm_gmtoff" "#include +" +if test "x$ac_cv_member_struct_tm_tm_gmtoff" = x""yes; then : + +$as_echo "#define HAVE_STRUCT_TIME_TM_GMTOFF /**/" >>confdefs.h + +fi + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking _XOPEN_SOURCE" >&5 $as_echo_n "checking _XOPEN_SOURCE... " >&6; } cat confdefs.h - <<_ACEOF >conftest.$ac_ext @@ -9486,6 +9596,8 @@ mkdir -p packages/jpl/src/java/jpl/fli mkdir -p packages/jpl/src/java/jpl/test mkdir -p packages/jpl/examples mkdir -p packages/jpl/examples/java +mkdir -p packages/tai +mkdir -p packages/tai/libtai mkdir -p packages/PLStream mkdir -p packages/plunit mkdir -p packages/ProbLog @@ -9539,6 +9651,10 @@ ac_config_files="$ac_config_files packages/cplint/approx/simplecuddLPADs/Makefil ac_config_files="$ac_config_files packages/http/Makefile" +ac_config_files="$ac_config_files packages/tai/Makefile" + +ac_config_files="$ac_config_files packages/tai/libtai/Makefile" + ac_config_files="$ac_config_files packages/PLStream/Makefile" ac_config_files="$ac_config_files packages/plunit/Makefile" @@ -10285,6 +10401,8 @@ do "packages/cplint/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/Makefile" ;; "packages/cplint/approx/simplecuddLPADs/Makefile") CONFIG_FILES="$CONFIG_FILES packages/cplint/approx/simplecuddLPADs/Makefile" ;; "packages/http/Makefile") CONFIG_FILES="$CONFIG_FILES packages/http/Makefile" ;; + "packages/tai/Makefile") CONFIG_FILES="$CONFIG_FILES packages/tai/Makefile" ;; + "packages/tai/libtai/Makefile") CONFIG_FILES="$CONFIG_FILES packages/tai/libtai/Makefile" ;; "packages/PLStream/Makefile") CONFIG_FILES="$CONFIG_FILES packages/PLStream/Makefile" ;; "packages/plunit/Makefile") CONFIG_FILES="$CONFIG_FILES packages/plunit/Makefile" ;; "packages/ProbLog/Makefile") CONFIG_FILES="$CONFIG_FILES packages/ProbLog/Makefile" ;; diff --git a/configure.in b/configure.in index 1ad4c407a..74d118ac0 100755 --- a/configure.in +++ b/configure.in @@ -139,6 +139,7 @@ AC_ARG_WITH(gmp, yap_cv_gmp=$with_gmp LDFLAGS="$LDFLAGS -L${yap_cv_gmp}/lib" CPPFLAGS="$CPPFLAGS -I${yap_cv_gmp}/include" + CFLAGS="$CFLAGS -I${yap_cv_gmp}/include" fi, [yap_cv_gmp=yes]) @@ -433,17 +434,17 @@ then then if test "$debugyap" = "yes" then - CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes" + CFLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" CXXFLAGS="-O -g -Wall" - C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes" + C_INTERF_FLAGS="-O -g -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" else - CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes" - CXXFLAGS="-O3 -fomit-frame-pointer -Wall" + CFLAGS="-O3 -fomit-frame-pointer -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" + CXXFLAGS="-O3 -fomit-frame-pointer -Wall $CFLAGS" case "`$CC --version < /dev/null`" in *3.4*) CFLAGS="-fno-gcse -fno-crossjumping $CFLAGS" ;; esac - C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes" - C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes" + C_INTERF_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" + C_PARSER_FLAGS="-O3 -Wall -Wstrict-prototypes -Wmissing-prototypes $CFLAGS" case "$target_cpu" in i*86*) CFLAGS="-DBP_FREE $CFLAGS" @@ -1757,6 +1758,40 @@ AC_CHECK_TYPES(ssize_t, [], [], #include ]) +dnl tszet and timezone trouble + +AC_MSG_CHECKING("variable timezone in tzset") +AC_TRY_RUN( +[ #include + #include + #ifdef __CYGWIN__ + #define timezone _timezone + #endif + extern long timezone; + + main() + { tzset(); + + if ( timezone > -15*3600 && + timezone < 15*3600 && + timezone % 60 == 0 ) + return 0; + + exit(1); + } +], +AC_MSG_RESULT(yes) +AC_DEFINE(HAVE_VAR_TIMEZONE, 1, + [Define if tzset sets timezone variable]), +AC_MSG_RESULT(no), +AC_MSG_RESULT(assuming no)) + +AC_CHECK_MEMBER(struct tm.tm_gmtoff, + AC_DEFINE(HAVE_STRUCT_TIME_TM_GMTOFF, [], + [Define is struct tm has tm_gmtoff]), + [], + [#include ]) + AC_MSG_CHECKING(_XOPEN_SOURCE) AC_TRY_COMPILE( [ @@ -1817,6 +1852,8 @@ mkdir -p packages/jpl/src/java/jpl/fli mkdir -p packages/jpl/src/java/jpl/test mkdir -p packages/jpl/examples mkdir -p packages/jpl/examples/java +mkdir -p packages/tai +mkdir -p packages/tai/libtai mkdir -p packages/PLStream mkdir -p packages/plunit mkdir -p packages/ProbLog @@ -1847,6 +1884,8 @@ AC_CONFIG_FILES([packages/CLPBN/Makefile]) AC_CONFIG_FILES([packages/cplint/Makefile]) AC_CONFIG_FILES([packages/cplint/approx/simplecuddLPADs/Makefile]) AC_CONFIG_FILES([packages/http/Makefile]) +AC_CONFIG_FILES([packages/tai/Makefile]) +AC_CONFIG_FILES([packages/tai/libtai/Makefile]) AC_CONFIG_FILES([packages/PLStream/Makefile]) AC_CONFIG_FILES([packages/plunit/Makefile]) AC_CONFIG_FILES([packages/ProbLog/Makefile ])