fix duplicated system predicate + android related cleanups

This commit is contained in:
Vítor Santos Costa 2014-06-20 11:13:39 +01:00
parent d0f2f50a8e
commit 74a65633d8
13 changed files with 935 additions and 403 deletions

View File

@ -263,21 +263,6 @@ p_strip_module( USES_REGS1 )
Yap_unify(ARG2, tmod);
}
static Int
p_system_module( USES_REGS1 )
{
Term t1 = Deref(ARG1);
if (t1 == PROLOG_MODULE) {
return TRUE;
}
return t1 == TermProlog ||
t1 == IDB_MODULE ||
t1 == IDB_MODULE ||
t1 == ATTRIBUTES_MODULE ||
t1 == SYSTEM_MODULE ||
t1 == GLOBALS_MODULE;
}
static Int
p_context_module( USES_REGS1 )
{
@ -351,7 +336,6 @@ Yap_InitModulesC(void)
Yap_InitCPred("$change_module", 1, p_change_module, SafePredFlag|SyncPredFlag);
Yap_InitCPred("strip_module", 3, p_strip_module, SafePredFlag|SyncPredFlag);
Yap_InitCPred("context_module", 1, p_context_module, 0);
Yap_InitCPred("$system_module", 1, p_system_module, 0);
Yap_InitCPredBack("$all_current_modules", 1, 1, init_current_module, cont_current_module,
SafePredFlag|SyncPredFlag);
}

View File

@ -828,6 +828,7 @@ ReadHash(IOSTREAM *stream)
static void
read_clauses(IOSTREAM *stream, PredEntry *pp, UInt nclauses, UInt flags) {
CACHE_REGS
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " ? read_uint %p %d %p", pp, nclauses, stream);
if (pp->PredFlags & LogUpdatePredFlag) {
/* first, clean up whatever was there */
if (pp->cs.p_code.NOfClauses) {
@ -968,8 +969,9 @@ read_pred(IOSTREAM *stream, Term mod) {
}
ap->TimeStampOfPred = read_uint(stream);
/* multifile predicates cannot reside in module 0 */
if (flags & MultiFileFlag && ap->ModuleOfPred == PROLOG_MODULE)
if (flags & MultiFileFlag && ap->ModuleOfPred == PROLOG_MODULE) {
ap->ModuleOfPred = TermProlog;
}
read_clauses(stream, ap, nclauses, flags);
if (flags & HiddenPredFlag) {
Yap_HidePred(ap);
@ -1003,15 +1005,17 @@ read_module(IOSTREAM *stream) {
InitHash();
read_header(stream);
ReadHash(stream);
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " after read_hash %p", stream);
while ((x = read_tag(stream)) == QLY_START_MODULE) {
Term mod = (Term)read_uint(stream);
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " after read_uint %x %p", mod, stream);
mod = MkAtomTerm(AtomAdjust(AtomOfTerm(mod)));
if (mod)
while ((x = read_tag(stream)) == QLY_START_PREDICATE) {
read_pred(stream, mod);
}
}
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " %p", stream);
read_ops(stream);
CloseHash();
}
@ -1087,6 +1091,7 @@ Yap_Restore(char *s, char *lib_dir)
read_module(stream);
Sclose( stream );
GLOBAL_RestoreFile = NULL;
__android_log_print(ANDROID_LOG_INFO, "qlyr.c", "loading startup %p, done", stream);
return DO_ONLY_CODE;
}

View File

@ -252,11 +252,10 @@ open_file(char *my_file, int flag)
if (flag == O_RDONLY) {
extern AAssetManager *assetManager;
my_file += strlen("/assets/");
__android_log_print(ANDROID_LOG_ERROR, "save.c", "open_file %p %s", assetManager, my_file);
AAsset* asset = AAssetManager_open(assetManager, my_file, AASSET_MODE_UNKNOWN);
if (!asset)
return -1;
__android_log_print(ANDROID_LOG_ERROR, "save.c", "open_file %p", asset);
__android_log_print(ANDROID_LOG_ERROR, __FUNCTION__ , " %p", asset);
AAsset_close( asset );
return 0; // usually the file will be compressed, so there is no point in actually trying to open it.
}

View File

@ -134,6 +134,7 @@ Yap_WinError(char *yap_error)
static int
is_directory(char *FileName)
{
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, " %s ",FileName);
#ifdef _WIN32
char s[YAP_FILENAME_MAX+1];
char *s0 = FileName;

View File

@ -48,6 +48,9 @@
/* use Barts idea of allocating extra memory */
#undef GC_NO_TAGS
/* Define if gethostname() is provided */
#undef HAS_GETHOSTNAME
/* Define to 1 if you have the `access' function. */
#undef HAVE_ACCESS
@ -387,6 +390,9 @@
/* Define to 1 if you have the `stdc++' library (-lstdc++). */
#undef HAVE_LIBSTDC__
/* Whether we have libunicode.a */
#undef HAVE_LIBUNICODE
/* Define to 1 if you have the `ws2_32' library (-lws2_32). */
#undef HAVE_LIBWS2_32
@ -697,6 +703,9 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
/* Define to 1 if you have the `strcasecmp' function. */
#undef HAVE_STRCASECMP
/* Define to 1 if you have the `strcasestr' function. */
#undef HAVE_STRCASESTR
@ -718,6 +727,9 @@
/* Define to 1 if you have the `strlwr' function. */
#undef HAVE_STRLWR
/* Define to 1 if you have the `strncasecmp' function. */
#undef HAVE_STRNCASECMP
/* Define to 1 if you have the `strncat' function. */
#undef HAVE_STRNCAT
@ -922,6 +934,12 @@
/* Define as the return type of signal handlers (`int' or `void'). */
#undef RETSIGTYPE
/* Specify package */
#undef RFC2045PKG
/* Specify version */
#undef RFC2045VER
/* The size of `double', as computed by sizeof. */
#undef SIZEOF_DOUBLE
@ -1000,6 +1018,15 @@
/* threaded emulator */
#undef USE_THREADED_CODE
/* Whether daylight savings time offset is set via the altzone variable */
#undef USE_TIME_ALTZONE
/* Whether daylight savings time offset is set via the tm_isdst member */
#undef USE_TIME_DAYLIGHT
/* Whether time offset is specified via the tm_gmtoff member */
#undef USE_TIME_GMTOFF
/* Define to name of the UUID header file. */
#undef UUID_H
@ -1060,8 +1087,20 @@
/* compiling for Windows */
#undef __WINDOWS__
/* Define to empty if `const' does not conform to ANSI C. */
#undef const
/* Define to `__inline__' or `__inline' if that's what the C compiler
calls it, or to nothing if 'inline' is not supported under any name. */
#ifndef __cplusplus
#undef inline
#endif
/* Define to `long int' if <sys/types.h> does not define. */
#undef off_t
/* Define to `int' if <sys/types.h> does not define. */
#undef pid_t
/* Define to `unsigned int' if <sys/types.h> does not define. */
#undef size_t

798
configure vendored

File diff suppressed because it is too large Load Diff

View File

@ -47,7 +47,7 @@ AC_ARG_WITH(sysroot,
CFLAGS="$CFLAGS --sysroot=$SYSROOT"
CXXFLAGS="$CXXFLAGS --sysroot=$SYSROOT"
LDFLAGS="$LDFLAGS --sysroot=$SYSROOT" ],
[])
[])
AC_PROG_CC
AC_PROG_CPP
@ -64,7 +64,7 @@ AC_ARG_ENABLE(abi,
AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(YapTermConfig.h)
dnl store the environment's compilation flags
dnl store the environments compilation flags
mycflags="$CFLAGS"
AC_PROG_AWK
@ -575,6 +575,7 @@ then
prefix="$SYSTEMDRIVE/Yap"
fi
i_am_cross_compiling=yes
PRE_INSTALL_ENV="wine "
;;
**)
if test "$target_cpu" = "x86_64"
@ -730,7 +731,7 @@ else
fi
if test -e "$srcdir"/packages/clib/Makefile.in; then
PKG_CLIB="packages/clib"
PKG_CLIB="packages/clib/maildrop/rfc2045 packages/clib/maildrop/rfc822 packages/clib"
else
PKG_CLIB=""
fi
@ -741,12 +742,6 @@ else
PKG_HTTP=""
fi
if test -e "$srcdir"/packages/pldoc/Makefile.in; then
PKG_PLDOC="packages/pldoc"
else
PKG_PLDOC=""
fi
if test -e "$srcdir"/packages/plunit/Makefile.in; then
PKG_PLUNIT="packages/plunit"
else
@ -771,12 +766,6 @@ else
PKG_RDF=""
fi
if test -e "$srcdir"/packages/ltx2htm/Makefile.in; then
PKG_LTX2HTM="packages/ltx2htm"
else
PKG_LTX2HTM=""
fi
if test -e "$srcdir"/packages/semweb/Makefile.in; then
PKG_SEMWEB="packages/semweb"
else
@ -874,7 +863,7 @@ fi
fi
if test "$have_nsl" = yes
then
LIBS="$LIBS -lnsl"
LIBS="$LIBS -lnsl"
fi
if test "$dynamic_loading" = "yes"
then
@ -886,7 +875,7 @@ fi
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
INSTALL_ENV="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
fi
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
;;
*sunos4*)
M4="/usr/5bin/m4"
@ -901,7 +890,7 @@ fi
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*hpux*)
@ -940,7 +929,7 @@ fi
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir) YAPLIBDIR=\$(abs_top_builddir):\$(abs_top_builddir)/library/system"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir) YAPLIBDIR=\$(abs_top_builddir):\$(abs_top_builddir)/library/system $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*aix*)
@ -954,7 +943,7 @@ fi
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*osf*)
@ -974,7 +963,7 @@ dnl Linux has both elf and a.out, in this case we found elf
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*irix6*)
@ -990,7 +979,7 @@ dnl Linux has both elf and a.out, in this case we found elf
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*darwin*)
@ -1037,7 +1026,7 @@ dnl Linux has both elf and a.out, in this case we found elf
DYNYAPLIB=libYap."$YAP_VERSION.$SO"
SONAMEFLAG="-Wl,-install_name,$prefix/lib/libYap.$YAP_MAJOR_VERSION.$SO -Wl,-compatibility_version,$YAP_MAJOR_VERSION.$YAP_MINOR_VERSION -Wl,-current_version,$YAP_VERSION"
YAPLIB_LD="$CC -dynamiclib"
PRE_INSTALL_ENV="DYLD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$DYLD_LIBRARY_PATH"
PRE_INSTALL_ENV="DYLD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$DYLD_LIBRARY_PATH $PRE_INSTALL_ENV"
EXTRAYAPLIBS="libYap.$SO libYap.$YAP_MAJOR_VERSION.$SO"
;;
*netbsd*|*openbsd*|*freebsd*|*dragonfly*)
@ -1065,7 +1054,7 @@ dnl Linux has both elf and a.out, in this case we found elf
YAPLIB_LD=$SHLIB_LD
SONAMEFLAG="-Wl,--soname=$DYNYAPLIB"
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -Wl,-R,\$(YAPLIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*solaris*)
@ -1086,11 +1075,10 @@ dnl Linux has both elf and a.out, in this case we found elf
then
YAPLIB_LD="\$(CC)"
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
else
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV=""
YAPLIB_LD="\$(CC) -shared"
INSTALL_ENV="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
fi
@ -1118,7 +1106,6 @@ dnl Linux has both elf and a.out, in this case we found elf
MERGE_DLL_OBJS=""
IN_UNIX="#"
YAPLIB_LD="\$(CC) -shared -Wl,--export-all-symbols"
PRE_INSTALL_ENV=""
INSTALL_ENV="YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
*)
@ -1145,13 +1132,13 @@ dnl Linux has both elf and a.out, in this case we found elf
DYNYAPLIB=libYap."$SO"
SONAMEFLAG=""
EXTRA_LIBS_FOR_DLLS="$EXTRA_LIBS_FOR_DLLS -L\$(abs_top_builddir) -lYap -Wl,-R,\$(YAPLIBDIR) -Wl,-R,\$(LIBDIR)"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH"
PRE_INSTALL_ENV="LD_LIBRARY_PATH=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:$LD_LIBRARY_PATH $PRE_INSTALL_ENV"
INSTALL_ENV="LD_LIBRARY_PATH=\$(DESTDIR)\$(LIBDIR):\$(DESTDIR)\$(YAPLIBDIR): YAPSHAREDIR=\$(DESTDIR)\$(SHAREDIR) YAPLIBDIR=\$(DESTDIR)\$(YAPLIBDIR)"
;;
esac
dnl use the current files, even if older
PRE_INSTALL_ENV="$PRE_INSTALL_ENV YAPLIBDIR=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:\$(abs_top_builddir)/packages/clib "
PRE_INSTALL_ENV="YAPLIBDIR=\$(abs_top_builddir):\$(abs_top_builddir)/library/system:\$(abs_top_builddir)/packages/clib $PRE_INSTALL_ENV "
if test "$dynamic_loading" = "yes"
then
@ -1419,8 +1406,6 @@ AC_SUBST(PKG_CLIB)
AC_SUBST(PKG_CLPQR)
AC_SUBST(PKG_HTTP)
AC_SUBST(PKG_JPL)
AC_SUBST(PKG_LTX2HTM)
AC_SUBST(PKG_PLDOC)
AC_SUBST(PKG_PLUNIT)
AC_SUBST(PKG_R)
AC_SUBST(PKG_RDF)
@ -1909,6 +1894,8 @@ m4_include([packages/myddas/configure.in])
if test "$PKG_CLIB" != ""
then
m4_include([packages/clib/maildrop/rfc2045/configure.in])
m4_include([packages/clib/maildrop/rfc822/configure.in])
m4_include([packages/clib/configure.in])
fi
@ -1988,15 +1975,6 @@ then
fi
if test -e "$srcdir"/packages/ltx2htm/Makefile.in
then
PKG_LTX22HTM="packages/ltx2htm"
m4_include([packages/ltx2htm/configure.in])
else
PKG_LTX2HTM=""
fi
if test -e "$srcdir"/packages/raptor/Makefile.in
then
PKG_RAPTOR="packages/raptor"
@ -2078,13 +2056,10 @@ 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/ltx2htm
mkdir -p packages/meld
mkdir -p packages/myddas
mkdir -p packages/PLStream
mkdir -p packages/PLStream/libtai
mkdir -p packages/pldoc
mkdir -p packages/pldoc/server
mkdir -p packages/plunit
mkdir -p packages/prism
mkdir -p packages/prism/src
@ -2134,6 +2109,11 @@ AC_CONFIG_FILES([packages/chr/Makefile])
fi
if test "$PKG_CLIB" != ""; then
AC_CONFIG_FILES([packages/clib/maildrop/rfc2045/Makefile])
AC_CONFIG_FILES([packages/clib/maildrop/rfc2045/config.h])
AC_CONFIG_FILES([packages/clib/maildrop/rfc2045/rfc2045charset.h])
AC_CONFIG_FILES([packages/clib/maildrop/rfc822/Makefile])
AC_CONFIG_FILES([packages/clib/maildrop/rfc822/config.h])
AC_CONFIG_FILES([packages/clib/Makefile])
fi
@ -2149,15 +2129,6 @@ if test "$PKG_JPL" != ""; then
AC_CONFIG_FILES([packages/jpl/Makefile packages/jpl/src/java/Makefile ])
fi
if test "$PKG_LTX2HTM" != ""; then
AC_CONFIG_FILES([ packages/ltx2htm/Makefile packages/ltx2htm/latex2html])
fi
if test "$PKG_PLDOC" != ""; then
AC_CONFIG_FILES([packages/pldoc/Makefile])
AC_CONFIG_FILES([packages/pldoc/server/man_server.pl])
fi
if test "$PKG_PLUNIT" != ""; then
AC_CONFIG_FILES([packages/plunit/Makefile])
fi

View File

@ -1,188 +1,182 @@
#!/bin/sh
#
# script for compiling and installing YAP under msys. Uses a mingw64
# compiler, msys shell and nsis to do the installing
# Please read the script before trying to execute it.
# Legal arguments for the script are
# 'threads' - enable threads
# 'no_threads',
# '32', '64' - compile for 32 or 64 bit architecture.
# By default threads are turned off and we use 64 bits.
#
# please check if you have gcc 64 bits in your path and a clone
# of msys shell like smartgit:
#
# http://sourceforge.net/projects/mingwbuilds/
# PS: don't install in the default location.
# mingw should avoid space in its directory,
# it freaks winres out.
# http://nsis.sourceforge.net/Main_Page
#
#
VERSION=6.3.4
THREADS=no
ABI=64
ROOTS=/l/work/noth/git
ROOTS_WIN=L:\\work\\noth\\git
TARGET=$ROOTS/yap
if test $# = 1; then
if test $1 = threads; then
THREADS=yes
elif test $1 = no_threads; then
THREADS=no
elif test $1 = 32; then
ABI=32
elif test $1 = 64; then
ABI=64
else
echo "received \"$1\", should be one of threads, no_threads, 32, 64"
fi
else
if test $1 = threads; then
THREADS=yes
elif test $1 = no_threads; then
THREADS=no
elif test $1 = 32; then
ABI=32
elif test $1 = 64; then
ABI=64
else
echo "received 1=\"$1\", should be one of threads, no_threads, 32, 64"
fi
if test $2 = threads; then
THREADS=yes
elif test $2 = no_threads; then
THREADS=no
elif test $2 = 32; then
ABI=32
elif test $2 = 64; then
ABI=64
else
echo "received 1=\"$2\", should be one of threads, no_threads, 32, 64"
fi
fi
# srcdir comes from here, please avoid relative paths
CONFIGURE=$ROOTS/yap-6.3/configure
# debugging setup
do_compile=true
do_install=true
# HOME WIN64 configuration
DOCS_DIR=/l/work/noth/yapdocs
if test "$THREADS" = yes; then
FULL_VERSION="$VERSION"-threads
else
FULL_VERSION="$VERSION"
fi
if test $ABI = 64; then
GCC_PATH=/l/Work/noth/mingw-w64/x86_64-4.9.0-posix-seh-rt_v3-rev1/mingw64
HOST="--host=x86_64-w64-mingw32"
# ok.
CUDD=no # BDD compiler package. Get version that compiles on Windows from Vitor!
GECODE=no #does not link with mingw64, VC++ trouble
GMP=yes # Compile it for infinite precision numbers and rationals
JAVA=no # for JPL only
PYTHON=no # does not work in Windows anyway (currently)
REAL=no # interface to R
# it seems python2.7 does not support mingw64
PYTHON_PATH="/c/Python33-64"
export PATH="$GCC_PATH"/bin:"$PATH"
GECODE_PATH="/c/Program Files/Gecode"
GMP=/l/Work/noth/msys/1.0/local
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw64
JAVA_PATH="/c/Program Files/Java/jdk1.7.0_51"
R_PATH="/c/Program Files/R/R-3.0.2"
if test $THREADS = yes
then
cp "$GCC_PATH/x86_64-w64-mingw32/lib/libwinpthread-1.dll" . # interface from posix threads to windows native threads
cp libwinpthread-1.dll pthreadGC2.dll
fi
fi
# HOME WIN32 configuration
if test $ABI = 32; then
GCC_PATH="/c/TDM-GCC-64"
CUDD=yes
GECODE=no # install only allows one of 32 or 64 bits
GMP=yes
JAVA=yes
PYTHON=no
REAL=yes
PYTHON_PATH="/c/Python27"
export PATH="$GCC_PATH"/bin:$PATH
GECODE_PATH="/c/Program Files/Gecode"
GMP=/c/cygwin/Yap/win32
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw32
JAVA_PATH="/c/Program Files (x86)/Java/jdk1.7.0_51"
R_PATH="/c/Program Files/R/R-3.0.2"
HOST="--enable-abi=32"
cp $GCC_PATH/bin/libwinpthread-1.dll .
cp libwinpthread-1.dll pthreadGC2.dll
fi
if test $CUDD = yes
then
CUDD="$CUDD_PATH"
BDDLIB="--enable-bddlib"
else
BDDLIB=""
fi
if test $GECODE = yes
then
export PATH="$PATH":"$GECODE_PATH"/bin
fi
if test $JAVA = yes
then
export PATH="$PATH":"$JAVA_PATH"/bin
fi
if test $PYTHON = yes
then
export PATH="$PATH":"$PYTHON_PATH"
fi
if test $REAL = yes
then
if test $ABI = 32; then
R_ABI=i386
else
R_ABI=x64
fi
export PATH="$PATH":"$R_PATH"/bin/"$R_ABI"
fi
export INSTALL_SH=$ROOTS/yap-6.3/install.sh
# avoid using relativ paths
if test "$do_compile" = true; then
"$CONFIGURE" $HOST \
--prefix=$TARGET \
--with-R="$REAL" \
--with-java="$JAVA" \
--with-gmp="$GMP" \
--with-python="$PYTHON" \
--with-cudd="$CUDD" "$BDDLIB" \
--enable-gecode="$GECODE" \
--enable-threads="$THREADS" --enable-pthread-locking \
--enable-debug-yap --enable-low-level-tracer
make -j 4 install
fi
if test "$do_install" = true; then
if test $ABI = 64; then
cp $DOCS_DIR/*html $TARGET/share/doc/Yap
cp $DOCS_DIR/*pdf $TARGET/share/doc/Yap
"/l/Program Files (x86)/NSIS/makensis" -DREGKEY=SOFTWARE\\YAP\\Prolog64 -DROOTDIR=$TARGET -DABI="$ABI" -DVERSION="$FULL_VERSION" -DOPTIONS="$ROOTS_WIN\\yap-6.3\\misc\\options.ini" -DOUT_DIR=".." -D"WIN64=1" -NOCD $ROOTS/yap-6.3/misc/Yap.nsi
else
cp $DOCS_DIR/*html $TARGET/share/doc/Yap
cp $DOCS_DIR/*pdf $TARGET/share/doc/Yap
"/l/Program Files (x86)/NSIS/makensis" -DREGKEY=SOFTWARE\\YAP\\Prolog -DROOTDIR=$TARGET -DABI="$ABI" -DVERSION="$FULL_VERSION" -DOPTIONS="$ROOTS_WIN\\yap-6.3\\misc\\options.ini" -DOUT_DIR=".." -NOCD $ROOTS/yap-6.3/misc/Yap.nsi
fi
fi
#!/bin/sh
#
# script for compiling and installing YAP under msys. Uses a mingw64
# compiler, msys shell and nsis to do the installing
# Please read the script before trying to execute it.
# Legal arguments for the script are
# 'threads' - enable threads
# 'no_threads',
# '32', '64' - compile for 32 or 64 bit architecture.
# By default threads are turned off and we use 64 bits.
#
# please check if you have gcc 64 bits in your path and a clone
# of msys shell like smartgit:
#
# http://sourceforge.net/projects/mingwbuilds/
# PS: don't install in the default location.
# mingw should avoid space in its directory,
# it freaks winres out.
# http://nsis.sourceforge.net/Main_Page
#
#
VERSION=6.3.4
# by default, compile without threads
THREADS=no
# use 64 bits
ABI=64
#SRC=/l/work/noth/git
#SRC_WIN=L:\\work\\noth\\git
SRC="$HOME"/git/yap-6.3
TARGET=/c/Yap64
NSIS="/c/Program Files (x86)/NSIS/makensis"
# by default, ""
PREFIX_CMD=wine
I=$#
while test $I -gt 0
do
if test $1 = threads
then
THREADS=yes
elif test $1 = no_threads
then
THREADS=no
elif test $1 = 32
then
ABI=32
elif test $1 = 64
then
ABI=64
else
echo "received \"$1\", should be one of threads, no_threads, 32, 64"
fi
I=$(( $I - 1 ))
done
# srcdir comes from here, please avoid relative paths
CONFIGURE=$SRC/configure
# debugging setup
do_compile=true
do_install=true
# HOME WIN64 configuration
# DOCS_DIR=/l/work/noth/yapdocs
DOCS_DIR=$HOME/Yap/bins/threads
if test "$THREADS" = yes; then
FULL_VERSION="$VERSION"-threads
else
FULL_VERSION="$VERSION"
fi
if test $ABI = 64; then
#GCC_PATH=/l/Work/noth/mingw-w64/x86_64-4.9.0-posix-seh-rt_v3-rev1/mingw64
GCC_PATH=$HOME/mxe/usr/bin
PATH=$PATH:$GCC_PATH
HOST="--host=x86_64-w64-mingw32"
# ok.
CUDD=no # BDD compiler package. Get version that compiles on Windows from Vitor!
GECODE=no #does not link with mingw64, VC++ trouble
GMP=yes # Compile it for infinite precision numbers and rationals
JAVA=no # for JPL only
PYTHON=no # does not work in Windows anyway (currently)
REAL=no # interface to R
# it seems python2.7 does not support mingw64
PYTHON_PATH="/c/Python33-64"
export PATH="$GCC_PATH"/bin:"$PATH"
GECODE_PATH="/c/Program Files/Gecode"
# GMP=/l/Work/noth/msys/1.0/local
GMP=yes
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw64
JAVA_PATH="/c/Program Files/Java/jdk1.7.0_51"
R_PATH="/c/Program Files/R/R-3.1.0"
if test $THREADS = yes
then
cp "$GCC_PATH/x86_64-w64-mingw32/lib/libwinpthread-1.dll" . # interface from posix threads to windows native threads
cp libwinpthread-1.dll pthreadGC2.dll
fi
fi
# HOME WIN32 configuration
if test $ABI = 32; then
GCC_PATH="/c/TDM-GCC-64"
CUDD=yes
GECODE=no # install only allows one of 32 or 64 bits
GMP=yes
JAVA=yes
PYTHON=no
REAL=yes
PYTHON_PATH="/c/Python27"
export PATH="$GCC_PATH"/bin:$PATH
GECODE_PATH="/c/Program Files/Gecode"
GMP=/c/cygwin/Yap/win32
CUDD_PATH=/c/cygwin/Yap/cudd-2.5.0-mingw32
JAVA_PATH="/c/Program Files (x86)/Java/jdk1.7.0_51"
R_PATH="/c/Program Files/R/R-3.0.2"
HOST="--enable-abi=32"
cp $GCC_PATH/bin/libwinpthread-1.dll .
cp libwinpthread-1.dll pthreadGC2.dll
fi
if test $CUDD = yes
then
CUDD="$CUDD_PATH"
BDDLIB="--enable-bddlib"
else
BDDLIB=""
fi
if test $GECODE = yes
then
export PATH="$PATH":"$GECODE_PATH"/bin
fi
if test $JAVA = yes
then
export PATH="$PATH":"$JAVA_PATH"/bin
fi
if test $PYTHON = yes
then
export PATH="$PATH":"$PYTHON_PATH"
fi
if test $REAL = yes
then
if test $ABI = 32; then
R_ABI=i386
else
R_ABI=x64
fi
export PATH="$PATH":"$R_PATH"/bin/"$R_ABI"
fi
export INSTALL_SH=$SRC/yap-6.3/install.sh
# avoid using relative paths
if test "$do_compile" = true; then
"$CONFIGURE" $HOST \
--prefix=$TARGET \
--with-R="$REAL" \
--with-java="$JAVA" \
--with-gmp="$GMP" \
--with-python="$PYTHON" \
--with-cudd="$CUDD" "$BDDLIB" \
--enable-gecode="$GECODE" \
--enable-threads="$THREADS" --enable-pthread-locking \
--enable-debug-yap --enable-low-level-tracer
make -j 4 install
fi
if test "$do_install" = true; then
if test $ABI = 64; then
cp $DOCS_DIR/*html $TARGET/share/doc/Yap
cp $DOCS_DIR/*pdf $TARGET/share/doc/Yap
"$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog64 -DROOTDIR=$TARGET -DABI="$ABI" -DVERSION="$FULL_VERSION" -DOPTIONS="$SRC_WIN\\yap-6.3\\misc\\options.ini" -DOUT_DIR=".." -D"WIN64=1" -NOCD $SRC/yap-6.3/misc/Yap.nsi
else
cp $DOCS_DIR/*html $TARGET/share/doc/Yap
cp $DOCS_DIR/*pdf $TARGET/share/doc/Yap
"$NSIS" -DREGKEY=SOFTWARE\\YAP\\Prolog -DROOTDIR=$TARGET -DABI="$ABI" -DVERSION="$FULL_VERSION" -DOPTIONS="$SRC_WIN\\yap-6.3\\misc\\options.ini" -DOUT_DIR=".." -NOCD $SRC/yap-6.3/misc/Yap.nsi
fi
fi

View File

@ -1649,6 +1649,8 @@ ChDir(const char *path)
char tmp[MAXPATHLEN];
int hyper_path = FALSE;
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, " %s ",ospath);
OsPath(path, ospath);
if ( path[0] == EOS || streq(path, ".") ||
@ -1656,7 +1658,6 @@ ChDir(const char *path)
succeed;
AbsoluteFile(path, tmp);
__android_log_print(ANDROID_LOG_INFO, __FUNCTION__, " %s ",ospath);
#if __ANDROID__
/* treat "/assets" as a directory (actually as a mounted file system).
*

View File

@ -184,7 +184,6 @@ class JavaCallback extends YAPCallback
public void run(String s)
{
System.out.println("JavaCallback.run() ");
Log.i(TAG, "java callback ");
output.append(s);
}

View File

@ -117,7 +117,7 @@ swapped, making the call
absolute_file_name(File,TrueFileName,Opts) :- ( var(TrueFileName) ->
true ; atom(TrueFileName), TrueFileName \= [] ), !,
absolute_file_name(File,Opts,TrueFileName).
absolute_file_name(File,Opts,TrueFileName) :-
absolute_file_name(File,Opts,TrueFileName) :-
'$absolute_file_name'(File,Opts,TrueFileName,absolute_file_name(File,Opts,TrueFileName)).
/**
@ -316,14 +316,6 @@ absolute_file_name(File0,File) :-
'$check_file'(F0, Type, Access, F).
'$check_file'(F, _Type, none, F) :- !.
'$check_file'(F0, _Type, _Access, F0) :-
% format('IN ~w~n', [F0]),
yap_flag( c_cc, Flag),
sub_atom( Flag, _, _, _, android),
sub_atom( F0, 0, _, _, '/assets'),
catch( open( F0, Access, S ), _, fail ),
% format('~w~n', [F0]),
!.
'$check_file'(F0, Type, Access, F0) :-
access_file(F0, Access),
(Type == directory ->

View File

@ -31,8 +31,8 @@
'$do_log_upd_clause'/6,
'$do_log_upd_clause0'/6,
'$do_log_upd_clause_erase'/6,
'$do_static_clause'/5,
'$system_module'/1], []).
'$do_static_clause'/5], [
'$system_module'/1]).
:- use_system_module( '$_boot', ['$cut_by'/1]).
@ -167,9 +167,6 @@ version(yap,[6,3]).
:- use_module('../swi/library/menu.pl').
'$system_module'('$swi').
'$system_module'('$win_menu').
yap_hacks:cut_by(CP) :- '$$cut_by'(CP).

View File

@ -1087,3 +1087,9 @@ ls_imports :-
ls_imports.
'$system_module'('$swi').
'$system_module'('$win_menu').
'$system_module'('prolog').
'$system_module'('system').
'$system_module'('$attributes').