2020-03-22 22:17:30 +01:00
|
|
|
# $NetBSD: NetBSD.mk,v 1.60 2020/03/22 21:17:30 joerg 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
|
|
|
|
|
2020-03-12 18:01:39 +01:00
|
|
|
# pax-as-tar, found on <=8, and optionally later, fails on many archives.
|
|
|
|
EXTRACT_USING?= bsdtar
|
|
|
|
|
2001-11-19 17:17:51 +01:00
|
|
|
USERADD?= /usr/sbin/useradd
|
|
|
|
GROUPADD?= /usr/sbin/groupadd
|
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
|
2012-11-19 12:34:15 +01:00
|
|
|
MOTIF_TYPE_DEFAULT?= motif # 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
|
2020-03-22 22:17:30 +01:00
|
|
|
ULIMIT_CMD_virtualsize?= ulimit -v `ulimit -H -v`
|
|
|
|
ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
|
|
|
|
ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
|
|
|
|
ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
|
|
|
|
ULIMIT_CMD_cputime?= ulimit -t `ulimit -H -t`
|
2001-11-21 13:53:04 +01:00
|
|
|
|
2012-02-28 20:35:58 +01:00
|
|
|
# Native X11 is only supported on NetBSD-5 and later.
|
Default to X11_TYPE=modular on netbsd-5.
Base xsrc on netbsd-5 has not really worked with pkgsrc for a while,
because various programs need newer versions of various X pieces. The
2014Q2 official bulk builds are missing about 1500 packages as a
result of this. Therefore, switch to modular on netbsd-5 (as netbsd-4
has been for a very long time), which should result in more useful
binary packages for netbsd-5 for 2014Q3.
(There is a notion of updating netbsd-5 base xsrc to more modern xorg.
If that happens, and there's a 5.x formal release, and builds show
that pkgsrc with native succeeds on it, this can perhaps be flipped
back. Odds are that's not going to happen, and it's overwhelmingly
unlikely to happen soon.)
Anyone who prefers to stay with native can set X11_TYPE=native in
mk.conf.
Note that this is about pkgsrc and specifically the default
dependencies for pkgsrc programs that use X11, so the native servers
are unaffected and can be run from /usr/X11R7, the same as they are
now, without any changes being necessary. (This message is in fact
being typed on a system with a native server, native xterm and modular
libs for pkgsrc.)
Discussed on tech-pkg, tech-x11 multiple times over the last 6 months
or so, and specifically encouraged by wiz@.
2014-09-02 18:13:27 +02:00
|
|
|
# On NetBSD-5, native X11 has enough issues that we default
|
|
|
|
# to modular.
|
|
|
|
.if empty(MACHINE_PLATFORM:MNetBSD-[0-5].*)
|
2011-09-10 18:30:02 +02:00
|
|
|
X11_TYPE?= native
|
|
|
|
.endif
|
|
|
|
|
* 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
|
2013-04-28 14:53:56 +02:00
|
|
|
_OPSYS_LIB_DIRS?= /usr/lib
|
|
|
|
_OPSYS_INCLUDE_DIRS?= /usr/include
|
2008-01-16 15:03:31 +01:00
|
|
|
|
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
|
2017-06-01 00:55:01 +02:00
|
|
|
_OPSYS_SHLIB_TYPE= ${_OPSYS_SHLIB_TYPE_cmd:sh} # shared library type
|
|
|
|
_OPSYS_SHLIB_TYPE_cmd= \
|
|
|
|
output=`/usr/bin/file /sbin/sysctl`; \
|
|
|
|
case $$output in \
|
|
|
|
*ELF*dynamically*) echo ELF ;; \
|
|
|
|
*shared*library*) echo a.out ;; \
|
|
|
|
*dynamically*) echo a.out ;; \
|
|
|
|
*) echo ELF ;; \
|
|
|
|
esac
|
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
|
|
|
|
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
|
|
|
|
2017-07-24 10:19:08 +02:00
|
|
|
.if (${MACHINE_ARCH} == alpha)
|
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
|
|
|
CFLAGS+= -mieee
|
|
|
|
FFLAGS+= -mieee
|
2017-07-24 10:19:08 +02:00
|
|
|
.endif
|
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
|
|
|
|
2016-03-12 00:54:08 +01:00
|
|
|
# Register support for FORTIFY (with GCC)
|
2017-08-08 01:44:53 +02:00
|
|
|
.if !empty(OS_VERSION:M[2-6].*)
|
|
|
|
# Disable on older versions, see:
|
|
|
|
# http://mail-index.netbsd.org/pkgsrc-users/2017/08/07/msg025435.html
|
|
|
|
.else
|
2016-03-12 00:03:31 +01:00
|
|
|
_OPSYS_SUPPORTS_FORTIFY=yes
|
2017-08-08 01:44:53 +02:00
|
|
|
.endif
|
2016-03-12 00:03:31 +01:00
|
|
|
|
|
|
|
# Register support for PIE on supported architectures (with GCC)
|
|
|
|
.if (${MACHINE_ARCH} == "i386") || \
|
|
|
|
(${MACHINE_ARCH} == "x86_64")
|
|
|
|
_OPSYS_SUPPORTS_MKPIE= yes
|
2015-08-10 23:44:34 +02:00
|
|
|
.endif
|
|
|
|
|
2019-01-09 14:19:03 +01:00
|
|
|
# Register support for RELRO on supported architectures
|
2016-03-12 00:03:31 +01:00
|
|
|
.if (${MACHINE_ARCH} == "i386") || \
|
|
|
|
(${MACHINE_ARCH} == "x86_64")
|
|
|
|
_OPSYS_SUPPORTS_RELRO= yes
|
|
|
|
.endif
|
|
|
|
|
2017-11-12 14:34:14 +01:00
|
|
|
# Register support for REPRO (with GCC)
|
|
|
|
_OPSYS_SUPPORTS_MKREPRO= yes
|
|
|
|
|
2016-03-12 00:03:31 +01:00
|
|
|
# Register support for SSP on most architectures (with GCC)
|
|
|
|
.if (${MACHINE_ARCH} != "alpha") && \
|
|
|
|
(${MACHINE_ARCH} != "hppa") && \
|
|
|
|
(${MACHINE_ARCH} != "ia64") && \
|
|
|
|
(${MACHINE_ARCH} != "mips")
|
|
|
|
_OPSYS_SUPPORTS_SSP= yes
|
2015-07-27 00:13:17 +02:00
|
|
|
.endif
|
|
|
|
|
2017-07-09 16:30:07 +02:00
|
|
|
# Register support for stack check on supported architectures (with GCC)
|
|
|
|
.if (${MACHINE_ARCH} == "i386") || \
|
|
|
|
(${MACHINE_ARCH} == "x86_64")
|
|
|
|
_OPSYS_SUPPORTS_STACK_CHECK= yes
|
|
|
|
.endif
|
|
|
|
|
2016-10-27 14:29:17 +02:00
|
|
|
_OPSYS_SUPPORTS_CWRAPPERS= yes
|
|
|
|
|
2017-07-04 20:29:24 +02:00
|
|
|
# use readelf in check/bsd.check-vars.mk
|
|
|
|
_OPSYS_CAN_CHECK_RELRO= yes
|
|
|
|
_OPSYS_CAN_CHECK_SHLIBS= yes
|
2017-10-03 15:18:00 +02:00
|
|
|
_OPSYS_CAN_CHECK_SSP= no # only supports libssp at this time
|
2009-07-26 07:32:43 +02:00
|
|
|
|
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
|