From 38771dc693f33ebda54841bccd5aac2eb2bc0d37 Mon Sep 17 00:00:00 2001 From: Christian Prochaska Date: Sun, 17 Aug 2014 02:37:47 +0200 Subject: [PATCH] GCC: migrate to new ports mechanism Fixes #1234. --- repos/ports/ports/gcc.hash | 1 + repos/ports/ports/gcc.mk | 64 ----------------------- repos/ports/ports/gcc.port | 31 +++++++++++ repos/ports/src/noux-pkg/gcc/build.patch | 66 +++++++++++------------- repos/ports/src/noux-pkg/gcc/target.inc | 4 +- 5 files changed, 62 insertions(+), 104 deletions(-) create mode 100644 repos/ports/ports/gcc.hash delete mode 100644 repos/ports/ports/gcc.mk create mode 100644 repos/ports/ports/gcc.port diff --git a/repos/ports/ports/gcc.hash b/repos/ports/ports/gcc.hash new file mode 100644 index 000000000..67a2825c6 --- /dev/null +++ b/repos/ports/ports/gcc.hash @@ -0,0 +1 @@ +92324ff98eeba762558097eeb8568980fe410d32 diff --git a/repos/ports/ports/gcc.mk b/repos/ports/ports/gcc.mk deleted file mode 100644 index 4af272e18..000000000 --- a/repos/ports/ports/gcc.mk +++ /dev/null @@ -1,64 +0,0 @@ -GCC_VERSION = 4.7.2 -GCC = gcc-$(GCC_VERSION) -GCC_URL = ftp://ftp.fu-berlin.de/gnu/gcc -GCC_TGZ = gcc-$(GCC_VERSION).tar.gz -GCC_SIG = $(GCC_TGZ).sig -GCC_KEY = GNU - -# -# Interface to top-level prepare Makefile -# -PORTS += $(GCC) - -prepare-gcc: $(CONTRIB_DIR)/$(GCC)/configure - -# -# Port-specific local rules -# - -$(DOWNLOAD_DIR)/$(GCC_TGZ): - $(VERBOSE)wget -P $(DOWNLOAD_DIR) $(GCC_URL)/$(GCC)/$(GCC_TGZ) && touch $@ - -$(DOWNLOAD_DIR)/$(GCC_SIG): - $(VERBOSE)wget -P $(DOWNLOAD_DIR) $(GCC_URL)/$(GCC)/$(GCC_SIG) && touch $@ - -$(DOWNLOAD_DIR)/$(GCC_TGZ).verified: $(DOWNLOAD_DIR)/$(GCC_TGZ) \ - $(DOWNLOAD_DIR)/$(GCC_SIG) - $(VERBOSE)$(SIGVERIFIER) $(DOWNLOAD_DIR)/$(GCC_TGZ) $(DOWNLOAD_DIR)/$(GCC_SIG) $(GCC_KEY) - $(VERBOSE)touch $@ - -# -# Utilities -# -AUTOCONF = autoconf2.64 - -# -# Check if 'autoconf' is installed -# -ifeq ($(shell which $(AUTOCONF)),) -$(error Need to have '$(AUTOCONF)' installed.) -endif - -# -# Check if 'autogen' is installed -# -ifeq ($(shell which autogen)),) -$(error Need to have 'autogen' installed.) -endif - -$(CONTRIB_DIR)/$(GCC): $(DOWNLOAD_DIR)/$(GCC_TGZ).verified - $(VERBOSE)tar xfz $(<:.verified=) -C $(CONTRIB_DIR) - -# needed in 'tool_chain_gcc_patches.inc' -GENODE_DIR := $(abspath ../..) - -include $(GENODE_DIR)/tool/tool_chain_gcc_patches.inc - -$(CONTRIB_DIR)/$(GCC)/configure:: $(CONTRIB_DIR)/$(GCC) - @# - @# Noux-specific changes - @# - $(VERBOSE)patch -d $(CONTRIB_DIR)/$(GCC) -N -p1 < src/noux-pkg/gcc/build.patch - -clean-gcc: - $(VERBOSE)rm -rf $(CONTRIB_DIR)/$(GCC) diff --git a/repos/ports/ports/gcc.port b/repos/ports/ports/gcc.port new file mode 100644 index 000000000..719f1d521 --- /dev/null +++ b/repos/ports/ports/gcc.port @@ -0,0 +1,31 @@ +LICENSE := GPLv3 +VERSION := 4.7.2 +DOWNLOADS := gcc.archive + +URL(gcc) := ftp://ftp.fu-berlin.de/gnu/gcc/gcc-$(VERSION)/gcc-$(VERSION).tar.gz +SHA(gcc) := 39b5662c4bdffa8d8b8f31f61764de2a9e3b69b0 +SIG(gcc) := ${URL(gcc)}.sig +KEY(gcc) := GNU +DIR(gcc) := src/noux-pkg/gcc + +GENODE_DIR := $(REP_DIR)/../.. +PATCHES_DIR := $(GENODE_DIR)/tool/patches/gcc-$(VERSION) +PATCHES := $(addprefix $(PATCHES_DIR)/,$(shell cat $(PATCHES_DIR)/series)) \ + $(REP_DIR)/src/noux-pkg/gcc/build.patch +PATCH_OPT := -p1 -d ${DIR(gcc)} + +AUTOCONF := autoconf2.64 + +$(call check_tool,$(AUTOCONF)) +$(call check_tool,autogen) + +default: _patch + @# + @# Re-generate configure scripts + @# + $(VERBOSE)cd ${DIR(gcc)}; autogen Makefile.def + $(VERBOSE)cd ${DIR(gcc)}/libgcc; $(AUTOCONF) + $(VERBOSE)cd ${DIR(gcc)}/libstdc++-v3; $(AUTOCONF) + $(VERBOSE)cd ${DIR(gcc)}/gcc; $(AUTOCONF) + $(VERBOSE)cd ${DIR(gcc)}; $(AUTOCONF) + $(VERBOSE)touch $@ diff --git a/repos/ports/src/noux-pkg/gcc/build.patch b/repos/ports/src/noux-pkg/gcc/build.patch index 3af99ce7c..c79c88afc 100644 --- a/repos/ports/src/noux-pkg/gcc/build.patch +++ b/repos/ports/src/noux-pkg/gcc/build.patch @@ -4,19 +4,31 @@ From: Christian Prochaska --- - Makefile.in | 7 +++++++ - configure | 1 + + Makefile.def | 1 + + Makefile.tpl | 6 ++++++ fixincludes/Makefile.in | 4 ++-- gcc/Makefile.in | 6 +++--- - gcc/configure | 1 + + gcc/configure.ac | 1 + libgcc/Makefile.in | 2 +- - 6 files changed, 15 insertions(+), 6 deletions(-) + 6 files changed, 14 insertions(+), 6 deletions(-) -diff --git a/Makefile.in b/Makefile.in -index 1cb2117..84759de 100644 ---- a/Makefile.in -+++ b/Makefile.in -@@ -153,6 +153,8 @@ BUILD_EXPORTS = \ +diff --git a/Makefile.def b/Makefile.def +index ae2689d..2569010 100644 +--- a/Makefile.def ++++ b/Makefile.def +@@ -256,6 +256,7 @@ flags_to_pass = { flag= GOCFLAGS_FOR_TARGET ; }; + flags_to_pass = { flag= LD_FOR_TARGET ; }; + flags_to_pass = { flag= LIPO_FOR_TARGET ; }; + flags_to_pass = { flag= LDFLAGS_FOR_TARGET ; }; ++flags_to_pass = { flag= LIBS_FOR_TARGET ; }; + flags_to_pass = { flag= LIBCFLAGS_FOR_TARGET ; }; + flags_to_pass = { flag= LIBCXXFLAGS_FOR_TARGET ; }; + flags_to_pass = { flag= NM_FOR_TARGET ; }; +diff --git a/Makefile.tpl b/Makefile.tpl +index 685756c..45fe31e 100644 +--- a/Makefile.tpl ++++ b/Makefile.tpl +@@ -156,6 +156,8 @@ BUILD_EXPORTS = \ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX_FOR_BUILD)"; export CXX; \ CXXFLAGS="$(CXXFLAGS_FOR_BUILD)"; export CXXFLAGS; \ @@ -25,7 +37,7 @@ index 1cb2117..84759de 100644 GCJ="$(GCJ_FOR_BUILD)"; export GCJ; \ GFORTRAN="$(GFORTRAN_FOR_BUILD)"; export GFORTRAN; \ GOC="$(GOC_FOR_BUILD)"; export GOC; \ -@@ -191,6 +193,8 @@ HOST_EXPORTS = \ +@@ -194,6 +196,8 @@ HOST_EXPORTS = \ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CXX="$(CXX)"; export CXX; \ CXXFLAGS="$(CXXFLAGS)"; export CXXFLAGS; \ @@ -34,7 +46,7 @@ index 1cb2117..84759de 100644 GCJ="$(GCJ)"; export GCJ; \ GFORTRAN="$(GFORTRAN)"; export GFORTRAN; \ GOC="$(GOC)"; export GOC; \ -@@ -277,6 +281,7 @@ BASE_TARGET_EXPORTS = \ +@@ -280,6 +284,7 @@ BASE_TARGET_EXPORTS = \ CFLAGS="$(CFLAGS_FOR_TARGET)"; export CFLAGS; \ CONFIG_SHELL="$(SHELL)"; export CONFIG_SHELL; \ CPPFLAGS="$(CPPFLAGS_FOR_TARGET)"; export CPPFLAGS; \ @@ -42,15 +54,7 @@ index 1cb2117..84759de 100644 CXXFLAGS="$(CXXFLAGS_FOR_TARGET)"; export CXXFLAGS; \ GCJ="$(GCJ_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GCJ; \ GFORTRAN="$(GFORTRAN_FOR_TARGET) $(XGCC_FLAGS_FOR_TARGET) $$TFLAGS"; export GFORTRAN; \ -@@ -775,6 +780,7 @@ BASE_FLAGS_TO_PASS = \ - "LD_FOR_TARGET=$(LD_FOR_TARGET)" \ - "LIPO_FOR_TARGET=$(LIPO_FOR_TARGET)" \ - "LDFLAGS_FOR_TARGET=$(LDFLAGS_FOR_TARGET)" \ -+ "LIBS_FOR_TARGET=$(LIBS_FOR_TARGET)" \ - "LIBCFLAGS_FOR_TARGET=$(LIBCFLAGS_FOR_TARGET)" \ - "LIBCXXFLAGS_FOR_TARGET=$(LIBCXXFLAGS_FOR_TARGET)" \ - "NM_FOR_TARGET=$(NM_FOR_TARGET)" \ -@@ -859,6 +865,7 @@ EXTRA_TARGET_FLAGS = \ +@@ -650,6 +655,7 @@ EXTRA_TARGET_FLAGS = \ 'CFLAGS=$$(CFLAGS_FOR_TARGET)' \ 'CXX=$$(CXX_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ 'CXXFLAGS=$$(CXXFLAGS_FOR_TARGET)' \ @@ -58,18 +62,6 @@ index 1cb2117..84759de 100644 'DLLTOOL=$$(DLLTOOL_FOR_TARGET)' \ 'GCJ=$$(GCJ_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ 'GFORTRAN=$$(GFORTRAN_FOR_TARGET) $$(XGCC_FLAGS_FOR_TARGET) $$(TFLAGS)' \ -diff --git a/configure b/configure -index 88ec0e7..dfb4906 100755 ---- a/configure -+++ b/configure -@@ -642,6 +642,7 @@ LDFLAGS_FOR_TARGET - CXXFLAGS_FOR_TARGET - CFLAGS_FOR_TARGET - CPPFLAGS_FOR_TARGET -+LDFLAGS_FOR_TARGET - DEBUG_PREFIX_CFLAGS_FOR_TARGET - SYSROOT_CFLAGS_FOR_TARGET - stage1_languages diff --git a/fixincludes/Makefile.in b/fixincludes/Makefile.in index b9857b9..0229f70 100644 --- a/fixincludes/Makefile.in @@ -112,11 +104,11 @@ index 5c3514d..9345bc3 100644 BACKENDLIBS = $(CLOOGLIBS) $(PPLLIBS) $(GMPLIBS) $(PLUGINLIBS) $(HOST_LIBS) \ $(ZLIB) # Any system libraries needed just for GNAT. -diff --git a/gcc/configure b/gcc/configure -index a211e83..f6abc2e 100755 ---- a/gcc/configure -+++ b/gcc/configure -@@ -11397,6 +11397,7 @@ else +diff --git a/gcc/configure.ac b/gcc/configure.ac +index 75bb2b5..1cb2b05 100644 +--- a/gcc/configure.ac ++++ b/gcc/configure.ac +@@ -1514,6 +1514,7 @@ else saved_CFLAGS="${CFLAGS}" CC="${CC_FOR_BUILD}" CFLAGS="${CFLAGS_FOR_BUILD}" \ LDFLAGS="${LDFLAGS_FOR_BUILD}" \ diff --git a/repos/ports/src/noux-pkg/gcc/target.inc b/repos/ports/src/noux-pkg/gcc/target.inc index 6eef8a2e4..d6ebeb66b 100644 --- a/repos/ports/src/noux-pkg/gcc/target.inc +++ b/repos/ports/src/noux-pkg/gcc/target.inc @@ -1,6 +1,6 @@ PWD = $(shell pwd) -NOUX_PKG_DIR := $(REP_DIR)/contrib/gcc-4.7.2 +NOUX_PKG_DIR = $(call select_from_ports,gcc)/src/noux-pkg/gcc NOUX_CONFIGURE_ARGS = --program-prefix=$(PROGRAM_PREFIX) \ --target=$(GCC_TARGET) \ @@ -65,8 +65,6 @@ Makefile: dummy_libs LIBS += libc libm libc_noux -NOUX_PKG_DIR = $(wildcard $(REP_DIR)/contrib/gcc-*) - include $(REP_DIR)/mk/noux.mk NOUX_CXXFLAGS += -ffunction-sections $(CC_OLEVEL) -nostdlib $(NOUX_CPPFLAGS)