wok-6.x view mingw32-gcc/receipt @ rev 7357
Up: lvm2 to 2.02.77.
author | Christopher Rogers <slaxemulator@gmail.com> |
---|---|
date | Tue Nov 23 01:54:05 2010 +0000 (2010-11-23) |
parents | d437e141264c |
children | 0b4cf0d9e1b5 |
line source
1 # SliTaz package receipt.
3 PACKAGE="mingw32-gcc"
4 SOURCE="gcc"
5 VERSION="3.4.5-20060117-2"
6 CATEGORY="development"
7 SHORT_DESC="MinGW32 gcc, for C, C++, and Ada."
8 MAINTAINER="rcx@zoominternet.net"
9 DEPENDS="glibc-base mingw32-binutils mingw32-w32api-headers mingw32-runtime-headers mingw32-w32api mingw32-runtime"
10 BUILD_DEPENDS="slitaz-toolchain bison flex mingw32-binutils mingw32-runtime-headers mingw32-w32api-headers mingw32-gcc-c mingw32-w32api mingw32-runtime"
11 PROVIDE="mingw32-gcc-c"
12 TARBALL="$SOURCE-core-$VERSION-src.tar.gz"
13 WEB_SITE="http://www.mingw.org/"
14 MINGW32_URL="$SF_MIRROR/mingw"
15 WGET_URL="$MINGW32_URL/$TARBALL"
16 MINGW32_ID="i586-pc-mingw32"
18 # Configuration only needs included if we're in the build/wok environment
19 if [ -e $WOK/mingw32-toolchain/stuff/mingw32.conf ] ; then
20 . $WOK/mingw32-toolchain/stuff/mingw32.conf
21 fi
23 # Rules to configure and make the package.
24 compile_rules()
25 {
26 if [ "$MINGW32_ID" != "$MINGW32_TARGET" ] ; then
27 echo "ERROR: Conf 'TARGET' string differs from Receipt 'ID' string"
28 exit 1
29 fi
31 MINGW32_DIR="$PWD"
32 MINGW32_CPP_TARBALL="$SOURCE-g++-$VERSION-src.tar.gz"
33 MINGW32_ADA_TARBALL="$SOURCE-ada-$VERSION-src.tar.gz"
35 for gcc_tgz in $MINGW32_CPP_TARBALL $MINGW32_ADA_TARBALL ; do
36 # Download the additional language tarballs
37 if [ ! -f "$SOURCES_REPOSITORY/$gcc_tgz" ] ; then
38 cd $SOURCES_REPOSITORY
39 download $MINGW32_URL/$gcc_tgz
40 fi
42 # Extract the additional language tarballs
43 if [ -f "$SOURCES_REPOSITORY/$gcc_tgz" ] ; then
44 cd $MINGW32_DIR
45 echo "Extracting $gcc_tgz ..."
46 tar xzf "$SOURCES_REPOSITORY/$gcc_tgz"
47 else
48 # Exit if file not found to avoid errors.
49 echo -e "\nDownload of $gcc_tgz failed, exiting. Please check the URL.\n"
50 exit 1
51 fi
52 done
54 cd $MINGW32_DIR
56 rm -f -r $src/binutils
57 mkdir -p $SOURCE-$VERSION-build
58 cd $SOURCE-$VERSION-build
59 $src/configure \
60 --prefix=/usr \
61 --libexecdir=/usr/lib \
62 --infodir=/usr/share/info \
63 --mandir=/usr/share/man \
64 --with-sysroot=$MINGW32_ROOT \
65 --disable-shared \
66 --disable-debug \
67 --target=$MINGW32_TARGET \
68 --enable-languages=c,c++,ada \
69 --enable-threads=win32 \
70 --disable-win32-registry \
71 --enable-sjlj-exceptions \
72 $CONFIGURE_ARGS &&
73 make -j 4 CFLAGS="-O2 -fomit-frame-pointer" LDFLAGS="-s" &&
74 make DESTDIR=$src/_pkg install
75 }
77 # Rules to gen a SliTaz package suitable for Tazpkg.
78 genpkg_rules()
79 {
80 mkdir -p $fs/usr/lib $fs$MINGW32_ROOT
81 cp -a $_pkg$MINGW32_ROOT/* $fs$MINGW32_ROOT
82 cp -a $_pkg/usr/bin $fs/usr
83 cp -a $_pkg/usr/include $fs/usr
84 # do not need to copy lib/libiberty.a
85 mkdir -p $fs/usr/lib
86 cp -a $_pkg/usr/lib/gcc $fs/usr/lib
87 }
89 # Rules to setup after installation
90 post_install()
91 {
92 # Archives get stripped during packaging; need to run ranlib
93 local root
94 root=$1
95 find $root/usr/lib/gcc/$MINGW32_ID/ -name *.a -exec $MINGW32_ID-ranlib {} \;
96 find $root/usr/$MINGW32_ID/lib/ -name *.a -exec $MINGW32_ID-ranlib {} \;
97 }
99 # Rules to clean the package
100 clean_wok()
101 {
102 rm -r $SOURCE-$VERSION-build
103 }