Fixes to make --disable-shared work in Mingw32

This commit is contained in:
jjgarcia 2006-01-13 13:32:25 +00:00
parent f1cf24949a
commit 8846ac62b2
4 changed files with 29 additions and 19 deletions

View file

@ -61,6 +61,11 @@ ECL 0.9i
- Implemented the standard behavior of NO-APPLICABLE-METHOD. Before, ECL
expected this function to simply fail and never return.
- --disable-shared works again in Mingw. The header file external.h has to be
modified at build time to remove a declaration "dllimport" which mingw does
not support in the statically linked code. MSVC++ does not seem to have a
problem with it, though.
* Documentation:
- The HTML manuals now use CSS for a more appealing look.

View file

@ -50,7 +50,18 @@ all: $(TARGETS) ecl-config doc
%Makefile: $(srcdir)/%Makefile.in config.status
./config.status
ecl$(EXE): ecl_min$(EXE) compile.lsp sysfun.lsp
#
# When compiling the library itself, we have to remove the dllimport
# declarations, because the variables that they mark are in the
# in the library and can be referenced without indirection.
#
c/external.h: $(top_srcdir)/h/external.h
sed 's,__declspec(dllimport),,g' $(top_srcdir)/h/external.h > $@
h/external.h: c/external.h
cp $(srcdir)/h/*.h h/
if grep 'undef ENABLE_DLOPEN' h/config.h; then cp c/external.h h; fi
ecl$(EXE): ecl_min$(EXE) compile.lsp sysfun.lsp h/external.h
if [ -f CROSS-COMPILER ]; then \
./CROSS-COMPILER < compile.lsp; \
else \
@ -77,7 +88,7 @@ ecl-config: ecl-config.pre
-e 's,@includedir\\@,$(libdir)/h,' ecl-config.pre > ecl-config
@LIBPREFIX@eclmin.@LIBEXT@: @LIBPREFIX@eclgmp.@LIBEXT@ @LIBPREFIX@eclgc.@LIBEXT@ lsp/config.lsp
@LIBPREFIX@eclmin.@LIBEXT@: @LIBPREFIX@eclgmp.@LIBEXT@ @LIBPREFIX@eclgc.@LIBEXT@ lsp/config.lsp h/external.h
cd c; $(MAKE)
@LIBPREFIX@eclgc.@LIBEXT@:
if (echo $(SUBDIRS) | grep gc); then \

View file

@ -31,7 +31,7 @@ libdir=@libdir@
# Files
HDIR = $(top_srcdir)/h
HDIR = ../h
HFILES = ../h/config.h $(HDIR)/ecl.h $(HDIR)/ecl-cmp.h\
$(HDIR)/object.h $(HDIR)/cs.h $(HDIR)/stacks.h\
$(HDIR)/external.h $(HDIR)/eval.h\
@ -54,7 +54,7 @@ OBJS = main.o symbol.o package.o list.o\
.SUFFIXES: .c .o .d
.PHONY: all
all: $(DPP) external.h ../libeclmin.a ../cinit.o
all: $(DPP) ../libeclmin.a ../cinit.o
.c.o: $(HFILES)
$(CC) $(CFLAGS) -o $@ $<
@ -63,14 +63,6 @@ all: $(DPP) external.h ../libeclmin.a ../cinit.o
ffi_x86.c: arch/ffi_x86.d $(DPP) $(HFILES)
if test -f ../CROSS-DPP ; then ../CROSS-DPP $< $@ ; else $(DPP) $< $@ ; fi
#
# When compiling the library itself, we have to remove the dllimport
# declarations, because the variables that they mark are in the
# in the library and can be referenced without indirection.
#
external.h: $(top_srcdir)/h/external.h
sed 's,__declspec(dllimport),,g' $(top_srcdir)/h/external.h > $@
install: $(HFILES)
for i in $(HFILES); do $(INSTALL_DATA) $$i $(DESTDIR)$(libdir)/h/; done
sed '/-CUT-/,$$d' ../h/config.h > ../h/config-install.h

View file

@ -38,7 +38,7 @@
;;; with an already installed copy of ECL.
;;;
(setq c::*cc-flags*
#-msvc "@CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/c -I\"@true_srcdir@\"/h -I\"@true_srcdir@\"/gmp -I\"@true_builddir@\"/h"
#-msvc "@CPPFLAGS@ @CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/c -I\"@true_srcdir@\"/gmp -I\"@true_builddir@\"/h"
#+msvc "@CFLAGS@ @ECL_CFLAGS@ -I\"@true_srcdir@\"/c -I\"@true_srcdir@\"/h -I\"@true_builddir@\"/h"
c::*cc-format*
#-msvc "~A ~A ~:[~*~;~A~] -I\"@true_builddir@\"/h~* -w -c ~S -o ~S"
@ -85,12 +85,14 @@
))
#-:wants-dlopen
(si::system "sh -c 'mkdir tmp; rm -f tmp/*;
cp @LIBPREFIX@eclmin.@LIBEXT@ @LIBPREFIX@ecl.@LIBEXT@;
cd tmp; ar -x ../@LIBPREFIX@lsp.@LIBEXT@;
for i in *.@OBJEXT@; do mv $i lsp_`basename $i`; done;
ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@ ../c/all_symbols2.@OBJEXT@; rm *.@OBJEXT@;
@RANLIB@ ../@LIBPREFIX@ecl.@LIBEXT@'")
(c::safe-system
(concatenate 'string
"sh -c 'rm -rf tmp; mkdir tmp;"
"cp @LIBPREFIX@eclmin.@LIBEXT@ @LIBPREFIX@ecl.@LIBEXT@;"
"cd tmp; ar -x ../@LIBPREFIX@lsp.@LIBEXT@;"
"for i in *.@OBJEXT@; do mv $i lsp_`basename $i`; done;"
"ar -r ../@LIBPREFIX@ecl.@LIBEXT@ *.@OBJEXT@ ../c/all_symbols2.@OBJEXT@; rm *.@OBJEXT@;"
"@RANLIB@ ../@LIBPREFIX@ecl.@LIBEXT@'"))
#+:wants-dlopen
;;;