annotate src/gcc.mk @ 504:0fd340b5a6a8

improved structure of the gcc-* packages
author Volker Grabsch <vog@notjusthosting.com>
date Tue, 27 Oct 2009 14:33:05 +0100
parents 7f0af68acada
children 96fa8fada1dc
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
417
c82e9294b774 replace the contact email address with hints to the project mailing list
Volker Grabsch <vog@notjusthosting.com>
parents: 414
diff changeset
1 # Copyright (C) 2009 Volker Grabsch
414
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
2 #
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
3 # Permission is hereby granted, free of charge, to any person obtaining
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
4 # a copy of this software and associated documentation files (the
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
5 # "Software"), to deal in the Software without restriction, including
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
6 # without limitation the rights to use, copy, modify, merge, publish,
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
7 # distribute, sublicense, and/or sell copies of the Software, and to
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
8 # permit persons to whom the Software is furnished to do so, subject
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
9 # to the following conditions:
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
10 #
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
11 # The above copyright notice and this permission notice shall be
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
12 # included in all copies or substantial portions of the Software.
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
13 #
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
14 # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
15 # EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
16 # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
17 # IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
18 # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
19 # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
20 # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
d2a6561bcb6d add a copyright notice and license to each source file
Volker Grabsch <vog@notjusthosting.com>
parents: 408
diff changeset
21
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
22 # GCC
306
85ffa9259036 validate downloads using SHA-1 checksums
Volker Grabsch <vog@notjusthosting.com>
parents: 266
diff changeset
23 PKG := gcc
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
24 $(PKG)_IGNORE := 4.4.2
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
25 $(PKG)_VERSION := 4.4.0
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
26 $(PKG)_CHECKSUM := 9215af6beb900ca1eef1d6a40c3dabe990203b25
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
27 $(PKG)_SUBDIR := gcc-$($(PKG)_VERSION)
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
28 $(PKG)_FILE := gcc-$($(PKG)_VERSION).tar.bz2
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
29 $(PKG)_WEBSITE := http://gcc.gnu.org/
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
30 $(PKG)_URL := ftp://ftp.gnu.org/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
31 $(PKG)_URL_2 := ftp://ftp.cs.tu-berlin.de/pub/gnu/gcc/gcc-$($(PKG)_VERSION)/$($(PKG)_FILE)
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
32 $(PKG)_DEPS := pkg_config mingwrt mingwrt-dll w32api binutils gcc-gmp gcc-mpfr gcc-tdm gcc-pthreads
115
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
33
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
34 define $(PKG)_UPDATE
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
35 wget -q -O- 'http://gcc.gnu.org/viewcvs/tags/?sortby=date' | \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
36 grep '<a name="gcc_' | \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
37 $(SED) -n 's,.*<a name="gcc_\([0-9][^"]*\)_release".*,\1,p' | \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
38 $(SED) 's,_,.,g' | \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
39 head -1
115
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
40 endef
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
41
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
42 $(PKG)_CONFIGURE_OPTIONS := \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
43 --target='$(TARGET)' \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
44 --prefix='$(PREFIX)' \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
45 --enable-languages='c,c++,objc,fortran' \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
46 --enable-version-specific-runtime-libs \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
47 --with-gcc \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
48 --with-gnu-ld \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
49 --with-gnu-as \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
50 --disable-nls \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
51 --disable-shared \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
52 --without-x \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
53 --disable-win32-registry \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
54 --enable-sjlj-exceptions
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
55
115
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
56 define $(PKG)_BUILD
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
57 # unpack TDM-GCC
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
58 mkdir '$(1)/gcc-tdm'
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
59 cd '$(1)/gcc-tdm' && $(call UNPACK_PKG_ARCHIVE,gcc-tdm)
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
60 # apply TDM-GCC patches
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
61 cd '$(1)' && \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
62 for p in '$(1)'/gcc-tdm/*.patch; do \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
63 $(SED) 's,\r$$,,' -i "$$p" || exit 1; \
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
64 patch -p1 < "$$p" || exit 1; \
217
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
65 done
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
66 # unpack support libraries
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
67 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-gmp)
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
68 mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/gmp'
217
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
69 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr)
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
70 mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/mpfr'
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
71 # build everything of GCC except libgomp and libmudflap
217
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
72 mkdir '$(1)/build'
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
73 cd '$(1)/build' && '$(1)/configure' \
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
74 $(gcc_CONFIGURE_OPTIONS) \
115
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
75 --enable-threads=win32 \
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
76 --disable-libgomp \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
77 --disable-libmudflap
217
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
78 $(MAKE) -C '$(1)/build' -j '$(JOBS)'
89ba55cd6e29 switch from MinGW GCC to TDM-GCC
Volker Grabsch <vog@notjusthosting.com>
parents: 143
diff changeset
79 $(MAKE) -C '$(1)/build' -j 1 install
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
80 # unpack and build pthreads (needed by libgomp)
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
81 cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-pthreads)
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
82 $(SED) '35i\#define PTW32_STATIC_LIB' -i '$(1)/$(gcc-pthreads_SUBDIR)/pthread.h'
456
2402e62b091d strip the disturbing '#include "config.h"' from pthread.h
Volker Grabsch <vog@notjusthosting.com>
parents: 448
diff changeset
83 $(SED) 's,#include "config.h",,' -i '$(1)/$(gcc-pthreads_SUBDIR)/pthread.h'
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
84 $(MAKE) -C '$(1)/$(gcc-pthreads_SUBDIR)' -j 1 GC-static CROSS='$(TARGET)-'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
85 $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
86 $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/libpthreadGC2.a' '$(PREFIX)/$(TARGET)/lib/libpthread.a'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
87 $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
88 $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/pthread.h' '$(PREFIX)/$(TARGET)/include/'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
89 $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/sched.h' '$(PREFIX)/$(TARGET)/include/'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
90 $(INSTALL) -m664 '$(1)/$(gcc-pthreads_SUBDIR)/semaphore.h' '$(PREFIX)/$(TARGET)/include/'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
91 # build libgomp
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
92 $(SED) 's,cross_compiling=no,cross_compiling=yes,' -i '$(1)/libgomp/configure'
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
93 mkdir '$(1)/build/$(TARGET)/libgomp'
504
0fd340b5a6a8 improved structure of the gcc-* packages
Volker Grabsch <vog@notjusthosting.com>
parents: 475
diff changeset
94 cd '$(1)/build/$(TARGET)/libgomp' && '$(1)/libgomp/configure' \
444
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
95 $(gcc_CONFIGURE_OPTIONS) \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
96 --host='$(TARGET)' \
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
97 LIBS='-lws2_32'
c828215f90ae enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
Volker Grabsch <vog@notjusthosting.com>
parents: 426
diff changeset
98 $(MAKE) -C '$(1)/build/$(TARGET)/libgomp' -j '$(JOBS)' install
115
ae21cae1b378 translated packages: mingwrt, w32api, binutils, gcc
Volker Grabsch <vog@notjusthosting.com>
parents:
diff changeset
99 endef