support dynamic loading

fix save to leave module user in boot.


git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@468 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-05-14 18:21:33 +00:00
parent e0a80c43c5
commit 757f5147c9
2 changed files with 16 additions and 3 deletions

View File

@ -456,7 +456,7 @@ mycb: $(srcdir)/mycb.c
startup: yap $(PL_SOURCES) startup: yap $(PL_SOURCES)
-rm -f startup -rm -f startup
echo "['$(srcdir)/pl/init.yap']. save_program(startup)." | @CROSS_SIMULATOR@ ./yap -b $(srcdir)/pl/boot.yap echo "['$(srcdir)/pl/init.yap']. module(user). save_program(startup)." | @CROSS_SIMULATOR@ ./yap -b $(srcdir)/pl/boot.yap
yap: $(HEADERS) yap.o @YAPLIB@ yap: $(HEADERS) yap.o @YAPLIB@
$(MPI_CC) $(STANDARD_CFLAGS) $(LDFLAGS) -o yap yap.o @YAPLIB@ $(LIBS) @MPI_LIBS@ $(MPI_CC) $(STANDARD_CFLAGS) $(LDFLAGS) -o yap yap.o @YAPLIB@ $(LIBS) @MPI_LIBS@
@ -466,6 +466,9 @@ libYap.a: $(LIB_OBJECTS)
$(AR) rc libYap.a $(LIB_OBJECTS) $(AR) rc libYap.a $(LIB_OBJECTS)
$(RANLIB) libYap.a $(RANLIB) libYap.a
@DO_SECOND_LD@libYap@SHLIB_SUFFIX@: $(LIB_OBJECTS)
@DO_SECOND_LD@ @SHLIB_LD@ -o libYap@SHLIB_SUFFIX@ $(LIB_OBJECTS) $(LIBS)
install: install_bin install_data install: install_bin install_data
install_bin: @INSTALL_COMMAND@ install_bin: @INSTALL_COMMAND@
@ -497,7 +500,7 @@ install_win32: startup
(cd library/system; make install_win32) (cd library/system; make install_win32)
(cd library/random; make install_win32) (cd library/random; make install_win32)
install_library: libYap.a install_library: @YAPLIB@
$(INSTALL_DATA) libYap.a $(DESTDIR)$(LIBDIR)/libYap.a $(INSTALL_DATA) libYap.a $(DESTDIR)$(LIBDIR)/libYap.a
mkdir -p $(DESTDIR)$(INCLUDEDIR) mkdir -p $(DESTDIR)$(INCLUDEDIR)
for h in $(HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done for h in $(HEADERS); do $(INSTALL) $$h $(DESTDIR)$(INCLUDEDIR); done

View File

@ -45,6 +45,9 @@ AC_ARG_ENABLE(debug-yap,
AC_ARG_ENABLE(cygwin, AC_ARG_ENABLE(cygwin,
[ --enable-cygwin use cygwin library in WIN32 ], [ --enable-cygwin use cygwin library in WIN32 ],
cygwin="$enableval", cygwin=no) cygwin="$enableval", cygwin=no)
AC_ARG_ENABLE(dynamic_loading,
[ --enable-dynamic-loading compile Yap as a DLL ],
dynamic_loading="$enableval", dynamic_loading=no)
AC_ARG_WITH(gmp, AC_ARG_WITH(gmp,
[ --with-gmp[=DIR] use GNU Multiple Precision in DIR], [ --with-gmp[=DIR] use GNU Multiple Precision in DIR],
@ -371,7 +374,6 @@ INSTALL_DLLS="#"
SHLIB_LD="@#" SHLIB_LD="@#"
DO_SECOND_LD="#" DO_SECOND_LD="#"
NEWSHOBJ="sobjs" NEWSHOBJ="sobjs"
YAPLIB="libYap.a"
M4="m4" M4="m4"
case $target_os in case $target_os in
@ -501,6 +503,14 @@ case $target_os in
;; ;;
esac esac
if test "$dynamic_loading" = "yes"
then
YAP_EXTRAS="$SHLIB_CFLAGS $YAP_EXTRAS"
YAPLIB=libYap"$SHLIB_SUFFIX"
else
YAPLIB="libYap.a"
fi
if test "$coroutining" = "yes" if test "$coroutining" = "yes"
then then
YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1" YAP_EXTRAS="$YAP_EXTRAS -DCOROUTINING=1"