Annotation of pkgsrc/mk/bsd.prefs.mk, Revision 1.24
1.24 ! tron 1: # $NetBSD: bsd.prefs.mk,v 1.23 2001/03/06 16:00:16 wiz Exp $
1.1 agc 2: #
3: # Make file, included to get the site preferences, if any. Should
4: # only be included by package Makefiles before any .if defined()
1.7 tv 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.
1.4 hubertf 8:
1.5 tv 9: # Do not recursively include mk.conf, redefine OPSYS, include bsd.own.mk, etc.
10: .ifndef BSD_PKG_MK
11:
1.7 tv 12: # Let mk.conf know that this is pkgsrc.
1.4 hubertf 13: BSD_PKG_MK=1
1.7 tv 14: __PREFIX_SET__:=${PREFIX}
1.1 agc 15:
1.9 christos 16: .if exists(/usr/bin/uname)
17: UNAME=/usr/bin/uname
18: .elif exists(/bin/uname)
19: UNAME=/bin/uname
20: .else
21: UNAME=echo Unknown
22: .endif
23:
1.7 tv 24: .ifndef OPSYS
1.9 christos 25: OPSYS!= ${UNAME} -s
1.17 mycroft 26: .endif
1.16 hubertf 27: MAKEFLAGS+= OPSYS=${OPSYS}
1.7 tv 28: .ifndef OS_VERSION
1.9 christos 29: OS_VERSION!= ${UNAME} -r
1.17 mycroft 30: .endif
1.16 hubertf 31: MAKEFLAGS+= OS_VERSION=${OS_VERSION}
1.1 agc 32:
1.7 tv 33: # Preload these for architectures not in all variations of bsd.own.mk.
34: GNU_ARCH.alpha?= alpha
35: GNU_ARCH.arm32?= arm
36: GNU_ARCH.i386?= i386
1.12 christos 37: GNU_ARCH.i486?= i386
38: GNU_ARCH.i586?= i386
39: GNU_ARCH.i686?= i386
1.7 tv 40: GNU_ARCH.m68k?= m68k
41: GNU_ARCH.mips?= mipsel
42: GNU_ARCH.ns32k?= ns32k
43: GNU_ARCH.sparc?= sparc
44: GNU_ARCH.vax?= vax
45: MACHINE_GNU_ARCH?= ${GNU_ARCH.${MACHINE_ARCH}}
1.3 tv 46:
1.10 agc 47: .if ${OPSYS} == "NetBSD"
48: LOWER_OPSYS?= netbsd
49: .elif ${OPSYS} == "SunOS"
1.16 hubertf 50: . if ${MACHINE_ARCH} == "unknown"
51: . if !defined(LOWER_ARCH)
1.13 kim 52: LOWER_ARCH!= ${UNAME} -p
1.17 mycroft 53: . endif # !defined(LOWER_ARCH)
1.16 hubertf 54: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH}
55: . endif
1.7 tv 56: LOWER_VENDOR?= sun
1.11 agc 57: LOWER_OPSYS?= solaris
1.10 agc 58: .elif ${OPSYS} == "Linux"
59: LOWER_OPSYS?= linux
1.16 hubertf 60: . if ${MACHINE_ARCH} == "unknown"
61: . if !defined(LOWER_ARCH)
1.13 kim 62: LOWER_ARCH!= ${UNAME} -m | sed -e 's/[456]86/386/'
1.17 mycroft 63: . endif # !defined(LOWER_ARCH)
1.16 hubertf 64: MAKEFLAGS+= LOWER_ARCH=${LOWER_ARCH}
65: . if ${LOWER_ARCH} == "i386"
1.12 christos 66: LOWER_VENDOR?= pc
1.16 hubertf 67: . else
1.12 christos 68: LOWER_VENDOR?= unknown
1.16 hubertf 69: . endif
70: . endif
1.12 christos 71:
1.10 agc 72: .elif !defined(LOWER_OPSYS)
1.7 tv 73: LOWER_OPSYS!= echo ${OPSYS} | tr A-Z a-z
1.17 mycroft 74: .endif
1.16 hubertf 75: MAKEFLAGS+= LOWER_OPSYS=${LOWER_OPSYS}
1.7 tv 76:
77: LOWER_VENDOR?=
78: LOWER_ARCH?= ${MACHINE_GNU_ARCH}
79:
80: MACHINE_PLATFORM?= ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
1.8 tv 81: MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}
1.7 tv 82:
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
86:
1.5 tv 87: .include <bsd.own.mk>
1.7 tv 88:
1.9 christos 89: .if (${OPSYS} == "NetBSD") || (${OPSYS} == "SunOS") || (${OPSYS} == "Linux")
1.7 tv 90: SHAREOWN?= ${DOCOWN}
91: SHAREGRP?= ${DOCGRP}
92: SHAREMODE?= ${DOCMODE}
1.1 agc 93: .endif
94:
1.3 tv 95: .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
1.2 tv 96: .BEGIN:
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."
99: @${FALSE}
1.14 itojun 100: .endif
101:
102: # if the system is IPv6-ready NetBSD, compile with IPv6 support turned on.
1.15 tron 103: .if (${OPSYS} == "NetBSD") && !defined(USE_SOCKS) && \
104: exists(/usr/include/netinet6)
1.14 itojun 105: USE_INET6?= YES
1.21 wiz 106: .else
107: USE_INET6?= NO
1.5 tv 108: .endif
1.6 tv 109:
1.7 tv 110: # Preload all default values for CFLAGS, LDFLAGS, etc. before bsd.pkg.mk
111: # or a pkg Makefile modifies them.
1.6 tv 112: .include <sys.mk>
1.5 tv 113:
1.18 rh 114: # Check if we got Mesa distributed with XFree86 4.x or if we need to
115: # depend on the Mesa package.
116: .if (defined(CHECK_MESA) || defined(USE_MESA))
117: X11BASE?= /usr/X11R6
118: .if exists(${X11BASE}/include/GL/glx.h)
119: __BUILTIN_MESA!= egrep -c BuildGLXLibrary ${X11BASE}/lib/X11/config/X11.tmpl || true
120: .else
121: __BUILTIN_MESA= 0
122: .endif
123: .if ${__BUILTIN_MESA} == "0"
124: HAVE_BUILTIN_MESA= NO
125: .else
126: HAVE_BUILTIN_MESA= YES
1.2 tv 127: .endif
1.18 rh 128: .undef __BUILTIN_MESA
129: .endif # CHECK_MESA
1.19 wiz 130:
131: .if defined(USE_CURSES) && !defined(NEED_NCURSES)
132: NEED_NCURSES= NO
133: .if ${OPSYS} == "NetBSD"
134: _INCOMPAT_CURSES= 0.* 1.[0123]* 1.4.* 1.4[A-X]
135: .for PATTERN in ${_INCOMPAT_CURSES}
136: .if ${OS_VERSION:M${PATTERN}} != ""
137: NEED_NCURSES= YES
138: .endif
139: .endfor
140: .endif
1.20 hubertf 141: # we can NOT pass the NEED_NCURSES flag down as every required package
142: # will start to require ncurses, which is not true (and raises some
143: # recursive dependency problems!)
1.19 wiz 144: .endif # USE_CURSES
1.22 agc 145:
146: ##### Some overrides of defaults below on a per-OS basis.
147: .if (${OPSYS} == "NetBSD")
148: LOCALBASE?= ${DESTDIR}/usr/pkg
1.23 wiz 149: PKG_TOOLS_BIN?= /usr/sbin
1.22 agc 150: .elif (${OPSYS} == "SunOS")
151: X11BASE?= ${DESTDIR}/usr/openwin
1.23 wiz 152: PKG_TOOLS_BIN?= ${LOCALBASE}/bsd/bin
1.24 ! tron 153: .elif (${OPSYS} == "Linux")
1.23 wiz 154: PKG_TOOLS_BIN?= ${LOCALBASE}/bsd/bin
1.22 agc 155: .endif
156:
157: LOCALBASE?= ${DESTDIR}/usr/local
158: X11BASE?= ${DESTDIR}/usr/X11R6
159: CROSSBASE?= ${LOCALBASE}/cross
160:
161: .ifndef DIGEST
162: DIGEST:= ${LOCALBASE}/bin/digest
163: MAKEFLAGS+= DIGEST=${DIGEST}
164: .endif
165:
166: .if !defined(DIGEST_VERSION)
167: .if exists(${DIGEST})
168: DIGEST_VERSION!= ${DIGEST} -V
169: .else
170: DIGEST_VERSION= ${DIGEST_REQD}
171: .endif
172: MAKEFLAGS+= DIGEST_VERSION="${DIGEST_VERSION}"
1.23 wiz 173: .endif
174:
175: .ifndef PKGTOOLS_VERSION
176: PKGTOOLS_VERSION!=${PKG_TOOLS_BIN}/pkg_info -V 2>/dev/null || echo 20010302
177: MAKEFLAGS+= PKGTOOLS_VERSION="${PKGTOOLS_VERSION}"
1.22 agc 178: .endif
1.18 rh 179:
180: .endif # BSD_PKG_MK
CVSweb <webmaster@jp.NetBSD.org>