1 # $NetBSD: emulator-vars.mk,v 1.7 2007/08/23 13:43:57 jlam Exp $
3 # This file is included by bsd.prefs.mk only if EMUL_PLATFORMS is defined
6 # User-settable variables:
8 # EMUL_TYPE.${EMUL_OPSYS}
9 # Specifies the "type" or "variant" of ${EMUL_OPSYS} to use, e.g.
10 # ${EMUL_TYPE.linux} == "suse".
13 # Specifies the platform to emulate, and is of the form
14 # ${EMUL_OPSYS}-${EMUL_ARCH}, e.g. linux-i386. By default
15 # this is the best-matching platform listed in EMUL_PLATFORMS
16 # chosen based on EMUL_PREFER.
19 # The list of platforms to try to emulate in order of preference.
20 # By default, only try to emulate the native platform. See the
21 # _EMUL_PREFER.* table below for additional preferences for various
24 # Package-settable variables:
27 # List of "${EMUL_OPSYS}-${EMUL_ARCH}" binary emulations supported
28 # by the package. This should be set prior to the inclusion of
31 # Default value: undefined
33 # Variables defined by this file:
36 # The machine architecture being emulated, e.g. i386. If the
37 # package isn't supported on this machine, then its value is
41 # The operating system being emulated, e.g. linux. If the
42 # package isn't supported on this machine, then its value is
46 # Whether or not the operating system being emulated matches the
47 # native operating system. It is either defined or undefined.
51 _USER_VARS.emulator
= EMUL_TYPE.
${EMUL_OPSYS} EMUL_PLATFORM EMUL_PREFER
52 _PKG_VARS.emulator
= EMUL_PLATFORMS
53 _SYS_VARS.emulator
= EMUL_ARCH EMUL_OPSYS EMUL_IS_NATIVE
56 # A table that maps ${OPSYS} to the operating system names
57 # (${EMUL_OPSYS}) used by the emulator framework.
59 # _EMUL_MACHINE_PLATFORM
60 # An "opsys-arch" pair that describes the "native" platform.
63 # A table that maps ${_EMUL_MACHINE_PLATFORM} to a list of
64 # platforms to try to emulate on the native platform, excluding
67 _EMUL_OPSYS.HPUX
= hpux
68 _EMUL_OPSYS.IRIX
= irix
69 _EMUL_OPSYS.OSF1
= osf1
70 .if
!empty
(OS_VERSION
:M4.
*)
71 _EMUL_OPSYS.SunOS
= sunos
73 _EMUL_OPSYS.SunOS
= solaris
75 .if defined
(_EMUL_OPSYS.
${OPSYS})
76 _EMUL_OPSYS
= ${_EMUL_OPSYS.
${OPSYS}}
78 _EMUL_OPSYS
= ${LOWER_OPSYS}
81 _EMUL_MACHINE_PLATFORM
= ${_EMUL_OPSYS}-${MACHINE_ARCH}
83 _EMUL_PREFER.netbsd-alpha
= osf1-alpha linux-alpha
84 _EMUL_PREFER.netbsd-arm
= linux-arm
85 _EMUL_PREFER.netbsd-i386
= linux-i386 freebsd-i386 solaris-i386 darwin-i386
86 _EMUL_PREFER.netbsd-m68k
= sunos-m68k linux-m68k
87 _EMUL_PREFER.netbsd-powerpc
= linux-powerpc darwin-powerpc
88 _EMUL_PREFER.netbsd-sparc64
= netbsd-sparc solaris-sparc64 solaris-sparc sunos-sparc
89 .if
!empty
(MACHINE_PLATFORM
:MNetBSD-1.
*-sparc
*)
90 _EMUL_PREFER.netbsd-sparc
= sunos-sparc
92 _EMUL_PREFER.netbsd-sparc
= solaris-sparc sunos-sparc
94 _EMUL_PREFER.netbsd-x86_64
= netbsd-i386 linux-x86_64 linux-i386
96 _EMUL_PREFER.dragonfly-i386
= linux-i386
98 _EMUL_PREFER.solaris-sparc64
= solaris-sparc
99 _EMUL_PREFER.solaris-x86_64
= solaris-i386
101 _EMUL_PREFER.linux-sparc64
= linux-sparc
102 _EMUL_PREFER.linux-x86_64
= linux-i386
104 # Prefer "emulating" the native operating system, then fall back to
105 # the other preferences listed above.
107 EMUL_PREFER?
= ${_EMUL_MACHINE_PLATFORM} \
108 ${_EMUL_PREFER.
${_EMUL_MACHINE_PLATFORM}}
110 .for _platform_ in
${EMUL_PREFER}
111 . if
!empty
(EMUL_PLATFORMS
:M
${_platform_})
112 EMUL_PLATFORM?
= ${_platform_}
117 .if
${EMUL_PLATFORM} == "none"
121 EMUL_ARCH?
= ${EMUL_PLATFORM
:C
/.
*-//}
122 EMUL_OPSYS?
= ${EMUL_PLATFORM
:C
/-.
*//}
125 .if
${_EMUL_OPSYS} == ${EMUL_OPSYS}
126 EMUL_IS_NATIVE
= defined