1 # $NetBSD: bsd.prefs.mk,v 1.16 2000/06/03 07:16:51 hubertf Exp $
3 # Make file, included to get the site preferences, if any. Should
4 # only be included by package Makefiles before any .if defined()
5 # statements or modifications to "passed" variables (CFLAGS, LDFLAGS, ...),
6 # to make sure any variables defined in /etc/mk.conf, $MAKECONF, or
7 # the system defaults (sys.mk and bsd.own.mk) are used.
9 # Do not recursively include mk.conf, redefine OPSYS, include bsd.own.mk, etc.
12 # Let mk.conf know that this is pkgsrc.
14 __PREFIX_SET__:=${PREFIX}
16 .if exists(/usr/bin/uname)
18 .elif exists(/bin/uname)
27 MAKEFLAGS+= OPSYS=${OPSYS}
29 OS_VERSION!= ${UNAME} -r
31 MAKEFLAGS+= OS_VERSION=${OS_VERSION}
33 # Preload these for architectures not in all variations of bsd.own.mk.
34 GNU_ARCH.alpha?= alpha
41 GNU_ARCH.mips?= mipsel
42 GNU_ARCH.ns32k?= ns32k
43 GNU_ARCH.sparc?= sparc
45 MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}}
47 .if ${OPSYS} == "NetBSD"
49 .elif ${OPSYS} == "SunOS"
50 . if ${MACHINE_ARCH} == "unknown"
51 . if !defined(LOWER_ARCH)
52 LOWER_ARCH!= ${UNAME} -p
53 . endif # !defined(LOWER_ARCH)
54 MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH}
58 .elif ${OPSYS} == "Linux"
60 . if ${MACHINE_ARCH} == "unknown"
61 . if !defined(LOWER_ARCH)
62 LOWER_ARCH!= ${UNAME} -m | sed -e 's/[456]86/386/'
63 . endif # !defined(LOWER_ARCH)
64 MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH}
65 . if ${LOWER_ARCH} == "i386"
68 LOWER_VENDOR?= unknown
72 .elif !defined(LOWER_OPSYS)
73 LOWER_OPSYS!= echo ${OPSYS} | tr A-Z a-z
75 MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS}
78 LOWER_ARCH?= ${MACHINE_GNU_ARCH}
80 MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
81 MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}
83 # Needed on NetBSD and SunOS (zoularis) to prevent an "install:" target
84 # from being created in bsd.own.mk.
85 NEED_OWN_INSTALL_TARGET=no
89 .if (${OPSYS} == "NetBSD") || (${OPSYS} == "SunOS") || (${OPSYS} == "Linux")
92 SHAREMODE?= ${DOCMODE}
95 .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
97 @${ECHO_MSG} "You can NOT set PREFIX manually or in mk.conf. Set LOCALBASE or X11BASE"
98 @${ECHO_MSG} "depending on your needs. See the pkg system documentation for more info."
102 # if the system is IPv6-ready NetBSD, compile with IPv6 support turned on.
103 .if (${OPSYS} == "NetBSD") && !defined(USE_SOCKS) && \
104 exists(/usr/include/netinet6)
108 # Preload all default values for CFLAGS, LDFLAGS, etc. before bsd.pkg.mk
109 # or a pkg Makefile modifies them.