summaryrefslogtreecommitdiffstats
path: root/src/gcc.mk
diff options
context:
space:
mode:
Diffstat (limited to 'src/gcc.mk')
-rw-r--r--src/gcc.mk57
1 files changed, 16 insertions, 41 deletions
diff --git a/src/gcc.mk b/src/gcc.mk
index a26f643..d16c62d 100644
--- a/src/gcc.mk
+++ b/src/gcc.mk
@@ -3,7 +3,7 @@
# GCC
PKG := gcc
-$(PKG)_IGNORE :=
+$(PKG)_IGNORE :=
$(PKG)_VERSION := 4.5.0
$(PKG)_CHECKSUM := 4beb8366ce1883f37255aa57f0258e7d3cd13a9b
$(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
@@ -11,7 +11,7 @@ $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
$(PKG)_WEBSITE := http://gcc.gnu.org/
$(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
$(PKG)_URL_2 := ftp://ftp.cs.tu-berlin.de/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS := mingwrt mingwrt-dll w32api binutils gcc-gmp gcc-mpc gcc-mpfr gcc-pthreads
+$(PKG)_DEPS := mingwrt mingwrt-dll w32api binutils gcc-gmp gcc-mpc gcc-mpfr
define $(PKG)_UPDATE
wget -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \
@@ -20,7 +20,18 @@ define $(PKG)_UPDATE
head -1
endef
-$(PKG)_CONFIGURE_OPTIONS := \
+define $(PKG)_BUILD
+ # unpack support libraries
+ cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-gmp)
+ mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/gmp'
+ cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpc)
+ mv '$(1)/$(gcc-mpc_SUBDIR)' '$(1)/mpc'
+ cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr)
+ mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/mpfr'
+
+ # build GCC and support libraries
+ mkdir '$(1)/build'
+ cd '$(1)/build' && '$(1)/configure' \
--target='$(TARGET)' \
--prefix='$(PREFIX)' \
--enable-languages='c,c++,objc,fortran' \
@@ -32,46 +43,10 @@ $(PKG)_CONFIGURE_OPTIONS := \
--disable-shared \
--without-x \
--disable-win32-registry \
- --enable-sjlj-exceptions
-
-define $(PKG)_BUILD
- # unpack support libraries
- cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-gmp)
- mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/gmp'
- cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpc)
- mv '$(1)/$(gcc-mpc_SUBDIR)' '$(1)/mpc'
- cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr)
- mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/mpfr'
- # build everything of GCC except libgomp and libmudflap
- mkdir '$(1)/build'
- cd '$(1)/build' && '$(1)/configure' \
- $(gcc_CONFIGURE_OPTIONS) \
- --enable-threads=win32 \
- --disable-libgomp \
- --disable-libmudflap
+ --enable-sjlj-exceptions \
+ --enable-threads=win32
$(MAKE) -C '$(1)/build' -j '$(JOBS)'
$(MAKE) -C '$(1)/build' -j 1 install
- # unpack and build pthreads (needed by libgomp)
- cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-pthreads)
- $(SED) -i '35i\#define PTW32_STATIC_LIB' '$(1)/$(gcc-pthreads_SUBDIR)/pthread.h'
- $(SED) -i '41i\#define PTW32_STATIC_LIB' '$(1)/$(gcc-pthreads_SUBDIR)/sched.h'
- $(SED) -i '41i\#define PTW32_STATIC_LIB' '$(1)/$(gcc-pthreads_SUBDIR)/semaphore.h'
- $(SED) -i 's,#include "config.h",,' '$(1)/$(gcc-pthreads_SUBDIR)/pthread.h'
- $(MAKE) -C '$(1)/$(gcc-pthreads_SUBDIR)' -j 1 GC-static CROSS='$(TARGET)-'
- $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
- $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/libpthreadGC2.a' '$(PREFIX)/$(TARGET)/lib/libpthread.a'
- $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
- $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/pthread.h' '$(PREFIX)/$(TARGET)/include/'
- $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/sched.h' '$(PREFIX)/$(TARGET)/include/'
- $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/semaphore.h' '$(PREFIX)/$(TARGET)/include/'
- # build libgomp
- $(SED) -i 's,cross_compiling=no,cross_compiling=yes,' '$(1)/libgomp/configure'
- mkdir '$(1)/build/$(TARGET)/libgomp'
- cd '$(1)/build/$(TARGET)/libgomp' && '$(1)/libgomp/configure' \
- $(gcc_CONFIGURE_OPTIONS) \
- --host='$(TARGET)' \
- LIBS='-lws2_32'
- $(MAKE) -C '$(1)/build/$(TARGET)/libgomp' -j '$(JOBS)' install
# create pkg-config script
(echo '#!/bin/sh'; \