Files
llvm-mingw/build-mingw-w64-libraries.sh
T
Martin Storsjö 2d1aeef4ac build-mingw-w64-libraries: Add an explicit --libdir parameter
On some distributions, e.g. openSUSE, the libraries for 64 bit
architectures end up stored in <target>/<triplet>/lib64 instead of
plain "lib".

(This is caused by their use of a site script for configure, which
overrides libdir when the host triplet matches 64 bit architecture
names - even if it's a triple for cross compilation for a totally
different OS. This only affects the libraries and not mingw-w64-crt,
as the crt's makefiles manually set the output directory name.)

This fixes https://github.com/mstorsjo/llvm-mingw/issues/51.
2019-09-26 16:25:08 +03:00

32 lines
683 B
Bash
Executable File

#!/bin/sh
set -e
if [ $# -lt 1 ]; then
echo $0 dest
exit 1
fi
PREFIX="$1"
mkdir -p "$PREFIX"
PREFIX="$(cd "$PREFIX" && pwd)"
export PATH=$PREFIX/bin:$PATH
: ${CORES:=$(nproc 2>/dev/null)}
: ${CORES:=$(sysctl -n hw.ncpu 2>/dev/null)}
: ${CORES:=4}
: ${ARCHS:=${TOOLCHAIN_ARCHS-i686 x86_64 armv7 aarch64}}
cd mingw-w64/mingw-w64-libraries
for lib in winpthreads winstorecompat; do
cd $lib
for arch in $ARCHS; do
mkdir -p build-$arch
cd build-$arch
../configure --host=$arch-w64-mingw32 --prefix=$PREFIX/$arch-w64-mingw32 --libdir=$PREFIX/$arch-w64-mingw32/lib
make -j$CORES
make install
cd ..
done
cd ..
done