diff options
author | jperkin <jperkin@pkgsrc.org> | 2016-01-24 16:14:44 +0000 |
---|---|---|
committer | jperkin <jperkin@pkgsrc.org> | 2016-01-24 16:14:44 +0000 |
commit | fce78c05d2b89e39cbed6550f41cfcb953a79b76 (patch) | |
tree | c3c974565ac88eddb790ad36e7b99f06ff190a0a /devel/bmake/files | |
parent | f0e3ed42a48ebe6c8c92d305dc49fb165e9d90cb (diff) | |
download | pkgsrc-fce78c05d2b89e39cbed6550f41cfcb953a79b76.tar.gz |
Attempt to bring sanity to how ABI and MACHINE_ARCH are set.
Previously there were at least 5 different ways MACHINE_ARCH could be set,
some statically and some at run time, and in many cases these settings
differed, leading to issues at pkg_add time where there was conflict
between the setting encoded into the package and that used by pkg_install.
Instead, move to a single source of truth where the correct value based on
the host and the chosen (or default) ABI is determined in the bootstrap
script. The value can still be overridden in mk.conf if necessary, e.g.
for cross-compiling.
ABI is now set by default and if unset a default is calculated based on
MACHINE_ARCH. This fixes some OS, e.g. Linux, where the wrong default was
previously chosen.
As a result of the refactoring there is no need for LOWER_ARCH, with
references to it replaced by MACHINE_ARCH. SPARC_TARGET_ARCH is also
removed.
Diffstat (limited to 'devel/bmake/files')
-rw-r--r-- | devel/bmake/files/main.c | 14 | ||||
-rw-r--r-- | devel/bmake/files/make-bootstrap.sh.in | 2 |
2 files changed, 12 insertions, 4 deletions
diff --git a/devel/bmake/files/main.c b/devel/bmake/files/main.c index ee83a902eb1..d18037f37be 100644 --- a/devel/bmake/files/main.c +++ b/devel/bmake/files/main.c @@ -1,4 +1,4 @@ -/* $NetBSD: main.c,v 1.13 2015/05/19 22:01:19 joerg Exp $ */ +/* $NetBSD: main.c,v 1.14 2016/01/24 16:14:44 jperkin Exp $ */ /* * Copyright (c) 1988, 1989, 1990, 1993 @@ -69,7 +69,7 @@ */ #ifndef MAKE_NATIVE -static char rcsid[] = "$NetBSD: main.c,v 1.13 2015/05/19 22:01:19 joerg Exp $"; +static char rcsid[] = "$NetBSD: main.c,v 1.14 2016/01/24 16:14:44 jperkin Exp $"; #else #include <sys/cdefs.h> #ifndef lint @@ -81,7 +81,7 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 1989, 1990, 1993\ #if 0 static char sccsid[] = "@(#)main.c 8.3 (Berkeley) 3/19/94"; #else -__RCSID("$NetBSD: main.c,v 1.13 2015/05/19 22:01:19 joerg Exp $"); +__RCSID("$NetBSD: main.c,v 1.14 2016/01/24 16:14:44 jperkin Exp $"); #endif #endif /* not lint */ #endif @@ -916,6 +916,14 @@ main(int argc, char **argv) #endif } + /* + * Hardcode default pkgsrc MACHINE_ARCH. There is only one legitimate + * way to override the variable, and that is through the environment, + * handled above. We need to use PKGSRC_MACHINE_ARCH as some OS define + * MACHINE_ARCH in their system headers. + */ + machine_arch = PKGSRC_MACHINE_ARCH; + if (!machine_arch) { #if defined(MAKE_NATIVE) && defined(HAVE_SYSCTL) && defined(CTL_HW) && defined(HW_MACHINE_ARCH) static char machine_arch_buf[sizeof(utsname.machine)]; diff --git a/devel/bmake/files/make-bootstrap.sh.in b/devel/bmake/files/make-bootstrap.sh.in index 2bb4c25a705..7a3721f6102 100644 --- a/devel/bmake/files/make-bootstrap.sh.in +++ b/devel/bmake/files/make-bootstrap.sh.in @@ -16,7 +16,7 @@ CFLAGS="@CFLAGS@ -I. -I${srcdir} @DEFS@ @CPPFLAGS@ -DMAKE_NATIVE ${XDEFS} -DBMAK MAKE_VERSION=`sed -n '/^MAKE_VERSION=/s,.*=[^0-9]*,,p' $srcdir/Makefile` MDEFS="-DMAKE_VERSION=\"$MAKE_VERSION\" \ --D@force_machine@MACHINE=\"@machine@\" -DMACHINE_ARCH=\"@machine_arch@\" \ +-D@force_machine@MACHINE=\"@machine@\" -DPKGSRC_MACHINE_ARCH=\"@machine_arch@\" \ -D_PATH_DEFSYSPATH=\"${DEFAULT_SYS_PATH}\"" |