Annotation of pkgsrc/mk/bsd.prefs.mk, Revision 1.30
1.30 ! tron 1: # $NetBSD: bsd.prefs.mk,v 1.29 2001/03/23 15:49:23 tron 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.27 dmcmahil 145:
146:
147: #
148: # list of serial port devices commonly found on various machines and
149: # which is the common default one. This is used for semi-reasonable
150: # defaults on different machines. These can and should be overridden
151: # on your machine in /etc/mk.conf.
152: # Please help fill in the list.
153: .if (${OPSYS} == "NetBSD")
154: .if (${MACHINE_ARCH} == alpha)
155: DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
156: SERIAL_DEVICES?= /dev/ttyC0 \
157: /dev/ttyC1
158: .elif (${MACHINE_ARCH} == "i386")
159: DEFAULT_SERIAL_DEVICE?= /dev/tty00
160: SERIAL_DEVICES?= /dev/tty00 \
161: /dev/tty01
162: .elif (${MACHINE_ARCH} == m68k)
163: DEFAULT_SERIAL_DEVICE?= /dev/tty00
164: SERIAL_DEVICES?= /dev/tty00 \
165: /dev/tty01
166: .elif (${MACHINE_ARCH} == mipsel)
167: DEFAULT_SERIAL_DEVICE?= /dev/ttyC0
168: SERIAL_DEVICES?= /dev/ttyC0 \
169: /dev/ttyC1
170: .elif (${MACHINE_ARCH} == "sparc")
171: DEFAULT_SERIAL_DEVICE?= /dev/ttya
172: SERIAL_DEVICES?= /dev/ttya \
173: /dev/ttyb
174: .else
175: DEFAULT_SERIAL_DEVICE?= /dev/null
176: SERIAL_DEVICES?= /dev/null
177: .endif # ${MACHINE_ARCH}
178: .else # ${OPSYS} != "NetBSD"
179: DEFAULT_SERIAL_DEVICE?= /dev/null
180: SERIAL_DEVICES?= /dev/null
181: .endif # ${OPSYS} == "NetBSD"
1.22 agc 182:
183: ##### Some overrides of defaults below on a per-OS basis.
184: .if (${OPSYS} == "NetBSD")
185: LOCALBASE?= ${DESTDIR}/usr/pkg
1.23 wiz 186: PKG_TOOLS_BIN?= /usr/sbin
1.22 agc 187: .elif (${OPSYS} == "SunOS")
188: X11BASE?= ${DESTDIR}/usr/openwin
1.23 wiz 189: PKG_TOOLS_BIN?= ${LOCALBASE}/bsd/bin
1.24 tron 190: .elif (${OPSYS} == "Linux")
1.23 wiz 191: PKG_TOOLS_BIN?= ${LOCALBASE}/bsd/bin
1.22 agc 192: .endif
193:
194: LOCALBASE?= ${DESTDIR}/usr/local
195: X11BASE?= ${DESTDIR}/usr/X11R6
196: CROSSBASE?= ${LOCALBASE}/cross
1.26 agc 197:
1.22 agc 198: .ifndef DIGEST
199: DIGEST:= ${LOCALBASE}/bin/digest
200: MAKEFLAGS+= DIGEST=${DIGEST}
201: .endif
1.26 agc 202:
203: # Only add the DIGEST_VERSION value to MAKEFLAGS when we know
204: # we've got a valid version number, retrieved from the digest(1)
205: # binary. This is different to PKGTOOLS_VERSION, since, in that
206: # case, the build dies when pkg_info(1) is out of date.
1.22 agc 207:
1.25 agc 208: .if !exists(${DIGEST})
209: DIGEST_VERSION= 20010301
210: .elif !defined(DIGEST_VERSION)
211: DIGEST_VERSION!= ${DIGEST} -V 2>/dev/null
1.22 agc 212: MAKEFLAGS+= DIGEST_VERSION="${DIGEST_VERSION}"
1.23 wiz 213: .endif
214:
215: .ifndef PKGTOOLS_VERSION
216: PKGTOOLS_VERSION!=${PKG_TOOLS_BIN}/pkg_info -V 2>/dev/null || echo 20010302
217: MAKEFLAGS+= PKGTOOLS_VERSION="${PKGTOOLS_VERSION}"
1.28 tron 218: .endif
219:
1.30 ! tron 220: .if (${OPSYS} != SunOS) && !defined(ZOULARIS_VERSION)
1.28 tron 221: .if !exists(${LOCALBASE}/bsd/share/mk/zoularis.mk)
222: ZOULARIS_VERSION= 20000522
223: .else
224: .include "${LOCALBASE}/bsd/share/mk/zoularis.mk"
225: .endif
226: MAKEFLAGS+= ZOULARIS_VERSION="${ZOULARIS_VERSION}"
1.22 agc 227: .endif
1.18 rh 228:
229: .endif # BSD_PKG_MK
CVSweb <webmaster@jp.NetBSD.org>