comparison src/build-gcc.mk @ 3542:bff3dfa5c343

make native linux builds work again, hopefully without breaking cross mingw builds...
author John W. Eaton <jwe@octave.org>
date Wed, 19 Feb 2014 16:46:26 -0500
parents 1b350761007f
children ba8987374138
comparison
equal deleted inserted replaced
3541:3ba1b1d89243 3542:bff3dfa5c343
8 $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION) 8 $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
9 $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2 9 $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
10 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE) 10 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
11 $(PKG)_URL_2 := ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE) 11 $(PKG)_URL_2 := ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
12 12
13 $(PKG)_DEPS := build-cmake build-binutils gcc-cloog gcc-gmp gcc-isl gcc-mpc gcc-mpfr 13 $(PKG)_DEPS := build-cmake gcc-cloog gcc-gmp gcc-isl gcc-mpc gcc-mpfr
14 ifneq ($(MXE_NATIVE_BUILD),yes)
15 $(PKG)_DEPS += build-binutils
16 endif
14 ifeq ($(MXE_SYSTEM),mingw) 17 ifeq ($(MXE_SYSTEM),mingw)
15 $(PKG)_DEPS += mingw-w64 18 $(PKG)_DEPS += mingw-w64
16 endif 19 endif
17 20
18 ifneq ($(BUILD_SHARED),yes) 21 ifneq ($(BUILD_SHARED),yes)
27 --with-gnu-ld \ 30 --with-gnu-ld \
28 --with-gnu-as \ 31 --with-gnu-as \
29 --disable-nls \ 32 --disable-nls \
30 --without-x \ 33 --without-x \
31 --disable-win32-registry \ 34 --disable-win32-registry \
32 --enable-threads=win32 \ 35 --with-native-system-header-dir='/include' \
33 --with-native-system-header-dir='/include' 36 --enable-threads=win32
34 ifneq ($(ENABLE_64),yes) 37 ifneq ($(ENABLE_64),yes)
35 $(PKG)_SYSDEP_CONFIGURE_OPTIONS += \ 38 $(PKG)_SYSDEP_CONFIGURE_OPTIONS += \
36 --disable-sjlj-exceptions 39 --disable-sjlj-exceptions
37 endif 40 endif
41 define $(PKG)_BUILD_SYSTEM_RUNTIME
42 # build standalone gcc
43 $(MAKE) -C '$(1).build' -j '$(JOBS)' all-gcc
44 $(MAKE) -C '$(1).build' -j 1 install-gcc
45
46 # build mingw-w64-crt
47 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,mingw-w64,$(TAR))
48 mkdir '$(1).crt-build'
49 cd '$(1).crt-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-crt/configure' \
50 --host='$(TARGET)' \
51 --prefix='$(HOST_PREFIX)' \
52 --with-sysroot='$(HOST_PREFIX)' \
53 $(ENABLE_SHARED_OR_STATIC)
54 $(MAKE) -C '$(1).crt-build' -j '$(JOBS)' || $(MAKE) -C '$(1).crt-build' -j '$(JOBS)'
55 $(MAKE) -C '$(1).crt-build' -j 1 install
56 endef
57 endif
58
59 ifneq ($(MXE_NATIVE_BUILD),yes)
60 $(PKG)_SYSDEP_CONFIGURE_OPTIONS += \
61 --target='$(TARGET)' \
62 --build='$(BUILD_SYSTEM)' \
63 --with-sysroot='$(HOST_PREFIX)' \
64 --with-as='$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-as' \
65 --with-ld='$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-ld' \
66 --with-nm='$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-nm'
38 endif 67 endif
39 68
40 define $(PKG)_UPDATE 69 define $(PKG)_UPDATE
41 $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \ 70 $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \
42 $(SED) -n 's,.*<a href="gcc-\([0-9][^"]*\)/".*,\1,p' | \ 71 $(SED) -n 's,.*<a href="gcc-\([0-9][^"]*\)/".*,\1,p' | \
53 82
54 define $(PKG)_CONFIGURE 83 define $(PKG)_CONFIGURE
55 # configure gcc 84 # configure gcc
56 mkdir '$(1).build' 85 mkdir '$(1).build'
57 cd '$(1).build' && '$(1)/configure' \ 86 cd '$(1).build' && '$(1)/configure' \
58 --target='$(TARGET)' \
59 --build='$(BUILD_SYSTEM)' \
60 --prefix='$(BUILD_TOOLS_PREFIX)' \ 87 --prefix='$(BUILD_TOOLS_PREFIX)' \
61 --enable-languages='c,c++,fortran' \ 88 --enable-languages='c,c++,fortran' \
62 --disable-multilib \ 89 --disable-multilib \
63 --with-sysroot='$(HOST_PREFIX)' \
64 $($(PKG)_SYSDEP_CONFIGURE_OPTIONS) \ 90 $($(PKG)_SYSDEP_CONFIGURE_OPTIONS) \
65 $(ENABLE_SHARED_OR_STATIC) \ 91 $(ENABLE_SHARED_OR_STATIC) \
66 --disable-libgomp \ 92 --disable-libgomp \
67 --disable-libmudflap \ 93 --disable-libmudflap \
68 --with-cloog='$(BUILD_TOOLS_PREFIX)' \ 94 --with-cloog='$(BUILD_TOOLS_PREFIX)' \
69 --with-gmp='$(BUILD_TOOLS_PREFIX)' \ 95 --with-gmp='$(BUILD_TOOLS_PREFIX)' \
70 --with-isl='$(BUILD_TOOLS_PREFIX)' \ 96 --with-isl='$(BUILD_TOOLS_PREFIX)' \
71 --with-mpc='$(BUILD_TOOLS_PREFIX)' \ 97 --with-mpc='$(BUILD_TOOLS_PREFIX)' \
72 --with-mpfr='$(BUILD_TOOLS_PREFIX)' \ 98 --with-mpfr='$(BUILD_TOOLS_PREFIX)' \
73 --with-as='$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-as' \
74 --with-ld='$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-ld' \
75 --with-nm='$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-nm'
76 $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'") 99 $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'")
77 endef 100 endef
78 101
79 define $(PKG)_BUILD 102 define $(PKG)_BUILD
80 # build standalone gcc
81 $($(PKG)_CONFIGURE) 103 $($(PKG)_CONFIGURE)
82 $(MAKE) -C '$(1).build' -j '$(JOBS)' all-gcc
83 $(MAKE) -C '$(1).build' -j 1 install-gcc
84 104
85 # build mingw-w64-crt 105 $($(PKG)_BUILD_SYSTEM_RUNTIME)
86 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,mingw-w64,$(TAR))
87 mkdir '$(1).crt-build'
88 cd '$(1).crt-build' && '$(1)/$(mingw-w64_SUBDIR)/mingw-w64-crt/configure' \
89 --host='$(TARGET)' \
90 --prefix='$(HOST_PREFIX)' \
91 --with-sysroot='$(HOST_PREFIX)' \
92 $(ENABLE_SHARED_OR_STATIC)
93 $(MAKE) -C '$(1).crt-build' -j '$(JOBS)' || $(MAKE) -C '$(1).crt-build' -j '$(JOBS)'
94 $(MAKE) -C '$(1).crt-build' -j 1 install
95 106
96 # build rest of gcc 107 # build rest of gcc
97 cd '$(1).build'
98 $(MAKE) -C '$(1).build' -j '$(JOBS)' 108 $(MAKE) -C '$(1).build' -j '$(JOBS)'
99 $(MAKE) -C '$(1).build' -j 1 install 109 $(MAKE) -C '$(1).build' -j 1 install
100 110
101 if [ -f $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/lib/libgcc_s.a ]; then \ 111 if [ -f $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/lib/libgcc_s.a ]; then \
102 mv $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/lib/libgcc_s.a $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/libgcc_s.a; \ 112 mv $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/lib/libgcc_s.a $(BUILD_TOOLS_PREFIX)/lib/gcc/$(TARGET)/$($(PKG)_VERSION)/libgcc_s.a; \