configure.build_arch

Jack Howarth howarth at bromo.med.uc.edu
Wed Sep 16 15:59:51 PDT 2009


    The attached patch for config.guess should cover all
of the bases for darwin10 and I've sent this to Ben
Elliston for review. If a system compiler exists, the
default triplet for on Intel darwin is set to the 
default code generation. In the absence of a compiler,
if the system is on darwin10 or later, the sysctl
call is used to detect if the processor is EMT64
capable. FYI.
             Jack
-------------- next part --------------
--- config.guess	2009-09-16 18:42:33.000000000 -0400
+++ config.guess.proposed2	2009-09-16 18:45:19.000000000 -0400
@@ -4,7 +4,7 @@
 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009
 #   Free Software Foundation, Inc.
 
-timestamp='2009-08-19'
+timestamp='2009-09-03'
 
 # This file is free software; you can redistribute it and/or modify it
 # under the terms of the GNU General Public License as published by
@@ -1247,6 +1247,31 @@
     *:Darwin:*:*)
 	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
 	case $UNAME_PROCESSOR in
+	    i386)
+		eval $set_cc_for_build
+		if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+		  # if system compiler available test by code generation
+		  sed 's/^                //' << EOF >$dummy.c
+		  #if defined(__LP64__)
+		  main()
+		  {
+		  }
+		  #endif
+EOF
+		  if test `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep -c main` = 1 ; then
+	              UNAME_PROCESSOR=x86_64
+		  fi
+		else
+		     # architecture test in absence of compiler
+		     case `uname -r` in
+		        [1-9].*) ;;
+		        *) 
+			  # if darwin10 or later test if EMT64 capable
+		          if test `sysctl -n hw.cpu64bit_capable | grep -c 1` = 1 ; then
+		              UNAME_PROCESSOR=x86_64
+		          fi ;;
+		     esac
+	        fi ;;
 	    unknown) UNAME_PROCESSOR=powerpc ;;
 	esac
 	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}


More information about the macports-dev mailing list