|
|
|
@ -31,16 +31,17 @@ VERSION=${VERSION:-3.4.5} |
|
|
|
|
BASEURL=${BASEURL:-http://ovh.dl.sourceforge.net/mingw} |
|
|
|
|
|
|
|
|
|
# Build infos |
|
|
|
|
NAMETGZ=${NAMETGZ:-gcc-mingw32} |
|
|
|
|
BUILD=${BUILD:-1GGD} |
|
|
|
|
NAMEPKG=${NAMEPKG:-gcc-mingw32} |
|
|
|
|
BUILD=${BUILD:-2GGD} |
|
|
|
|
ARCH=${ARCH:-i486} |
|
|
|
|
TARGET=${TARGET:-$ARCH-pc-mingw32} |
|
|
|
|
TARGET=${TARGET:-i686-pc-mingw32} |
|
|
|
|
JOBS=${JOBS:-1} |
|
|
|
|
EXT=${EXT:-txz} |
|
|
|
|
|
|
|
|
|
# Directories |
|
|
|
|
TMP=${TMP:-/tmp} |
|
|
|
|
OUT=${OUT:-$TMP/build} |
|
|
|
|
PKG=${PKG:-$OUT/$NAMETGZ} |
|
|
|
|
PKG=${PKG:-$OUT/$NAMEPKG} |
|
|
|
|
CWD=$(pwd) |
|
|
|
|
|
|
|
|
|
set -e |
|
|
|
@ -67,9 +68,6 @@ case "$ARCH" in |
|
|
|
|
i?86) |
|
|
|
|
CPUOPT="-O2 -march=$ARCH -mtune=i686" |
|
|
|
|
;; |
|
|
|
|
x86_64) |
|
|
|
|
CPUOPT="-O2 -fPIC" |
|
|
|
|
;; |
|
|
|
|
*) |
|
|
|
|
CPUOPT="-O2" |
|
|
|
|
;; |
|
|
|
@ -78,8 +76,7 @@ esac |
|
|
|
|
# Get and verify the source archive |
|
|
|
|
for archive in $(cut -d' ' -f3 checksums); do |
|
|
|
|
if [ ! -r $archive ]; then |
|
|
|
|
rm -f $archive.part |
|
|
|
|
wget -vc "$BASEURL/$archive" -O $archive.part |
|
|
|
|
wget -c -O $archive.part "$BASEURL/$archive" |
|
|
|
|
mv $archive.part $archive |
|
|
|
|
fi |
|
|
|
|
done |
|
|
|
@ -112,16 +109,16 @@ make -j $JOBS |
|
|
|
|
make install DESTDIR=$PKG |
|
|
|
|
|
|
|
|
|
# Strip binaries |
|
|
|
|
find $PKG | xargs file | grep "ELF 32-bit LSB" | cut -d : -f 1 | \ |
|
|
|
|
find $PKG | xargs file | grep "ELF \(32\|64\)-bit LSB" | cut -d : -f 1 | \ |
|
|
|
|
xargs strip --strip-unneeded 2> /dev/null |
|
|
|
|
|
|
|
|
|
# libiberty is already installed by binutils-mingw32 |
|
|
|
|
rm $PKG/opt/mingw32/lib/libiberty.a |
|
|
|
|
|
|
|
|
|
# Remove man and info pages (we already have those of the |
|
|
|
|
# Delete man and info pages (we already have those of the |
|
|
|
|
# native GCC in /usr) |
|
|
|
|
rm -rf $PKG/opt/mingw32/{info,man} |
|
|
|
|
|
|
|
|
|
# Delete unused library file |
|
|
|
|
rm -rf $PKG/opt/mingw32/lib{,64}/libiberty.a |
|
|
|
|
|
|
|
|
|
# Copy slack-desc file |
|
|
|
|
install -D -m 644 $CWD/slack-desc $PKG/install/slack-desc |
|
|
|
|
|
|
|
|
@ -130,7 +127,7 @@ cd $PKG |
|
|
|
|
mkdir -p $OUT |
|
|
|
|
PACKAGING=" |
|
|
|
|
chown root:root . -R |
|
|
|
|
/sbin/makepkg -l y -c n $OUT/$NAMETGZ-$VERSION-$ARCH-$BUILD.tgz |
|
|
|
|
/sbin/makepkg -l y -c n $OUT/$NAMEPKG-$VERSION-$ARCH-$BUILD.$EXT |
|
|
|
|
rm -rf $PKG |
|
|
|
|
rm -rf $TMP/mingw32 |
|
|
|
|
" |
|
|
|
|