mirror of
https://gitlab.com/embeddable-common-lisp/ecl.git
synced 2026-02-21 22:50:25 -08:00
Fix compilation problems under MSVC and enable threads support
This commit is contained in:
parent
a19d3afbeb
commit
22b5fdf705
5 changed files with 44 additions and 9 deletions
|
|
@ -61,6 +61,7 @@ SUBDIR = c gc gmp
|
|||
LIBRARIES =
|
||||
LSP_LIBRARIES = cmp.fas clx.fas sysfun.lsp
|
||||
TARGETS = ecl.exe
|
||||
DEF = ecl.def
|
||||
# Define here the processor type to compile GMP library
|
||||
# with maximum optimization. Possible values are:
|
||||
# gc -> generic implementation
|
||||
|
|
@ -68,6 +69,16 @@ TARGETS = ecl.exe
|
|||
# p3 -> Pentium III processor
|
||||
# p4 -> Pentium IV processor
|
||||
GMP_TYPE = gc
|
||||
# Set it to non-empty to include Win32 thread support
|
||||
ECL_THREADS =
|
||||
|
||||
!if "$(ECL_THREADS)" == ""
|
||||
ENV_EXPORT = cl_env,DATA
|
||||
!else
|
||||
ENV_EXPORT = ecl_process_env
|
||||
CFLAGS = $(CFLAGS) -DECL_THREADS
|
||||
DEF = ecl-threads.def
|
||||
!endif
|
||||
|
||||
all: $(TARGETS) doc ecl-config.bat
|
||||
.PHONY: all
|
||||
|
|
@ -116,6 +127,7 @@ compile.lsp: bare.lsp $(srcdir)/compile.lsp.in Makefile.msvc6
|
|||
-e "s,@LIBEXT@,lib,g" \
|
||||
-e "s,@EXEEXT@,.exe,g" \
|
||||
-e "s,@LDINSTALLNAME@,,g" \
|
||||
-e "s,@DEF@,$(DEF),g" \
|
||||
< $(srcdir)\compile.lsp.in > compile.lsp
|
||||
bare.lsp: $(srcdir)/bare.lsp.in lsp/load.lsp clos/load.lsp cmp/load.lsp cmp/cmpcfg.lsp
|
||||
sed -e "s,@true_srcdir@,$(srcdir:\=/),g" \
|
||||
|
|
@ -156,11 +168,11 @@ ecl-config.bat: util\ecl-config.bat Makefile.msvc6
|
|||
|
||||
eclmin.lib: eclgmp.lib eclgc.lib lsp/config.lsp
|
||||
cd c
|
||||
$(MAKE) -f Makefile.msvc6
|
||||
$(MAKE) -f Makefile.msvc6 "ECL_THREADS = $(ECL_THREADS)"
|
||||
cd ..
|
||||
eclgc.lib:
|
||||
cd gc
|
||||
$(MAKE) -f Makefile.msvc6 gc.lib
|
||||
$(MAKE) -f Makefile.msvc6 "ECL_THREADS = $(ECL_THREADS)" gc.lib
|
||||
$(CP) gc.lib ..\eclgc.lib
|
||||
cd ..
|
||||
for %h in (gc.h gc_local_alloc.h gc_pthread_redirects.h \
|
||||
|
|
@ -190,6 +202,7 @@ install-base:
|
|||
for %i in ($(TARGETS) ecl.dll) do $(CP) %i $(bindir)\%i
|
||||
$(CP) ecl-config.bat $(bindir)\ecl-config.bat
|
||||
for %i in ($(LSP_LIBRARIES) $(LIBRARIES) c\dpp.exe help.doc ecl.lib) do $(CP) %i $(libdir)
|
||||
for %i in (ecl-s.lib ecl-full-s.lib) do IF EXIST %i $(CP) %i $(libdir)
|
||||
$(CP) h\config.h $(libdir)\h
|
||||
flatinstall:
|
||||
$(MAKE) -f Makefile.msvc6 bindir=$(prefix) libdir=$(prefix) install-base
|
||||
|
|
|
|||
|
|
@ -4,14 +4,23 @@
|
|||
top_srcdir = ..\..\src
|
||||
srcdir = ..\..\src\c
|
||||
|
||||
!if "$(ECL_THREADS)" != ""
|
||||
THREADS_OBJ= threads_win32.obj
|
||||
THREADS_FLAGS= -DECL_THREADS -DGC_WIN32_THREADS
|
||||
!else
|
||||
THREADS_OBJ=
|
||||
THREADS_FLAGS=
|
||||
!endif
|
||||
|
||||
# Programs used by "make":
|
||||
#
|
||||
TRUE_CC = cl
|
||||
CC = cl
|
||||
CFLAGS = -c -Zi -I./ -I$(srcdir) -I$(HDIR) -I../h -I$(top_srcdir)/gc/include -DHAVE_ISATTY
|
||||
CFLAGS = -c -Zi -I./ -I$(srcdir) -I$(HDIR) -I../h -I$(top_srcdir)/gc/include -DHAVE_ISATTY $(THREADS_FLAGS)
|
||||
# -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align \
|
||||
# -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-prototypes -Wredundant-decls \
|
||||
# -Wunreachable-code -Winline
|
||||
DEFS = $(THREADS_FLAGS)
|
||||
|
||||
SHELL = /bin/sh
|
||||
RM = del
|
||||
|
|
@ -49,7 +58,7 @@ OBJS = main.obj symbol.obj package.obj list.obj\
|
|||
time.obj unixint.obj\
|
||||
mapfun.obj multival.obj hash.obj format.obj pathname.obj\
|
||||
structure.obj load.obj unixfsys.obj unixsys.obj \
|
||||
ffi.obj alloc_2.obj tcp.obj
|
||||
ffi.obj alloc_2.obj tcp.obj $(THREADS_OBJ)
|
||||
|
||||
all: $(DPP) external.h ..\eclmin.lib ..\cinit.obj
|
||||
|
||||
|
|
@ -57,6 +66,8 @@ all: $(DPP) external.h ..\eclmin.lib ..\cinit.obj
|
|||
|
||||
{$(srcdir:\=/)}.d{}.c:
|
||||
$(DPP) $< $@
|
||||
#.d.c:
|
||||
# $(DPP) $< $@
|
||||
.c.obj:
|
||||
$(CC) $(CFLAGS) -o $@ $<
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,23 @@ CPU= i386
|
|||
|
||||
srcdir = ..\..\src\gc
|
||||
|
||||
OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj obj_map.obj blacklst.obj finalize.obj new_hblk.obj dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj typd_mlc.obj ptr_chck.obj gc_cpp.obj mallocx.obj
|
||||
!if "$(ECL_THREADS)" != ""
|
||||
THREADS_OBJ= win32_threads.obj
|
||||
THREADS_FLAGS= -DGC_WIN32_THREADS
|
||||
!else
|
||||
THREADS_OBJ=
|
||||
THREADS_FLAGS=
|
||||
!endif
|
||||
|
||||
OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj mach_dep.obj os_dep.obj mark_rts.obj headers.obj mark.obj obj_map.obj blacklst.obj finalize.obj new_hblk.obj dbg_mlc.obj malloc.obj stubborn.obj dyn_load.obj typd_mlc.obj ptr_chck.obj gc_cpp.obj mallocx.obj $(THREADS_OBJ)
|
||||
|
||||
all: gctest.exe cord\de.exe test_cpp.exe
|
||||
|
||||
{$(srcdir)}.c{}.obj:
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ -DGC_NOT_DLL $< /Fo$*.obj
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ -DGC_NOT_DLL $(THREADS_FLAGS) $< /Fo$*.obj
|
||||
|
||||
.cpp.obj:
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -DGC_NOT_DLL $*.CPP /Fo$*.obj
|
||||
$(cc) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -DGC_NOT_DLL $(THREADS_FLAGS) $*.CPP /Fo$*.obj
|
||||
|
||||
$(OBJS) tests\test.obj: $(srcdir)\include\private\gc_priv.h $(srcdir)\include\private\gc_hdrs.h $(srcdir)\include\gc.h $(srcdir)\include\private\gcconfig.h $(srcdir)\include\private\gc_locks.h $(srcdir)\include\private\gc_pmark.h $(srcdir)\include\gc_mark.h
|
||||
|
||||
|
|
|
|||
|
|
@ -26,10 +26,13 @@
|
|||
#endif
|
||||
|
||||
/* Userland threads? */
|
||||
#undef ECL_THREADS
|
||||
/* #undef ECL_THREADS */
|
||||
|
||||
/* Network streams */
|
||||
#define TCP 1
|
||||
#if defined(TCP) && (defined(_MSC_VER) || defined(mingw32))
|
||||
# define ECL_WSOCK
|
||||
#endif
|
||||
|
||||
/* Foreign functions interface */
|
||||
#define ECL_FFI
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
|
||||
#if defined(mignw32) || defined(_MSC_VER)
|
||||
/* The function sleep() in MinGW is bogus: it counts millisecons! */
|
||||
#include <winbase.h>
|
||||
#include <windows.h>
|
||||
#define sleep(x) Sleep(x*1000)
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue