Clean-up the way how GC symbols are accessed and re-exported from ECL.

This commit is contained in:
goffioul 2005-10-27 14:32:53 +00:00
parent b2b226ae47
commit 716eae22a8
10 changed files with 33 additions and 43 deletions

View file

@ -27,7 +27,7 @@ THEHOST = win32
GMP_TYPE = gc
# Set it to non-empty to include Win32 thread support
ECL_THREADS =
ECL_THREADS = 1
# Set it to non-empty to enable Win32 debug support
ECL_DEBUG = 1
@ -41,7 +41,7 @@ ECL_ASDF =
# TCP support
ECL_SOCKETS =
# X Windows support
ECL_CLX =
#ECL_CLX =
# Regression Tests support
ECL_RT =
@ -55,7 +55,7 @@ TAR_DIR = %%CD%%\ecl-$(ECL_VERSION)
CC = cl
MFLAGS = -MD
CFLAGS = -GX -DGC_NOT_DLL -nologo
CFLAGS = -GX -DGC_DLL -nologo
LIBS = eclgc.lib eclgmp.lib user32.lib ws2_32.lib
LDFLAGS =
SHARED_LDFLAGS = -LD
@ -189,7 +189,7 @@ compile.lsp: bare.lsp $(srcdir)/compile.lsp.in Makefile
c\cut "@ecldir@" "$(libdir:\=/)" \
"@true_srcdir@" "$(srcdir:\=/)" \
"@true_builddir@" "$(MAKEDIR:\=/)" \
"@CFLAGS@" "$(CFLAGS)" \
"@CFLAGS@" "$(CFLAGS) -DGC_BUILD" \
"@ECL_CFLAGS@" "" \
"@CPPFLAGS@" "" \
"@LDRPATH@" "" \
@ -247,14 +247,14 @@ ecl-config.bat: util\ecl-config.bat Makefile
"@ECL_CFLAGS@" "$(CFLAGS)" \
"@LDFLAGS@" "$(LDFLAGS)" \
"@CLIBS@" "" \
"@libdir@" "$(libdir:\=/)" \
"@includedir@" "$(libdir:\=/)/h" \
"@libdir@" "$(prefix:\=/)" \
"@includedir@" "$(prefix:\=/)/h" \
< util\ecl-config.bat > ecl-config.bat
eclmin.lib: eclgmp.lib eclgc.lib lsp/config.lsp
cd c
$(MAKE) "ECL_THREADS = $(ECL_THREADS)" "ECL_CFLAGS = $(CFLAGS)"
$(MAKE) "ECL_THREADS = $(ECL_THREADS)" "ECL_CFLAGS = $(CFLAGS) -DGC_BUILD"
cd ..
eclgc.lib:
cd gc

View file

@ -6,7 +6,7 @@ srcdir = ..\..\src\c
!if "$(ECL_THREADS)" != ""
THREADS_OBJ= threads_win32.obj
THREADS_FLAGS= -DECL_THREADS -DGC_WIN32_THREADS
THREADS_FLAGS= -DECL_THREADS
!else
THREADS_OBJ=
THREADS_FLAGS=
@ -16,7 +16,7 @@ THREADS_FLAGS=
#
TRUE_CC = cl
CC = cl
CFLAGS = -c $(ECL_CFLAGS) -I./ -I$(srcdir) -I$(HDIR) -I../h -I$(top_srcdir)/gc/include $(THREADS_FLAGS)
CFLAGS = -c $(ECL_CFLAGS) -I./ -I$(srcdir) -I$(HDIR) -I../h -I$(top_srcdir)/gc/include
# -Wall -W -Wfloat-equal -Wundef -Wendif-labels -Wpointer-arith -Wcast-align \
# -Wwrite-strings -Wconversion -Wsign-compare -Wmissing-prototypes -Wredundant-decls \
# -Wunreachable-code -Winline

View file

@ -9,11 +9,6 @@ EXPORTS
make_cons
si_gc
si_gc_dump
GC_malloc
GC_malloc_atomic_ignore_off_page
GC_free
GC_dont_gc DATA
GC_CreateThread
; all_symbols
@ -356,7 +351,6 @@ EXPORTS
; gbc.c
GC_dont_gc DATA
ecl_register_root

View file

@ -9,10 +9,6 @@ EXPORTS
make_cons
si_gc
si_gc_dump
GC_malloc
GC_malloc_atomic_ignore_off_page
GC_free
GC_dont_gc DATA
; all_symbols
@ -355,7 +351,6 @@ EXPORTS
; gbc.c
GC_dont_gc DATA
ecl_register_root

View file

@ -9,7 +9,7 @@ srcdir = ..\..\src\gc
!if "$(ECL_THREADS)" != ""
THREADS_OBJ= win32_threads.obj
THREADS_FLAGS= -DGC_WIN32_THREADS
THREADS_FLAGS= -DGC_THREADS
!else
THREADS_OBJ=
THREADS_FLAGS=
@ -22,10 +22,10 @@ OBJS= alloc.obj reclaim.obj allchblk.obj misc.obj mach_dep.obj os_dep.obj mark_r
all: gctest.exe cord\de.exe test_cpp.exe
{$(srcdir)}.c{}.obj:
$(cc) $(MFLAGS) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ -DGC_NOT_DLL -DLARGE_CONFIG $(THREADS_FLAGS) $< /Fo$*.obj
$(cc) $(MFLAGS) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -D__STDC__ -DGC_DLL -DGC_BUILD -DLARGE_CONFIG $(THREADS_FLAGS) $< /Fo$*.obj
.cpp.obj:
$(cc) $(MFLAGS) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -DGC_NOT_DLL -DLARGE_CONFIG $(THREADS_FLAGS) $*.CPP /Fo$*.obj
$(cc) $(MFLAGS) $(cdebug) $(cflags) $(cvars) -I$(srcdir)\include -DSILENT -DALL_INTERIOR_POINTERS -DGC_DLL -DGC_BUILD -DLARGE_CONFIG $(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

View file

@ -6,7 +6,7 @@ IF %1 == --cflags (
ECHO @ECL_CFLAGS@ -I@includedir@
GOTO END
) ELSE IF %1 == --libs (
ECHO /LIBDIR:@libdir@ ecl.lib @LDFLAGS@ @CLIBS@
ECHO @LDFLAGS@ /link /LIBPATH:@libdir@ ecl.lib @CLIBS@
GOTO END
)

View file

@ -18,13 +18,6 @@
#include <signal.h>
#include "ecl.h"
#include "internal.h"
#define GC_THREADS
#include "gc.h"
/* This is should be done automatically by gc.h: */
#ifdef GBC_BOEHM
#define CreateThread GC_CreateThread
#endif
#ifndef WITH___THREAD
DWORD cl_env_key;

View file

@ -40,6 +40,9 @@ typedef unsigned short uint16_t;
typedef HANDLE pthread_t;
typedef HANDLE pthread_mutex_t;
# undef ERROR
# ifdef GBC_BOEHM
# define CreateThread GC_CreateThread
# endif
# else
# include <pthread.h>
# if defined(__APPLE__) || defined(freebsd)
@ -58,6 +61,13 @@ typedef unsigned short uint16_t;
#endif /* WITH_GMP */
#include <object.h>
#include <stacks.h>
#ifdef GBC_BOEHM
# ifdef _MSC_VER
# include <gc.h>
# else
# include <gc/gc.h>
# endif
#endif
#include <external.h>
#include <eval.h>
#include <number.h>

View file

@ -43,6 +43,9 @@ typedef unsigned short uint16_t;
typedef HANDLE pthread_t;
typedef HANDLE pthread_mutex_t;
# undef ERROR
# ifdef GBC_BOEHM
# define CreateThread GC_CreateThread
# endif
# else
# include <pthread.h>
# if defined(__APPLE__) || defined(freebsd)
@ -64,6 +67,13 @@ typedef unsigned short uint16_t;
#ifndef _ARGS
# define _ARGS(x) x
#endif
#ifdef GBC_BOEHM
# ifdef _MSC_VER
# include <gc.h>
# else
# include <gc/gc.h>
# endif
#endif
#include <external.h>
/*#include "ecl-inl.h"*/
#include <eval.h>

View file

@ -189,14 +189,6 @@ extern void cl_dealloc(void *p, cl_index s);
#ifdef GBC_BOEHM
extern cl_object si_gc(cl_object area);
extern cl_object si_gc_dump(void);
#ifdef _MSC_VER
extern char *GC_malloc_ignore_off_page(size_t size);
extern char *GC_malloc_atomic_ignore_off_page(size_t size);
#else
extern void *GC_malloc_ignore_off_page(size_t size);
extern void *GC_malloc_atomic_ignore_off_page(size_t size);
#endif
extern void GC_free(void *);
#define cl_alloc GC_malloc_ignore_off_page
#define cl_alloc_atomic GC_malloc_atomic_ignore_off_page
#define cl_alloc_align(s,d) GC_malloc_ignore_off_page(s)
@ -612,10 +604,6 @@ extern void ecl_gc(cl_type t);
#define GC_enabled() (!GC_dont_gc)
#define GC_enable() GC_dont_gc = FALSE;
#define GC_disable() GC_dont_gc = TRUE;
#if defined(mingw32) || defined(_MSC_VER) || defined(cygwin)
__declspec(dllimport)
#endif
extern int GC_dont_gc;
extern void ecl_register_root(cl_object *p);
#endif /* GBC_BOEHM */