summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorxantares2015-09-05 12:45:51 +0200
committerxantares2015-09-05 12:45:51 +0200
commitba97829aad400afa7c197a74dbcdb92b8778c8fb (patch)
tree0135bbdae1f1559ca9ab4399282b0e9ff53caf18
parent804687236835b0e50f9af4f720643e6c70ace7d0 (diff)
downloadaur-ba97829aad400afa7c197a74dbcdb92b8778c8fb.tar.gz
add optional last dir arg
-rw-r--r--mingw-configure.sh12
1 files changed, 11 insertions, 1 deletions
diff --git a/mingw-configure.sh b/mingw-configure.sh
index 6281562420b..e3b6e6b9dff 100644
--- a/mingw-configure.sh
+++ b/mingw-configure.sh
@@ -1,9 +1,19 @@
#!/bin/sh
+
+# check if last arg is a path to configure, else use parent
+for last; do true; done
+if test -x "${last}/configure"
+then
+ config_path="$last"
+else
+ config_path=".."
+fi
+
mingw_c_flags="-O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions --param=ssp-buffer-size=4"
LDFLAGS=""
export CFLAGS="$mingw_c_flags $CFLAGS"
export CXXFLAGS="$mingw_c_flags $CXXFLAGS"
-../configure --host=@TRIPLE@ --target=@TRIPLE@ --build="$CHOST" \
+${config_path}/configure --host=@TRIPLE@ --target=@TRIPLE@ --build="$CHOST" \
--prefix=/usr/@TRIPLE@ --libdir=/usr/@TRIPLE@/lib --includedir=/usr/@TRIPLE@/include \
--enable-shared --enable-static "$@"