pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/mk/emulator Reorganize some code so that including bsd...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/93fcc985b2a7
branches:  trunk
changeset: 532518:93fcc985b2a7
user:      jlam <jlam%pkgsrc.org@localhost>
date:      Wed Aug 22 14:47:10 2007 +0000

description:
Reorganize some code so that including bsd.prefs.mk doesn't expose
so much of the emulator framework.

diffstat:

 mk/emulator/emulator-vars.mk |  32 +---------------------------
 mk/emulator/emulator.mk      |  49 +++++++++++++++++++++++++++++++++++++++----
 2 files changed, 45 insertions(+), 36 deletions(-)

diffs (141 lines):

diff -r 9aea020bb6e4 -r 93fcc985b2a7 mk/emulator/emulator-vars.mk
--- a/mk/emulator/emulator-vars.mk      Wed Aug 22 14:03:47 2007 +0000
+++ b/mk/emulator/emulator-vars.mk      Wed Aug 22 14:47:10 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: emulator-vars.mk,v 1.5 2007/08/21 22:49:33 jlam Exp $
+# $NetBSD: emulator-vars.mk,v 1.6 2007/08/22 14:47:10 jlam Exp $
 #
 # This file is included by bsd.prefs.mk only if EMUL_PLATFORMS is defined
 # and non-empty.
@@ -42,22 +42,6 @@
 #      package isn't supported on this machine, then its value is
 #      "none".
 #
-# 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.
-#
 
 # _EMUL_OPSYS
 #      A table that maps ${OPSYS} to the operating system names
@@ -121,24 +105,10 @@
 .endfor
 EMUL_PLATFORM?=                none
 
-# _EMUL_RUN_LDCONFIG
-#      This is YesNo variable that is modified by makefiles in the
-#      emulator framework.  This is used as the default value of
-#      RUN_LDCONFIG by any package that uses the emulator framework.
-#      
-#      Default value: no
-#
-_EMUL_RUN_LDCONFIG=    no
-
 .if ${EMUL_PLATFORM} == "none"
 EMUL_ARCH?=            none
 EMUL_OPSYS?=           none
-EMUL_DISTRO?=          none
-EMULSUBDIR?=           # empty
-EMULDIR?=              ${PREFIX}
-OPSYS_EMULDIR?=                # empty
 .else
 EMUL_ARCH?=            ${EMUL_PLATFORM:C/.*-//}
 EMUL_OPSYS?=           ${EMUL_PLATFORM:C/-.*//}
-.  include "../../mk/emulator/${EMUL_OPSYS}.mk"
 .endif
diff -r 9aea020bb6e4 -r 93fcc985b2a7 mk/emulator/emulator.mk
--- a/mk/emulator/emulator.mk   Wed Aug 22 14:03:47 2007 +0000
+++ b/mk/emulator/emulator.mk   Wed Aug 22 14:47:10 2007 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: emulator.mk,v 1.3 2007/08/13 15:17:09 jlam Exp $
+# $NetBSD: emulator.mk,v 1.4 2007/08/22 14:47:10 jlam Exp $
 #
 # This file is included by bsd.pkg.mk.
 #
@@ -17,6 +17,22 @@
 #
 # 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
@@ -36,6 +52,25 @@
 #      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
+
 # If we're doing true binary emulation, then file paths found in the
 # package's binaries, libraries and scripts won't necessarily match the
 # actual paths on the file system, so skip some path checks that are
@@ -51,6 +86,14 @@
 #
 CHECK_PORTABILITY_SKIP=                *
 
+# _EMUL_RUN_LDCONFIG
+#      This is YesNo variable that is modified by makefiles in the
+#      emulator framework.  This is used as the default value of
+#      RUN_LDCONFIG by any package that uses the emulator framework.
+#
+#      Default value: no
+#
+_EMUL_RUN_LDCONFIG?=   no
 RUN_LDCONFIG?=         ${_EMUL_RUN_LDCONFIG}
 
 FILES_SUBST+=          EMUL_PLATFORM=${EMUL_PLATFORM:Q}
@@ -73,10 +116,6 @@
 FILES_SUBST+=          EMULSUBDIRSLASH=${EMULSUBDIRSLASH:Q}
 PLIST_SUBST+=          EMULSUBDIRSLASH=${EMULSUBDIRSLASH:Q}
 
-.if empty(EMUL_PLATFORMS:M${EMUL_PLATFORM})
-PKG_FAIL_REASON+=      "${PKGNAME} is not available for ${MACHINE_PLATFORM}"
-.endif
-
 # Add dependencies for each "module" that the package requests in
 # EMUL_MODULES.${EMUL_OPSYS}.
 #



Home | Main Index | Thread Index | Old Index