Ticket #1346: ghc.diff
| File ghc.diff, 17.9 kB (added by kili, 4 months ago) |
|---|
-
ghc-6.8.2/Makefile
old new 59 59 60 60 # We can't 'make boot' in libraries until stage1 is built 61 61 ifeq "$(BootingFromHc)" "YES" 62 SUBDIRS_BUILD = gmp includes rts comp at compiler docs utils driver62 SUBDIRS_BUILD = gmp includes rts compiler docs utils driver 63 63 else 64 64 SUBDIRS_BUILD = gmp includes compat utils driver docs compiler rts libraries/Cabal/doc 65 65 endif … … 498 498 # HC file bundles 499 499 500 500 hc-file-bundle : 501 cd libraries && $(MAKE) bootmakefiles 501 502 $(RM) -r ghc-$(ProjectVersion) 502 503 $(LN_S) . ghc-$(ProjectVersion) 503 504 $(FIND) ghc-$(ProjectVersion)/compiler \ 504 505 ghc-$(ProjectVersion)/utils \ 505 ghc-$(ProjectVersion)/compat \506 506 ghc-$(ProjectVersion)/libraries -follow \ 507 \( -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" \) -print > hc-files-to-go 507 \( -name "*.hc" -o -name "*_hsc.[ch]" -o -name "*_stub.[ch]" \ 508 -o -name boot.mk \ 509 \) -print > hc-files-to-go 508 510 for f in `$(FIND) ghc-$(ProjectVersion)/compiler ghc-$(ProjectVersion)/utils ghc-$(ProjectVersion)/libraries -name "*.hsc" -follow -print` ""; do \ 509 511 if test "x$$f" != "x" && test -e `echo "$$f" | sed 's/hsc$$/hs/g'`; then \ 510 512 echo `echo "$$f" | sed 's/hsc$$/hs/g' ` >> hc-files-to-go ; \ … … 515 517 echo `echo "$$f" | sed 's/cmm$$/hc/g' ` >> hc-files-to-go ; \ 516 518 fi; \ 517 519 done; 520 echo ghc-$(ProjectVersion)/driver/package.conf.inplace >> hc-files-to-go 518 521 echo ghc-$(ProjectVersion)/libraries/base/GHC/PrimopWrappers.hs >> hc-files-to-go 519 522 echo ghc-$(ProjectVersion)/compiler/parser/Parser.hs >> hc-files-to-go 520 523 echo ghc-$(ProjectVersion)/compiler/parser/ParserCore.hs >> hc-files-to-go 521 524 echo ghc-$(ProjectVersion)/compiler/main/ParsePkgConf.hs >> hc-files-to-go 522 echo ghc-$(ProjectVersion)/libraries/haskell-src/Language/Haskell/Parser.hs >> hc-files-to-go523 525 tar czf ghc-$(ProjectVersion)-$(TARGETPLATFORM)-hc.tar.gz `cat hc-files-to-go` 524 526 525 527 # ----------------------------------------------------------------------------- -
ghc-6.8.2/aclocal.m4
old new 1098 1098 AC_DEFUN([FP_FIND_ROOT],[ 1099 1099 AC_MSG_CHECKING(for path to top of build tree) 1100 1100 1101 dnl This would be 1102 dnl make -C utils/pwd clean && make -C utils/pwd 1103 dnl except we don't want to have to know what make is called. Sigh. 1104 if test ! -f utils/pwd/pwd && test ! -f utils/pwd/pwd.exe; then 1105 cd utils/pwd 1106 rm -f *.o 1107 rm -f *.hi 1108 rm -f pwd 1109 rm -f pwd.exe 1110 $WithGhc -v0 --make pwd -o pwd 1111 cd ../.. 1112 fi 1113 1114 hardtop=`utils/pwd/pwd forwardslash` 1115 1116 if ! test -d "$hardtop"; then 1117 AC_MSG_ERROR([cannot determine current directory]) 1118 fi 1101 hardtop=`pwd` 1119 1102 1120 1103 dnl Remove common automounter nonsense 1121 1104 dnl -
ghc-6.8.2/compiler/Makefile
old new 442 442 PKG_DEPENDS += hpc bytestring 443 443 endif 444 444 445 ifeq "$(GhcWithInterpreter) $(bootstrapped) " "YES YES"445 ifeq "$(GhcWithInterpreter) $(bootstrapped) $(BootingFromHc)" "YES YES NO" 446 446 447 447 # Yes, include the interepreter and Template Haskell extensions 448 448 SRC_HC_OPTS += -DGHCI -package template-haskell … … 723 723 #----------------------------------------------------------------------------- 724 724 # Linking 725 725 726 # Include libghccompat in stage1 only. In stage2 onwards, all these 727 # libraries will be available from the main libraries. 726 # Include libghccompat in stage1 only, and only if not bootstrapping 727 # from HC files. In stage2 onwards, all these libraries will be 728 # available from the main libraries. 728 729 729 ifeq "$( stage)" "1"730 ifeq "$(BootingFromHc)$(stage)" "NO1" 730 731 include $(GHC_COMPAT_DIR)/compat.mk 731 732 endif 732 733 … … 753 754 $(SED) -e "s@GHC_PATH@$(GHC_PATH)@g" -e "s@TOP_ABS@$(FPTOOLS_TOP_ABS)@g" < $< > $@ 754 755 755 756 $(INPLACE_PROG): $(INPLACE_SRC) 757 ifneq "$(BootingFromHc)" "YES" 756 758 $(HC) -cpp $(INPLACE_EXTRA_FLAGS) $< -o $@ 759 else 760 $(CC) $(HC_BOOT_CC_OPTS) $(INPLACE_EXTRA_FLAGS) $< -o $@ 761 endif 757 762 758 763 all :: $(INPLACE_PROG) 759 764 … … 775 780 # but put it together with the libraries. 776 781 # Also don't want any interface files installed 777 782 778 DESTDIR = $(INSTALL_LIBRARY_DIR_GHC)779 783 780 784 ifneq "$(HOSTPLATFORM)" "i386-unknown-mingw32" 781 785 INSTALL_LIBEXECS += $(GHC_PROG) … … 1023 1027 MKDEPENDHS_HC_OPTS = $(patsubst -i$(odir)/%, -i%, $(HC_OPTS)) 1024 1028 1025 1029 MKDEPENDHS=$(HC) 1030 1031 ifeq "$(BootingFromHc)" "YES" 1032 include $(TOP)/libraries/Cabal/boot.mk 1033 include $(TOP)/libraries/bytestring/boot.mk 1034 include $(TOP)/libraries/haskell98/boot.mk 1035 # XXX why is hpc needed? 1036 include $(TOP)/libraries/hpc/boot.mk 1037 HC_BOOT_CC_OPTS += $(foreach P,$(DEP_PKGS),-I$(TOP)/libraries/$P/include) 1038 endif 1026 1039 1027 1040 # Must do this *after* including target.mk, because $(HS_SRCS) isn't set yet. 1028 1041 depend :: $(STAGE_PLATFORM_H) $(HS_SRCS) $(C_SRCS) -
ghc-6.8.2/libraries/Makefile
old new 20 20 # [ -e foo/configure.ac ] && ( cd foo && autoreconf ) 21 21 # make make.library.foo 22 22 23 .PHONY: default_target show24 25 default_target: all26 27 show:28 @echo '$(VALUE)="$($(VALUE))"'29 30 23 # make doesn't give us an easy way to get the libraries built in 31 24 # dependency order the first time, but not rebuild base (for example) 32 25 # when we want to rebuild another library later. … … 38 31 TOP=.. 39 32 include $(TOP)/mk/boilerplate.mk 40 33 34 ifneq "$(BootingFromHc)" "YES" 35 36 .PHONY: default_target show 37 38 default_target: all 39 40 show: 41 @echo '$(VALUE)="$($(VALUE))"' 42 43 41 44 SUBDIRS = base array packedstring containers bytestring 42 45 SUBDIRS += old-locale old-time filepath directory 43 46 ifeq "$(GhcLibsWithUnix)" "YES" … … 402 405 html-no-chunks chm HxS fo dvi ps pdf: 403 406 @: 404 407 408 # Build some simple Makefile fragments to get all transitive 409 # dependencies and other information for bootstrapping from HC files 410 411 .PHONY: bootmakefiles 412 413 bootmakefiles: boot.mk \ 414 $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/boot.mk) 415 416 %/boot.mk: Makefile 417 echo ifndef $*-version > $@ 418 echo 'PACKAGE ?= $*' >> $@ 419 for f in version exposed-modules hidden-modules extra-libraries; do \ 420 $(TOP)/utils/ghc-pkg/ghc-pkg-inplace field $* $$f | \ 421 sed -e "s/$$f:/$*-$$f =/" \ 422 -e 's/$$/ \\/' \ 423 -e '$$s/ \\$$//'; \ 424 done >> $@ 425 # Hack! This information isn't registered in the package.conf, 426 # so get it from the cabal-generated GNUmakefile. This should be 427 # really done with a small Haskell program using Cabal. 428 { cd $* && $(MAKE) --no-print-directory -s -f GNUmakefile \ 429 show VALUE=C_SRCS; } | sed 's/^/$*-/;s/"//g' >> $@ 430 $(TOP)/utils/ghc-pkg/ghc-pkg-inplace field $* depends | \ 431 tr ' ' '\n' | \ 432 sed -e 's/-[0-9][0-9.]*//g' -e 's/depends://' \ 433 -e '/^rts$$/d' -e '/^$$/d' \ 434 -e 's!^!include $$(TOP)/libraries/!' \ 435 -e 's!$$!/boot.mk!' >> $@ 436 echo 'DEP_PKGS := $* $$(filter-out $*, $$(DEP_PKGS))' >> $@ 437 echo endif >> $@ 438 439 boot.mk: 440 echo "SUBDIRS = $(SUBDIRS)" > $@ 441 442 443 else 444 445 # BootingFromHc 446 include boot.mk 447 448 boot:: $(foreach SUBDIR,$(SUBDIRS),$(SUBDIR)/Makefile) 449 450 %/Makefile: Makefile.boot 451 $(CP) $^ $@ 452 453 include $(TOP)/mk/target.mk 454 endif -
ghc-6.8.2/libraries/Makefile.boot
old new 1 TOP=../.. 2 include $(TOP)/mk/boilerplate.mk 3 include boot.mk 4 5 modules = $($(PACKAGE)-exposed-modules) $($(PACKAGE)-hidden-modules) 6 7 ALL_DIRS = $(patsubst %/,%,$(sort $(dir $(subst .,/,$(modules))))) 8 9 C_SRCS = $($(PACKAGE)-C_SRCS) 10 11 HC_BOOT_CC_OPTS += $(addprefix -I../, $(addsuffix /include, $(DEP_PKGS))) 12 13 # Ad hoc exclusion of sources that aren't used. 14 base-EXCLUDED_SRCS = GHC/Prim.hs 15 filepath-EXCLUDED_SRCS = System/FilePath/Internal.hs 16 17 EXCLUDED_SRCS = $($(PACKAGE)-EXCLUDED_SRCS) 18 EXCLUDED_SRCS += Setup.hs Setup.lhs DefaultSetup.lhs 19 20 odir = dist/build 21 22 STUB_SRCS = $(wildcard $(patsubst %, $(odir)/%/*_stub.c, $(ALL_DIRS))) 23 STUB_OBJS += $(patsubst %.c, %.o, $(STUB_SRCS)) 24 25 LIBOBJS = $(addprefix $(odir)/,$(OBJS)) $(STUB_OBJS) 26 LIBRARY = $(odir)/libHS$(PACKAGE).a 27 28 boot:: stamp-configure 29 30 all:: $(LIBRARY) 31 32 stamp-configure: 33 if [ -x configure ]; then \ 34 ./configure \ 35 $(CONFIGURE_OPTS) \ 36 --prefix=/NONEXISTANT \ 37 --bindir=/NONEXISTANT \ 38 --libdir=/NONEXISTANT \ 39 --libexecdir=/NONEXISTANT \ 40 --datadir=/NONEXISTANT \ 41 --with-hc=../../compiler/stage1/ghc-inplace \ 42 --with-hc-pkg=../../utils/ghc-pkg/ghc-pkg-inplace \ 43 --with-hsc2hs=../../utils/hsc2hs/hsc2hs-inplace \ 44 --with-ld=$(LD) \ 45 $(CONFIGURE_ARGS) \ 46 --with-cc=$(CC); \ 47 fi 48 touch $@ 49 50 include $(TOP)/mk/target.mk -
ghc-6.8.2/libraries/ifBuildable.sh
old new 1 #!/bin/sh 2 # 3 # Replacement of that strange ifBuildable.hs 4 5 if [ $# != 1 ]; then 6 echo 'Syntax: ifBuildable <package>' >& 2 7 exit 1 8 fi 9 10 set -e 11 12 cd "$1" 13 14 if [ -f unbuildable ] && 15 { [ "$1" = readline ] || ! grep -qF "$1" ../boot-packages; } 16 then 17 echo 'Warning: Package is unbuildable' >& 2 18 exit 1 19 fi -
ghc-6.8.2/mk/bootstrap.mk
old new 83 83 84 84 ifeq "$(HaveLibGmp)" "NO" 85 85 DASH_L_GHC_RTS_GMP_DIR=-L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL)/gmp 86 else 87 DASH_L_GHC_RTS_GMP_DIR=$(foreach D,$(GMP_LIB_DIRS),-L$D) 86 88 endif 87 89 88 HC_BOOT_LD_OPTS = \ 89 -L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL) \ 90 $(DASH_L_GHC_RTS_GMP_DIR) \ 91 -L$(FPTOOLS_TOP_ABS)/libraries/base \ 92 -L$(FPTOOLS_TOP_ABS)/libraries/base/cbits \ 93 -L$(FPTOOLS_TOP_ABS)/libraries/haskell98 \ 94 -L$(FPTOOLS_TOP_ABS)/libraries/parsec \ 95 -L$(FPTOOLS_TOP_ABS)/libraries/regex-base \ 96 -L$(FPTOOLS_TOP_ABS)/libraries/regex-posix \ 97 -L$(FPTOOLS_TOP_ABS)/libraries/regex-compat \ 98 -L$(FPTOOLS_TOP_ABS)/libraries/Cabal 90 # XXX DEP_PKGS stuff should probably moved to compiler/Makefile. 91 HC_BOOT_LD_OPTS = \ 92 -L$(FPTOOLS_TOP_ABS)/$(GHC_RTS_DIR_REL) \ 93 $(DASH_L_GHC_RTS_GMP_DIR) \ 94 $(foreach P,$(DEP_PKGS),-L$(FPTOOLS_TOP_ABS)/libraries/$P/dist/build) 99 95 100 ifeq "$(GhcWithInterpreter)" "YES"101 96 HC_BOOT_LD_OPTS += \ 102 -L$(FPTOOLS_TOP_ABS)/libraries/template-haskell \103 -L$(FPTOOLS_TOP_ABS)/libraries/readline \104 -L$(FPTOOLS_TOP_ABS)/libraries/unix \105 -L$(FPTOOLS_TOP_ABS)/libraries/unix/cbits106 endif107 108 HC_BOOT_LD_OPTS += \109 97 -u "$(UNDERSCORE)base_GHCziBase_Izh_static_info" \ 110 98 -u "$(UNDERSCORE)base_GHCziBase_Czh_static_info" \ 111 99 -u "$(UNDERSCORE)base_GHCziFloat_Fzh_static_info" \ … … 139 127 -u "$(UNDERSCORE)__stginit_Prelude" 140 128 141 129 142 HC_BOOT_LIBS = 130 HC_BOOT_LIBS = $(addprefix -lHS, $(DEP_PKGS)) \ 131 $(addprefix -l, $(foreach P, $(DEP_PKGS), \ 132 $($P-extra-libraries))) \ 133 -lHSrts -lgmp -lm $(EXTRA_HC_BOOT_LIBS) 143 134 144 ifeq "$(GhcWithInterpreter)" "YES"145 HC_BOOT_LIBS += -lHSreadline -lHStemplate-haskell -lHSunix -lHSunix_cbits146 endif147 148 HC_BOOT_LIBS += -lHSregex-compat -lHSregex-posix -lHSregex-base -lHSCabal -lHShaskell98 -lHSbase -lHSbase_cbits -lHSparsec -lHSrts -lgmp -lm -lrt $(EXTRA_HC_BOOT_LIBS)149 135 150 136 ifeq "$(GhcLibsWithReadline)" "YES" 151 137 HC_BOOT_LIBS += $(patsubst %, -l%, $(LibsReadline)) -
ghc-6.8.2/mk/opts.mk
old new 77 77 CPP_OPTS = $(SRC_CPP_OPTS) $(WAY$(_way)_CPP_OPTS) $(EXTRA_CPP_OPTS) 78 78 CTAGS_OPTS = $(SRC_CTAGS_OPTS) $(WAY$(_way)_CTAGS_OPTS) $(EXTRA_CTAGS_OPTS) 79 79 CC_OPTS = $(SRC_CC_OPTS) $(WAY$(_way)_CC_OPTS) $($*_CC_OPTS) $(EXTRA_CC_OPTS) 80 ifneq "$(GMP_INCLUDE_DIRS)" "" 81 CC_OPTS += -I$(GMP_INCLUDE_DIRS) 82 endif 80 83 FLEX_OPTS = $(SRC_FLEX_OPTS) $(WAY$(_way)_FLEX_OPTS) $(EXTRA_FLEX_OPTS) 81 84 HADDOCK_OPTS = $(SRC_HADDOCK_OPTS) $(WAY$(_way)_HADDOCK_OPTS) $($*_HADDOCK_OPTS) $(EXTRA_HADDOCK_OPTS) 82 85 HAPPY_OPTS = $(SRC_HAPPY_OPTS) $($(HcFlavour)_HAPPY_OPTS) $(WAY$(_way)_HAPPY_OPTS) $($*_HAPPY_OPTS) $(EXTRA_HAPPY_OPTS) -
ghc-6.8.2/mk/suffix.mk
old new 125 125 # without mangling 126 126 127 127 $(odir_)%.o : %.hc 128 $(CC) -x c $< -o $@ -c -O $(HC_BOOT_CC_OPTS) -I. `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` 128 @mkdir -p $(dir $@) 129 $(CC) -x c $< -o $@ -c -O $(HC_BOOT_CC_OPTS) -I. -Iinclude \ 130 $(addprefix -I,$(odir)) \ 131 `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` 129 132 133 $(odir_)%.o : $(odir_)%.hc 134 $(CC) -x c $< -o $@ -c -O $(HC_BOOT_CC_OPTS) -I. -Iinclude \ 135 $(addprefix -I,$(odir)) \ 136 `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` 137 130 138 else 131 139 132 140 # with mangling 133 141 134 142 $(odir_)%.raw_s : %.hc 135 $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I. `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` 143 @mkdir -p $(dir $@) 144 $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I. -Iinclude \ 145 $(addprefix -I,$(odir)) \ 146 `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` 136 147 148 $(odir_)%.raw_s : $(odir_)%.hc 149 $(CC) -x c $< -o $@ -S -O $(HC_BOOT_CC_OPTS) -I. -Iinclude \ 150 $(addprefix -I,$(odir)) \ 151 `echo $(patsubst -monly-%-regs, -DSTOLEN_X86_REGS=%, $(filter -monly-%-regs, $($*_HC_OPTS))) | sed 's/^$$/-DSTOLEN_X86_REGS=4/'` 152 137 153 $(odir_)%.s : $(odir_)%.raw_s 138 154 $(MANGLER) $< $@ $(patsubst -monly-%-regs, %, $(filter -monly-%-regs, $($*_HC_OPTS))) 139 155 … … 208 224 209 225 $(odir_)%.$(way_)o : %.c 210 226 @$(RM) $@ 211 $(CC) $(CC_OPTS) -c $< -o $@ 227 @mkdir -p $(dir $@) 228 $(CC) $(CC_OPTS) -Iinclude -c $< -o $@ 212 229 213 230 $(odir_)%.$(way_)o : %.$(way_)s 214 231 @$(RM) $@ 232 @mkdir -p $(dir $@) 215 233 $(AS) $(AS_OPTS) -o $@ $< 216 234 217 235 $(odir_)%.$(way_)o : %.S 218 236 @$(RM) $@ 237 @mkdir -p $(dir $@) 219 238 $(CC) $(CC_OPTS) -c $< -o $@ 220 239 221 240 $(odir_)%.$(way_)s : %.c 222 241 @$(RM) $@ 223 $(CC) $(CC_OPTS) -S $< -o $@ 242 @mkdir -p $(dir $@) 243 $(CC) $(CC_OPTS) -Iinclude -S $< -o $@ 224 244 225 245 endif 226 246 247 ifneq "$(BootingFromHc)" "YES" 227 248 # stubs are automatically generated and compiled by GHC 228 249 %_stub.$(way_)o: %.o 229 250 @: 251 else 252 # have to compile the stubs from the HC file bundle 253 $(odir_)%.o : $(odir_)%.c 254 @$(RM) $@ 255 @mkdir -p $(dir $@) 256 $(CC) $(CC_OPTS) -Iinclude -c $< -o $@ 257 endif 230 258 231 259 # ----------------------------------------------------------------------------- 232 260 # Flex/lex -
ghc-6.8.2/utils/Makefile
old new 6 6 SUBDIRS = mkdirhier ghc-pkg hasktags hp2ps hsc2hs parallel prof unlit runghc hpc pwd 7 7 else 8 8 ifeq "$(BootingFromHc)" "YES" 9 SUBDIRS = mkdependC mkdirhier runstdtest genapply genprimopcode ghc-pkgunlit9 SUBDIRS = mkdependC mkdirhier runstdtest unlit 10 10 else 11 11 SUBDIRS = mkdependC mkdirhier runstdtest ghc-pkg hasktags hp2ps hsc2hs \ 12 12 parallel prof unlit genprimopcode genapply runghc hpc pwd
