Skip to content

Instantly share code, notes, and snippets.

@jperkin
Last active January 15, 2016 15:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jperkin/b220bf3c09a6fcc29aaa to your computer and use it in GitHub Desktop.
Save jperkin/b220bf3c09a6fcc29aaa to your computer and use it in GitHub Desktop.
Index: bootstrap
===================================================================
RCS file: /cvsroot/pkgsrc/bootstrap/bootstrap,v
retrieving revision 1.226
diff -u -r1.226 bootstrap
--- bootstrap 6 Jan 2016 17:59:58 -0000 1.226
+++ bootstrap 15 Jan 2016 15:56:44 -0000
@@ -503,7 +503,6 @@
root_user=root
bmakexargs=
need_extras=no
-set_machine_arch=no
use_bsdinstall=
case "$opsys" in
AIX)
@@ -523,10 +522,6 @@
need_sed=no
set_opsys=no
machine_arch=`arch -s`
- if [ "$machine_arch" = "amd64" ]; then
- machine_arch=x86_64
- bmakexargs="MACHINE_ARCH=$machine_arch"
- fi
check_compiler=yes
;;
CYGWIN_*)
@@ -556,9 +551,6 @@
set_opsys=no
get_abi "Darwin"
machine_arch=`uname -p`
- if [ "$machine_arch" = "i386" -a "$abi" = "64" ]; then
- machine_arch=x86_64
- fi
CC=${CC:-"cc -isystem /usr/include"}; export CC
check_compiler=yes
osrev=`uname -r`
@@ -590,10 +582,6 @@
set_opsys=no
check_prog tarprog tar
machine_arch=`uname -p`
- if [ "$machine_arch" = "amd64" ]; then
- machine_arch=x86_64
- bmakexargs="MACHINE_ARCH=$machine_arch"
- fi
;;
FreeBSD)
root_group=wheel
@@ -602,10 +590,6 @@
need_sed=no
set_opsys=no
machine_arch=`uname -p`
- if [ "$machine_arch" = "amd64" ]; then
- machine_arch=x86_64
- bmakexargs="MACHINE_ARCH=$machine_arch"
- fi
check_compiler=yes
;;
FreeMiNT)
@@ -705,7 +689,6 @@
need_sed=yes
set_opsys=yes
machine_arch=mipseb
- bmakexargs="MACHINE_ARCH=$machine_arch"
check_compiler=yes
if [ `uname -r` -lt 6 ]; then
# IRIX 5's mkdir bails out with an error when trying to create with the -p
@@ -730,12 +713,6 @@
need_sed=no
set_opsys=no
machine_arch=`uname -m | sed -e 's/i.86/i386/'`
- # Support multiarch systems.
- if [ "$machine_arch" = "x86_64" -a "$abi" = "32" ]; then
- machine_arch=i386
- set_machine_arch=yes
- bmakexargs="MACHINE_ARCH=$machine_arch"
- fi
;;
Minix)
root_group=operator
@@ -789,10 +766,6 @@
need_sed=no
set_opsys=no
machine_arch=`arch -s`
- if [ "$machine_arch" = "amd64" ]; then
- machine_arch=x86_64
- bmakexargs="MACHINE_ARCH=$machine_arch"
- fi
;;
OSF1)
root_group=system
@@ -871,6 +844,21 @@
;;
esac
+# Fixup MACHINE_ARCH, ensuring we use the canonical "x86_64" on 64-bit x86
+# systems, and supporting multiarch.
+#
+case "$machine_arch/$abi" in
+amd64/*)
+ machine_arch=x86_64
+ ;;
+i386/64)
+ machine_arch=x86_64
+ ;;
+x86_64/32)
+ machine_arch=i386
+ ;;
+esac
+
# If "--full" is specified, then install all of the platform-independent
# bootstrap software.
#
@@ -898,14 +886,10 @@
die "ERROR: --make-jobs must be a positive integer argument"
fi
-# export OPSYS and MACHINE_ARCH for pkg_install. we only set
-# MACHINE_ARCH on platforms where we override bmake's value.
+# export MACHINE_ARCH and OPSYS for pkg_install and bmake.
+MACHINE_ARCH=${machine_arch}
OPSYS=${opsys}
-export OPSYS
-if [ "${machine_arch}" != "" ]; then
- MACHINE_ARCH=${machine_arch}
- export MACHINE_ARCH
-fi
+export MACHINE_ARCH OPSYS
if [ "x$preserve_path" != "xyes" ]; then
PATH="$overpath:$PATH"
@@ -1021,9 +1005,6 @@
if [ -n "$abi" ]; then
echo "ABI= $abi" >> ${TARGET_MKCONF}
fi
-if [ "$set_machine_arch" = "yes" ]; then
- echo "MACHINE_ARCH= $machine_arch" >> ${TARGET_MKCONF}
-fi
if [ "$compiler" != "" ]; then
echo "PKGSRC_COMPILER= $compiler" >> ${TARGET_MKCONF}
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment