annotate src/native-gcc.mk @ 3480:13be64f9f16d

move version info from index.html to src/*.mk files
author John W. Eaton <jwe@octave.org>
date Fri, 31 Jan 2014 16:04:01 -0500
parents e3944cf36a54
children 799dcef88a41
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
1 # This file is part of MXE.
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
2 # See index.html for further information.
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
3
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
4 PKG := native-gcc
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
5 $(PKG)_IGNORE :=
3480
13be64f9f16d move version info from index.html to src/*.mk files
John W. Eaton <jwe@octave.org>
parents: 3250
diff changeset
6 $(PKG)_VERSION := 4.8.1
3250
e3944cf36a54 update native gcc version to match build-gcc version
John W. Eaton <jwe@octave.org>
parents: 3174
diff changeset
7 $(PKG)_CHECKSUM := 4e655032cda30e1928fcc3f00962f4238b502169
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
8 $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
9 $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
10 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
11 $(PKG)_URL_2 := ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
3058
09c2c23f4bf2 fix building native-binutils
Philip Nienhuis
parents: 3048
diff changeset
12 $(PKG)_DEPS := mingwrt w32api build-binutils gcc-gmp gcc-mpc gcc-mpfr
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
13 ifneq ($(BUILD_SHARED),yes)
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
14 $(PKG)_STATIC_FLAG := --static
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
15 endif
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
16
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
17 define $(PKG)_UPDATE
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
18 $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
19 $(SED) -n 's,.*<a href="gcc-\([0-9][^"]*\)/".*,\1,p' | \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
20 grep -v '^4\.[543]\.' | \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
21 head -1
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
22 endef
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
23
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
24 define $(PKG)_BUILD
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
25 # unpack support libraries
3174
6e323510f5b5 Fix calls to UNPACK_PKG_ARCHIVE in src/*.mk files.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3058
diff changeset
26 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-gmp,$(TAR))
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
27 mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/gmp'
3174
6e323510f5b5 Fix calls to UNPACK_PKG_ARCHIVE in src/*.mk files.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3058
diff changeset
28 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpc,$(TAR))
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
29 mv '$(1)/$(gcc-mpc_SUBDIR)' '$(1)/mpc'
3174
6e323510f5b5 Fix calls to UNPACK_PKG_ARCHIVE in src/*.mk files.
Michael Goffioul <michael.goffioul@gmail.com>
parents: 3058
diff changeset
30 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr,$(TAR))
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
31 mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/mpfr'
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
32
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
33 # build GCC and support libraries
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
34 mkdir '$(1).build'
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
35 cd '$(1).build' && '$(1)/configure' \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
36 --target='$(TARGET)' \
3013
bcc26ffe9a0f use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents: 3012
diff changeset
37 $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
38 --prefix='/usr' \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
39 --libdir='/usr/lib' \
3016
c94807091658 native-gcc.mk: don't build objective C compiler
John W. Eaton <jwe@octave.org>
parents: 3014
diff changeset
40 --enable-languages='c,c++,fortran' \
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
41 --enable-version-specific-runtime-libs \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
42 --with-gcc \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
43 --with-gnu-ld \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
44 --with-gnu-as \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
45 --disable-nls \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
46 $(ENABLE_SHARED_OR_STATIC) \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
47 --disable-sjlj-exceptions \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
48 --without-x \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
49 --disable-win32-registry \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
50 --enable-threads=win32 \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
51 --disable-libgomp \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
52 --disable-libmudflap \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
53 --with-mpfr-include='$(1)/mpfr/src' \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
54 --with-mpfr-lib='$(1).build/mpfr/src/.libs' \
3014
b6c7244a2f66 Use HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR instead of MXE_BINDIR, MXE_LIBDIR, and MXE_INCDIR. Attempt to use these variables consistently instead of using $(HOST_PREFIX)/bin, $(HOST_PREFIX)/lib, and $(HOST_PREFIX)/include
John W. Eaton <jwe@octave.org>
parents: 3013
diff changeset
55 --with-native-system-header-dir=$(HOST_INCDIR) \
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
56 $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'")
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
57 $(MAKE) -C '$(1).build' -j '$(JOBS)'
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 2997
diff changeset
58 $(MAKE) -C '$(1).build' -j 1 DESTDIR='$(TOP_DIR)/native-tools' install
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
59
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
60 # # create pkg-config script
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
61 # (echo '#!/bin/sh'; \
3014
b6c7244a2f66 Use HOST_BINDIR, HOST_LIBDIR, and HOST_INCDIR instead of MXE_BINDIR, MXE_LIBDIR, and MXE_INCDIR. Attempt to use these variables consistently instead of using $(HOST_PREFIX)/bin, $(HOST_PREFIX)/lib, and $(HOST_PREFIX)/include
John W. Eaton <jwe@octave.org>
parents: 3013
diff changeset
62 # echo 'PKG_CONFIG_PATH="$$PKG_CONFIG_PATH_$(subst -,_,$(TARGET))" PKG_CONFIG_LIBDIR='\''$(HOST_LIBDIR)/pkgconfig'\'' exec pkg-config $($(PKG)_STATIC_FLAG) "$$@"') \
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
63 # > '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config'
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
64 # chmod 0755 '$(BUILD_TOOLS_PREFIX)/bin/$(MXE_TOOL_PREFIX)pkg-config'
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
65
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
66 # # create the CMake toolchain file
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
67 # [ -d '$(dir $(CMAKE_TOOLCHAIN_FILE))' ] || mkdir -p '$(dir $(CMAKE_TOOLCHAIN_FILE))'
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
68 # (echo 'set(CMAKE_SYSTEM_NAME Windows)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
69 # echo 'set(MSYS 1)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
70 # if [ $(BUILD_SHARED) = yes ]; then \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
71 # echo 'set(BUILD_SHARED_LIBS ON)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
72 # else \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
73 # echo 'set(BUILD_SHARED_LIBS OFF)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
74 # fi; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
75 # if [ $(BUILD_STATIC) = yes ]; then \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
76 # echo 'set(BUILD_STATIC_LIBS ON)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
77 # else \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
78 # echo 'set(BUILD_STATIC_LIBS OFF)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
79 # fi; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
80 # echo 'set(CMAKE_BUILD_TYPE Release)'; \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 2997
diff changeset
81 # echo 'set(CMAKE_FIND_ROOT_PATH $(HOST_PREFIX))'; \
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
82 # echo 'set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
83 # echo 'set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)'; \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
84 # echo 'set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)'; \
3031
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
85 # echo 'set(CMAKE_C_COMPILER $(MXE_CC))'; \
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
86 # echo 'set(CMAKE_CXX_COMPILER $(MXE_CXX))'; \
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
87 # echo 'set(CMAKE_Fortran_COMPILER $(MXE_F77))'; \
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
88 # echo 'set(CMAKE_RC_COMPILER $(MXE_WINDRES))'; \
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
89 # echo 'set(PKG_CONFIG_EXECUTABLE $(MXE_PKG_CONFIG))'; \
951da75fd09c improve handling of cross tool prefix
John W. Eaton <jwe@octave.org>
parents: 3016
diff changeset
90 # echo 'set(QT_QMAKE_EXECUTABLE $(MXE_QMAKE))'; \
3012
100e618349f7 Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents: 2997
diff changeset
91 # echo 'set(CMAKE_INSTALL_PREFIX $(HOST_PREFIX) CACHE PATH "Installation Prefix")'; \
2915
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
92 # echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel")') \
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
93 # > '$(CMAKE_TOOLCHAIN_FILE)'
74304e21f1ab native gcc and binutils
John W. Eaton <jwe@octave.org>
parents:
diff changeset
94 endef