From 12423a46dcc20710f346e0f05f05983048c622e6 Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Wed, 31 Aug 2005 16:28:15 +0000 Subject: [PATCH] ARCH and CPU_ARCH have been split. Now, you can build a 32-bit version of Sherlock on an amd64 system by calling ./configure debug CC="gcc-3.4 -m32" LD="gcc-3.4 -m32" ARCH=i386 or a 64-bit version by not overriding anything. On 32-bit systems, everything should act the same as before. --- lib/autoconf.cfg | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/lib/autoconf.cfg b/lib/autoconf.cfg index 0e8496dc..9b0304cd 100644 --- a/lib/autoconf.cfg +++ b/lib/autoconf.cfg @@ -35,11 +35,22 @@ $gccver >= 3000 or Fail "GCC older than 3.0 doesn't support C99 well enough."; ### CPU ### -Test("CPU_ARCH", "Checking for CPU architecture", sub { +Test("ARCH", "Checking for machine architecture", sub { my $mach = `uname -m`; chomp $mach; Fail "Unable to determine machine type" if $? || $mach eq ""; if ($mach =~ /^i[0-9]86$/) { + return "i386"; + } elsif ($mach =~ /^(x86[_-]|amd)64$/) { + return "amd64"; + } else { + return "unknown"; + } +}); + +Test("CPU_ARCH", "Checking for CPU architecture", sub { + my $mach = Get("ARCH"); + if ($mach eq "i386") { Set("CPU_I386"); UnSet("CPU_64BIT_POINTERS"); Set("CPU_LITTLE_ENDIAN"); @@ -90,7 +101,7 @@ Test("CPU_ARCH", "Checking for CPU architecture", sub { } } return $arch ? $arch : "i386"; - } elsif ($mach =~ /^(x86[_-]|amd)64$/) { + } elsif ($mach eq "amd64") { Set("CPU_AMD64"); Set("CPU_64BIT_POINTERS"); Set("CPU_LITTLE_ENDIAN"); @@ -99,10 +110,11 @@ Test("CPU_ARCH", "Checking for CPU architecture", sub { Set("CPU_STRUCT_ALIGN" => 8); return "x86-64"; } else { - return "unknown"; + return undef; } }); -if (Get("CPU_ARCH") eq "unknown") { Warn "CPU type not recognized, using defaults, keep fingers crossed."; } + +if (!IsSet("CPU_ARCH")) { Warn "CPU type not recognized, using defaults, keep fingers crossed."; } ### Compiler and its Options ### -- 2.39.2