public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* RFA: Improve 128-bit long double configure test
@ 2007-11-15 20:18 Daniel Jacobowitz
  2007-11-24 10:06 ` Mark Mitchell
  2008-03-06 20:33 ` [ping] " Daniel Jacobowitz
  0 siblings, 2 replies; 11+ messages in thread
From: Daniel Jacobowitz @ 2007-11-15 20:18 UTC (permalink / raw)
  To: gcc-patches

MontaVista builds both cross compilers (Linux or Windows -> MVL
target) and native compilers (MVL host) on their Linux-based build
systems.  We discovered that the two compilers disagreed on the
size of long double for PowerPC.  Have I mentioned that I think
making ABI choices based on configure tests is a really lousy idea?

This is the best I could think of to solve the problem.  Configure
wants to grep through /usr/include; if we're building with $build
!= $host (and $host = $target is assured by the previous test, above
the context of the diff), then ask GCC where glibc's headers are.

What do you think?  Is the approach OK?  How about the shell scripting
choices?

-- 
Daniel Jacobowitz
CodeSourcery

2007-11-15  Daniel Jacobowitz  <dan@codesourcery.com>

	* configure.ac: For $build != $host, use the preprocessor to
	find glibc headers.
	* configure: Regenerate.

Index: configure.ac
===================================================================
--- configure.ac	(revision 129996)
+++ configure.ac	(working copy)
@@ -3392,6 +3392,8 @@ AC_CACHE_CHECK(__stack_chk_fail in targe
 	else
 	  glibc_header_dir="${with_sysroot}/usr/include"
 	fi
+      elif test x$build != x$host && test x$GCC = xyes; then
+	glibc_header_dir=`echo "#include <features.h>" | $CPP -x c - | sed '/features/ { s,/features.h".*,,; s,.*",,; q }; d'`
       else
 	glibc_header_dir=/usr/include
       fi
@@ -3446,6 +3448,8 @@ case "$target" in
 	else
 	  glibc_header_dir="${with_sysroot}/usr/include"
 	fi
+      elif test x$build != x$host && test x$GCC = xyes; then
+	glibc_header_dir=`echo "#include <features.h>" | $CPP -x c - | sed '/features/ { s,/features.h".*,,; s,.*",,; q }; d'`
       else
 	glibc_header_dir=/usr/include
       fi

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2008-04-09 15:23 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-15 20:18 RFA: Improve 128-bit long double configure test Daniel Jacobowitz
2007-11-24 10:06 ` Mark Mitchell
2007-11-26  6:45   ` Daniel Jacobowitz
2007-11-26 21:09     ` Mark Mitchell
2008-03-06 20:33 ` [ping] " Daniel Jacobowitz
2008-04-09  0:40   ` Mark Mitchell
2008-04-09  2:59     ` David Edelsohn
2008-04-09  6:48       ` Mark Mitchell
2008-04-09 13:16         ` David Edelsohn
2008-04-09 13:37           ` Paolo Bonzini
2008-04-09 16:02           ` Mark Mitchell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).