Fixup fromcvs/togit conversion
[minix-pkgsrc.git] / mk / platform / NetBSD.mk
bloba5b2ee962ebe6b4246297f6b39b31ed64e1c05cd
1 # $NetBSD: NetBSD.mk,v 1.38 2012/11/19 11:34:15 ryoon Exp $
3 # Variable definitions for the NetBSD operating system.
5 # Needed for 1.6.1 and earlier due to rpcgen bugs and paths
6 .if defined(CPP) && ${CPP} == "cpp"
7 CPP= /usr/bin/cpp
8 .endif
9 ECHO_N?= ${ECHO} -n
10 IMAKE_MAKE?= ${MAKE} # program which gets invoked by imake
11 PKGLOCALEDIR?= share
12 PS?= /bin/ps
13 SU?= /usr/bin/su
14 TYPE?= type # Shell builtin
16 .if exists(/usr/sbin/user)
17 USERADD?= /usr/sbin/useradd
18 GROUPADD?= /usr/sbin/groupadd
19 .else
20 USERADD?= ${LOCALBASE}/sbin/useradd
21 GROUPADD?= ${LOCALBASE}/sbin/groupadd
22 _USER_DEPENDS= user>=20000313:../../sysutils/user
23 .endif
25 CPP_PRECOMP_FLAGS?= # unset
26 DEF_UMASK?= 0022
27 .if ${OBJECT_FMT} == "ELF"
28 EXPORT_SYMBOLS_LDFLAGS?=-Wl,-E # add symbols to the dynamic symbol table
29 .else
30 EXPORT_SYMBOLS_LDFLAGS?=-Wl,--export-dynamic
31 .endif
32 MOTIF_TYPE_DEFAULT?= motif # default 2.0 compatible libs type
33 NOLOGIN?= /sbin/nologin
34 # This must be lazy and using :? evaluation doesn't work due to a make bugs.
35 PKG_TOOLS_BIN_cmd= if [ -x ${LOCALBASE}/sbin/pkg_info ]; then echo ${LOCALBASE}/sbin; else echo /usr/sbin; fi
36 PKG_TOOLS_BIN?= ${PKG_TOOLS_BIN_cmd:sh}
37 ROOT_CMD?= ${SU} - root -c
38 ROOT_USER?= root
39 ROOT_GROUP?= wheel
40 ULIMIT_CMD_datasize?= ulimit -d `ulimit -H -d`
41 ULIMIT_CMD_stacksize?= ulimit -s `ulimit -H -s`
42 ULIMIT_CMD_memorysize?= ulimit -m `ulimit -H -m`
44 # Native X11 is only supported on NetBSD-5 and later.
45 .if empty(MACHINE_PLATFORM:MNetBSD-[0-4].*)
46 X11_TYPE?= native
47 .endif
49 _OPSYS_EMULDIR.aout= /emul/aout
50 _OPSYS_EMULDIR.darwin= /emul/darwin
51 _OPSYS_EMULDIR.freebsd= /emul/freebsd
52 _OPSYS_EMULDIR.hpux= /emul/hpux
53 _OPSYS_EMULDIR.irix= /emul/irix
54 _OPSYS_EMULDIR.linux= /emul/linux
55 _OPSYS_EMULDIR.linux32= /emul/linux32
56 _OPSYS_EMULDIR.netbsd= # empty
57 _OPSYS_EMULDIR.netbsd32= /emul/netbsd32
58 _OPSYS_EMULDIR.osf1= /emul/osf1
59 _OPSYS_EMULDIR.solaris= /emul/svr4
60 _OPSYS_EMULDIR.solaris32= /emul/svr4_32
61 _OPSYS_EMULDIR.sunos= /emul/sunos
63 _OPSYS_SYSTEM_RPATH?= /usr/lib
64 _OPSYS_LIB_DIRS?= /usr/lib
65 _OPSYS_INCLUDE_DIRS?= /usr/include
67 .if exists(/usr/include/netinet6)
68 _OPSYS_HAS_INET6= yes # IPv6 is standard
69 .else
70 _OPSYS_HAS_INET6= no # IPv6 is not standard
71 .endif
72 _OPSYS_HAS_JAVA= no # Java is not standard
73 _OPSYS_HAS_MANZ= yes # MANZ controls gzipping of man pages
74 _OPSYS_HAS_OSSAUDIO= yes # libossaudio is available
75 _OPSYS_PERL_REQD= # no base version of perl required
76 _OPSYS_PTHREAD_AUTO= no # -lpthread needed for pthreads
77 _OPSYS_SHLIB_TYPE= ELF/a.out # shared lib type
78 _PATCH_CAN_BACKUP= yes # native patch(1) can make backups
79 _PATCH_BACKUP_ARG?= -V simple --suffix # switch to patch(1) for backup suffix
80 _USE_RPATH= yes # add rpath to LDFLAGS
82 # flags passed to the linker to extract all symbols from static archives.
83 # this is GNU ld.
84 _OPSYS_WHOLE_ARCHIVE_FLAG= -Wl,--whole-archive
85 _OPSYS_NO_WHOLE_ARCHIVE_FLAG= -Wl,--no-whole-archive
87 # for programs which use dlopen()
88 # not necessary since 1.6 (shared libs are linked against libgcc_pic)
89 .if !empty(OS_VERSION:M1.5*)
90 LINK_ALL_LIBGCC_HACK= -Wl,--whole-archive -lgcc -Wl,--no-whole-archive
91 .endif
93 _STRIPFLAG_CC?= ${_INSTALL_UNSTRIPPED:D:U-s} # cc(1) option to strip
94 _STRIPFLAG_INSTALL?= ${_INSTALL_UNSTRIPPED:D:U-s} # install(1) option to strip
96 .if (${MACHINE_ARCH} == alpha)
97 DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
98 SERIAL_DEVICES?= /dev/ttyC0 \
99 /dev/ttyC1
100 .elif (${MACHINE_ARCH} == "i386")
101 DEFAULT_SERIAL_DEVICE?= /dev/tty00
102 SERIAL_DEVICES?= /dev/tty00 \
103 /dev/tty01
104 .elif (${MACHINE_ARCH} == m68k)
105 DEFAULT_SERIAL_DEVICE?= /dev/tty00
106 SERIAL_DEVICES?= /dev/tty00 \
107 /dev/tty01
108 .elif (${MACHINE_ARCH} == mipsel)
109 DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
110 SERIAL_DEVICES?= /dev/ttyC0 \
111 /dev/ttyC1
112 .elif (${MACHINE_ARCH} == "sparc")
113 DEFAULT_SERIAL_DEVICE?= /dev/ttya
114 SERIAL_DEVICES?= /dev/ttya \
115 /dev/ttyb
116 .else
117 DEFAULT_SERIAL_DEVICE?= /dev/null
118 SERIAL_DEVICES?= /dev/null
119 .endif
121 # Add -mieee to CFLAGS and FFLAGS for NetBSD->=1.5V-alpha
122 .for __tmp__ in 1.5[V-Z] 1.5[A-Z][A-Z]* 1.[6-9]* [2-9].*
123 . if ${MACHINE_PLATFORM:MNetBSD-${__tmp__}-alpha} != ""
124 CFLAGS+= -mieee
125 FFLAGS+= -mieee
126 . endif # MACHINE_PLATFORM
127 .endfor # __tmp__
129 # check for kqueue(2) support, added in NetBSD-1.6J
130 .if exists(/usr/include/sys/event.h)
131 PKG_HAVE_KQUEUE= # defined
132 .endif
134 _OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk
136 # check for maximum command line length and set it in configure's environment,
137 # to avoid a test required by the libtool script that takes forever.
138 _OPSYS_MAX_CMDLEN_CMD= /sbin/sysctl -n kern.argmax