Received: from mailman by lists.gnu.org with archive (Exim 4.43) id 1E2ewP-0002Ae-O2 for mharc-grub-devel@gnu.org; Tue, 09 Aug 2005 20:59:33 -0400 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1E2evF-0001kR-Cr for grub-devel@gnu.org; Tue, 09 Aug 2005 20:58:22 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1E2euy-0001bd-Sd for grub-devel@gnu.org; Tue, 09 Aug 2005 20:58:08 -0400 Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1E2euw-0001ZD-Sq for grub-devel@gnu.org; Tue, 09 Aug 2005 20:58:03 -0400 Received: from [66.163.179.101] (helo=web35307.mail.mud.yahoo.com) by monty-python.gnu.org with smtp (Exim 4.34) id 1E2f05-0001sY-BD for grub-devel@gnu.org; Tue, 09 Aug 2005 21:03:21 -0400 Received: (qmail 27234 invoked by uid 60001); 10 Aug 2005 00:48:50 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=VNegAwGrpmnHKK891gFYSwUcDP7AD9Ab+sFzVw+gulnkM0YeLwOnNENl+94FtmVYyMucP1+AxsX/l3ZgMDONBpjS7EAHPfw8CpawqfiqV9UKHzCyNfpZk0YboPg2hdhlGVXUqIxA2RS04y6UfQueasAxtrBjKU1Vba/6NO9bjnA= ; Message-ID: <20050810004850.27232.qmail@web35307.mail.mud.yahoo.com> Received: from [84.53.202.16] by web35307.mail.mud.yahoo.com via HTTP; Tue, 09 Aug 2005 17:48:50 PDT Date: Tue, 9 Aug 2005 17:48:50 -0700 (PDT) From: Ruslan Nikolaev To: grub-devel@gnu.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-1496996547-1123634930=:26666" Content-Transfer-Encoding: 8bit Subject: [PATCH] compiling on x86_64 (again) X-BeenThere: grub-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: The development of GRUB 2 List-Id: The development of GRUB 2 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 10 Aug 2005 00:59:30 -0000 --0-1496996547-1123634930=:26666 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Hi! I send patch again (patch in previous message was broken). CC_ARCH is used just for saving CC for BUILD_CC; CC in turns overrides for x86_64 x86_64 uses separate host_cpu and host_vendor, but during configuring will be created links onto i386-specific files. ChangeLog: 2005-08-08 Ruslan Nikolaev * configure.ac: Added x86_64 support. PATCH: diff -urN old/configure.ac new/configure.ac --- old/configure.ac 2005-08-08 19:08:41.000000000 +0000 +++ new/configure.ac 2005-08-09 01:25:14.135290880 +0000 @@ -22,16 +22,27 @@ case "$host_cpu" in i[[3456]]86) host_cpu=i386 ;; + x86_64) ;; powerpc) ;; *) AC_MSG_ERROR([unsupported CPU type]) ;; esac case "$host_cpu"-"$host_vendor" in i386-*) host_vendor=pc ;; + x86_64-*) host_vendor=pc ;; powerpc-*) host_vendor=ieee1275 ;; *) AC_MSG_ERROR([unsupported machine type]) ;; esac +# Keep CC for BUILD_CC +CC_ARCH="$CC" + +# Override x86_64 settings +if test "x$host_cpu" = xx86_64; then + CC="$CC -m32" + LD="ld -melf_i386" +fi + AC_SUBST(host_cpu) AC_SUBST(host_vendor) @@ -62,8 +73,8 @@ tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops" fi - # Force no alignment to save space on i386. - if test "x$host_cpu" = xi386; then + # Force no alignment to save space on i386/x86_64. + if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [ CFLAGS="-falign-loops=1" AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no]) @@ -82,13 +93,13 @@ # Defined in aclocal.m4. grub_ASM_USCORE -if test "x$host_cpu" = xi386; then +if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then grub_CHECK_START_SYMBOL grub_CHECK_BSS_START_SYMBOL grub_CHECK_END_SYMBOL fi -if test "x$host_cpu" = xi386; then +if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then grub_I386_ASM_PREFIX_REQUIREMENT grub_I386_ASM_ADDR32 grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK @@ -113,7 +124,7 @@ AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc], [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])]) else - BUILD_CC="$CC" + BUILD_CC="$CC_ARCH" AC_SUBST(BUILD_CC) fi @@ -130,8 +141,8 @@ AC_CHECK_SIZEOF(void *) AC_CHECK_SIZEOF(long) -# Check LZO when compiling for the i386. -if test "x$host_cpu" = xi386; then +# Check LZO when compiling for the i386/x86_64. +if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then AC_CHECK_LIB(lzo, __lzo_init2, , AC_MSG_ERROR([LZO library version 1.02 or later is required])) AC_CHECK_FUNC(lzo1x_999_compress, , @@ -150,6 +161,13 @@ CFLAGS="$tmp_CFLAGS" CPPFLAGS="$tmp_CPPFLAGS" +# Create links for x86_64 +if test "x$host_cpu" = xx86_64; then + AC_CONFIG_LINKS([include/grub/x86_64:include/grub/i386]) + AC_CONFIG_LINKS([conf/x86_64-$host_vendor.mk:conf/i386-$host_vendor.mk + conf/x86_64-$host_vendor.rmk:conf/i386-$host_vendor.rmk]) +fi + # Output files. AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu include/grub/machine:include/grub/$host_cpu/$host_vendor]) --------------------------------- Yahoo! Mail Stay connected, organized, and protected. Take the tour --0-1496996547-1123634930=:26666 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit
Hi!
 
I send patch again (patch in previous message was broken).
CC_ARCH is used just for saving CC for BUILD_CC; CC in turns overrides for x86_64
 
x86_64 uses separate host_cpu and host_vendor, but during configuring will be created links onto i386-specific files.
 
ChangeLog:
 
2005-08-08  Ruslan Nikolaev  <nruslan_devel@yahoo.com>
   * configure.ac: Added x86_64 support.
 
PATCH:
 
diff -urN old/configure.ac new/configure.ac
--- old/configure.ac 2005-08-08 19:08:41.000000000 +0000
+++ new/configure.ac 2005-08-09 01:25:14.135290880 +0000
@@ -22,16 +22,27 @@
 
 case "$host_cpu" in
   i[[3456]]86) host_cpu=i386 ;;
+  x86_64) ;;
   powerpc) ;;
   *) AC_MSG_ERROR([unsupported CPU type]) ;;
 esac
 
 case "$host_cpu"-"$host_vendor" in
   i386-*) host_vendor=pc ;;
+  x86_64-*) host_vendor=pc ;;
   powerpc-*) host_vendor=ieee1275 ;;
   *) AC_MSG_ERROR([unsupported machine type]) ;;
 esac
 
+# Keep CC for BUILD_CC
+CC_ARCH="$CC"
+
+# Override x86_64 settings
+if test "x$host_cpu" = xx86_64; then
+  CC="$CC -m32"
+  LD="ld -melf_i386"
+fi
+
 AC_SUBST(host_cpu)
 AC_SUBST(host_vendor)
 
@@ -62,8 +73,8 @@
     tmp_CFLAGS="$tmp_CFLAGS -O2 -fno-strength-reduce -fno-unroll-loops"
   fi
 
-  # Force no alignment to save space on i386.
-  if test "x$host_cpu" = xi386; then
+  # Force no alignment to save space on i386/x86_64.
+  if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then
     AC_CACHE_CHECK([whether -falign-loops works], [falign_loop_flag], [
       CFLAGS="-falign-loops=1"
       AC_TRY_COMPILE(, , [falign_loop_flag=yes], [falign_loop_flag=no])
@@ -82,13 +93,13 @@
 
 # Defined in aclocal.m4.
 grub_ASM_USCORE
-if test "x$host_cpu" = xi386; then
+if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then
   grub_CHECK_START_SYMBOL
   grub_CHECK_BSS_START_SYMBOL
   grub_CHECK_END_SYMBOL
 fi
 
-if test "x$host_cpu" = xi386; then
+if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then
   grub_I386_ASM_PREFIX_REQUIREMENT
   grub_I386_ASM_ADDR32
   grub_I386_ASM_ABSOLUTE_WITHOUT_ASTERISK
@@ -113,7 +124,7 @@
   AC_CHECK_PROGS(BUILD_CC, [gcc egcs cc],
    [AC_MSG_ERROR([none of gcc, egcs and cc is found. set BUILD_CC manually.])])
 else
-  BUILD_CC="$CC"
+  BUILD_CC="$CC_ARCH"
   AC_SUBST(BUILD_CC)
 fi
 
@@ -130,8 +141,8 @@
 AC_CHECK_SIZEOF(void *)
 AC_CHECK_SIZEOF(long)
 
-# Check LZO when compiling for the i386.
-if test "x$host_cpu" = xi386; then
+# Check LZO when compiling for the i386/x86_64.
+if test "x$host_cpu" = xi386 -o "x$host_cpu" = xx86_64; then
   AC_CHECK_LIB(lzo, __lzo_init2, ,
         AC_MSG_ERROR([LZO library version 1.02 or later is required]))
   AC_CHECK_FUNC(lzo1x_999_compress, ,
@@ -150,6 +161,13 @@
 CFLAGS="$tmp_CFLAGS"
 CPPFLAGS="$tmp_CPPFLAGS"
 
+# Create links for x86_64
+if test "x$host_cpu" = xx86_64; then
+  AC_CONFIG_LINKS([include/grub/x86_64:include/grub/i386])
+  AC_CONFIG_LINKS([conf/x86_64-$host_vendor.mk:conf/i386-$host_vendor.mk
+   conf/x86_64-$host_vendor.rmk:conf/i386-$host_vendor.rmk])
+fi
+
 # Output files.
 AC_CONFIG_LINKS([include/grub/cpu:include/grub/$host_cpu
  include/grub/machine:include/grub/$host_cpu/$host_vendor])


Yahoo! Mail
Stay connected, organized, and protected. Take the tour --0-1496996547-1123634930=:26666--