From d28b000e1d33222a4ef0de387a6e359a52cb8249 Mon Sep 17 00:00:00 2001 From: Patrik Nyblom Date: Wed, 22 Feb 2012 11:55:57 +0100 Subject: Make hipe hipe-compiled w/ --enable-native-libs --- Makefile.in | 11 +++++++++-- configure.in | 6 ++++++ lib/hipe/Makefile | 21 +++++++++++++++++---- lib/hipe/amd64/Makefile | 3 +++ lib/hipe/arm/Makefile | 3 +++ lib/hipe/boot_ebin/.gitignore | 0 lib/hipe/cerl/Makefile | 3 +++ lib/hipe/doc/Makefile | 3 +++ lib/hipe/doc/src/Makefile | 3 +++ lib/hipe/flow/Makefile | 3 +++ lib/hipe/icode/Makefile | 3 +++ lib/hipe/main/Makefile | 3 +++ lib/hipe/native.mk | 4 +++- lib/hipe/opt/Makefile | 3 +++ lib/hipe/ppc/Makefile | 3 +++ lib/hipe/regalloc/Makefile | 3 +++ lib/hipe/rtl/Makefile | 3 +++ lib/hipe/sparc/Makefile | 3 +++ lib/hipe/util/Makefile | 3 +++ lib/hipe/x86/Makefile | 3 +++ make/otp.mk.in | 6 ++++++ 21 files changed, 86 insertions(+), 7 deletions(-) create mode 100644 lib/hipe/boot_ebin/.gitignore diff --git a/Makefile.in b/Makefile.in index 0b1f0930ca..761d37ac02 100644 --- a/Makefile.in +++ b/Makefile.in @@ -157,6 +157,14 @@ ERLANG_LIBDIR = $(DESTDIR)$(ERLANG_INST_LIBDIR) # Must be GNU make! MAKE = @MAKE_PROG@ +NATIVE_LIBS_ENABLED = @NATIVE_LIBS_ENABLED@ + +ifeq ($(NATIVE_LIBS_ENABLED),yes) +HIPE_BOOTSTRAP_EBIN = boot_ebin +else +HIPE_BOOTSTRAP_EBIN = ebin +endif + # This should be set to the target "arch-vendor-os" TARGET := @TARGET@ include $(ERL_TOP)/make/target.mk @@ -527,7 +535,7 @@ secondary_bootstrap_build: secondary_bootstrap_copy: if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe ; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin ; fi - for x in lib/hipe/ebin/*.beam; do \ + for x in lib/hipe/$(HIPE_BOOTSTRAP_EBIN)/*.beam; do \ BN=`basename $$x`; \ TF=$(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin/$$BN; \ test -f $$TF && \ @@ -537,7 +545,6 @@ secondary_bootstrap_copy: cp $$x $$TF; \ true; \ done -# if test -f lib/hipe/ebin/hipe.beam ; then cp lib/hipe/ebin/*.beam $(BOOTSTRAP_ROOT)/bootstrap/lib/hipe/ebin; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools ; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/ebin ; fi if test ! -d $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; then mkdir $(BOOTSTRAP_ROOT)/bootstrap/lib/parsetools/include ; fi diff --git a/configure.in b/configure.in index c8d4561a44..2c3ee1cb57 100644 --- a/configure.in +++ b/configure.in @@ -361,6 +361,12 @@ if test X${enable_m32_build} = Xyes; then export LDFLAGS fi +NATIVE_LIBS_ENABLED= +if test X${enable_native_libs} = Xyes -a X${enable_hipe} != Xno; then + NATIVE_LIBS_ENABLED=yes +fi +AC_SUBST(NATIVE_LIBS_ENABLED) + export ERL_TOP AC_CONFIG_SUBDIRS(lib erts) diff --git a/lib/hipe/Makefile b/lib/hipe/Makefile index 6682c9aac0..f2be75f0dd 100644 --- a/lib/hipe/Makefile +++ b/lib/hipe/Makefile @@ -37,8 +37,13 @@ else SUB_DIRECTORIES = $(ALWAYS_SUBDIRS) endif + include native.mk +ifndef EBIN +EBIN = ../ebin +endif + # # Default Subdir Targets # @@ -52,12 +57,20 @@ edocs: fi all-subdirs: - -for dir in $(SUB_DIRECTORIES); do \ - (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=../ebin; cd ..); \ + for dir in $(SUB_DIRECTORIES); do \ + (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=$(EBIN); cd ..); \ + done + +# distclean and realclean should clean the bootstrap files +all-subdirs-x: + for dir in $(SUB_DIRECTORIES); do \ + (cd $$dir; $(MAKE) $(MAKETARGET) EBIN=../boot_ebin; cd ..); \ done +clean: + $(MAKE) MAKETARGET="clean" all-subdirs all-subdirs-x distclean: - $(MAKE) MAKETARGET="distclean" all-subdirs + $(MAKE) MAKETARGET="distclean" all-subdirs all-subdirs-x realclean: - $(MAKE) MAKETARGET="realclean" all-subdirs + $(MAKE) MAKETARGET="realclean" all-subdirs all-subdirs-x diff --git a/lib/hipe/amd64/Makefile b/lib/hipe/amd64/Makefile index 58377e5349..397cc0539e 100644 --- a/lib/hipe/amd64/Makefile +++ b/lib/hipe/amd64/Makefile @@ -89,6 +89,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/arm/Makefile b/lib/hipe/arm/Makefile index 3f60cd77cc..6187b7e925 100644 --- a/lib/hipe/arm/Makefile +++ b/lib/hipe/arm/Makefile @@ -90,6 +90,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/boot_ebin/.gitignore b/lib/hipe/boot_ebin/.gitignore new file mode 100644 index 0000000000..e69de29bb2 diff --git a/lib/hipe/cerl/Makefile b/lib/hipe/cerl/Makefile index 7fcc44d27d..d0a0ea1f59 100644 --- a/lib/hipe/cerl/Makefile +++ b/lib/hipe/cerl/Makefile @@ -82,6 +82,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/doc/Makefile b/lib/hipe/doc/Makefile index cdf9c9c798..e28b16c12e 100644 --- a/lib/hipe/doc/Makefile +++ b/lib/hipe/doc/Makefile @@ -24,6 +24,9 @@ include $(ERL_TOP)/make/$(TARGET)/otp.mk clean: -rm -f *.html edoc-info stylesheet.css erlang.png +distclean: clean +realclean: clean + # ---------------------------------------------------- # Special Build Targets # ---------------------------------------------------- diff --git a/lib/hipe/doc/src/Makefile b/lib/hipe/doc/src/Makefile index d440178e4c..065854e8a7 100644 --- a/lib/hipe/doc/src/Makefile +++ b/lib/hipe/doc/src/Makefile @@ -97,6 +97,9 @@ clean clean_docs: rm -f $(TOP_PDF_FILE) $(TOP_PDF_FILE:%.pdf=%.fo) rm -f errs core *~ +distclean: clean +realclean: clean + # ---------------------------------------------------- # Release Target # ---------------------------------------------------- diff --git a/lib/hipe/flow/Makefile b/lib/hipe/flow/Makefile index bbe8ef8666..e8d570ac48 100644 --- a/lib/hipe/flow/Makefile +++ b/lib/hipe/flow/Makefile @@ -82,6 +82,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/icode/Makefile b/lib/hipe/icode/Makefile index bd6436c8b3..e57daecfbc 100644 --- a/lib/hipe/icode/Makefile +++ b/lib/hipe/icode/Makefile @@ -100,6 +100,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/main/Makefile b/lib/hipe/main/Makefile index a14c9c3ca4..d49dd6f424 100644 --- a/lib/hipe/main/Makefile +++ b/lib/hipe/main/Makefile @@ -93,6 +93,9 @@ clean: rm -f $(TARGET_FILES) $(DOC_FILES) $(HRL_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/native.mk b/lib/hipe/native.mk index 6f4602477b..738e78e556 100644 --- a/lib/hipe/native.mk +++ b/lib/hipe/native.mk @@ -1,5 +1,7 @@ -ifndef SECONDARY_BOOTSTRAP ifeq ($(NATIVE_LIBS_ENABLED),yes) +ifndef SECONDARY_BOOTSTRAP ERL_COMPILE_FLAGS += +native +else +EBIN = ../boot_ebin endif endif diff --git a/lib/hipe/opt/Makefile b/lib/hipe/opt/Makefile index 4596201801..8e244ab360 100644 --- a/lib/hipe/opt/Makefile +++ b/lib/hipe/opt/Makefile @@ -80,6 +80,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/ppc/Makefile b/lib/hipe/ppc/Makefile index f24139e34b..83376e8d9d 100644 --- a/lib/hipe/ppc/Makefile +++ b/lib/hipe/ppc/Makefile @@ -92,6 +92,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/regalloc/Makefile b/lib/hipe/regalloc/Makefile index 386f3589c6..c327b443b0 100644 --- a/lib/hipe/regalloc/Makefile +++ b/lib/hipe/regalloc/Makefile @@ -94,6 +94,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/rtl/Makefile b/lib/hipe/rtl/Makefile index 48086ec79f..30026831b7 100644 --- a/lib/hipe/rtl/Makefile +++ b/lib/hipe/rtl/Makefile @@ -89,6 +89,9 @@ clean: rm -f $(TARGET_FILES) rm -f core erl_crash.dump +distclean: clean +realclean: clean + # ---------------------------------------------------- # Special Build Targets # ---------------------------------------------------- diff --git a/lib/hipe/sparc/Makefile b/lib/hipe/sparc/Makefile index f25212a89b..e3acecdcb8 100644 --- a/lib/hipe/sparc/Makefile +++ b/lib/hipe/sparc/Makefile @@ -92,6 +92,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/util/Makefile b/lib/hipe/util/Makefile index 85719ec3d6..7d1a7c01c7 100644 --- a/lib/hipe/util/Makefile +++ b/lib/hipe/util/Makefile @@ -85,6 +85,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/lib/hipe/x86/Makefile b/lib/hipe/x86/Makefile index d7d0c7bf5a..aed757246f 100644 --- a/lib/hipe/x86/Makefile +++ b/lib/hipe/x86/Makefile @@ -100,6 +100,9 @@ clean: rm -f $(TARGET_FILES) rm -f core +distclean: clean +realclean: clean + $(DOCS)/%.html:%.erl erl -noshell -run edoc_run file '"$<"' '[{dir, "$(DOCS)"}]' -s init stop diff --git a/make/otp.mk.in b/make/otp.mk.in index 507f040729..b9ab9dd4b5 100644 --- a/make/otp.mk.in +++ b/make/otp.mk.in @@ -115,6 +115,12 @@ $(EBIN)/%.beam: $(EGEN)/%.erl $(EBIN)/%.beam: $(ESRC)/%.erl $(ERLC) $(ERL_COMPILE_FLAGS) -o$(EBIN) $< +ifeq ($(NATIVE_LIBS_ENABLED),yes) +# Special rule for the HIPE bootstrap w/ native libs +../boot_ebin/%.beam: $(ESRC)/%.erl + $(ERLC) $(ERL_COMPILE_FLAGS) -o../boot_ebin $< +endif + .erl.beam: $(ERLC) $(ERL_COMPILE_FLAGS) -o$(dir $@) $< -- cgit v1.2.3