l/mingw32-libs: Cleaned up.

slackware-14.2
Damien Goutte-Gattat 2009-05-03 03:20:29 +02:00
parent a2bc359d71
commit cfd75feeba
1 changed files with 22 additions and 9 deletions

View File

@ -26,15 +26,16 @@
#
# Depends: d/mingw32-binutils
# Source package infos
# Source packages infos (checksums and filenames in `checksums' file)
VERSION=${VERSION:-3.15.2} # MinGW runtime's version
BASEURL=${BASEURL:-http://ovh.dl.sourceforge.net/mingw}
# Built package infos
# Build infos
NAMETGZ=${NAMETGZ:-mingw32-libs}
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
@ -100,9 +113,9 @@ $TMP/mingw32/gcc-*/configure \
--enable-threads=win32 \
--disable-win32-registry \
--with-sysroot=$TMP/mingw32/stage1
make -j 3
make -j $JOBS
make install
export PATH=$PATH:$TMP/mingw32/stage1/bin
PATH=$PATH:$TMP/mingw32/stage1/bin
# Compile Win32 API libraries
cd $TMP/mingw32/w32api-*
@ -112,7 +125,7 @@ CFLAGS="$CPUOPT" \
--prefix=/opt/mingw32 \
--host=$TARGET \
--build=$ARCH-pc-linux-gnu
make -j 3
make -j $JOBS
make install prefix=$PKG/opt/mingw32
# Compile MinGW runtime
@ -124,7 +137,7 @@ CFLAGS="-I$PKG/opt/mingw32/include $CPUOPT" \
--host=$TARGET \
--build=$ARCH-pc-linux-gnu
sed -i "s:-Lmingwex:-L$PKG/opt/mingw32/lib -Lmingwex:" Makefile
make -j 3
make -j $JOBS
make install prefix=$PKG/opt/mingw32
# Simulate a standard tree under /opt/mingw32