summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-04-20 02:59:16 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-04-20 02:59:16 -0700
commit559fd21bdd40b17a3dd3ee3775947e6bc020763f (patch)
treecca95e246862f4a2fd2234d7e63dd373d8444e7c
parentf6411cc3f00389ca429f54d4ff4580e2f4864c02 (diff)
downloadtxr-559fd21bdd40b17a3dd3ee3775947e6bc020763f.tar.gz
txr-559fd21bdd40b17a3dd3ee3775947e6bc020763f.tar.bz2
txr-559fd21bdd40b17a3dd3ee3775947e6bc020763f.zip
configure: better way to avoid -no-pie.
* configure (gcc_version, broken128): Formally declare existing ad hoc variables. (do_nopie): New variable. Compiler version test moved up. We use the gcc version to disable nopie, and check for clang to do the same. Instead of checking for darwin and android to skip the nopie stuff, we check do_nopie.
-rwxr-xr-xconfigure33
1 files changed, 21 insertions, 12 deletions
diff --git a/configure b/configure
index 0ccd5b7f..131068d0 100755
--- a/configure
+++ b/configure
@@ -148,6 +148,9 @@ cross=
compiler_prefix=
ccname='$(CC)'
cc='$(cross)$(compiler_prefix)$(ccname)'
+gcc_version=
+broken128=
+do_nopie=y
cplusplus=
intptr=
exe=
@@ -1021,6 +1024,23 @@ else
printf "okay\n"
fi
+printf "Checking compiler version for various workarounds ... "
+
+output=$($make conftest.ccver)
+set -- $output
+if [ "$1" = "gcc" ] ; then
+ gcc_version=$3
+ save_ifs=$IFS ; IFS=. ; set -- $gcc_version ; IFS=$save_ifs
+ if [ $1 -lt 4 ] || [ $1 -eq 4 -a $2 -le 3 ] ; then
+ broken128=y
+ fi
+ [ $1 -lt 5 ] && do_nopie=
+elif [ "$2" = "clang" ] ; then
+ do_nopie=
+fi
+
+printf "done\n"
+
printf "Checking whether executables have that idiotic .exe suffix ... "
if ls conftest.exe > /dev/null 2>&1 ; then
@@ -1194,7 +1214,7 @@ else
fi
-if ! [ $android_target ] && ! [ $darwin_target ] ; then
+if [ $do_nopie ] ; then
printf "Checking how to disable PIE ..."
nopie_flags=
@@ -1297,17 +1317,6 @@ fi
printf "Checking what C type we have for integers wider than \"long long\" ... "
-broken128=
-output=$($make conftest.ccver)
-set -- $output
-if [ "$1" = "gcc" ] ; then
- gcc_version=$3
- save_ifs=$IFS ; IFS=. ; set -- $gcc_version ; IFS=$save_ifs
- if [ $1 -lt 4 ] || [ $1 -eq 4 -a $2 -le 3 ] ; then
- broken128=y
- fi
-fi
-
superlong=
if [ -z "$broken128" ] ; then