summaryrefslogtreecommitdiff
path: root/mk
diff options
context:
space:
mode:
authorjlam <jlam@pkgsrc.org>2007-08-23 15:59:33 +0000
committerjlam <jlam@pkgsrc.org>2007-08-23 15:59:33 +0000
commite44e2c60b8c08c7926831a152cd9fbaf85c8e60f (patch)
tree39d6f1c0868fafa02240c1916ce099f71a729e66 /mk
parent8704d27510f1be0cd77257475b6f0cc340f14590 (diff)
downloadpkgsrc-e44e2c60b8c08c7926831a152cd9fbaf85c8e60f.tar.gz
Break out the inclusion of the operating-system-specific Makefile into
a separate emulator-opsys.mk file. The emulator-opsys.mk file defines EMUL_DISTRO and the various *EMUL*DIR* variables, as well as any opsys-specific variables. Include this file within compat_netbsd/Makefile.common so that the *EXEC_FMT variables (defined by the compat*/emulator.mk files) are defined. This fixes the build of compat* packages. XXX emulator-opsys.mk will go away in the near future as we do more XXX appropriate information hiding.
Diffstat (limited to 'mk')
-rw-r--r--mk/emulator/emulator-opsys.mk46
-rw-r--r--mk/emulator/emulator.mk37
2 files changed, 48 insertions, 35 deletions
diff --git a/mk/emulator/emulator-opsys.mk b/mk/emulator/emulator-opsys.mk
new file mode 100644
index 00000000000..f931d0ac7fb
--- /dev/null
+++ b/mk/emulator/emulator-opsys.mk
@@ -0,0 +1,46 @@
+# $NetBSD: emulator-opsys.mk,v 1.1 2007/08/23 15:59:33 jlam Exp $
+#
+# This file is included by emulator.mk.
+#
+# Variables defined by this file:
+#
+# EMUL_DISTRO
+# The distribution of the emulated operating system being used,
+# e.g. native-linux, suse-10.0, etc. If the package isn't
+# supported on this machine, then its value is "none".
+#
+# EMULDIR
+# Convenience variable that expands to ${PREFIX}/${EMULSUBDIR}
+#
+# EMULSUBDIR
+# Path relative to ${PREFIX} where the files and directories
+# are located, e.g. emul/linux.
+#
+# OPSYS_EMULDIR
+# Path through which the platform expects to find a "chroot"
+# installation of the files and directories, e.g. /emul/linux.
+#
+
+.if !defined(_EMULATOR_EMULATOR_OPSYS_MK)
+_EMULATOR_EMULATOR_OPSYS_MK= defined
+
+.if empty(EMUL_PLATFORMS:M${EMUL_PLATFORM})
+PKG_FAIL_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}"
+.endif
+
+.if ${EMUL_PLATFORM} == "none"
+EMUL_DISTRO?= none
+EMULSUBDIR?= # empty
+EMULDIR?= ${PREFIX}
+OPSYS_EMULDIR?= # empty
+.else
+#
+# The ${EMUL_OPSYS}.mk file included here should define the following
+# variables either directly or indirectly:
+#
+# EMUL_DISTRO, EMULSUBDIR, EMULDIR, OPSYS_EMULDIR
+#
+. include "${.PARSEDIR}/${EMUL_OPSYS}.mk"
+.endif
+
+.endif # _EMULATOR_EMULATOR_OPSYS_MK
diff --git a/mk/emulator/emulator.mk b/mk/emulator/emulator.mk
index ed7f30f913f..46ae5e1a9e7 100644
--- a/mk/emulator/emulator.mk
+++ b/mk/emulator/emulator.mk
@@ -1,4 +1,4 @@
-# $NetBSD: emulator.mk,v 1.4 2007/08/22 14:47:10 jlam Exp $
+# $NetBSD: emulator.mk,v 1.5 2007/08/23 15:59:34 jlam Exp $
#
# This file is included by bsd.pkg.mk.
#
@@ -17,22 +17,6 @@
#
# Variables defined by this file:
#
-# EMUL_DISTRO
-# The distribution of the emulated operating system being used,
-# e.g. native-linux, suse-10.0, etc. If the package isn't
-# supported on this machine, then its value is "none".
-#
-# EMULDIR
-# Convenience variable that expands to ${PREFIX}/${EMULSUBDIR}
-#
-# EMULSUBDIR
-# Path relative to ${PREFIX} where the files and directories
-# are located, e.g. emul/linux.
-#
-# OPSYS_EMULDIR
-# Path through which the platform expects to find a "chroot"
-# installation of the files and directories, e.g. /emul/linux.
-#
# EMULSUBDIRSLASH
# Expands to either ${EMULSUBDIR}/lib or just lib depending on
# whether EMULSUBDIR is empty or not. It is meant to be used
@@ -52,24 +36,7 @@
# of the ``emul-fetch'' target.
#
-.if empty(EMUL_PLATFORMS:M${EMUL_PLATFORM})
-PKG_FAIL_REASON+= "${PKGNAME} is not available for ${MACHINE_PLATFORM}"
-.endif
-
-.if ${EMUL_PLATFORM} == "none"
-EMUL_DISTRO?= none
-EMULSUBDIR?= # empty
-EMULDIR?= ${PREFIX}
-OPSYS_EMULDIR?= # empty
-.else
-#
-# The ${EMUL_OPSYS}.mk file included here should define the following
-# variables either directly or indirectly:
-#
-# EMUL_DISTRO, EMULSUBDIR, EMULDIR, OPSYS_EMULDIR
-#
-. include "../../mk/emulator/${EMUL_OPSYS}.mk"
-.endif
+.include "${.PARSEDIR}/emulator-opsys.mk"
# If we're doing true binary emulation, then file paths found in the
# package's binaries, libraries and scripts won't necessarily match the