From f47a7bb999fe01d053465b81552631542780a4ee Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 17 Dec 2012 16:25:27 +0000 Subject: [PATCH 01/12] add debugging hooks to gc --- C/heapgc.c | 33 ++++++++++++++++++++++++++++++--- H/heapgc.h | 4 +++- 2 files changed, 33 insertions(+), 4 deletions(-) diff --git a/C/heapgc.c b/C/heapgc.c index 2f4617664..31b453dba 100644 --- a/C/heapgc.c +++ b/C/heapgc.c @@ -410,8 +410,15 @@ push_registers(Int num_regs, yamop *nextop USES_REGS) al = al->NextAE; } while (gl) { - check_pr_trail(TR PASS_REGS); - TrailTerm(TR++) = gl->global; + Term t = gl->global; + if (!IsUnboundVar(&gl->global) && + !IsAtomTerm(t) && + !IsIntTerm(t) + ) { + check_pr_trail(TR PASS_REGS); + //fprintf(stderr,"in=%s %p\n", gl->AtomOfGE->StrOfAE, gl->global); + TrailTerm(TR++) = t; + } gl = gl->NextGE; } while (sal) { @@ -504,7 +511,14 @@ pop_registers(Int num_regs, yamop *nextop USES_REGS) al = al->NextAE; } while (gl) { - gl->global = TrailTerm(ptr++); + Term t = gl->global; + if (!IsUnboundVar(&gl->global) && + !IsAtomTerm(t) && + !IsIntTerm(t) + ) { + //fprintf(stderr,"out=%s %p\n", gl->AtomOfGE->StrOfAE, gl->global); + gl->global = TrailTerm(ptr++); + } gl = gl->NextGE; } sal = LOCAL_StaticArrays; @@ -1150,6 +1164,7 @@ mark_variable(CELL_PTR current USES_REGS) POP_CONTINUATION(); } if (current >= H0 && current < H) { + //fprintf(stderr,"%p M\n", current); LOCAL_total_marked++; if (current < LOCAL_HGEN) { LOCAL_total_oldies++; @@ -1165,6 +1180,7 @@ mark_variable(CELL_PTR current USES_REGS) if (IN_BETWEEN(LOCAL_GlobalBase,current,H) && GlobalIsAttVar(current) && current==next) { if (next < H0) POP_CONTINUATION(); if (!UNMARKED_MARK(next-1,local_bp)) { + //fprintf(stderr,"%p M\n", next-1); LOCAL_total_marked++; if (next-1 < LOCAL_HGEN) { LOCAL_total_oldies++; @@ -1207,6 +1223,7 @@ mark_variable(CELL_PTR current USES_REGS) UNMARK(current); *current = cnext; if (current >= H0 && current < H) { + //fprintf(stderr,"%p M\n", current-1); LOCAL_total_marked--; if (current < LOCAL_HGEN) { LOCAL_total_oldies--; @@ -1231,6 +1248,7 @@ mark_variable(CELL_PTR current USES_REGS) *current = UNMARK_CELL(cnext); UNMARK(current); if (current >= H0 && current < H ) { + //fprintf(stderr,"%p M\n", current); LOCAL_total_marked--; if (current < LOCAL_HGEN) { LOCAL_total_oldies--; @@ -1278,6 +1296,7 @@ mark_variable(CELL_PTR current USES_REGS) /* speedup for strings */ if (IsAtomOrIntTerm(*next)) { if (!UNMARKED_MARK(next,local_bp)) { + //fprintf(stderr,"%p M\n", next); LOCAL_total_marked++; if (next < LOCAL_HGEN) { LOCAL_total_oldies++; @@ -1337,6 +1356,7 @@ mark_variable(CELL_PTR current USES_REGS) DEBUG_printf0("%p 1\n", next); DEBUG_printf0("%p 3\n", next); } + //fprintf(stderr,"%p M 3\n", next); LOCAL_total_marked += 3; PUSH_POINTER(next PASS_REGS); PUSH_POINTER(next+2 PASS_REGS); @@ -1352,6 +1372,7 @@ mark_variable(CELL_PTR current USES_REGS) DEBUG_printf0("%p 1\n", next); DEBUG_printf1("%p %ld\n", next, (long int)(sz+1)); } + //fprintf(stderr,"%p M %d\n", next,1+sz); LOCAL_total_marked += 1+sz; PUSH_POINTER(next+sz PASS_REGS); MARK(next+sz); @@ -1390,6 +1411,7 @@ mark_variable(CELL_PTR current USES_REGS) DEBUG_printf0("%p 1\n", next); DEBUG_printf1("%p %ld\n", next, (long int)(sz+2)); } + //fprintf(stderr,"%p M %d\n", next,2+sz); LOCAL_total_marked += 2+sz; PUSH_POINTER(next PASS_REGS); sz++; @@ -1411,6 +1433,7 @@ mark_variable(CELL_PTR current USES_REGS) #endif arity = ArityOfFunctor((Functor)(cnext)); MARK(next); + //fprintf(stderr,"%p M\n", next); ++LOCAL_total_marked; if (next < LOCAL_HGEN) { ++LOCAL_total_oldies; @@ -1422,6 +1445,7 @@ mark_variable(CELL_PTR current USES_REGS) /* speedup for leaves */ while (arity && IsAtomOrIntTerm(*next)) { if (!UNMARKED_MARK(next,local_bp)) { + //fprintf(stderr,"%p M\n", next); LOCAL_total_marked++; if (next < LOCAL_HGEN) { LOCAL_total_oldies++; @@ -1695,6 +1719,7 @@ mark_trail(tr_fr_ptr trail_ptr, tr_fr_ptr trail_base, CELL *gc_H, choiceptr gc_B The ideal solution would be to unbind all variables. The current solution is to remark it as an attributed variable */ if (IN_BETWEEN(LOCAL_GlobalBase,hp,H) && GlobalIsAttVar(hp) && !UNMARKED_MARK(hp-1,LOCAL_bp)) { + //fprintf(stderr,"%p M\n", hp); LOCAL_total_marked++; PUSH_POINTER(hp-1 PASS_REGS); if (hp-1 < LOCAL_HGEN) { @@ -3367,6 +3392,7 @@ compact_heap( USES_REGS1 ) ptr++; MARK(ptr); #ifdef DEBUG + //fprintf(stderr,"%p U %d\n", ptr, nofcells); found_marked+=nofcells; #endif /* first swap the tag so that it will be seen by the next step */ @@ -3381,6 +3407,7 @@ compact_heap( USES_REGS1 ) DEBUG_printf20("%p 1\n", current); } #ifdef DEBUG + // fprintf(stderr,"%p U\n", current); found_marked++; #endif /* DEBUG */ update_relocation_chain(current, dest PASS_REGS); diff --git a/H/heapgc.h b/H/heapgc.h index 79d5d97ca..caada250d 100644 --- a/H/heapgc.h +++ b/H/heapgc.h @@ -111,7 +111,9 @@ UNMARKED_MARK__(CELL* ptr, char *bp USES_REGS) static inline void MARK__(CELL* ptr USES_REGS) { - mcell(ptr) = mcell(ptr) | MARK_BIT; + Int pos = ptr - (CELL *)LOCAL_GlobalBase; + char t = LOCAL_bp[pos]; + LOCAL_bp[pos] = t | MARK_BIT; } static inline void From 06cf32688522106b9ce9c9b3be0e7c7c4037c1b7 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Mon, 17 Dec 2012 16:27:15 +0000 Subject: [PATCH 02/12] avoi calls to inityaamregs. --- C/c_interface.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/C/c_interface.c b/C/c_interface.c index d3338a2da..775a4992a 100644 --- a/C/c_interface.c +++ b/C/c_interface.c @@ -3190,7 +3190,7 @@ YAP_Init(YAP_init_args *yap_init) /* first, initialise the saved state */ Term t_goal = MkAtomTerm(AtomInitProlog); YAP_RunGoalOnce(t_goal); - Yap_InitYaamRegs( 0 ); + // Yap_InitYaamRegs( 0 ); /* reset stacks */ return YAP_BOOT_FROM_SAVED_CODE; } else { @@ -3314,7 +3314,7 @@ YAP_Reset(void) } } /* reinitialise the engine */ - Yap_InitYaamRegs( worker_id ); + // Yap_InitYaamRegs( worker_id ); GLOBAL_Initialised = TRUE; RECOVER_MACHINE_REGS(); From 4d9d22530fc6c56d81056ec2c6cbe95c1eea5b31 Mon Sep 17 00:00:00 2001 From: "U-vsc-PC\\vsc" Date: Wed, 19 Dec 2012 00:48:43 +0000 Subject: [PATCH 03/12] fix compilation on sequential win32 --- C/sysbits.c | 25 ++++++++++++++++++++++--- 1 file changed, 22 insertions(+), 3 deletions(-) diff --git a/C/sysbits.c b/C/sysbits.c index e46dd7399..497ed2a07 100755 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -466,7 +466,7 @@ static clock_t TimesStartOfTimes, Times_last_time; /* store user time in this variable */ static void -InitTime (int) +InitTime (int wid) { HANDLE hProcess = GetCurrentProcess(); FILETIME CreationTime, ExitTime, KernelTime, UserTime; @@ -476,8 +476,9 @@ InitTime (int) t = clock (); Times_last_time = TimesStartOfTimes = t; } else { +#if THREADS (*REMOTE_ThreadHandle(wid).last_timep).dwLowDateTime = - UserTime.dwLowDateTime; + UserTime.dwLowDateTime;pp (*REMOTE_ThreadHandle(wid).last_timep).dwHighDateTime = UserTime.dwHighDateTime; (*REMOTE_ThreadHandle(wid).start_of_timesp).dwLowDateTime = @@ -488,10 +489,28 @@ InitTime (int) KernelTime.dwLowDateTime; (*REMOTE_ThreadHandle(wid).last_time_sysp).dwHighDateTime = KernelTime.dwHighDateTime; - (*REMOTE_ThreadHandle(wid).start_of_times_sysp).dwLowDateTime = + (*REMOTE_ThreadHandle(wid).start_of_times_sysp).dwLowDateTime = KernelTime.dwLowDateTime; (*REMOTE_ThreadHandle(wid).start_of_times_sysp).dwHighDateTime = KernelTime.dwHighDateTime; +#else + last_time.dwLowDateTime = + UserTime.dwLowDateTime; + last_time.dwHighDateTime = + UserTime.dwHighDateTime; + StartOfTimes.dwLowDateTime = + UserTime.dwLowDateTime; + StartOfTimes.dwHighDateTime = + UserTime.dwHighDateTime; + last_time_sys.dwLowDateTime = + KernelTime.dwLowDateTime; + last_time_sys.dwHighDateTime = + KernelTime.dwHighDateTime; + StartOfTimes_sys.dwLowDateTime = + KernelTime.dwLowDateTime; + StartOfTimes_sys.dwHighDateTime = + KernelTime.dwHighDateTime; +#endif } } From a7307f3faaa1215398e06c0e5dd373f63a85451b Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Wed, 19 Dec 2012 00:52:29 +0000 Subject: [PATCH 04/12] add SWI PL_uninstantiatin_error --- include/SWI-Prolog.h | 1 + 1 file changed, 1 insertion(+) diff --git a/include/SWI-Prolog.h b/include/SWI-Prolog.h index a88e8c450..79a8ca0d9 100755 --- a/include/SWI-Prolog.h +++ b/include/SWI-Prolog.h @@ -706,6 +706,7 @@ PL_EXPORT(int) PL_get_list_ex(term_t l, term_t h, term_t t); PL_EXPORT(int) PL_get_nil_ex(term_t l); PL_EXPORT(int) PL_instantiation_error(term_t culprit); +PL_EXPORT(int) PL_uninstantiation_error(term_t culprit); PL_EXPORT(int) PL_representation_error(const char *resource); PL_EXPORT(int) PL_type_error(const char *expected, term_t culprit); PL_EXPORT(int) PL_domain_error(const char *expected, term_t culprit); From fe4218be19be7d9a3c7bb5e47c0f20d5f22fdea5 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 20 Dec 2012 21:12:30 +0000 Subject: [PATCH 05/12] improve java support --- configure.in | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/configure.in b/configure.in index db505b1ef..cc03e2acd 100755 --- a/configure.in +++ b/configure.in @@ -863,7 +863,6 @@ elif test -e "$srcdir"/packages/python/Makefile.in ; then PYTHONHOME=`$PYTHON -c'import sys; print sys.prefix'` PYTHONVERSION=`"$PYTHON" -c "import sys; print sys.version[[:3]]"` PYTHON_LIBS="-L $PYTHONHOME/lib -lpython$PYTHONVERSION" - LIBS="$LIBS $PYTHON_LIBS" PYTHON_INCLUDES="-I $PYTHONHOME/include/python$PYTHONVERSION" else PYTHON_TARGET="dummy" @@ -1110,11 +1109,7 @@ elif test -e "$srcdir"/packages/jpl/Makefile.in; then JAVA_HOME="$yap_cv_java" case "$target_os" in *cygwin*|*mingw*) - if test $threads = yes; then - JAVALIBS="\"$JAVA_HOME\"/lib/jvm.lib -lpthread" - else - JAVALIBS="\"$JAVA_HOME\"/lib/jvm.lib" - fi + JAVALIBS="\"$JAVA_HOME\"/lib/jvm.lib" JPLCFLAGS="-I\"$JAVA_HOME\"/include -I\"$JAVA_HOME\"/include/win32" ;; *darwin*) @@ -1475,8 +1470,6 @@ dnl Linux has both elf and a.out, in this case we found elf ;; esac -EXTRA_LIBS_FOR_SWIDLLS="$EXTRA_LIBS_FOR_DLLS" - if test "$dynamic_loading" = "yes" then YAPLIB_CFLAGS="$SHLIB_CFLAGS" @@ -1813,7 +1806,6 @@ AC_SUBST(SHLIB_CXX_LD) AC_SUBST(YAPLIB_LD) AC_SUBST(YAPLIB_CFLAGS) AC_SUBST(EXTRA_LIBS_FOR_DLLS) -AC_SUBST(EXTRA_LIBS_FOR_SWIDLLS) dnl objects in YAP library AC_SUBST(YAPLIB) AC_SUBST(DYNYAPLIB) @@ -2256,6 +2248,9 @@ AC_CHECK_TYPES(ssize_t, [], [], #include ]) +EXTRA_LIBS_FOR_SWIDLLS="$EXTRA_LIBS_FOR_DLLS $CLIB_PTHREADS" +AC_SUBST(EXTRA_LIBS_FOR_SWIDLLS) + dnl tszet and timezone trouble AC_MSG_CHECKING("variable timezone in tzset") From a309f47794a5cc03ffd1a0e88dcf7dc575f5e879 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 20 Dec 2012 21:13:20 +0000 Subject: [PATCH 06/12] MT support in win32 --- C/sysbits.c | 8 ++++++-- H/Yap.h | 7 ++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/C/sysbits.c b/C/sysbits.c index 497ed2a07..4725607c6 100755 --- a/C/sysbits.c +++ b/C/sysbits.c @@ -477,8 +477,12 @@ InitTime (int wid) Times_last_time = TimesStartOfTimes = t; } else { #if THREADS + REMOTE_ThreadHandle(wid).start_of_timesp = (struct _FILETIME *)malloc(sizeof(FILETIME)); + REMOTE_ThreadHandle(wid).last_timep = (struct _FILETIME *)malloc(sizeof(FILETIME)); + REMOTE_ThreadHandle(wid).start_of_times_sysp = (struct _FILETIME *)malloc(sizeof(FILETIME)); + REMOTE_ThreadHandle(wid).last_time_sysp = (struct _FILETIME *)malloc(sizeof(FILETIME)); (*REMOTE_ThreadHandle(wid).last_timep).dwLowDateTime = - UserTime.dwLowDateTime;pp + UserTime.dwLowDateTime; (*REMOTE_ThreadHandle(wid).last_timep).dwHighDateTime = UserTime.dwHighDateTime; (*REMOTE_ThreadHandle(wid).start_of_timesp).dwLowDateTime = @@ -1494,8 +1498,8 @@ STATIC_PROTO (void my_signal, (int, void (*)(int))); static RETSIGTYPE HandleMatherr(int sig) { -#if HAVE_FETESTEXCEPT CACHE_REGS +#if HAVE_FETESTEXCEPT /* This should work in Linux, but it doesn't seem to. */ int raised = fetestexcept(FE_ALL_EXCEPT); diff --git a/H/Yap.h b/H/Yap.h index 910a8b8ef..a77e3d4c1 100755 --- a/H/Yap.h +++ b/H/Yap.h @@ -746,11 +746,16 @@ typedef struct thandle { #endif pthread_mutex_t tlock; pthread_mutex_t tlock_status; -#if HAVE_GETRUSAGE||defined(_WIN32) +#if HAVE_GETRUSAGE struct timeval *start_of_timesp; struct timeval *last_timep; struct timeval *start_of_times_sysp; struct timeval *last_time_sysp; +#elif _WIN32 + struct _FILETIME *start_of_timesp; + struct _FILETIME *last_timep; + struct _FILETIME *start_of_times_sysp; + struct _FILETIME *last_time_sysp; #endif } yap_thandle; #endif /* THREADS */ From cb37e7714a56641a7b882819f0d2bf056281e253 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 20 Dec 2012 21:13:51 +0000 Subject: [PATCH 07/12] fix warnings --- C/adtdefs.c | 2 -- C/amasm.c | 1 - C/dbase.c | 1 - C/gprof.c | 2 +- C/index.c | 1 - C/qlyr.c | 2 -- C/qlyw.c | 2 -- 7 files changed, 1 insertion(+), 10 deletions(-) mode change 100644 => 100755 C/adtdefs.c mode change 100644 => 100755 C/amasm.c mode change 100644 => 100755 C/dbase.c mode change 100644 => 100755 C/gprof.c mode change 100644 => 100755 C/index.c mode change 100644 => 100755 C/qlyr.c mode change 100644 => 100755 C/qlyw.c diff --git a/C/adtdefs.c b/C/adtdefs.c old mode 100644 new mode 100755 index 9ec4c8fab..30f404c9f --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -771,7 +771,6 @@ ExpandPredHash(void) Prop Yap_NewPredPropByFunctor(FunctorEntry *fe, Term cur_mod) { - CACHE_REGS PredEntry *p = (PredEntry *) Yap_AllocAtomSpace(sizeof(*p)); if (p == NULL) { @@ -907,7 +906,6 @@ Yap_NewThreadPred(PredEntry *ap USES_REGS) Prop Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod) { - CACHE_REGS Prop p0; PredEntry *p = (PredEntry *) Yap_AllocAtomSpace(sizeof(*p)); diff --git a/C/amasm.c b/C/amasm.c old mode 100644 new mode 100755 index e160d7f8d..62223ed11 --- a/C/amasm.c +++ b/C/amasm.c @@ -2050,7 +2050,6 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod yamop *newcp; /* emit a special instruction and then a label for backpatching */ if (pass_no) { - CACHE_REGS UInt size = (UInt)NEXTOP((yamop *)NULL,OtaLl); if ((newcp = (yamop *)Yap_AllocCodeSpace(size)) == NULL) { /* OOOPS, got in trouble, must do a longjmp and recover space */ diff --git a/C/dbase.c b/C/dbase.c old mode 100644 new mode 100755 index 90fc7cb4d..69cf50f9c --- a/C/dbase.c +++ b/C/dbase.c @@ -1887,7 +1887,6 @@ Yap_new_ludbe(Term t, PredEntry *pe, UInt nargs) static LogUpdClause * record_lu(PredEntry *pe, Term t, int position) { - CACHE_REGS LogUpdClause *cl; if ((cl = new_lu_db_entry(t, pe)) == NULL) { diff --git a/C/gprof.c b/C/gprof.c old mode 100644 new mode 100755 index 80352eb9e..19642cded --- a/C/gprof.c +++ b/C/gprof.c @@ -1177,8 +1177,8 @@ static Int profres0( USES_REGS1 ) { void Yap_InitLowProf(void) { - CACHE_REGS #if LOW_PROF + CACHE_REGS LOCAL_ProfCalls = 0; LOCAL_ProfilerOn = FALSE; diff --git a/C/index.c b/C/index.c old mode 100644 new mode 100755 index 8e2c717b2..b7b65e7f8 --- a/C/index.c +++ b/C/index.c @@ -1888,7 +1888,6 @@ emit_single_switch_case(ClauseDef *min, struct intermediates *cint, int first, i static UInt suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermediates *cint) { - CACHE_REGS UInt tcls = ap->cs.p_code.NOfClauses; UInt cls = (max-min)+1; diff --git a/C/qlyr.c b/C/qlyr.c old mode 100644 new mode 100755 index a0a802ae3..5c473b718 --- a/C/qlyr.c +++ b/C/qlyr.c @@ -961,7 +961,6 @@ read_ops(IOSTREAM *stream) { static void read_module(IOSTREAM *stream) { - CACHE_REGS qlf_tag_t x; InitHash(); @@ -1045,7 +1044,6 @@ p_read_program( USES_REGS1 ) int Yap_Restore(char *s, char *lib_dir) { - CACHE_REGS IOSTREAM *stream = Yap_OpenRestore(s, lib_dir); if (!stream) return -1; diff --git a/C/qlyw.c b/C/qlyw.c old mode 100644 new mode 100755 index b00b923fb..0bde3d2e6 --- a/C/qlyw.c +++ b/C/qlyw.c @@ -765,7 +765,6 @@ save_ops(IOSTREAM *stream, Term mod) { static size_t save_module(IOSTREAM *stream, Term mod) { - CACHE_REGS PredEntry *ap = Yap_ModulePred(mod); InitHash(); ModuleAdjust(mod); @@ -803,7 +802,6 @@ save_header(IOSTREAM *stream) static size_t save_program(IOSTREAM *stream) { - CACHE_REGS ModEntry *me = CurrentModules; InitHash(); From 4098b9b964ce6a4a562da34691739b0aa58a3f84 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 20 Dec 2012 21:15:01 +0000 Subject: [PATCH 08/12] fix compilation MT in win32 --- packages/prism/src/c/Makefile.in | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 packages/prism/src/c/Makefile.in diff --git a/packages/prism/src/c/Makefile.in b/packages/prism/src/c/Makefile.in old mode 100644 new mode 100755 index b3d80ef7b..70268027a --- a/packages/prism/src/c/Makefile.in +++ b/packages/prism/src/c/Makefile.in @@ -71,7 +71,7 @@ mp/%.o: $(srcdir)/mp/%.c $(CC) -c $(CFLAGS) $< -o $@ @DO_SECOND_LD@prism.@SO@: $(OBJS) -@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@ +@DO_SECOND_LD@ @SHLIB_LD@ $(LDFLAGS) -o $@ $(OBJS) @EXTRA_LIBS_FOR_DLLS@ @CLIB_PTHREADS@ all: $(TARGETS) From ebb239b2335fd0c517216a4ec4c63217b9ca6c5c Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Thu, 20 Dec 2012 21:15:26 +0000 Subject: [PATCH 09/12] uninst error --- os/pl-error.c | 5 +++++ 1 file changed, 5 insertions(+) mode change 100644 => 100755 os/pl-error.c diff --git a/os/pl-error.c b/os/pl-error.c old mode 100644 new mode 100755 index f3eb2f63b..8587a9198 --- a/os/pl-error.c +++ b/os/pl-error.c @@ -204,6 +204,11 @@ PL_instantiation_error(term_t actual) { return PL_error(NULL, 0, NULL, ERR_INSTANTIATION); } +int +PL_uninstantiation_error(term_t actual) +{ return PL_error(NULL, 0, NULL, ERR_UNINSTANTIATION, 0, actual); +} + int PL_representation_error(const char *resource) { atom_t r = PL_new_atom(resource); From 0ac9f6f4367bdfc7901bd88820a87895149ee750 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 20 Dec 2012 21:17:23 +0000 Subject: [PATCH 10/12] propagate changes --- configure | 251 ++++++++++++++++++++++++++++-------------------------- 1 file changed, 128 insertions(+), 123 deletions(-) diff --git a/configure b/configure index 509f2e2a8..40c53d5e3 100755 --- a/configure +++ b/configure @@ -1,11 +1,9 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.68. +# Generated by GNU Autoconf 2.69. # # -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, -# 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free Software -# Foundation, Inc. +# Copyright (C) 1992-1996, 1998-2012 Free Software Foundation, Inc. # # # This configure script is free software; the Free Software Foundation @@ -134,6 +132,31 @@ export LANGUAGE # CDPATH. (unset CDPATH) >/dev/null 2>&1 && unset CDPATH +# Use a proper internal environment variable to ensure we don't fall + # into an infinite loop, continuously re-executing ourselves. + if test x"${_as_can_reexec}" != xno && test "x$CONFIG_SHELL" != x; then + _as_can_reexec=no; export _as_can_reexec; + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +as_fn_exit 255 + fi + # We don't want this to propagate to other subprocesses. + { _as_can_reexec=; unset _as_can_reexec;} if test "x$CONFIG_SHELL" = x; then as_bourne_compatible="if test -n \"\${ZSH_VERSION+set}\" && (emulate sh) >/dev/null 2>&1; then : emulate sh @@ -167,7 +190,8 @@ if ( set x; as_fn_ret_success y && test x = \"\$1\" ); then : else exitcode=1; echo positional parameters were not saved. fi -test x\$exitcode = x0 || exit 1" +test x\$exitcode = x0 || exit 1 +test -x / || exit 1" as_suggested=" as_lineno_1=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_1a=\$LINENO as_lineno_2=";as_suggested=$as_suggested$LINENO;as_suggested=$as_suggested" as_lineno_2a=\$LINENO eval 'test \"x\$as_lineno_1'\$as_run'\" != \"x\$as_lineno_2'\$as_run'\" && @@ -212,21 +236,25 @@ IFS=$as_save_IFS if test "x$CONFIG_SHELL" != x; then : - # We cannot yet assume a decent shell, so we have to provide a - # neutralization value for shells without unset; and this also - # works around shells that cannot unset nonexistent variables. - # Preserve -v and -x to the replacement shell. - BASH_ENV=/dev/null - ENV=/dev/null - (unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV - export CONFIG_SHELL - case $- in # (((( - *v*x* | *x*v* ) as_opts=-vx ;; - *v* ) as_opts=-v ;; - *x* ) as_opts=-x ;; - * ) as_opts= ;; - esac - exec "$CONFIG_SHELL" $as_opts "$as_myself" ${1+"$@"} + export CONFIG_SHELL + # We cannot yet assume a decent shell, so we have to provide a +# neutralization value for shells without unset; and this also +# works around shells that cannot unset nonexistent variables. +# Preserve -v and -x to the replacement shell. +BASH_ENV=/dev/null +ENV=/dev/null +(unset BASH_ENV) >/dev/null 2>&1 && unset BASH_ENV ENV +case $- in # (((( + *v*x* | *x*v* ) as_opts=-vx ;; + *v* ) as_opts=-v ;; + *x* ) as_opts=-x ;; + * ) as_opts= ;; +esac +exec $CONFIG_SHELL $as_opts "$as_myself" ${1+"$@"} +# Admittedly, this is quite paranoid, since all the known shells bail +# out after a failed `exec'. +$as_echo "$0: could not re-execute with $CONFIG_SHELL" >&2 +exit 255 fi if test x$as_have_required = xno; then : @@ -328,6 +356,14 @@ $as_echo X"$as_dir" | } # as_fn_mkdir_p + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p # as_fn_append VAR VALUE # ---------------------- # Append the text in VALUE to the end of the definition contained in VAR. Take @@ -449,6 +485,10 @@ as_cr_alnum=$as_cr_Letters$as_cr_digits chmod +x "$as_me.lineno" || { $as_echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2; as_fn_exit 1; } + # If we had to re-execute with $CONFIG_SHELL, we're ensured to have + # already done that, so ensure we don't try to do so again and fall + # in an infinite loop. This has already happened in practice. + _as_can_reexec=no; export _as_can_reexec # Don't try to exec as it changes $[0], causing all sort of problems # (the dirname of $[0] is not the place where we might find the # original and so on. Autoconf is especially sensitive to this). @@ -483,16 +523,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -504,28 +544,8 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -617,6 +637,7 @@ ZLIB_TARGETS ZLIBS MAILDROP_CFLAGS RFC2045CHARSET +EXTRA_LIBS_FOR_SWIDLLS CLIB_CRYPTLIBS CLIB_NETLIBS CLIB_PLTARGETS @@ -686,7 +707,6 @@ YAP_EXTRAS SONAMEFLAG DYNYAPLIB YAPLIB -EXTRA_LIBS_FOR_SWIDLLS EXTRA_LIBS_FOR_DLLS YAPLIB_CFLAGS YAPLIB_LD @@ -1315,8 +1335,6 @@ target=$target_alias if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe - $as_echo "$as_me: WARNING: if you wanted to set the --build type, don't use --host. - If a cross compiler is detected then cross compile mode will be used" >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi @@ -1607,9 +1625,9 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF configure -generated by GNU Autoconf 2.68 +generated by GNU Autoconf 2.69 -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. _ACEOF @@ -1920,7 +1938,7 @@ $as_echo "$ac_try_echo"; } >&5 test ! -s conftest.err } && test -s conftest$ac_exeext && { test "$cross_compiling" = yes || - $as_test_x conftest$ac_exeext + test -x conftest$ac_exeext }; then : ac_retval=0 else @@ -2023,7 +2041,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2039,7 +2058,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2065,7 +2085,8 @@ int main () { static int test_array [1 - 2 * !(($2) < 0)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2081,7 +2102,8 @@ int main () { static int test_array [1 - 2 * !(($2) >= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2115,7 +2137,8 @@ int main () { static int test_array [1 - 2 * !(($2) <= $ac_mid)]; -test_array [0] = 0 +test_array [0] = 0; +return test_array [0]; ; return 0; @@ -2299,7 +2322,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was $ $0 $@ @@ -2675,7 +2698,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2715,7 +2738,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="gcc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2768,7 +2791,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="${ac_tool_prefix}cc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2809,7 +2832,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue @@ -2867,7 +2890,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CC="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -2911,7 +2934,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CC="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3357,8 +3380,7 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ #include #include -#include -#include +struct stat; /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); @@ -3471,7 +3493,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3515,7 +3537,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_CXX="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -3718,7 +3740,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AWK="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -4068,7 +4090,7 @@ do for ac_prog in grep ggrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue + as_fn_executable_p "$ac_path_GREP" || continue # Check for GNU ac_path_GREP and select it if it is found. # Check for GNU $ac_path_GREP case `"$ac_path_GREP" --version 2>&1` in @@ -4134,7 +4156,7 @@ do for ac_prog in egrep; do for ac_exec_ext in '' $ac_executable_extensions; do ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext" - { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue + as_fn_executable_p "$ac_path_EGREP" || continue # Check for GNU ac_path_EGREP and select it if it is found. # Check for GNU $ac_path_EGREP case `"$ac_path_EGREP" --version 2>&1` in @@ -5256,7 +5278,7 @@ case $as_dir/ in #(( # by default. for ac_prog in ginstall scoinst install; do for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_prog$ac_exec_ext"; then if test $ac_prog = install && grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then # AIX install. It has an incompatible calling convention. @@ -5329,7 +5351,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5369,7 +5391,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_RANLIB="ranlib" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5421,7 +5443,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_INDENT="${ac_tool_prefix}indent" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5461,7 +5483,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_INDENT="indent" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5513,7 +5535,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_AR="${ac_tool_prefix}ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5553,7 +5575,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_AR="ar" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5605,7 +5627,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_MPI_CC="${ac_tool_prefix}mpicc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5645,7 +5667,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_ac_ct_MPI_CC="mpicc" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5699,7 +5721,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_INSTALL_INFO="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -5740,7 +5762,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_path_SHELL="$as_dir/$ac_word$ac_exec_ext" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6730,7 +6752,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_REXE="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6851,7 +6873,7 @@ do IFS=$as_save_IFS test -z "$as_dir" && as_dir=. for ac_exec_ext in '' $ac_executable_extensions; do - if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then + if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then ac_cv_prog_PYTHON="$ac_prog" $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5 break 2 @@ -6882,7 +6904,6 @@ test -n "$PYTHON" || PYTHON=""none"" PYTHONHOME=`$PYTHON -c'import sys; print sys.prefix'` PYTHONVERSION=`"$PYTHON" -c "import sys; print sys.version[:3]"` PYTHON_LIBS="-L $PYTHONHOME/lib -lpython$PYTHONVERSION" - LIBS="$LIBS $PYTHON_LIBS" PYTHON_INCLUDES="-I $PYTHONHOME/include/python$PYTHONVERSION" else PYTHON_TARGET="dummy" @@ -7658,11 +7679,7 @@ elif test -e "$srcdir"/packages/jpl/Makefile.in; then JAVA_HOME="$yap_cv_java" case "$target_os" in *cygwin*|*mingw*) - if test $threads = yes; then - JAVALIBS="\"$JAVA_HOME\"/lib/jvm.lib -lpthread" - else - JAVALIBS="\"$JAVA_HOME\"/lib/jvm.lib" - fi + JAVALIBS="\"$JAVA_HOME\"/lib/jvm.lib" JPLCFLAGS="-I\"$JAVA_HOME\"/include -I\"$JAVA_HOME\"/include/win32" ;; *darwin*) @@ -8425,8 +8442,6 @@ fi ;; esac -EXTRA_LIBS_FOR_SWIDLLS="$EXTRA_LIBS_FOR_DLLS" - if test "$dynamic_loading" = "yes" then YAPLIB_CFLAGS="$SHLIB_CFLAGS" @@ -9702,7 +9717,6 @@ CMDEXT=sh - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for gcc threaded code" >&5 @@ -10806,6 +10820,9 @@ _ACEOF fi +EXTRA_LIBS_FOR_SWIDLLS="$EXTRA_LIBS_FOR_DLLS $CLIB_PTHREADS" + + { $as_echo "$as_me:${as_lineno-$LINENO}: checking \"variable timezone in tzset\"" >&5 $as_echo_n "checking \"variable timezone in tzset\"... " >&6; } @@ -11832,16 +11849,16 @@ if (echo >conf$$.file) 2>/dev/null; then # ... but there are two gotchas: # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail. # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable. - # In both cases, we have to default to `cp -p'. + # In both cases, we have to default to `cp -pR'. ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe || - as_ln_s='cp -p' + as_ln_s='cp -pR' elif ln conf$$.file conf$$ 2>/dev/null; then as_ln_s=ln else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi else - as_ln_s='cp -p' + as_ln_s='cp -pR' fi rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file rmdir conf$$.dir 2>/dev/null @@ -11901,28 +11918,16 @@ else as_mkdir_p=false fi -if test -x / >/dev/null 2>&1; then - as_test_x='test -x' -else - if ls -dL / >/dev/null 2>&1; then - as_ls_L_option=L - else - as_ls_L_option= - fi - as_test_x=' - eval sh -c '\'' - if test -d "$1"; then - test -d "$1/."; - else - case $1 in #( - -*)set "./$1";; - esac; - case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in #(( - ???[sx]*):;;*)false;;esac;fi - '\'' sh - ' -fi -as_executable_p=$as_test_x + +# as_fn_executable_p FILE +# ----------------------- +# Test if FILE is an executable regular file. +as_fn_executable_p () +{ + test -f "$1" && test -x "$1" +} # as_fn_executable_p +as_test_x='test -x' +as_executable_p=as_fn_executable_p # Sed expression to map a string onto a valid CPP name. as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" @@ -11944,7 +11949,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1 # values after options handling. ac_log=" This file was extended by $as_me, which was -generated by GNU Autoconf 2.68. Invocation command line was +generated by GNU Autoconf 2.69. Invocation command line was CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS @@ -12006,10 +12011,10 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`" ac_cs_version="\\ config.status -configured by $0, generated by GNU Autoconf 2.68, +configured by $0, generated by GNU Autoconf 2.69, with options \\"\$ac_cs_config\\" -Copyright (C) 2010 Free Software Foundation, Inc. +Copyright (C) 2012 Free Software Foundation, Inc. This config.status script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it." @@ -12099,7 +12104,7 @@ fi _ACEOF cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 if \$ac_cs_recheck; then - set X '$SHELL' '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion + set X $SHELL '$0' $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion shift \$as_echo "running CONFIG_SHELL=$SHELL \$*" >&6 CONFIG_SHELL='$SHELL' From 14b67dc76db1fe0f44642b83749785c7e90fa91b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 20 Dec 2012 21:33:20 +0000 Subject: [PATCH 11/12] fix threads --- C/adtdefs.c | 18 ++++++++++++------ C/amasm.c | 5 ++++- C/dbase.c | 11 +++++++---- C/exec.c | 2 +- C/index.c | 5 ++++- 5 files changed, 28 insertions(+), 13 deletions(-) diff --git a/C/adtdefs.c b/C/adtdefs.c index 30f404c9f..922001d91 100755 --- a/C/adtdefs.c +++ b/C/adtdefs.c @@ -851,9 +851,12 @@ Yap_NewPredPropByFunctor(FunctorEntry *fe, Term cur_mod) } p->FunctorOfPred = fe; WRITE_UNLOCK(fe->FRWLock); - Yap_inform_profiler_of_clause(&(p->OpcodeOfPred), &(p->OpcodeOfPred)+1, p, GPROF_NEW_PRED_FUNC); - if (!(p->PredFlags & (CPredFlag|AsmPredFlag))) { - Yap_inform_profiler_of_clause(&(p->cs.p_code.ExpandCode), &(p->cs.p_code.ExpandCode)+1, p, GPROF_NEW_PRED_FUNC); + { + CACHE_REGS + Yap_inform_profiler_of_clause(&(p->OpcodeOfPred), &(p->OpcodeOfPred)+1, p, GPROF_NEW_PRED_FUNC); + if (!(p->PredFlags & (CPredFlag|AsmPredFlag))) { + Yap_inform_profiler_of_clause(&(p->cs.p_code.ExpandCode), &(p->cs.p_code.ExpandCode)+1, p, GPROF_NEW_PRED_FUNC); + } } return AbsPredProp(p); } @@ -962,9 +965,12 @@ Yap_NewPredPropByAtom(AtomEntry *ae, Term cur_mod) p0 = AbsPredProp(p); p->FunctorOfPred = (Functor)AbsAtom(ae); WRITE_UNLOCK(ae->ARWLock); - Yap_inform_profiler_of_clause(&(p->OpcodeOfPred), &(p->OpcodeOfPred)+1, p, GPROF_NEW_PRED_ATOM); - if (!(p->PredFlags & (CPredFlag|AsmPredFlag))) { - Yap_inform_profiler_of_clause(&(p->cs.p_code.ExpandCode), &(p->cs.p_code.ExpandCode)+1, p, GPROF_NEW_PRED_ATOM); + { + CACHE_REGS + Yap_inform_profiler_of_clause(&(p->OpcodeOfPred), &(p->OpcodeOfPred)+1, p, GPROF_NEW_PRED_ATOM); + if (!(p->PredFlags & (CPredFlag|AsmPredFlag))) { + Yap_inform_profiler_of_clause(&(p->cs.p_code.ExpandCode), &(p->cs.p_code.ExpandCode)+1, p, GPROF_NEW_PRED_ATOM); + } } return p0; } diff --git a/C/amasm.c b/C/amasm.c index 62223ed11..7bd09e56c 100755 --- a/C/amasm.c +++ b/C/amasm.c @@ -2056,7 +2056,10 @@ a_try(op_numbers opcode, CELL lab, CELL opr, int nofalts, int hascut, yamop *cod save_machine_regs(); siglongjmp(cip->CompilerBotch,2); } - Yap_inform_profiler_of_clause(newcp, (char *)(newcp)+size, ap, GPROF_INDEX); + { + CACHE_REGS + Yap_inform_profiler_of_clause(newcp, (char *)(newcp)+size, ap, GPROF_INDEX); + } Yap_LUIndexSpace_CP += size; #ifdef DEBUG Yap_NewCps++; diff --git a/C/dbase.c b/C/dbase.c index 69cf50f9c..99438d338 100755 --- a/C/dbase.c +++ b/C/dbase.c @@ -1892,7 +1892,10 @@ record_lu(PredEntry *pe, Term t, int position) if ((cl = new_lu_db_entry(t, pe)) == NULL) { return NULL; } - Yap_inform_profiler_of_clause(cl, (char *)cl+cl->ClSize, pe, GPROF_NEW_LU_CLAUSE); + { + CACHE_REGS + Yap_inform_profiler_of_clause(cl, (char *)cl+cl->ClSize, pe, GPROF_NEW_LU_CLAUSE); + } Yap_add_logupd_clause(pe, cl, (position == MkFirst ? 2 : 0)); return cl; } @@ -4429,7 +4432,7 @@ p_increase_reference_counter( USES_REGS1 ) cl = (LogUpdClause *)DBRefOfTerm(t1); PELOCK(67,cl->ClPred); cl->ClRefCount++; - UNLOCK(cl->ClPred); + UNLOCK(cl->ClPred->PELock); return TRUE; } @@ -4452,10 +4455,10 @@ p_decrease_reference_counter( USES_REGS1 ) PELOCK(67,cl->ClPred); if (cl->ClRefCount) { cl->ClRefCount--; - UNLOCK(cl->ClPred); + UNLOCK(cl->ClPred->PELock); return TRUE; } - UNLOCK(cl->ClPred); + UNLOCK(cl->ClPred->PELock); return FALSE; } diff --git a/C/exec.c b/C/exec.c index c4c8628d0..6befeace0 100644 --- a/C/exec.c +++ b/C/exec.c @@ -1736,7 +1736,7 @@ Yap_InitYaamRegs( int myworker_id ) Yap_ResetExceptionTerm ( myworker_id ); Yap_PutValue (AtomBreak, MkIntTerm (0)); TR = (tr_fr_ptr)REMOTE_TrailBase(myworker_id); - H = H0 = ((CELL *) REMOTE_GlobalBase(myworker_id))+1; + H = H0 = ((CELL *) REMOTE_GlobalBase(myworker_id))+1; // +1: hack to ensure the gc does not try to mark mistakenly LCL0 = ASP = (CELL *) REMOTE_LocalBase(myworker_id); CurrentTrailTop = (tr_fr_ptr)(REMOTE_TrailTop(myworker_id)-MinTrailGap); /* notice that an initial choice-point and environment diff --git a/C/index.c b/C/index.c index b7b65e7f8..252d56409 100755 --- a/C/index.c +++ b/C/index.c @@ -1923,7 +1923,10 @@ suspend_indexing(ClauseDef *min, ClauseDef *max, PredEntry *ap, struct intermedi } else { Yap_IndexSpace_EXT += sz; } - Yap_inform_profiler_of_clause(ncode, (CODEADDR)ncode+sz, ap, GPROF_NEW_EXPAND_BLOCK); + { + CACHE_REGS + Yap_inform_profiler_of_clause(ncode, (CODEADDR)ncode+sz, ap, GPROF_NEW_EXPAND_BLOCK); + } /* create an expand_block */ ncode->opc = Yap_opcode(_expand_clauses); ncode->u.sssllp.p = ap; From 3565a01f1eb3ddabfb3be4a8f59a6f687499a651 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Thu, 20 Dec 2012 21:41:06 +0000 Subject: [PATCH 12/12] upstream --- packages/real | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/real b/packages/real index 29a8436d8..4452ed66c 160000 --- a/packages/real +++ b/packages/real @@ -1 +1 @@ -Subproject commit 29a8436d86886cf932a790a013cfcf10240c68c8 +Subproject commit 4452ed66c995b13258d74144d64a9d9425f22e77