pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc Break out the inclusion of the operating-system-specif...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/a8add25a6400
branches:  trunk
changeset: 532569:a8add25a6400
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Thu Aug 23 15:59:33 2007 +0000

description:
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:

 emulators/compat_netbsd/Makefile.common |   4 ++-
 mk/emulator/emulator-opsys.mk           |  46 +++++++++++++++++++++++++++++++++
 mk/emulator/emulator.mk                 |  37 +-------------------------
 3 files changed, 51 insertions(+), 36 deletions(-)

diffs (126 lines):

diff -r fd43c9514e1a -r a8add25a6400 emulators/compat_netbsd/Makefile.common
--- a/emulators/compat_netbsd/Makefile.common   Thu Aug 23 15:38:53 2007 +0000
+++ b/emulators/compat_netbsd/Makefile.common   Thu Aug 23 15:59:33 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile.common,v 1.1 2007/08/21 22:49:25 jlam Exp $
+# $NetBSD: Makefile.common,v 1.2 2007/08/23 15:59:33 jlam Exp $
 #
 # Common infrastructure for NetBSD compat* packages.
 #
@@ -43,6 +43,8 @@
 MAKE_DIRS+=            ${EMULDIR}
 ELF_SYMLINKS_DATA=     ${WRKDIR}/.symlinks-data
 
+.include "../../mk/emulator/emulator-opsys.mk"
+
 #
 # PLISTs are composed from the following bits, in order:
 #
diff -r fd43c9514e1a -r a8add25a6400 mk/emulator/emulator-opsys.mk
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ b/mk/emulator/emulator-opsys.mk     Thu Aug 23 15:59:33 2007 +0000
@@ -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 -r fd43c9514e1a -r a8add25a6400 mk/emulator/emulator.mk
--- a/mk/emulator/emulator.mk   Thu Aug 23 15:38:53 2007 +0000
+++ b/mk/emulator/emulator.mk   Thu Aug 23 15:59:33 2007 +0000
@@ -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



Home | Main Index | Thread Index | Old Index