From 8385f4bea68e141ccddacd778ee1861838e3b3f8 Mon Sep 17 00:00:00 2001 From: Vitor Santos Costa Date: Sat, 2 May 2009 14:06:24 -0500 Subject: [PATCH] saved state should be startup.yss, not startup.yss, in case YAP looks up saved state in current directory (obs from Ulrich Neumerkel). --- C/save.c | 4 ++-- Makefile.in | 26 ++++++++++---------------- README.nt | 2 +- docs/yap.tex | 4 ++-- misc/tkyap | 2 +- misc/yap.nsi | 4 ++-- 6 files changed, 18 insertions(+), 24 deletions(-) diff --git a/C/save.c b/C/save.c index d392f8198..d363c80b2 100644 --- a/C/save.c +++ b/C/save.c @@ -56,7 +56,7 @@ static char SccsId[] = "@(#)save.c 1.3 3/15/90"; /********* hack for accesing several kinds of terms. Should be cleaned **/ -static char StartUpFile[] = "startup"; +static char StartUpFile[] = "startup.yss"; static char end_msg[256] ="*** End of YAP saved state *****"; @@ -1537,7 +1537,7 @@ OpenRestore(char *inpf, char *YapLibDir, CELL *Astate, CELL *ATrail, CELL *AStac } /* now, this is a possible location for the ROOT_DIR, let's look for a share directory here */ pt[1] = '\0'; - strncat(Yap_FileNameBuf,"lib/Yap/startup",YAP_FILENAME_MAX); + strncat(Yap_FileNameBuf,"lib/Yap/startup.yss",YAP_FILENAME_MAX); } if ((splfild = open_file(Yap_FileNameBuf, O_RDONLY)) > 0) { if ((mode = commit_to_saved_state(Yap_FileNameBuf,Astate,ATrail,AStack,AHeap)) != FAIL_RESTORE) { diff --git a/Makefile.in b/Makefile.in index 40958adf6..2d47ec521 100644 --- a/Makefile.in +++ b/Makefile.in @@ -274,7 +274,7 @@ OBJECTS = yap.o $(LIB_OBJECTS) -all: Makefile startup +all: Makefile startup.yss Makefile: $(srcdir)/Makefile.in @@ -375,12 +375,6 @@ tab.tries.o: $(srcdir)/OPTYap/tab.tries.c tab.suspend.o: $(srcdir)/OPTYap/tab.suspend.c $(CC) -c $(CFLAGS) $(srcdir)/OPTYap/tab.suspend.c -o $@ -mpi.o: $(srcdir)/library/mpi/mpi.c - $(MPI_CC) -c $(CFLAGS) $(srcdir)/library/mpi/mpi.c -o $@ - -mpe.o: $(srcdir)/library/mpi/mpe.c - $(MPI_CC) -c $(CFLAGS) $(srcdir)/library/mpi/mpe.c -o $@ - eam_showcode.o: $(srcdir)/BEAM/eam_showcode.c $(CC) -c $(CFLAGS) $(srcdir)/BEAM/eam_showcode.c -o $@ @@ -437,7 +431,7 @@ 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 +all: startup.yss @INSTALL_DLLS@ (cd library/random; $(MAKE)) @INSTALL_DLLS@ (cd library/regex; $(MAKE)) @INSTALL_DLLS@ (cd library/rltree; $(MAKE)) @@ -453,9 +447,9 @@ all: startup @ENABLE_CPLINT@ (cd cplint; $(MAKE)) @USE_CUDD@ (cd packages/ProbLog/simplecudd; $(MAKE)) -startup: yap@EXEC_SUFFIX@ $(PL_SOURCES) - -rm -f startup - echo "bootstrap('$(srcdir)/pl/init.yap'). module(user). save_program(startup)." | @PRE_DYNLOADER_PATH@ ./yap -b $(srcdir)/pl/boot.yap +startup.yss: yap@EXEC_SUFFIX@ $(PL_SOURCES) + -rm -f startup.yss + echo "bootstrap('$(srcdir)/pl/init.yap'). module(user). save_program('startup.yss')." | @PRE_DYNLOADER_PATH@ ./yap -b $(srcdir)/pl/boot.yap yap@EXEC_SUFFIX@: $(HEADERS) yap.o @YAPLIB@ $(MPI_CC) $(STANDARD_CFLAGS) $(LDFLAGS) -o yap yap.o @YAPLIB@ $(LIBS) @MPI_LIBS@ @@ -472,11 +466,11 @@ install: install_bin install_data install_bin: @INSTALL_COMMAND@ -install_unix: startup libYap.a +install_unix: startup.yss libYap.a mkdir -p $(DESTDIR)$(BINDIR) $(INSTALL_PROGRAM) -m 755 yap@EXEC_SUFFIX@ $(DESTDIR)$(BINDIR)/yap mkdir -p $(DESTDIR)$(YAPLIBDIR) - $(INSTALL_DATA) startup $(DESTDIR)$(YAPLIBDIR)/startup + $(INSTALL_DATA) startup.yss $(DESTDIR)$(YAPLIBDIR)/startup.yss @INSTALL_DLLS@ $(INSTALL_DATA) -m 755 @YAPLIB@ $(DESTDIR)$(LIBDIR) mkdir -p $(DESTDIR)$(SHAREDIR)/Yap mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl @@ -498,7 +492,7 @@ install_unix: startup libYap.a @USE_CUDD@ (cd packages/ProbLog/simplecudd; $(MAKE) install) -install_win32: startup +install_win32: startup.yss mkdir -p $(DESTDIR)$(BINDIR) mkdir -p $(DESTDIR)$(LIBDIR) mkdir -p $(DESTDIR)$(YAPLIBDIR) @@ -506,7 +500,7 @@ install_win32: startup $(INSTALL_PROGRAM) -m 755 yap.exe $(DESTDIR)$(BINDIR)/yap.exe $(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 + $(INSTALL_PROGRAM) -m 755 startup.yss $(DESTDIR)$(YAPLIBDIR)/startup.yss mkdir -p $(DESTDIR)$(SHAREDIR)/Yap mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/pl mkdir -p $(DESTDIR)$(SHAREDIR)/Yap/swi @@ -577,7 +571,7 @@ clean: clean_docs realclean: clean realclean_docs - rm -f yap@EXEC_SUFFIX@ startup config.log config.cache config.h + rm -f yap@EXEC_SUFFIX@ startup.yss config.log config.cache config.h dist: diff --git a/README.nt b/README.nt index 43a25cafa..4859ff902 100644 --- a/README.nt +++ b/README.nt @@ -141,7 +141,7 @@ o Build the system. o Use Build.Start Debug to boot the system, and then create the saved state with ['$YAPSRC\\pl\\init']. -save_program(startup). +save_program('startup.yss'). ^Z That's it, you've got YAP and the saved state! diff --git a/docs/yap.tex b/docs/yap.tex index 33070c3fa..599b5e4dc 100644 --- a/docs/yap.tex +++ b/docs/yap.tex @@ -817,7 +817,7 @@ $YAPSRC\VC\include, $YAPSRC\include @example ['$YAPSRC\\pl\\init']. -save_program(startup). +save_program('startup.yss'). ^Z @end example @@ -915,7 +915,7 @@ the allocated memory is not enough to restore the state. When restoring a saved state, YAP will allocate the same amount of memory as that in use when the state was saved, unless a different amount is specified by flags in the command line. By default, -YAP restores the file @samp{startup} from the current directory or from +YAP restores the file @samp{startup.yss} from the current directory or from the YAP library. @cindex environment variables diff --git a/misc/tkyap b/misc/tkyap index eeed7f3ae..4f3b9e19e 100644 --- a/misc/tkyap +++ b/misc/tkyap @@ -37,7 +37,7 @@ if {[file exists /vmlinuz]} { } else { set homeyap . } - set PrologCommand "$homeyap/yap $homeyap/startup -c localhost $service $YapOptions" + set PrologCommand "$homeyap/yap $homeyap/startup.yss -c localhost $service $YapOptions" set SolarisBug 0 } else { set PrologCommand "ny -h8000 -s1000" diff --git a/misc/yap.nsi b/misc/yap.nsi index 8edcf5c39..289d551e0 100644 --- a/misc/yap.nsi +++ b/misc/yap.nsi @@ -70,7 +70,7 @@ Section "Base system (required)" SetOutPath $INSTDIR\lib ; SYSTEM STUFF - File c:\Yap\lib\Yap\startup + File c:\Yap\lib\Yap\startup.yss SetOutPath $INSTDIR\share ; SYSTEM STUFF @@ -84,7 +84,7 @@ Section "Base system (required)" File c:\Yap\share\docs\COPYING.TXT WriteRegStr HKLM ${REGKEY} "home" "$INSTDIR" - WriteRegStr HKLM ${REGKEY} "startup" "$INSTDIR\lib\startup" + WriteRegStr HKLM ${REGKEY} "startup" "$INSTDIR\lib\startup.yss" WriteRegStr HKLM ${REGKEY} "library" "$INSTDIR\share" ; Write uninstaller