Browse Source

d/gcc-mingw32: Cleaned up.

slackware-14.2
Damien Goutte-Gattat 12 years ago
parent
commit
573feae1e3
  1. 25
      d/gcc-mingw32/gcc-mingw32.SlackBuild

25
d/gcc-mingw32/gcc-mingw32.SlackBuild

@ -26,15 +26,16 @@
#
# Depends: l/mingw32-libs
# Source package infos
# Source packages infos (checksums and filenames in `checksums' file)
VERSION=${VERSION:-3.4.5}
BASEURL=${BASEURL:-http://ovh.dl.sourceforge.net/mingw}
# Built package infos
# Build infos
NAMETGZ=${NAMETGZ:-gcc-mingw32}
BUILD=${BUILD:-1GGD}
ARCH=${ARCH:-i486}
TARGET=${TARGET:-i686-pc-mingw32}
TARGET=${TARGET:-$ARCH-pc-mingw32}
JOBS=${JOBS:-1}
# Directories
TMP=${TMP:-/tmp}
@ -42,7 +43,7 @@ OUT=${OUT:-$TMP/build}
PKG=${PKG:-$OUT/$NAMETGZ}
CWD=$(pwd)
set -e # Quit if a command returns non-zero
set -e
# Sanity checks
if [ $UID -eq 0 ]; then
@ -53,12 +54,22 @@ if [ ! -d $TMP ]; then
echo "$TMP does not exist or is not a directory!"
exit 1
fi
if [ ! -d /opt/mingw32 ]; then
echo "MinGW32 base directory not found!"
exit 1
fi
if ! echo $PATH | grep -q /opt/mingw32/bin ; then
PATH=$PATH:/opt/mingw32/bin
fi
# Compilation flags
case "$ARCH" in
i?86)
CPUOPT="-O2 -march=$ARCH -mtune=i686"
;;
x86_64)
CPUOPT="-O2 -fPIC"
;;
*)
CPUOPT="-O2"
;;
@ -67,7 +78,9 @@ esac
# Get and verify the source archive
for archive in $(cut -d' ' -f3 checksums); do
if [ ! -r $archive ]; then
wget "$BASEURL/$archive"
rm -f $archive.part
wget -vc "$BASEURL/$archive" -O $archive.part
mv $archive.part $archive
fi
done
sha1sum -c checksums
@ -95,7 +108,7 @@ $TMP/mingw32/gcc-*/configure \
--enable-threads=win32 \
--disable-win32-registry \
--with-sysroot=/opt/mingw32
make -j 3
make -j $JOBS
make install DESTDIR=$PKG
# Strip binaries

Loading…
Cancel
Save