summaryrefslogtreecommitdiff
path: root/devel
diff options
context:
space:
mode:
authorjperkin <jperkin>2016-01-24 16:14:44 +0000
committerjperkin <jperkin>2016-01-24 16:14:44 +0000
commit06b7c32135974a8c4839c7fe4856cb9f1312e0e0 (patch)
treec3c974565ac88eddb790ad36e7b99f06ff190a0a /devel
parent7a3f6152d179fa262274b5e0e142c21ec690b76f (diff)
downloadpkgsrc-06b7c32135974a8c4839c7fe4856cb9f1312e0e0.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')
-rw-r--r--devel/bmake/Makefile6
-rw-r--r--devel/bmake/files/main.c14
-rw-r--r--devel/bmake/files/make-bootstrap.sh.in2
3 files changed, 14 insertions, 8 deletions
diff --git a/devel/bmake/Makefile b/devel/bmake/Makefile
index 86daf07e9f8..b3b40129b54 100644
--- a/devel/bmake/Makefile
+++ b/devel/bmake/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.71 2015/06/17 17:37:50 tron Exp $
+# $NetBSD: Makefile,v 1.72 2016/01/24 16:14:44 jperkin Exp $
DISTNAME= bmake-20150505
CATEGORIES= devel
@@ -28,6 +28,7 @@ INSTALLATION_DIRS= bin ${PKGMANDIR}/cat1 ${PKGMANDIR}/man1
GNU_CONFIGURE= yes
CONFIGURE_ARGS+= --prefix=${PREFIX}
CONFIGURE_ARGS+= --with-default-sys-path=${makesyspath}
+CONFIGURE_ARGS+= --with-machine_arch=${MACHINE_ARCH}
CONFIGURE_ARGS+= --sysconfdir=${PKG_SYSCONFDIR}
.include "../../mk/bsd.prefs.mk"
@@ -41,9 +42,6 @@ CONFIGURE_ARGS+= --with-defshell=${PREFIX}/bin/pdksh
.if ${OPSYS} == "Interix"
MAKE_ENV+= XDEFS=-DUSE_SELECT
.endif
-.if ${OPSYS} == "IRIX"
-CONFIGURE_ARGS+= --with-machine_arch=${MACHINE_ARCH}
-.endif
do-extract:
${CP} -R ${FILESDIR} ${WRKSRC}
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}\""