changeset 444:c828215f90ae

enable libgomp (OpenMP) in package gcc by interweaving the pthread build into the gcc build
author Volker Grabsch <vog@notjusthosting.com>
date Sat, 19 Sep 2009 04:46:12 +0200
parents 23271dff7a05
children 34c22b396c66
files doc/index.html src/fltk.mk src/gcc-pthreads.mk src/gcc.mk src/libmikmod.mk src/pthreads.mk src/tiff.mk src/vorbis.mk
diffstat 8 files changed, 78 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/doc/index.html	Fri Sep 11 04:00:35 2009 +0200
+++ b/doc/index.html	Sat Sep 19 04:46:12 2009 +0200
@@ -370,7 +370,7 @@
         </p>
 
         <p>
-        This release ...
+        This release enables OpenMP support in GCC.
         </p>
 
         <p>
--- a/src/fltk.mk	Fri Sep 11 04:00:35 2009 +0200
+++ b/src/fltk.mk	Sat Sep 19 04:46:12 2009 +0200
@@ -27,7 +27,7 @@
 $(PKG)_FILE     := fltk-$($(PKG)_VERSION)-source.tar.bz2
 $(PKG)_WEBSITE  := http://www.fltk.org/
 $(PKG)_URL      := http://ftp.easysw.com/pub/fltk/$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc pthreads zlib jpeg libpng
+$(PKG)_DEPS     := gcc zlib jpeg libpng
 
 define $(PKG)_UPDATE
     wget -q -O- 'http://www.fltk.org/' | \
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/gcc-pthreads.mk	Sat Sep 19 04:46:12 2009 +0200
@@ -0,0 +1,37 @@
+# Copyright (C) 2009  Volker Grabsch
+#
+# Permission is hereby granted, free of charge, to any person obtaining
+# a copy of this software and associated documentation files (the
+# "Software"), to deal in the Software without restriction, including
+# without limitation the rights to use, copy, modify, merge, publish,
+# distribute, sublicense, and/or sell copies of the Software, and to
+# permit persons to whom the Software is furnished to do so, subject
+# to the following conditions:
+#
+# The above copyright notice and this permission notice shall be
+# included in all copies or substantial portions of the Software.
+#
+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
+# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
+# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
+# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
+# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+
+# Pthreads-w32 for GCC
+PKG             := gcc-pthreads
+$(PKG)_VERSION  := 2-8-0
+$(PKG)_CHECKSUM := da8371cb20e8e238f96a1d0651212f154d84a9ac
+$(PKG)_SUBDIR   := pthreads-w32-$($(PKG)_VERSION)-release
+$(PKG)_FILE     := pthreads-w32-$($(PKG)_VERSION)-release.tar.gz
+$(PKG)_WEBSITE  := http://sourceware.org/pthreads-win32/
+$(PKG)_URL      := ftp://sourceware.org/pub/pthreads-win32/$($(PKG)_FILE)
+$(PKG)_DEPS     :=
+
+define $(PKG)_UPDATE
+    wget -q -O- 'ftp://sourceware.org/pub/pthreads-win32/Release_notes' | \
+    $(SED) -n 's,^RELEASE \([0-9][^[:space:]]*\).*,\1,p' | \
+        tr '.' '-' | \
+    head -1
+endef
--- a/src/gcc.mk	Fri Sep 11 04:00:35 2009 +0200
+++ b/src/gcc.mk	Sat Sep 19 04:46:12 2009 +0200
@@ -27,7 +27,7 @@
 $(PKG)_FILE     := gcc-$($(PKG)_VERSION)-srcbase-2.zip
 $(PKG)_WEBSITE  := http://www.tdragon.net/recentgcc/
 $(PKG)_URL      := http://$(SOURCEFORGE_MIRROR)/project/tdm-gcc/Sources/TDM Sources/$($(PKG)_VERSION)/$($(PKG)_FILE)
-$(PKG)_DEPS     := pkg_config mingwrt w32api binutils gcc-gmp gcc-mpfr gcc-core gcc-g++ gcc-objc gcc-fortran
+$(PKG)_DEPS     := pkg_config mingwrt w32api binutils gcc-gmp gcc-mpfr gcc-core gcc-g++ gcc-objc gcc-fortran gcc-pthreads
 
 define $(PKG)_UPDATE
     $(call SOURCEFORGE_FILES,http://sourceforge.net/projects/tdm-gcc/files/Sources/) | \
@@ -35,6 +35,20 @@
     tail -1
 endef
 
+$(PKG)_CONFIGURE_OPTIONS := \
+        --target='$(TARGET)' \
+        --prefix='$(PREFIX)' \
+        --enable-languages='c,c++,objc,fortran' \
+        --enable-version-specific-runtime-libs \
+        --with-gcc \
+        --with-gnu-ld \
+        --with-gnu-as \
+        --disable-nls \
+        --disable-shared \
+        --without-x \
+        --disable-win32-registry \
+        --enable-sjlj-exceptions
+
 define $(PKG)_BUILD
     # unpack GCC
     cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-core)
@@ -51,22 +65,30 @@
     mv '$(1)/$(gcc-gmp_SUBDIR)' '$(1)/$(gcc-core_SUBDIR)/gmp'
     cd '$(1)' && $(call UNPACK_PKG_ARCHIVE,gcc-mpfr)
     mv '$(1)/$(gcc-mpfr_SUBDIR)' '$(1)/$(gcc-core_SUBDIR)/mpfr'
-    # build
+    # build everything of GCC except libgomp and libmudflap
     mkdir '$(1)/build'
     cd '$(1)/build' && '$(1)/$(gcc-core_SUBDIR)/configure' \
-        --target='$(TARGET)' \
-        --prefix='$(PREFIX)' \
-        --enable-languages='c,c++,objc,fortran' \
-        --enable-version-specific-runtime-libs \
-        --with-gcc \
-        --with-gnu-ld \
-        --with-gnu-as \
-        --disable-nls \
-        --disable-shared \
-        --without-x \
+        $(gcc_CONFIGURE_OPTIONS) \
         --enable-threads=win32 \
-        --disable-win32-registry \
-        --enable-sjlj-exceptions
+        --disable-libgomp \
+        --disable-libmudflap
     $(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) '35i\#define PTW32_STATIC_LIB' -i '$(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
+    mkdir '$(1)/build/$(TARGET)/libgomp'
+    cd '$(1)/build/$(TARGET)/libgomp' && '$(1)/$(gcc-core_SUBDIR)/libgomp/configure' \
+        $(gcc_CONFIGURE_OPTIONS) \
+        --host='$(TARGET)' \
+        LIBS='-lws2_32'
+    $(MAKE) -C '$(1)/build/$(TARGET)/libgomp' -j '$(JOBS)' install
 endef
--- a/src/libmikmod.mk	Fri Sep 11 04:00:35 2009 +0200
+++ b/src/libmikmod.mk	Sat Sep 19 04:46:12 2009 +0200
@@ -27,7 +27,7 @@
 $(PKG)_FILE     := libmikmod-$($(PKG)_VERSION).tar.bz2
 $(PKG)_WEBSITE  := http://mikmod.raphnet.net/
 $(PKG)_URL      := http://mikmod.raphnet.net/files/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc pthreads
+$(PKG)_DEPS     := gcc
 
 define $(PKG)_UPDATE
     wget -q -O- 'http://mikmod.raphnet.net/' | \
--- a/src/pthreads.mk	Fri Sep 11 04:00:35 2009 +0200
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-# Copyright (C) 2009  Volker Grabsch
-#
-# Permission is hereby granted, free of charge, to any person obtaining
-# a copy of this software and associated documentation files (the
-# "Software"), to deal in the Software without restriction, including
-# without limitation the rights to use, copy, modify, merge, publish,
-# distribute, sublicense, and/or sell copies of the Software, and to
-# permit persons to whom the Software is furnished to do so, subject
-# to the following conditions:
-#
-# The above copyright notice and this permission notice shall be
-# included in all copies or substantial portions of the Software.
-#
-# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
-# IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
-# CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
-# TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
-# SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-# pthreads-w32
-PKG             := pthreads
-$(PKG)_VERSION  := 2-8-0
-$(PKG)_CHECKSUM := da8371cb20e8e238f96a1d0651212f154d84a9ac
-$(PKG)_SUBDIR   := pthreads-w32-$($(PKG)_VERSION)-release
-$(PKG)_FILE     := pthreads-w32-$($(PKG)_VERSION)-release.tar.gz
-$(PKG)_WEBSITE  := http://sourceware.org/pthreads-win32/
-$(PKG)_URL      := ftp://sourceware.org/pub/pthreads-win32/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc
-
-define $(PKG)_UPDATE
-    wget -q -O- 'ftp://sourceware.org/pub/pthreads-win32/Release_notes' | \
-    $(SED) -n 's,^RELEASE \([0-9][^[:space:]]*\).*,\1,p' | \
-        tr '.' '-' | \
-    head -1
-endef
-
-define $(PKG)_BUILD
-    $(SED) '35i\#define PTW32_STATIC_LIB' -i '$(1)/pthread.h'
-    $(MAKE) -C '$(1)' -j 1 GC-static CROSS='$(TARGET)-'
-    $(INSTALL) -d '$(PREFIX)/$(TARGET)/lib'
-    $(INSTALL) -m664 '$(1)/libpthreadGC2.a' '$(PREFIX)/$(TARGET)/lib/libpthread.a'
-    $(INSTALL) -d '$(PREFIX)/$(TARGET)/include'
-    $(INSTALL) -m664 '$(1)/pthread.h' '$(1)/sched.h' '$(1)/semaphore.h' '$(PREFIX)/$(TARGET)/include/'
-endef
--- a/src/tiff.mk	Fri Sep 11 04:00:35 2009 +0200
+++ b/src/tiff.mk	Sat Sep 19 04:46:12 2009 +0200
@@ -28,7 +28,7 @@
 $(PKG)_WEBSITE  := http://www.remotesensing.org/libtiff/
 $(PKG)_URL      := http://ftp.remotesensing.org/libtiff/$($(PKG)_FILE)
 $(PKG)_URL_2    := http://download.osgeo.org/libtiff/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc pthreads zlib jpeg
+$(PKG)_DEPS     := gcc zlib jpeg
 
 define $(PKG)_UPDATE
     wget -q -O- 'http://www.remotesensing.org/libtiff/' | \
--- a/src/vorbis.mk	Fri Sep 11 04:00:35 2009 +0200
+++ b/src/vorbis.mk	Sat Sep 19 04:46:12 2009 +0200
@@ -27,7 +27,7 @@
 $(PKG)_FILE     := libvorbis-$($(PKG)_VERSION).tar.gz
 $(PKG)_WEBSITE  := http://www.vorbis.com/
 $(PKG)_URL      := http://downloads.xiph.org/releases/vorbis/$($(PKG)_FILE)
-$(PKG)_DEPS     := gcc pthreads ogg
+$(PKG)_DEPS     := gcc ogg
 
 define $(PKG)_UPDATE
     wget -q -O- 'http://www.xiph.org/downloads/' | \