[project @ 1999-09-17 10:43:51 by sof]
authorsof <unknown>
Fri, 17 Sep 1999 10:43:54 +0000 (10:43 +0000)
committersof <unknown>
Fri, 17 Sep 1999 10:43:54 +0000 (10:43 +0000)
DLL building tweaks, including terrible hack to compile PrelMain

ghc/lib/concurrent/Makefile
ghc/lib/exts/Makefile
ghc/lib/misc/Makefile
ghc/lib/misc/cbits/Makefile
ghc/lib/std/Makefile

index 46d0b57..f99e2c5 100644 (file)
@@ -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
 
index 6a207cf..d662b07 100644 (file)
@@ -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
index e3468d5..2da481e 100644 (file)
@@ -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
 
index 379073f..69feafe 100644 (file)
@@ -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
index e05657a..eab2b40 100644 (file)
@@ -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)