wok-next view mingw32-gcc/receipt @ rev 21159
updated diffutils (3.6 -> 3.7)
author | Hans-G?nter Theisgen |
---|---|
date | Wed Feb 20 08:46:59 2019 +0100 (2019-02-20) |
parents | d5aab818505e |
children |
line source
1 # SliTaz package receipt v2.
3 PACKAGE="mingw32-gcc"
4 VERSION="3.4.5-20060117-2"
5 CATEGORY="development"
6 SHORT_DESC="MinGW32 gcc, for C, C++, and Ada"
7 MAINTAINER="devel@slitaz.org"
8 LICENSE="GPL2"
9 WEB_SITE="http://www.mingw.org/"
11 TARBALL="gcc-core-$VERSION-src.tar.gz"
12 WGET_URL="$SF_MIRROR/mingw/$TARBALL"
14 EXTRA_SOURCE_FILES="gcc-g++-$VERSION-src.tar.gz gcc-ada-$VERSION-src.tar.gz"
15 MINGW32_ID="i586-pc-mingw32"
17 BUILD_DEPENDS="slitaz-toolchain bison flex mingw32-binutils \
18 mingw32-runtime-headers mingw32-w32api-headers mingw32-gcc-c \
19 mingw32-w32api mingw32-runtime perl"
21 compile_rules() {
22 export CFLAGS="${CFLAGS/-mindirect-branch=thunk/}"
23 export CXXFLAGS="$CFLAGS"
24 echo "CFLAGS=CXXFLAGS='$CFLAGS'"
26 # Configuration only needs included if we're in the build/wok environment
27 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ]; then
28 . $WOK/mingw32-toolchain/stuff/mingw32.conf
29 fi
31 mkdir -p $install/usr/share/man/man1 $install/usr/share/man/man7
32 if [ "$MINGW32_ID" != "$MINGW32_TARGET" ]; then
33 echo "ERROR: Conf 'TARGET' string differs from Receipt 'ID' string"
34 return 1
35 fi
37 ln -s . gcc-$VERSION
38 for tgz in $EXTRA_SOURCE_FILES; do
39 [ -s $SRC/$tgz ] || wget -P $SRC $SF_MIRROR/mingw/$tgz
40 [ -s $SRC/$tgz ] && tar xzf $SRC/$tgz && continue
41 echo "Can't download $SF_MIRROR/mingw/$tgz abort."
42 return 1
43 done
45 rm -rf $src/binutils
47 mkdir -p gcc-core-$VERSION-build
48 cd gcc-core-$VERSION-build
50 $src/configure \
51 --prefix=/usr \
52 --libexecdir=/usr/lib \
53 --infodir=/usr/share/info \
54 --mandir=/usr/share/man \
55 --with-sysroot=$MINGW32_ROOT \
56 --disable-shared \
57 --disable-debug \
58 --target=$MINGW32_TARGET \
59 --enable-languages=c,c++,ada \
60 --enable-threads=win32 \
61 --disable-win32-registry \
62 --enable-sjlj-exceptions \
63 $CONFIGURE_ARGS &&
64 make \
65 CFLAGS="-O2 -fomit-frame-pointer" \
66 LDFLAGS="-s" &&
67 make DESTDIR=$install install
68 }
70 genpkg_rules() {
71 # Configuration only needs included if we're in the build/wok environment
72 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ]; then
73 . $WOK/mingw32-toolchain/stuff/mingw32.conf
74 fi
76 mkdir -p $fs/usr/lib $fs$MINGW32_ROOT
77 cp -a $install$MINGW32_ROOT/* $fs$MINGW32_ROOT
78 rm $fs$MINGW32_ROOT/lib/*.la
79 cp -a $install/usr/bin $fs/usr
80 cp -a $install/usr/include $fs/usr
81 # do not need to copy lib/libiberty.a
82 mkdir -p $fs/usr/lib
83 cp -a $install/usr/lib/gcc $fs/usr/lib
84 DEPENDS="glibc-base mingw32-binutils mingw32-w32api-headers \
85 mingw32-runtime-headers mingw32-w32api mingw32-runtime"
86 PROVIDE="mingw32-gcc-c"
87 TAGS="compiler C C++ Ada"
88 }
90 post_install() {
91 MINGW32_ID="i586-pc-mingw32"
92 # Archives get stripped during packaging; need to run ranlib
93 chroot "$1/" find "/usr/lib/gcc/$MINGW32_ID/" -name *.a -exec $MINGW32_ID-ranlib {} \;
94 chroot "$1/" find "/usr/$MINGW32_ID/lib/" -name *.a -exec $MINGW32_ID-ranlib {} \;
95 }