WIN32 support updates and some fixes.

git-svn-id: https://yap.svn.sf.net/svnroot/yap/trunk@685 b08c6af1-5177-4d33-ba66-4b1c6b8b522a
This commit is contained in:
vsc 2002-11-12 19:53:52 +00:00
parent 9cfd0deeab
commit 81716ef31f
12 changed files with 42 additions and 158 deletions

View File

@ -331,7 +331,7 @@ _YAP_absmi(int inp)
/* YREG =was pointing to where we were going to build the
* next choice-point. The stack shifter will need to know this
* to move the local stack */
if (YREG => (CELL *) B) {
if (YREG > (CELL *) B) {
ASP = (CELL *) B;
}
else {

View File

@ -41,13 +41,13 @@ STATIC_PROTO (void ShowOp, (char *));
* afterwards
*/
#ifdef DEBUG
static Int arg, rn;
static compiler_vm_op ic;
static CELL *cptr;
#ifdef DEBUG
char _YAP_Option[20];
YP_FILE *_YAP_logfile;

View File

@ -4422,17 +4422,17 @@ format(Term tail, Term args, int sno)
if (size_args)
radix = arg_size;
if (IsVarTerm (args)) {
FreeAtomSpace(format_base);
Error(INSTANTIATION_ERROR,args,"~T in format/2");
_YAP_FreeAtomSpace(format_base);
_YAP_Error(INSTANTIATION_ERROR,args,"~T in format/2");
return(FALSE);
} else if (!IsPairTerm (args)) {
FreeAtomSpace(format_base);
Error(TYPE_ERROR_LIST,args,"~T in format/2");
_YAP_FreeAtomSpace(format_base);
_YAP_Error(TYPE_ERROR_LIST,args,"~T in format/2");
return(FALSE);
}
if (radix > 36 || radix < 2) {
FreeAtomSpace(format_base);
Error(DOMAIN_ERROR_RADIX,MkIntTerm(radix),"~T in format/2");
_YAP_FreeAtomSpace(format_base);
_YAP_Error(DOMAIN_ERROR_RADIX,MkIntTerm(radix),"~T in format/2");
return(FALSE);
}
arghd = HeadOfTerm (args);

View File

@ -681,7 +681,7 @@ Macros to check the limits of stacks
#else
#define check_trail() if (Unsigned(TrailTop) - Unsigned(TR) < MinTrailGap) \
#define check_trail() if (Unsigned(_YAP_TrailTop) - Unsigned(TR) < MinTrailGap) \
goto notrailleft
#endif

View File

@ -491,6 +491,7 @@ main (int argc, char **argv)
int BootMode;
YAP_init_args init_args;
fprintf(stderr,"Entering YAP\n");
#ifdef SIMICS
fprintf(stdout,"Entering YAP\n");
#endif /* SIMICS */

View File

@ -671,20 +671,32 @@ CC="gcc -mabi=64" ./configure --...
Be careful. At least for some versions of @code{GCC}, compiling with
@code{-g} seems to result in broken code.
@item WIN32: The cygwin environment is our suggested approach. The
@item WIN32: GCC is distributed in the MINGW32 and CYGWIN packages.
The Mingw32 environment is available from the URL:
@code{http://www.mingw.org}
You will need to install the @code{msys} and @code{mingw}
packages. You should be able to do configure, make and make install.
If you use mingw32 you may want to search the contributed packages for
the @code{gmp} multi-precision arithmetic library. If you do setup Yap
with @code{gmp} note that @code{libgmp.dll} must be in the path,
otherwise Yap will not be able to execute.
CygWin environment is available from the URL:
@code{http://sourceware.cygnus.com}
@code{http://www.cygwin.com}
@noindent
and mirrors. Yap should compile under cygwin 20.1 but we suggest using
the newer 1.1.1 or recent, which has a more complete implementation of
the WIN32 API and uses GCC2.95.2 instead of egcs. The compilation
steps under the cygwin shell are as follows:
and mirrors. We suggest using recent versions of the cygwin shell. The
compilation steps under the cygwin shell are as follows:
@example
mkdir cyg
$YAPSRC/configure --enable-coroutining \\
--enable-depth-limit \\
--enable-max-performance
make
make install
@ -702,7 +714,7 @@ You should check the default installation path which is set to
@code{/PROGRA~1/Yap} in the standard Makefile. This string will usually
be expanded into @code{c:\Program Files\Yap} by Windows.
The cygwin environment does not provide @t{gm}. You can fetch a dll for
The cygwin environment does not provide @t{gmp}. You can fetch a dll for
the @t{gmp} library from @url{http://www.sf.net/projects/mingwrep}.
It is also possible to configure Yap to be a part of the cygwin
@ -715,8 +727,9 @@ $YAPSRC/configure --enable-coroutining \\
make
make install
@end example
Yap will then compile using the cygwin library. You can use Yap from a
cygwin console, or as a standalone application as long as it can fin
Yap will then compile using the cygwin library and will be installed
in cygwin's @code{/usr/local}. You can use Yap from a cygwin console,
or as a standalone application as long as it can find
@code{cygwin1.dll} in its path.
@end table

View File

@ -39,11 +39,7 @@ SOBJS=random@SHLIB_SUFFIX@
#in some systems we just create a single object, in others we need to
# create a libray
all: @NEWSHOBJ@
sobjs: $(SOBJS)
dll: random@SHLIB_SUFFIX@
all: $(SOBJS)
random.o: $(srcdir)/random.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/random.c -o random.o
@ -54,38 +50,9 @@ random.o: $(srcdir)/random.c
@DO_SECOND_LD@random@SHLIB_SUFFIX@: random.o
@DO_SECOND_LD@ @SHLIB_LD@ -o random@SHLIB_SUFFIX@ random.o
#
# create a new DLL library on cygwin environments
#
# DLLNAME: name of the new dll
# OBJS: list of object files I want to put in
# LIBS: list of libraries to link with
# DEFFILE is the name of the definitions file.
# BASEFILE temporary
# EXPFILE temporary
# ENTRY is the entry point int WINAPI startup (HINSTANCE, DWORD, LPVOID)
#
DLLTOOL=dlltool
DLLNAME=random.dll
DLL_LIBS=@DLL_LIBS@ -L../.. -lWYap
BASE_FILE=random.base
EXP_FILE=random.exp
DEF_FILE=$(srcdir)/random.def
ENTRY_FUNCTION=_win_random@12
#
random.dll: $(OBJS)
$(LD) -s --base-file $(BASE_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) -s --base-file $(BASE_FILE) $(EXP_FILE) -dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) $(EXP_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR)
install_win32: dll
$(INSTALL_PROGRAM) -m 755 random.dll $(LIBDIR)/random.dll
clean:
rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK

View File

@ -39,11 +39,7 @@ SOBJS=regexp@SHLIB_SUFFIX@ @NO_BUILTIN_REGEXP@ regcomp@SHLIB_SUFFIX@ regexec@SHL
#in some systems we just create a single object, in others we need to
# create a libray
all: @NEWSHOBJ@
sobjs: $(SOBJS)
dll: regexp@SHLIB_SUFFIX@
all: $(SOBJS)
regexp.o: $(srcdir)/regexp.c @NO_BUILTIN_REGEXP@ $(srcdir)/regex2.h $(srcdir)/engine.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/regexp.c -o regexp.o
@ -63,11 +59,11 @@ regexec.o: $(srcdir)/regexec.c
@DO_SECOND_LD@%@SHLIB_SUFFIX@: %.o
@DO_SECOND_LD@ @SHLIB_LD@ -o $@ $<
@DO_SECOND_LD@regexp@SHLIB_SUFFIX@: regexp.o
@DO_SECOND_LD@ @SHLIB_LD@ -o regexp@SHLIB_SUFFIX@ regexp.o
@DO_SECOND_LD@regexp@SHLIB_SUFFIX@: regexp.o @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
@DO_SECOND_LD@ @SHLIB_LD@ -o regexp@SHLIB_SUFFIX@ regexp.o @MERGE_DLL_OBJS@ regcomp.o regerror.o regfree.o regexec.o
@DO_SECOND_LD@regcomp@SHLIB_SUFFIX@: regcomp.o
@DO_SECOND_LD@ @SHLIB_LD@ -o regcomp@SHLIB_SUFFIX@ regcomp.o
@DO_SECOND_LD@regcomp@SHLIB_SUFFIX@: regcomp.o @MERGE_DLL_OBJS@ regfree.o
@DO_SECOND_LD@ @SHLIB_LD@ -o regcomp@SHLIB_SUFFIX@ regcomp.o @MERGE_DLL_OBJS@ regfree.o
@DO_SECOND_LD@regerror@SHLIB_SUFFIX@: regerror.o
@DO_SECOND_LD@ @SHLIB_LD@ -o regerror@SHLIB_SUFFIX@ regerror.o
@ -78,38 +74,9 @@ regexec.o: $(srcdir)/regexec.c
@DO_SECOND_LD@regexec@SHLIB_SUFFIX@: regexec.o
@DO_SECOND_LD@ @SHLIB_LD@ -o regexec@SHLIB_SUFFIX@ regexec.o
#
# create a new DLL library on cygwin environments
#
# DLLNAME: name of the new dll
# OBJS: list of object files I want to put in
# LIBS: list of libraries to link with
# DEFFILE is the name of the definitions file.
# BASEFILE temporary
# EXPFILE temporary
# ENTRY is the entry point int WINAPI startup (HINSTANCE, DWORD, LPVOID)
#
DLLTOOL=dlltool
DLLNAME=regexp.dll
DLL_LIBS=@DLL_LIBS@ -L../.. -lWYap
BASE_FILE=regexp.base
EXP_FILE=regexp.exp
DEF_FILE=$(srcdir)/regexp.def
ENTRY_FUNCTION=_win_regexp@12
#
regexp.dll: $(OBJS)
$(LD) -s --base-file $(BASE_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) -s --base-file $(BASE_FILE) $(EXP_FILE) -dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) $(EXP_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR)
install_win32: dll
$(INSTALL_PROGRAM) -m 755 regexp.dll $(LIBDIR)/regexp.dll
clean:
rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK

View File

@ -77,7 +77,7 @@ unsigned char collate_substitute_table[UCHAR_MAX + 1][STR_LEN];
struct collate_st_char_pri collate_char_pri_table[UCHAR_MAX + 1];
struct collate_st_chain_pri collate_chain_pri_table[TABLE_SIZE];
#if _MSC_VER || defined(__MINGW32__)
#if _MSC_VER || defined(__MINGW32__) || defined(__CYGWIN__)
#define isblank(X) isspace(X)
#define isascii(X) ((unsigned int)(X) < 0177)
#endif

View File

@ -38,7 +38,7 @@
*/
/* utility definitions */
#if defined(_WIN32) || defined(__MINGW32__)
#if defined(_WIN32) || defined(__MINGW32__) || defined(__CYGWIN__)
#define DUPMAX ((unsigned int)-2) /* xxx is this right? */
#else
#define DUPMAX _POSIX2_RE_DUP_MAX /* xxx is this right? */

View File

@ -39,9 +39,7 @@ SOBJS=sys@SHLIB_SUFFIX@
#in some systems we just create a single object, in others we need to
# create a libray
all: @NEWSHOBJ@
sobjs: $(SOBJS)
all: $(SOBJS)
sys.o: $(srcdir)/sys.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/sys.c -o sys.o
@ -52,38 +50,9 @@ sys.o: $(srcdir)/sys.c
@DO_SECOND_LD@sys@SHLIB_SUFFIX@: sys.o
@DO_SECOND_LD@ @SHLIB_LD@ -o sys@SHLIB_SUFFIX@ sys.o
#
# create a new DLL library on mingw32 environments
#
# DLLNAME: name of the new dll
# OBJS: list of object files I want to put in
# LIBS: list of libraries to link with
# DEFFILE is the name of the definitions file.
# BASEFILE temporary
# EXPFILE temporary
# ENTRY is the entry point int WINAPI startup (HINSTANCE, DWORD, LPVOID)
#
DLLTOOL=dlltool
DLLNAME=sys.dll
DLL_LIBS=@DLL_LIBS@ -L../.. -lWYap
BASE_FILE=sys.base
EXP_FILE=sys.exp
DEF_FILE=$(srcdir)/sys.def
ENTRY_FUNCTION=_win_sys@12
#
sys.dll: $(OBJS)
$(LD) -s --base-file $(BASE_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) -s --base-file $(BASE_FILE) $(EXP_FILE) -dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) $(EXP_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR)
install_win32: dll
$(INSTALL_PROGRAM) -m 755 sys.dll $(LIBDIR)/sys.dll
clean:
rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK

View File

@ -39,11 +39,7 @@ SOBJS=yap2swi@SHLIB_SUFFIX@
#in some systems we just create a single object, in others we need to
# create a libray
all: @NEWSHOBJ@
sobjs: $(SOBJS)
dll: yap2swi@SHLIB_SUFFIX@
all: $(SOBJS)
yap2swi.o: $(srcdir)/yap2swi.c
$(CC) -c $(CFLAGS) $(SHLIB_CFLAGS) $(srcdir)/yap2swi.c -o yap2swi.o
@ -54,38 +50,9 @@ yap2swi.o: $(srcdir)/yap2swi.c
@DO_SECOND_LD@yap2swi@SHLIB_SUFFIX@: yap2swi.o
@DO_SECOND_LD@ @SHLIB_LD@ -o yap2swi@SHLIB_SUFFIX@ yap2swi.o
#
# create a new DLL library on cygwin environments
#
# DLLNAME: name of the new dll
# OBJS: list of object files I want to put in
# LIBS: list of libraries to link with
# DEFFILE is the name of the definitions file.
# BASEFILE temporary
# EXPFILE temporary
# ENTRY is the entry point int WINAPI startup (HINSTANCE, DWORD, LPVOID)
#
DLLTOOL=dlltool
DLLNAME=yap2swi.dll
DLL_LIBS=@DLL_LIBS@ -L../.. -lWYap
BASE_FILE=yap2swi.base
EXP_FILE=yap2swi.exp
DEF_FILE=$(srcdir)/yap2swi.def
ENTRY_FUNCTION=_win_yap2swi@12
#
yap2swi.dll: $(OBJS)
$(LD) -s --base-file $(BASE_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) -s --base-file $(BASE_FILE) $(EXP_FILE) -dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
$(DLLTOOL) --as=$(AS) --dllname $(DLLNAME) --def $(DEF_FILE) --base-file $(BASE_FILE) --output-exp $(EXP_FILE)
$(LD) $(EXP_FILE) --dll -o $(DLLNAME) $(OBJS) $(DLL_LIBS) -e $(ENTRY_FUNCTION)
install: all
$(INSTALL_PROGRAM) $(SOBJS) $(DESTDIR)$(LIBDIR)
install_win32: dll
$(INSTALL_PROGRAM) -m 755 yap2swi.dll $(LIBDIR)/yap2swi.dll
clean:
rm -f *.o *~ $(OBJS) $(SOBJS) *.BAK