2014-03-07 16:03:15 +01:00
|
|
|
# $NetBSD: Linux.mk,v 1.60 2014/03/07 15:03:15 jperkin Exp $
|
2001-06-12 14:49:55 +02:00
|
|
|
#
|
|
|
|
# Variable definitions for the Linux operating system.
|
|
|
|
|
2005-05-03 20:30:12 +02:00
|
|
|
ECHO_N?= ${ECHO} -n
|
2011-10-15 05:15:37 +02:00
|
|
|
.if defined(X11_TYPE) && ${X11_TYPE} == "native"
|
2007-10-19 15:41:34 +02:00
|
|
|
IMAKE_MAKE?= ${GMAKE} # program which gets invoked by imake
|
2010-03-18 23:46:01 +01:00
|
|
|
IMAKE_TOOLS= gmake # extra tools required when we use imake
|
2008-01-12 23:44:10 +01:00
|
|
|
.endif
|
2005-05-03 20:30:12 +02:00
|
|
|
IMAKEOPTS+= -DBuildHtmlManPages=NO
|
2007-10-19 15:41:34 +02:00
|
|
|
PKGLOCALEDIR?= share
|
2005-05-03 20:30:12 +02:00
|
|
|
PS?= /bin/ps
|
2005-08-02 05:38:09 +02:00
|
|
|
# XXX: default from defaults/mk.conf. Verify/correct for this platform
|
2005-05-03 20:30:12 +02:00
|
|
|
# and remove this comment.
|
2011-03-20 10:00:08 +01:00
|
|
|
.if exists(/usr/bin/su)
|
|
|
|
SU?= /usr/bin/su
|
|
|
|
.else
|
2005-05-03 20:30:12 +02:00
|
|
|
SU?= /bin/su
|
2011-03-20 10:00:08 +01:00
|
|
|
.endif
|
2005-05-03 20:30:12 +02:00
|
|
|
TYPE?= type # Shell builtin
|
|
|
|
|
2007-10-19 15:41:34 +02:00
|
|
|
CPP_PRECOMP_FLAGS?= # unset
|
|
|
|
DEF_UMASK?= 022
|
2001-11-21 15:10:06 +01:00
|
|
|
DEFAULT_SERIAL_DEVICE?= /dev/null
|
2002-09-04 16:47:32 +02:00
|
|
|
EXPORT_SYMBOLS_LDFLAGS?= # Don't add symbols to the dynamic symbol table
|
2001-11-21 15:10:06 +01:00
|
|
|
GROUPADD?= /usr/sbin/groupadd
|
2012-11-19 12:34:15 +01:00
|
|
|
MOTIF_TYPE_DEFAULT?= motif # default 2.0 compatible libs type
|
2011-05-11 14:46:20 +02:00
|
|
|
.if exists(/etc/ssdlinux_version)
|
|
|
|
NOLOGIN?= /sbin/nologin
|
2010-02-13 09:29:12 +01:00
|
|
|
.else
|
2004-09-13 14:09:22 +02:00
|
|
|
NOLOGIN?= /bin/false
|
2010-02-13 09:29:12 +01:00
|
|
|
.endif
|
2007-10-19 15:41:34 +02:00
|
|
|
PKG_TOOLS_BIN?= ${LOCALBASE}/sbin
|
2002-07-15 18:24:01 +02:00
|
|
|
ROOT_CMD?= ${SU} - root -c
|
2010-01-16 03:16:35 +01:00
|
|
|
.if exists(/etc/ssdlinux_version)
|
|
|
|
ROOT_GROUP?= wheel
|
|
|
|
.else
|
2003-08-25 17:47:15 +02:00
|
|
|
ROOT_GROUP?= root
|
2010-01-16 03:16:35 +01:00
|
|
|
.endif
|
2001-11-21 15:10:06 +01:00
|
|
|
ROOT_USER?= root
|
|
|
|
SERIAL_DEVICES?= /dev/null
|
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 15:10:06 +01:00
|
|
|
USERADD?= /usr/sbin/useradd
|
2001-11-21 13:53:04 +01:00
|
|
|
|
2007-07-29 07:18:36 +02:00
|
|
|
_OPSYS_EMULDIR.linux= # empty
|
|
|
|
_OPSYS_EMULDIR.linux32= # empty
|
|
|
|
|
2013-05-12 01:56:24 +02:00
|
|
|
# Support Debian/Ubuntu's multiarch hierarchy.
|
|
|
|
.if exists(/etc/debian_version)
|
|
|
|
.if !empty(MACHINE_ARCH:Mx86_64)
|
|
|
|
_OPSYS_SYSTEM_RPATH= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}:/lib/x86_64-linux-gnu:/usr/lib/x86_64-linux-gnu
|
|
|
|
_OPSYS_LIB_DIRS?= /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX} /lib/x86_64-linux-gnu /usr/lib/x86_64-linux-gnu
|
|
|
|
.endif
|
|
|
|
.if !empty(MACHINE_ARCH:Mi386)
|
|
|
|
_OPSYS_SYSTEM_RPATH= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}:/lib/i386-linux-gnu:/usr/lib/i386-linux-gnu
|
2013-05-17 05:40:02 +02:00
|
|
|
_OPSYS_LIB_DIRS?= /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX} /lib/i386-linux-gnu /usr/lib/i386-linux-gnu
|
2013-05-12 01:56:24 +02:00
|
|
|
.endif
|
|
|
|
.if !empty(MACHINE_ARCH:Marm*)
|
|
|
|
_OPSYS_SYSTEM_RPATH= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}:/lib/arm-linux-gnueabi:/usr/lib/arm-linux-gnueabi
|
|
|
|
_OPSYS_LIB_DIRS?= /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX} /lib/arm-linux-gnueabi /usr/lib/arm-linux-gnueabi
|
|
|
|
.endif
|
|
|
|
.else
|
2010-05-16 08:59:26 +02:00
|
|
|
_OPSYS_SYSTEM_RPATH= /lib${LIBABISUFFIX}:/usr/lib${LIBABISUFFIX}
|
2013-04-28 14:53:56 +02:00
|
|
|
_OPSYS_LIB_DIRS?= /lib${LIBABISUFFIX} /usr/lib${LIBABISUFFIX}
|
2013-05-12 01:56:24 +02:00
|
|
|
.endif
|
2013-04-28 14:53:56 +02:00
|
|
|
_OPSYS_INCLUDE_DIRS?= /usr/include
|
2010-05-16 08:59:26 +02:00
|
|
|
|
2014-02-19 18:20:23 +01:00
|
|
|
# These are libc builtins
|
|
|
|
_OPSYS_PREFER.getopt?= native
|
|
|
|
_OPSYS_PREFER.gettext?= native
|
|
|
|
_OPSYS_PREFER.iconv?= native
|
2014-02-20 12:03:09 +01:00
|
|
|
_OPSYS_PREFER.libexecinfo?= native
|
2014-02-20 11:52:33 +01:00
|
|
|
_OPSYS_PREFER.libinotify?= native
|
2014-02-19 18:20:23 +01:00
|
|
|
_OPSYS_PREFER.sysexits?= native
|
|
|
|
|
2003-03-20 01:34:17 +01:00
|
|
|
.if exists(/usr/include/netinet6) || exists(/usr/include/linux/in6.h)
|
2002-12-18 07:18:14 +01:00
|
|
|
_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= no # no MANZ for gzipping of man pages
|
2013-07-23 15:01:05 +02:00
|
|
|
_OPSYS_HAS_OSSAUDIO= no # libossaudio is unavailable
|
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-11-15 15:48:18 +01:00
|
|
|
_OPSYS_SHLIB_TYPE= ELF # shared lib type
|
2002-12-03 20:24:26 +01:00
|
|
|
_PATCH_CAN_BACKUP= yes # native patch(1) can make backups
|
2003-12-16 23:54:13 +01:00
|
|
|
_PATCH_BACKUP_ARG?= -b -V simple -z # switch to patch(1) for backup suffix
|
2001-11-21 14:44:44 +01:00
|
|
|
_USE_RPATH= yes # add rpath to LDFLAGS
|
2002-02-27 05:41:22 +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
|
|
|
|
|
2005-03-18 19:16:34 +01: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
|
2003-09-05 15:54:13 +02:00
|
|
|
|
2010-05-16 08:59:26 +02:00
|
|
|
_OPSYS_CAN_CHECK_SHLIBS= yes # use readelf in check/bsd.check-vars.mk
|
2009-07-26 07:32:43 +02:00
|
|
|
|
2004-04-19 22:19:46 +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.
|
2011-08-22 17:17:53 +02:00
|
|
|
.if exists(/usr/bin/getconf)
|
|
|
|
_OPSYS_MAX_CMDLEN_CMD?= /usr/bin/getconf ARG_MAX
|
|
|
|
.endif
|
2004-05-12 16:10:18 +02:00
|
|
|
|
2014-02-20 12:03:09 +01:00
|
|
|
.if ${MACHINE_ARCH} == "x86_64"
|
|
|
|
ABI?= 64
|
|
|
|
LIBABISUFFIX?= 64
|
2006-01-06 23:47:24 +01:00
|
|
|
.endif
|
2010-05-20 09:57:22 +02:00
|
|
|
|
2014-03-07 16:03:15 +01:00
|
|
|
# When building 32-bit packages on x86_64 GNU ld isn't smart enough to
|
|
|
|
# figure out the target architecture based on the objects so we need to
|
|
|
|
# explicitly set it.
|
|
|
|
.if ${NATIVE_MACHINE_ARCH} == "x86_64" && ${MACHINE_ARCH} == "i386"
|
|
|
|
_WRAP_EXTRA_ARGS.LD+= -m elf_i386
|
|
|
|
.endif
|
|
|
|
|
2010-05-20 09:57:22 +02:00
|
|
|
## Use _CMD so the command only gets run when needed!
|
2012-04-23 10:14:36 +02:00
|
|
|
.if exists(/lib${LIBABISUFFIX}/libc.so.6)
|
|
|
|
_GLIBC_VERSION_CMD= /lib${LIBABISUFFIX}/libc.so.6 --version | \
|
2010-05-20 09:57:22 +02:00
|
|
|
sed -ne's/^GNU C.*version \(.*\),.*$$/\1/p'
|
|
|
|
GLIBC_VERSION= ${_GLIBC_VERSION_CMD:sh}
|
|
|
|
.endif
|
2012-03-05 08:53:42 +01:00
|
|
|
|
|
|
|
# If this is defined pass it to the make process.
|
2012-04-09 06:19:24 +02:00
|
|
|
.if defined(NOGCCERROR)
|
2012-03-05 08:53:42 +01:00
|
|
|
MAKE_ENV+= NOGCCERROR=true
|
|
|
|
.endif
|