--- Yap-5.1.3.orig/configure.in 2008-05-24 10:29:52.000000000 +1200 +++ Yap-5.1.3/configure.in 2009-01-25 10:00:30.000000000 +1300 @@ -95,22 +95,35 @@ fi, [yap_cv_gmp=yes]) -AC_ARG_ENABLE(myddas, - [ --enable-myddas[[=DIR]] enable the MYDDAS library], +AC_ARG_ENABLE(myddas-mysql, + [ --enable-myddas-mysql[[=DIR]] enable the MYDDAS MySQL library], if test "$enableval" = yes; then - yap_cv_myddas=/usr/ + yap_cv_myddas_mysql=/usr/ elif test "$enableval" = no; then - yap_cv_myddas=no + yap_cv_myddas_mysql=no else - yap_cv_myddas=$enable_myddas - LDFLAGS="$LDFLAGS -L${yap_cv_myddas}/lib " - CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas}/include " + yap_cv_myddas_mysql=$enable_myddas_mysql + LDFLAGS="$LDFLAGS -L${yap_cv_myddas_mysql}/lib " + CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas_mysql}/include " fi, - [yap_cv_myddas=no]) + [yap_cv_myddas_mysql=no]) + +AC_ARG_ENABLE(myddas-odbc, + [ --enable-myddas-odbc[[=DIR]] enable the MYDDAS ODBC library], + if test "$enableval" = yes; then + yap_cv_myddas_odbc=/usr/ + elif test "$enableval" = no; then + yap_cv_myddas_odbc=no + else + yap_cv_myddas_odbc=$enable_myddas_odbc + LDFLAGS="$LDFLAGS -L${yap_cv_myddas_odbc}/lib " + CPPFLAGS="$CPPFLAGS -I${yap_cv_myddas_odbc}/include " + fi, + [yap_cv_myddas_odbc=no]) AC_ARG_ENABLE(myddas-stats, [ --enable-myddas-stats enable the MYDDAS library statistics support], - if test "$yap_cv_myddas" = no; then + if test "$yap_cv_myddas_mysql" = no; then myddasstats=no else myddasstats="$enableval" @@ -118,7 +131,7 @@ AC_ARG_ENABLE(myddas-top-level, [ --enable-myddas-top-level enable the MYDDAS top-level support to MySQL], - if test "$yap_cv_myddas" = no; then + if test "$yap_cv_myddas_mysql" = no; then myddastoplevel=no else myddastoplevel="$enableval" @@ -128,8 +141,6 @@ [ --with-jpl=JAVA_HOME use Java instalation in JAVA_HOME], if test "$withval" = yes; then yap_cv_jpl="$JAVA_HOME" - dynamic_loading=yes - maxmemory=yes dnl threads=yes elif test "$withval" = no; then yap_cv_jpl=no @@ -261,7 +272,6 @@ fi, [yap_cv_max_threads="1024"]) - if test "$tabling" = yes -o "$orparallelism" = yes -o "$threads" = yes then AC_DEFINE(MinHeapSpace, (1000*SIZEOF_INT_P)) @@ -432,6 +442,8 @@ AC_PATH_PROG(INSTALL_INFO,install-info,true,$PATH:/sbin:/usr/sbin:/usr/etc:/usr/local/sbin) AC_PATH_PROG(SHELL,sh) +AC_HEADER_STDC + dnl Check for libraries. dnl mingw does not get along well with libm dnl cygnus and mingw32 also need wsock32 to use sockets. @@ -488,7 +500,7 @@ AC_CHECK_LIB(gmp,main) fi -if test "$yap_cv_myddas" != "no" +if test "$yap_cv_myddas_mysql" != "no" then dnl check for mysql AC_MSG_CHECKING(for main in -lmysqlclient) @@ -505,9 +517,26 @@ if test "$yap_mysql" = yes then YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_MYSQL" - LIBS="$LIBS -L${yap_cv_myddas}/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv " + LIBS="$LIBS -L${yap_cv_myddas_mysql}/lib/mysql -lmysqlclient -lz -lcrypt -lnsl -lm -lc -lnss_files -lnss_dns -lresolv " + fi + if test "$yap_mysql" = no + then + echo "-------------------------------" + echo "--" + echo "--" + echo "--" + echo "-- There\'s no devel libraries for MySQL" + echo "--" + echo "--" + echo "--" + echo "-------------------------------" + exit fi - + cutc="yes" +fi + +if test "$yap_cv_myddas_odbc" != "no" +then dnl check for odbc AC_MSG_CHECKING(for main in -lodbc) AC_CACHE_VAL(yap_odbc,[ @@ -526,40 +555,21 @@ YAP_EXTRAS="$YAP_EXTRAS -DMYDDAS_ODBC" LIBS="$LIBS -lodbc " fi - - if test "$yap_mysql" = no -a "$yap_odbc" = no + if test "$yap_odbc" = no then echo "-------------------------------" echo "--" echo "--" echo "--" - echo "-- There\'s no devel libraries for MySQL or ODBC" + echo "-- There\'s no devel libraries for ODBC" echo "--" echo "--" echo "--" echo "-------------------------------" exit fi - - if test "$cutc" = no - then - echo - echo - echo "********************************************************" - echo - echo - echo "!!!!!! WARNING !!!!!!" - echo "The MYDDAS interface makes no sense without cut-c" - echo "Please contact tiagosoares@ncc.up.pt for help" - echo - echo "Enabling cut-c" - echo - echo "********************************************************" - echo - echo - cutc="yes" - fi -fi + cutc="yes" +fi if test "$myddasstats" = "yes" then @@ -854,10 +864,14 @@ YAP_EXTRAS="$SHLIB_CFLAGS $YAP_EXTRAS" CROSS_SIMULATOR="LD_LIBRARY_PATH=." case "$target_os" in + *cygwin*!*mingw32*) + EXTEND_DYNLOADER_PATH="" + ;; *darwin*) DYNYAPLIB=libYap"$SHLIB_SUFFIX" YAPLIB="$DYNYAPLIB" DYNLIB_LD="gcc -dynamiclib" + EXTEND_DYNLOADER_PATH="DYLD_LIBRARY_PATH=\$DYLD_LIBRARY_PATH:\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR)/Yap YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/Yap/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" ;; *) case "$target_cpu" in @@ -871,13 +885,15 @@ JAVA_TARGET=sparc ;; esac - LDFLAGS="$LDFLAGS -Wl,-R,$prefix/lib -Wl,-R,$JAVA_HOME/jre/lib/$JAVA_TARGET" + EXTEND_DYNLOADER_PATH="LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$(DESTDIR)\$(LIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR)/Yap YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/Yap/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" DYNYAPLIB=libYap"$SHLIB_SUFFIX" + LDFLAGS="$LDFLAGS -Wl,-R,$prefix/lib -Wl,-R,$JAVA_HOME/jre/lib/$JAVA_TARGET -Wl,-soname=$DYNYAPLIB" YAPLIB="$DYNYAPLIB" DYNLIB_LD="$SHLIB_LD" ;; esac else + EXTEND_DYNLOADER_PATH="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR)/Yap YAPBOOTDIR=\$(DESTDIR)\$(SHAREDIR)/Yap/pl YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)" DYNYAPLIB=libYap.notused fi @@ -992,6 +1008,7 @@ ENABLE_CPLINT="#" fi AC_SUBST(ENABLE_CPLINT) +AC_SUBST(EXTEND_DYNLOADER_PATH) # LAM OLD_CC=${CC} @@ -1002,7 +1019,6 @@ CC=${OLD_CC} dnl Checks for header files. -AC_HEADER_STDC AC_HEADER_SYS_WAIT AC_CHECK_HEADERS(arpa/inet.h ctype.h direct.h dirent.h dlfcn.h) AC_CHECK_HEADERS(errno.h fcntl.h) @@ -1021,7 +1037,7 @@ then AC_CHECK_HEADERS(gmp.h) fi -if test "$yap_cv_myddas" != "no" +if test "$yap_cv_myddas_mysql" != "no" then AC_CHECK_HEADERS(mysql/mysql.h) fi