From 68ee122facf9b3723d2baf4e1441ac2f2238e1f0 Mon Sep 17 00:00:00 2001 From: sof Date: Fri, 17 Sep 1999 10:43:54 +0000 Subject: [PATCH] [project @ 1999-09-17 10:43:51 by sof] DLL building tweaks, including terrible hack to compile PrelMain --- ghc/lib/concurrent/Makefile | 9 +++++++-- ghc/lib/exts/Makefile | 8 +++++++- ghc/lib/misc/Makefile | 15 ++++++++++++--- ghc/lib/misc/cbits/Makefile | 15 ++++++++++++++- ghc/lib/std/Makefile | 28 ++++++++++++++++++++++++++-- 5 files changed, 66 insertions(+), 9 deletions(-) diff --git a/ghc/lib/concurrent/Makefile b/ghc/lib/concurrent/Makefile index 46d0b57..f99e2c5 100644 --- a/ghc/lib/concurrent/Makefile +++ b/ghc/lib/concurrent/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.6 1999/05/05 10:48:06 sof Exp $ +# $Id: Makefile,v 1.7 1999/09/17 10:43:51 sof Exp $ # # Makefile for concurrent libraries. # @@ -47,7 +47,7 @@ SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR) DLL_NAME = HSconc.dll DLL_IMPLIB_NAME = libHSconcurrent_imp.a SRC_BLD_DLL_OPTS += --export-all --output-def=HSconc.def -SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits +SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits #----------------------------------------------------------------------------- # Installation; need to install .hi files as well as libraries @@ -65,6 +65,11 @@ override datadir:=$(libdir)/imports/concurrent # INSTALL_LIBS += $(LIBRARY) INSTALL_DATAS += $(HS_IFACES) +ifeq "$(EnableWin32DLLs)" "YES" +INSTALL_PROGS += $(DLL_NAME) +INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) +INSTALL_DATAS += dLL_ifs.hi +endif include $(TOP)/mk/target.mk diff --git a/ghc/lib/exts/Makefile b/ghc/lib/exts/Makefile index 6a207cf..d662b07 100644 --- a/ghc/lib/exts/Makefile +++ b/ghc/lib/exts/Makefile @@ -62,7 +62,7 @@ SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR) -optdep--include-prelude -optdep-w $ DLL_NAME = HSexts.dll DLL_IMPLIB_NAME = libHSexts_imp.a SRC_BLD_DLL_OPTS += --export-all --output-def=HSexts.def -SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits +SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lHS_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits #----------------------------------------------------------------------------- # Installation; need to install .hi files as well as libraries @@ -81,4 +81,10 @@ override datadir:=$(libdir)/imports/exts INSTALL_LIBS += $(LIBRARY) INSTALL_DATAS += $(HS_IFACES) +ifeq "$(EnableWin32DLLs)" "YES" +INSTALL_PROGS += $(DLL_NAME) +INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) +INSTALL_DATAS += dLL_ifs.hi +endif + include $(TOP)/mk/target.mk diff --git a/ghc/lib/misc/Makefile b/ghc/lib/misc/Makefile index e3468d5..2da481e 100644 --- a/ghc/lib/misc/Makefile +++ b/ghc/lib/misc/Makefile @@ -1,4 +1,4 @@ -# $Id: Makefile,v 1.17 1999/08/06 10:55:26 simonmar Exp $ +# $Id: Makefile,v 1.18 1999/09/17 10:43:52 sof Exp $ # # Makefile for miscellaneous libraries. # @@ -19,7 +19,10 @@ endif # LIBRARY = libHSmisc$(_way).a -HS_SRCS = $(wildcard *.lhs) + +ifeq "$(EnableWin32DLLs)" "YES" + HS_SRCS := $(filter-out Select.lhs,$(HS_SRCS)) +endif # Remove Readline.lhs if readline.h isn't available. ifneq "$(GhcLibsWithReadline)" "YES" @@ -79,7 +82,7 @@ SRC_MKDEPENDHS_OPTS += -I$(GHC_INCLUDE_DIR) DLL_NAME = HSmisc.dll DLL_IMPLIB_NAME = libHSmisc_imp.a SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc.def -SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHS_cbits_imp -lHSmisc_cbits_imp -lHS_imp -lHSexts_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits -L../exts -Lcbits +SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHScbits_imp -lHSmisc_cbits_imp -lHS_imp -lHSexts_imp -lgmp -L. -L../../rts/gmp -L../../rts -L../std -L../std/cbits -L../exts -Lcbits #----------------------------------------------------------------------------- @@ -99,5 +102,11 @@ override datadir:=$(libdir)/imports/misc INSTALL_LIBS += $(LIBRARY) INSTALL_DATAS += $(HS_IFACES) +ifeq "$(EnableWin32DLLs)" "YES" +INSTALL_PROGS += $(DLL_NAME) +INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) +INSTALL_DATAS += dLL_ifs.hi +endif + include $(TOP)/mk/target.mk diff --git a/ghc/lib/misc/cbits/Makefile b/ghc/lib/misc/cbits/Makefile index 379073f..69feafe 100644 --- a/ghc/lib/misc/cbits/Makefile +++ b/ghc/lib/misc/cbits/Makefile @@ -14,6 +14,14 @@ ifneq "$(HAVE_READLINE)" "YES" C_SRCS := $(filter-out ghcReadline.c,$(C_SRCS)) endif +ifeq "$(EnableWin32DLLs)" "YES" + C_SRCS := $(filter-out selectFrom.c,$(C_SRCS)) +endif + +ifneq "$(way)" "dll" +SRC_CC_OPTS += -static +endif + SRC_MKDEPENDC_OPTS += -I$(GHC_INCLUDE_DIR) SRC_CC_OPTS += -I$(GHC_INCLUDE_DIR) -I$(GHC_LIB_DIR)/std/cbits @@ -23,6 +31,11 @@ INSTALL_LIBS += $(LIBRARY) DLL_NAME = HSmisc_cbits.dll SRC_BLD_DLL_OPTS += --export-all --output-def=HSmisc_cbits.def -SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../../rts/gmp -L../../../rts -L../../std/cbits +SRC_BLD_DLL_OPTS += -lwinmm -lwsock32 -lHSrts_imp -lHScbits_imp -lgmp -L. -L../../../rts/gmp -L../../../rts -L../../std/cbits + +ifeq "$(EnableWin32DLLs)" "YES" +INSTALL_PROGS += $(DLL_NAME) +INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) +endif include $(TOP)/mk/target.mk diff --git a/ghc/lib/std/Makefile b/ghc/lib/std/Makefile index e05657a..eab2b40 100644 --- a/ghc/lib/std/Makefile +++ b/ghc/lib/std/Makefile @@ -84,13 +84,37 @@ boot :: PrelGHC.hi $(foreach way, $(WAYS), PrelGHC.$(way)_hi) DLL_NAME = HSprel.dll DLL_IMPLIB_NAME = libHS_imp.a SRC_BLD_DLL_OPTS += --export-all --output-def=HSprel.def -SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHS_cbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits +SRC_BLD_DLL_OPTS += -lwinmm -lHSrts_imp -lHScbits_imp -lgmp -L. -L../../rts/gmp -L../../rts -Lcbits ifeq "$(way)" "dll" HS_SRCS := $(filter-out PrelMain.lhs, $(HS_SRCS)) endif +# PrelMain.dll_o isn't to be included in the final .a +ifeq "$(way)" "dll" +all :: PrelMain.dll_o +endif + +# +# Building PrelMain.dll_o is, unfortunately, somewhat tricky +# with the current DLL setup. PrelMain.dll_o should refer to +# all its imports bar Main.main_closure as residing in DLLs. +# But, since the .hi's of PrelBase et al. is in the same +# directory as PrelMain, the compiler will assume that they +# reside in the same DLL as PrelMain & generate code accordingly. +# +# So, we copy out PrelMain.lhs to ".." and build it there & +# copy the gen'ed object file back in again. +# +ifeq "$(way)" "dll" +PrelMain.dll_o : PrelMain.lhs + $(RM) ../PrelMain.lhs + $(CP) PrelMain.lhs ../ + $(MAKE) -C .. PrelMain.dll_o way=dll HC_OPTS="$(filter-out -fcompiling-prelude, $(HC_OPTS))" + $(MV) ../PrelMain.dll_o . + $(RM) ../PrelMain.lhs ../PrelMain.dll_hi +endif #----------------------------------------------------------------------------- # Installation; need to install .hi files as well as libraries @@ -109,7 +133,7 @@ override datadir:=$(libdir)/imports/std INSTALL_LIBS += $(LIBRARY) ifeq "$(EnableWin32DLLs)" "YES" INSTALL_PROGS += $(DLL_NAME) -INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) PrelMain.o +INSTALL_LIBS += $(patsubst %.a, %_imp.a, $(LIBRARY)) PrelMain.dll_o INSTALL_DATAS += dLL_ifs.hi endif INSTALL_DATAS += $(HS_IFACES) -- 1.7.10.4