From 5336c93d6b6b79daac6d1a239ac2955277b376fa Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Tue, 10 Apr 2012 14:49:39 -0700 Subject: * Makefile (conftest.ccver): New phony target. * configure: The test for non-working 128 bit integers in the gcc used by NetBSD 5.1 is not good enough to catch the bug. Adding a test which will assume that gcc 4.3.x and lesser does not have working 128 bit types. --- ChangeLog | 9 +++++++++ Makefile | 4 ++++ configure | 51 +++++++++++++++++++++++++++++++-------------------- 3 files changed, 44 insertions(+), 20 deletions(-) diff --git a/ChangeLog b/ChangeLog index 77694b90..75bc2656 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2012-04-10 Kaz Kylheku + + * Makefile (conftest.ccver): New phony target. + + * configure: The test for non-working 128 bit integers in the gcc + used by NetBSD 5.1 is not good enough to catch the bug. + Adding a test which will assume that gcc 4.3.x and lesser + does not have working 128 bit types. + 2012-04-10 Kaz Kylheku * eval.c (eval_init): Expose regex-compile and regexp as intrinsics. diff --git a/Makefile b/Makefile index f784b7e0..2296e095 100644 --- a/Makefile +++ b/Makefile @@ -186,3 +186,7 @@ conftest.syms: conftest.o .PHONY: conftest.yacc conftest.yacc: @echo $(YACC) + +.PHONY: conftest.ccver +conftest.ccver: + @$(CC) --version diff --git a/configure b/configure index 2696f682..af340423 100755 --- a/configure +++ b/configure @@ -717,14 +717,22 @@ 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= -# The C test is coded this way because on some GCC installation, -# the 128 bit type doesn't actually work for multiplying two long longs. -# On NetBSD. with gcc 4.1.3, the test case compile dies with an internal -# error. -for try_type in int128 int128_t __int128 __int128_t ; do - cat > conftest.c < conftest.c < conftest.err 2>&1 ; then - superlong=$try_type - break - fi -done + rm -f conftest.o + if $make conftest.o > conftest.err 2>&1 ; then + superlong=$try_type + break + fi + done +fi if [ -n "$superlong" ] ; then printf '"%s"\n' "$superlong" @@ -753,8 +762,9 @@ printf "Checking what C type we have for u. integers wider than \"long long\" .. usuperlong= -for try_type in uint128 uint128_t __uint128 __uint128_t ; do - cat > conftest.c < conftest.c < conftest.err 2>&1 ; then - usuperlong=$try_type - break - fi -done + rm -f conftest.o + if $make conftest.o > conftest.err 2>&1 ; then + usuperlong=$try_type + break + fi + done +fi if [ -n "$usuperlong" ] ; then printf '"%s"\n' "$usuperlong" -- cgit v1.2.3