Mercurial > mxe-octave
annotate src/native-gcc.mk @ 3013:bcc26ffe9a0f
use variable for --host and --build configure arguments
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Sun, 02 Jun 2013 12:40:32 -0400 |
parents | 100e618349f7 |
children | b6c7244a2f66 |
rev | line source |
---|---|
2915 | 1 # This file is part of MXE. |
2 # See index.html for further information. | |
3 | |
4 PKG := native-gcc | |
5 $(PKG)_IGNORE := | |
6 $(PKG)_CHECKSUM := a464ba0f26eef24c29bcd1e7489421117fb9ee35 | |
7 $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION) | |
8 $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2 | |
9 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE) | |
10 $(PKG)_URL_2 := ftp://ftp.mirrorservice.org/sites/sourceware.org/pub/gcc/releases/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE) | |
11 $(PKG)_DEPS := mingwrt w32api binutils gcc-gmp gcc-mpc gcc-mpfr | |
12 ifneq ($(BUILD_SHARED),yes) | |
13 $(PKG)_STATIC_FLAG := --static | |
14 endif | |
15 | |
16 define $(PKG)_UPDATE | |
17 $(WGET) -q -O- 'http://ftp.gnu.org/gnu/gcc/?C=M;O=D' | \ | |
18 $(SED) -n 's,.*<a href="gcc-\([0-9][^"]*\)/".*,\1,p' | \ | |
19 grep -v '^4\.[543]\.' | \ | |
20 head -1 | |
21 endef | |
22 | |
23 define $(PKG)_BUILD | |
24 # unpack support libraries | |
25 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-gmp) | |
26 mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/gmp' | |
27 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpc) | |
28 mv '$(1)/$(gcc-mpc_SUBDIR)' '$(1)/mpc' | |
29 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr) | |
30 mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/mpfr' | |
31 | |
32 # build GCC and support libraries | |
33 mkdir '$(1).build' | |
34 cd '$(1).build' && '$(1)/configure' \ | |
35 --target='$(TARGET)' \ | |
3013
bcc26ffe9a0f
use variable for --host and --build configure arguments
John W. Eaton <jwe@octave.org>
parents:
3012
diff
changeset
|
36 $(HOST_AND_BUILD_CONFIGURE_OPTIONS) \ |
2915 | 37 --prefix='/usr' \ |
38 --libdir='/usr/lib' \ | |
39 --enable-languages='c,c++,objc,fortran' \ | |
40 --enable-version-specific-runtime-libs \ | |
41 --with-gcc \ | |
42 --with-gnu-ld \ | |
43 --with-gnu-as \ | |
44 --disable-nls \ | |
45 $(ENABLE_SHARED_OR_STATIC) \ | |
46 --disable-sjlj-exceptions \ | |
47 --without-x \ | |
48 --disable-win32-registry \ | |
49 --enable-threads=win32 \ | |
50 --disable-libgomp \ | |
51 --disable-libmudflap \ | |
52 --with-mpfr-include='$(1)/mpfr/src' \ | |
53 --with-mpfr-lib='$(1).build/mpfr/src/.libs' \ | |
2997 | 54 --with-native-system-header-dir=$(MXE_INCDIR) \ |
2915 | 55 $(shell [ `uname -s` == Darwin ] && echo "LDFLAGS='-Wl,-no_pie'") |
56 $(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
|
57 $(MAKE) -C '$(1).build' -j 1 DESTDIR='$(TOP_DIR)/native-tools' install |
2915 | 58 |
59 # # create pkg-config script | |
60 # (echo '#!/bin/sh'; \ | |
2997 | 61 # echo 'PKG_CONFIG_PATH="$$PKG_CONFIG_PATH_$(subst -,_,$(TARGET))" PKG_CONFIG_LIBDIR='\''$(MXE_LIBDIR)/pkgconfig'\'' exec pkg-config $($(PKG)_STATIC_FLAG) "$$@"') \ |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
62 # > '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-pkg-config' |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
63 # chmod 0755 '$(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-pkg-config' |
2915 | 64 |
65 # # create the CMake toolchain file | |
66 # [ -d '$(dir $(CMAKE_TOOLCHAIN_FILE))' ] || mkdir -p '$(dir $(CMAKE_TOOLCHAIN_FILE))' | |
67 # (echo 'set(CMAKE_SYSTEM_NAME Windows)'; \ | |
68 # echo 'set(MSYS 1)'; \ | |
69 # if [ $(BUILD_SHARED) = yes ]; then \ | |
70 # echo 'set(BUILD_SHARED_LIBS ON)'; \ | |
71 # else \ | |
72 # echo 'set(BUILD_SHARED_LIBS OFF)'; \ | |
73 # fi; \ | |
74 # if [ $(BUILD_STATIC) = yes ]; then \ | |
75 # echo 'set(BUILD_STATIC_LIBS ON)'; \ | |
76 # else \ | |
77 # echo 'set(BUILD_STATIC_LIBS OFF)'; \ | |
78 # fi; \ | |
79 # 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
|
80 # echo 'set(CMAKE_FIND_ROOT_PATH $(HOST_PREFIX))'; \ |
2915 | 81 # echo 'set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)'; \ |
82 # echo 'set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY)'; \ | |
83 # echo 'set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY)'; \ | |
3012
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
84 # echo 'set(CMAKE_C_COMPILER $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-gcc)'; \ |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
85 # echo 'set(CMAKE_CXX_COMPILER $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-g++)'; \ |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
86 # echo 'set(CMAKE_Fortran_COMPILER $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-gfortran)'; \ |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
87 # echo 'set(CMAKE_RC_COMPILER $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-windres)'; \ |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
88 # echo 'set(PKG_CONFIG_EXECUTABLE $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-pkg-config)'; \ |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
89 # echo 'set(QT_QMAKE_EXECUTABLE $(BUILD_TOOLS_PREFIX)/bin/$(TARGET)-qmake)'; \ |
100e618349f7
Improve handling of prefix directories by defining HOST_PREFIX and
John W. Eaton <jwe@octave.org>
parents:
2997
diff
changeset
|
90 # echo 'set(CMAKE_INSTALL_PREFIX $(HOST_PREFIX) CACHE PATH "Installation Prefix")'; \ |
2915 | 91 # echo 'set(CMAKE_BUILD_TYPE Release CACHE STRING "Debug|Release|RelWithDebInfo|MinSizeRel")') \ |
92 # > '$(CMAKE_TOOLCHAIN_FILE)' | |
93 endef |