summaryrefslogtreecommitdiffstats
path: root/configure
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
commit4020cbdc1afb502b1522eec088ce47bc9e7dac0e (patch)
treecca95e246862f4a2fd2234d7e63dd373d8444e7c /configure
parent47d5feb3175a8cd1dfb515c0f552eb50d2edad47 (diff)
downloadtxr-4020cbdc1afb502b1522eec088ce47bc9e7dac0e.tar.gz
txr-4020cbdc1afb502b1522eec088ce47bc9e7dac0e.tar.bz2
txr-4020cbdc1afb502b1522eec088ce47bc9e7dac0e.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.
Diffstat (limited to 'configure')
-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