2016-07-13 19:39:28 +02:00
|
|
|
#!/bin/sh
|
|
|
|
|
|
|
|
# check if last arg is a path to configure, else use parent
|
|
|
|
for last; do true; done
|
2018-12-30 23:49:46 +01:00
|
|
|
if test -x "${last}/configure"; then
|
2016-07-13 19:39:28 +02:00
|
|
|
config_path="$last"
|
|
|
|
else
|
|
|
|
config_path=".."
|
|
|
|
fi
|
|
|
|
|
2018-12-30 23:49:46 +01:00
|
|
|
default_mingw_pp_flags="-D_FORTIFY_SOURCE=2"
|
2019-01-05 01:47:00 +01:00
|
|
|
default_mingw_compiler_flags="-O2 -pipe -fno-plt -fexceptions --param=ssp-buffer-size=4"
|
2018-12-30 23:49:46 +01:00
|
|
|
default_mingw_linker_flags="-Wl,-O1,--sort-common,--as-needed"
|
|
|
|
|
|
|
|
export CPPFLAGS="${MINGW_CPPFLAGS:-$default_mingw_pp_flags $CPPFLAGS}"
|
|
|
|
export CFLAGS="${MINGW_CFLAGS:-$default_mingw_compiler_flags $CFLAGS}"
|
|
|
|
export CXXFLAGS="${MINGW_CXXFLAGS:-$default_mingw_compiler_flags $CXXFLAGS}"
|
|
|
|
export LDFLAGS="${MINGW_LDFLAGS:-$default_mingw_linker_flags $LDFLAGS}"
|
|
|
|
|
|
|
|
${config_path}/configure \
|
|
|
|
--host=@TRIPLE@ --target=@TRIPLE@ --build="$CHOST" \
|
2016-07-13 19:39:28 +02:00
|
|
|
--prefix=/usr/@TRIPLE@ --libdir=/usr/@TRIPLE@/lib --includedir=/usr/@TRIPLE@/include \
|
|
|
|
--enable-shared --enable-static "$@"
|