2011-09-18 14:42:23 +02:00
|
|
|
# $NetBSD: NetBSD.mk,v 1.35 2011/09/18 12:42:23 abs Exp $
|
2001-06-12 14:49:55 +02:00
|
|
|
#
|
|
|
|
# Variable definitions for the NetBSD operating system.
|
|
|
|
|
2005-05-03 20:30:12 +02:00
|
|
|
# Needed for 1.6.1 and earlier due to rpcgen bugs and paths
|
|
|
|
.if defined(CPP) && ${CPP} == "cpp"
|
|
|
|
CPP= /usr/bin/cpp
|
|
|
|
.endif
|
|
|
|
ECHO_N?= ${ECHO} -n
|
2007-10-19 15:41:34 +02:00
|
|
|
IMAKE_MAKE?= ${MAKE} # program which gets invoked by imake
|
|
|
|
PKGLOCALEDIR?= share
|
2005-05-03 20:30:12 +02:00
|
|
|
PS?= /bin/ps
|
|
|
|
SU?= /usr/bin/su
|
|
|
|
TYPE?= type # Shell builtin
|
|
|
|
|
2001-11-19 17:17:51 +01:00
|
|
|
.if exists(/usr/sbin/user)
|
|
|
|
USERADD?= /usr/sbin/useradd
|
|
|
|
GROUPADD?= /usr/sbin/groupadd
|
|
|
|
.else
|
|
|
|
USERADD?= ${LOCALBASE}/sbin/useradd
|
|
|
|
GROUPADD?= ${LOCALBASE}/sbin/groupadd
|
2004-04-27 15:43:05 +02:00
|
|
|
_USER_DEPENDS= user>=20000313:../../sysutils/user
|
2001-11-20 17:53:44 +01:00
|
|
|
.endif
|
2001-11-21 13:42:23 +01:00
|
|
|
|
2007-10-19 15:41:34 +02:00
|
|
|
CPP_PRECOMP_FLAGS?= # unset
|
|
|
|
DEF_UMASK?= 0022
|
2002-09-04 16:47:32 +02:00
|
|
|
.if ${OBJECT_FMT} == "ELF"
|
|
|
|
EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
|
|
|
|
.else
|
|
|
|
EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic
|
|
|
|
.endif
|
2001-11-21 14:54:14 +01:00
|
|
|
MOTIF_TYPE_DEFAULT?= openmotif # default 2.0 compatible libs type
|
2001-11-21 15:10:06 +01:00
|
|
|
NOLOGIN?= /sbin/nologin
|
2008-04-03 16:07:51 +02:00
|
|
|
# This must be lazy and using :? evaluation doesn't work due to a make bugs.
|
|
|
|
PKG_TOOLS_BIN_cmd= if [ -x ${LOCALBASE}/sbin/pkg_info ]; then echo ${LOCALBASE}/sbin; else echo /usr/sbin; fi
|
|
|
|
PKG_TOOLS_BIN?= ${PKG_TOOLS_BIN_cmd:sh}
|
2002-07-15 18:24:01 +02:00
|
|
|
ROOT_CMD?= ${SU} - root -c
|
2001-11-21 15:10:06 +01:00
|
|
|
ROOT_USER?= root
|
2001-11-20 17:19:20 +01:00
|
|
|
ROOT_GROUP?= wheel
|
2007-10-19 15:41:34 +02:00
|
|
|
ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
|
|
|
|
ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
|
|
|
|
ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
|
2001-11-21 13:53:04 +01:00
|
|
|
|
2011-09-10 18:30:02 +02:00
|
|
|
# native is only supported on NetBSD-4 and later. Need to confirm NetBSD-4.
|
2011-09-18 14:42:23 +02:00
|
|
|
.if empty(MACHINE_PLATFORM:MNetBSD-[0-4].*)
|
2011-09-10 18:30:02 +02:00
|
|
|
X11_TYPE?= native
|
|
|
|
.endif
|
|
|
|
|
2003-02-24 20:49:47 +01:00
|
|
|
# imake installs manpages in weird places
|
|
|
|
# these values from /usr/X11R6/lib/X11/config/NetBSD.cf
|
|
|
|
IMAKE_MAN_SOURCE_PATH= man/cat
|
2004-01-31 17:52:16 +01:00
|
|
|
IMAKE_MANNEWSUFFIX= 0
|
2005-06-01 16:23:07 +02:00
|
|
|
IMAKE_MAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
|
|
|
|
IMAKE_LIBMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
|
2004-01-31 17:52:16 +01:00
|
|
|
IMAKE_KERNMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
|
2005-06-01 16:23:07 +02:00
|
|
|
IMAKE_FILEMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
|
2005-12-04 02:44:30 +01:00
|
|
|
IMAKE_GAMEMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
|
2004-01-31 17:52:16 +01:00
|
|
|
IMAKE_MISCMAN_SUFFIX= ${IMAKE_MANNEWSUFFIX}
|
2003-02-24 20:49:47 +01:00
|
|
|
IMAKE_MAN_DIR= ${IMAKE_MAN_SOURCE_PATH}1
|
|
|
|
IMAKE_LIBMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}3
|
2004-01-31 17:52:16 +01:00
|
|
|
IMAKE_KERNMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}4
|
2003-02-24 20:49:47 +01:00
|
|
|
IMAKE_FILEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}5
|
2005-12-04 02:44:30 +01:00
|
|
|
IMAKE_GAMEMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}6
|
2004-01-31 17:52:16 +01:00
|
|
|
IMAKE_MISCMAN_DIR= ${IMAKE_MAN_SOURCE_PATH}7
|
2006-01-13 00:43:56 +01:00
|
|
|
IMAKE_MANINSTALL?= maninstall catinstall
|
2003-02-24 20:49:47 +01:00
|
|
|
|
* Support netbsd-* as a valid platform in EMUL_PLATFORMS. Use the
pkgsrc/emulator/compat* and pkgsrc/emulator/netbsd32_compat* packages
to provide the necessary shared libraries to run dynamically linked
NetBSD binaries from the days of yore.
* Add some additional compat* packages for completeness:
compat15, compat20, compat30
* Modify the compat* packages so that "compatNM" only provides files
that aren't in "NetBSD-N.(M+1)". For example, compat12 only provides
files that don't exist in NetBSD-1.3.x, compat13 only provides files
that don't exist in NetBSD-1.4.x, etc.
As a result, if you are running NetBSD-3.0/alpha and want to run a
1.3 dynamically linked binary, there is an automatic dependency
chain that causes the following packages to be installed:
compat13, compat14, compat15, compat16, compat20
There are some deviations from this dependency chain on platforms
that have changed executable formats, e.g. i386, m68, sparc, etc.
However, in general pkgsrc will require that you have the necessary
COMPAT_* options in your kernel to match the installed compat*
packages. This restriction is an artificial one imposed by pkgsrc,
but allows for a single set of distfiles to be used on all versions
of NetBSD.
* Provide compat* package support for every supported architecture
of NetBSD. Verily, it is now possible to run 1.2 binaries on
NetBSD-1.5.3/pc532 by installing the compat12 package from pkgsrc.
Rejoice, one and all!
* The netbsd32_compat* packages mirror the corresponding compat*
packages for use by sparc64 and x86_64 to allow running 32-bit
binaries with COMPAT_NETBSD32 kernel support. The "extras" packages
supply the additional shared libraries from the corresponding release
of NetBSD so that the set of files in /emul/netbsd32 will be complete.
* pkgsrc/emulators/compat_netbsd contains infrastructure files shared
by all of the compat* packages.
2007-08-22 00:49:02 +02:00
|
|
|
_OPSYS_EMULDIR.aout= /emul/aout
|
2007-08-01 17:17:56 +02:00
|
|
|
_OPSYS_EMULDIR.darwin= /emul/darwin
|
2007-07-29 07:18:36 +02:00
|
|
|
_OPSYS_EMULDIR.freebsd= /emul/freebsd
|
|
|
|
_OPSYS_EMULDIR.hpux= /emul/hpux
|
|
|
|
_OPSYS_EMULDIR.irix= /emul/irix
|
|
|
|
_OPSYS_EMULDIR.linux= /emul/linux
|
|
|
|
_OPSYS_EMULDIR.linux32= /emul/linux32
|
* Support netbsd-* as a valid platform in EMUL_PLATFORMS. Use the
pkgsrc/emulator/compat* and pkgsrc/emulator/netbsd32_compat* packages
to provide the necessary shared libraries to run dynamically linked
NetBSD binaries from the days of yore.
* Add some additional compat* packages for completeness:
compat15, compat20, compat30
* Modify the compat* packages so that "compatNM" only provides files
that aren't in "NetBSD-N.(M+1)". For example, compat12 only provides
files that don't exist in NetBSD-1.3.x, compat13 only provides files
that don't exist in NetBSD-1.4.x, etc.
As a result, if you are running NetBSD-3.0/alpha and want to run a
1.3 dynamically linked binary, there is an automatic dependency
chain that causes the following packages to be installed:
compat13, compat14, compat15, compat16, compat20
There are some deviations from this dependency chain on platforms
that have changed executable formats, e.g. i386, m68, sparc, etc.
However, in general pkgsrc will require that you have the necessary
COMPAT_* options in your kernel to match the installed compat*
packages. This restriction is an artificial one imposed by pkgsrc,
but allows for a single set of distfiles to be used on all versions
of NetBSD.
* Provide compat* package support for every supported architecture
of NetBSD. Verily, it is now possible to run 1.2 binaries on
NetBSD-1.5.3/pc532 by installing the compat12 package from pkgsrc.
Rejoice, one and all!
* The netbsd32_compat* packages mirror the corresponding compat*
packages for use by sparc64 and x86_64 to allow running 32-bit
binaries with COMPAT_NETBSD32 kernel support. The "extras" packages
supply the additional shared libraries from the corresponding release
of NetBSD so that the set of files in /emul/netbsd32 will be complete.
* pkgsrc/emulators/compat_netbsd contains infrastructure files shared
by all of the compat* packages.
2007-08-22 00:49:02 +02:00
|
|
|
_OPSYS_EMULDIR.netbsd= # empty
|
|
|
|
_OPSYS_EMULDIR.netbsd32= /emul/netbsd32
|
2007-07-29 07:18:36 +02:00
|
|
|
_OPSYS_EMULDIR.osf1= /emul/osf1
|
|
|
|
_OPSYS_EMULDIR.solaris= /emul/svr4
|
|
|
|
_OPSYS_EMULDIR.solaris32= /emul/svr4_32
|
|
|
|
_OPSYS_EMULDIR.sunos= /emul/sunos
|
|
|
|
|
2008-01-16 15:03:31 +01:00
|
|
|
_OPSYS_SYSTEM_RPATH?= /usr/lib
|
|
|
|
|
2002-12-18 07:18:14 +01:00
|
|
|
.if exists(/usr/include/netinet6)
|
|
|
|
_OPSYS_HAS_INET6= yes # IPv6 is standard
|
|
|
|
.else
|
|
|
|
_OPSYS_HAS_INET6= no # IPv6 is not standard
|
|
|
|
.endif
|
2002-12-03 21:53:39 +01:00
|
|
|
_OPSYS_HAS_JAVA= no # Java is not standard
|
2001-11-21 14:44:44 +01:00
|
|
|
_OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
|
2001-11-21 14:57:31 +01:00
|
|
|
_OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
|
2002-12-03 22:13:37 +01:00
|
|
|
_OPSYS_PERL_REQD= # no base version of perl required
|
2003-09-14 18:30:34 +02:00
|
|
|
_OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
|
2004-03-11 23:57:22 +01:00
|
|
|
_OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
|
2002-12-03 20:24:26 +01:00
|
|
|
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
|
2008-08-10 19:40:00 +02:00
|
|
|
_PATCH_BACKUP_ARG?= -V simple --suffix # switch to patch(1) for backup suffix
|
2001-11-21 14:44:44 +01:00
|
|
|
_USE_RPATH= yes # add rpath to LDFLAGS
|
2001-11-21 15:10:06 +01:00
|
|
|
|
2003-04-15 07:29:45 +02:00
|
|
|
# flags passed to the linker to extract all symbols from static archives.
|
|
|
|
# this is GNU ld.
|
|
|
|
_OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
|
|
|
|
_OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
|
|
|
|
|
2003-06-06 19:13:31 +02:00
|
|
|
# for programs which use dlopen()
|
|
|
|
# not necessary since 1.6 (shared libs are linked against libgcc_pic)
|
|
|
|
.if !empty(OS_VERSION:M1.5*)
|
|
|
|
LINK_ALL_LIBGCC_HACK= -Wl,--whole-archive -lgcc -Wl,--no-whole-archive
|
|
|
|
.endif
|
|
|
|
|
2007-10-19 15:41:34 +02:00
|
|
|
_STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-s} # cc(1) option to strip
|
|
|
|
_STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip
|
|
|
|
|
2001-11-21 15:10:06 +01:00
|
|
|
.if (${MACHINE_ARCH} == alpha)
|
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
|
|
|
|
SERIAL_DEVICES?= /dev/ttyC0 \
|
|
|
|
/dev/ttyC1
|
|
|
|
.elif (${MACHINE_ARCH} == "i386")
|
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/tty00
|
|
|
|
SERIAL_DEVICES?= /dev/tty00 \
|
|
|
|
/dev/tty01
|
|
|
|
.elif (${MACHINE_ARCH} == m68k)
|
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/tty00
|
|
|
|
SERIAL_DEVICES?= /dev/tty00 \
|
|
|
|
/dev/tty01
|
|
|
|
.elif (${MACHINE_ARCH} == mipsel)
|
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
|
|
|
|
SERIAL_DEVICES?= /dev/ttyC0 \
|
|
|
|
/dev/ttyC1
|
|
|
|
.elif (${MACHINE_ARCH} == "sparc")
|
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/ttya
|
|
|
|
SERIAL_DEVICES?= /dev/ttya \
|
|
|
|
/dev/ttyb
|
|
|
|
.else
|
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/null
|
|
|
|
SERIAL_DEVICES?= /dev/null
|
|
|
|
.endif
|
For NetBSD/alpha versions >= 1.5V add -mieee to both CFLAGS and FFLAGS.
This will pass -mieee to those package which obey CFLAGS and FFLAGS.
paraphrasing an email from Ross:
The executive summary is: if i386 uses it (and
it does) then alpha should also, or some programs will SIGFPE out
on alpha when they don't on i386.
If anyone asks, the details are as follows:
The actual effect of -mieee is to put a software completion code
bit into every floating point instruction, and to put trap barrier
instructions in the code as necessary to ensure that traps are
delivered before branches or other instructions make it impossible
to trace backwards to the trapping op.
The code bits have little effect on the hardware, mainly what
happens is that when the hardware and palcode deliver a trap, they
tell the trap handler whether the faulting op had a completion
code. If it did, the kernel is suppose to trace backwards, find
the op, and interpret it in SW, doing all the wacky ieee stuff that
most chips don't do, stuff like denormal arithmetic and the generation
of magic values (infinity, NaN) and the sticky flags. We do all
that now except for a couple of truly obscure things that SoftFloat
didn't support and which I haven't yet added. (And these are things
that happen ONLY when you are taking overflow and underflow traps,
which no one has every really done AFAICT. If you have the default
behavior of gradual underflow and nontrapping infinity generation,
we do everything.)
This brings up the question of -mieee libraries, but that's not a
pkgsrc problem. (Except to the extent that I recommend that libraries
from pkgsrc, like everything else, also be compiled with -mieee.
And in the case of libraries, it might be worth individually
modifying the Makefile for the "not easy" case.)
2002-01-24 15:58:07 +01:00
|
|
|
|
|
|
|
# Add -mieee to CFLAGS and FFLAGS for NetBSD->=1.5V-alpha
|
|
|
|
.for __tmp__ in 1.5[V-Z] 1.5[A-Z][A-Z]* 1.[6-9]* [2-9].*
|
|
|
|
. if ${MACHINE_PLATFORM:MNetBSD-${__tmp__}-alpha} != ""
|
|
|
|
CFLAGS+= -mieee
|
|
|
|
FFLAGS+= -mieee
|
2003-10-19 09:38:31 +02:00
|
|
|
. endif # MACHINE_PLATFORM
|
|
|
|
.endfor # __tmp__
|
2002-11-24 10:17:44 +01:00
|
|
|
|
|
|
|
# check for kqueue(2) support, added in NetBSD-1.6J
|
|
|
|
.if exists(/usr/include/sys/event.h)
|
|
|
|
PKG_HAVE_KQUEUE= # defined
|
|
|
|
.endif
|
2004-04-10 00:43:31 +02:00
|
|
|
|
2009-07-26 07:32:43 +02:00
|
|
|
_OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk
|
|
|
|
|
2004-04-10 00:43:31 +02:00
|
|
|
# check for maximum command line length and set it in configure's environment,
|
|
|
|
# to avoid a test required by the libtool script that takes forever.
|
2005-01-25 19:15:58 +01:00
|
|
|
_OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax
|