From fc0eecbdd2abd79e4f22ad28dcfabd86d89b0bb4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Henrik=20Grubbstr=C3=B6m=20=28Grubba=29?=
 <grubba@grubba.org>
Date: Wed, 30 Mar 2016 16:47:52 +0200
Subject: [PATCH] Build [Configure]: Second attempt at fixing --with-abi.

The previous patch broke the AC_CHECK_SIZEOF-tests when using
a non-default ABI.
---
 src/configure.in | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/src/configure.in b/src/configure.in
index 1a11d46690..e7516ecc03 100644
--- a/src/configure.in
+++ b/src/configure.in
@@ -674,7 +674,8 @@ esac
 # Skip if user does not wish to use smartlink binary.
 if test "x$force_smartlink_script_only" = "x"; then
 # Strip smartlink and arguments from $CC
-REALCC="`echo $CC|sed -e 's/.*smartlink *//' -e 's/ .*//g'`"
+REALCC="`echo $CC|sed -e 's/.*smartlink *//'`";
+RAWCC="`echo $REALCC|sed -e 's/ .*//g'`"
 
 
 # FIXME: Add proper tests
@@ -820,7 +821,8 @@ CC="$SMARTLINK $REALCC"
 pike_cv_prog_CC="$CC"
 
 # Strip smartlink and arguments from $CXX
-REALCXX="`echo $CXX|sed -e 's/.*smartlink *//' -e 's/ .*//g'`"
+REALCXX="`echo $CXX|sed -e 's/.*smartlink *//'`"
+RAWCXX="`echo $REALCXX|sed -e 's/ .*//g'`"
 CXX="$SMARTLINK $REALCXX"
 pike_cv_prog_CXX="$CXX"
 
@@ -831,7 +833,7 @@ export CC CXX REALCC REALCXX SMARTLINK
 
 AC_MSG_CHECKING([for a fallback compiler])
 # Strip smartlink and arguments from $FALLBACK_CC
-FALLBACK_CC="`echo $FALLBACK_CC|sed -e 's/.*smartlink *//' -e 's/ .*//g'`"
+FALLBACK_CC="`echo $FALLBACK_CC|sed -e 's/.*smartlink *//'`"
 if test "x$FALLBACK_CC" = "x"; then
   AC_MSG_RESULT(no)
 else
@@ -8187,7 +8189,7 @@ if_autoconf(2,50,[
   # Ensure that the propagated CC (if any) is up to date.
   # Otherwise the sub-configures will attempt to use eg
   # -R with the raw compiler, which only works on Solaris.
-  ac_configure_args=`echo " $ac_configure_args " | sed -e "s% 'CC=$REALCC' % 'CC=$CC' %g"`
+  ac_configure_args=`echo " $ac_configure_args " | sed -e "s% 'CC=$REALCC' % 'CC=$CC' %g" -e "s% 'CC=$RAWCC' % 'CC=$CC' %g"`
 ])
 
 AC_CONFIG_SUBDIRS(modules post_modules)
-- 
GitLab