bsd.own.mk revision 175412
1314817Sngie# $FreeBSD: head/share/mk/bsd.own.mk 175412 2008-01-17 20:51:58Z brueffer $
2272343Sngie#
3272343Sngie# The include file <bsd.own.mk> set common variables for owner,
4272343Sngie# group, mode, and directories. Defaults are in brackets.
5272343Sngie#
6272343Sngie#
7272343Sngie# +++ variables +++
8272343Sngie#
9272343Sngie# DESTDIR	Change the tree where the file gets installed. [not set]
10272343Sngie#
11272343Sngie# DISTDIR	Change the tree where the file for a distribution
12272343Sngie# 		gets installed (see /usr/src/release/Makefile). [not set]
13272343Sngie#
14272343Sngie# COMPRESS_CMD	Program to compress documents.
15272343Sngie#		Output is to stdout. [gzip -cn]
16272343Sngie#
17272343Sngie# COMPRESS_EXT	File name extension of ${COMPRESS_CMD} command. [.gz]
18272343Sngie#
19272343Sngie# BINOWN	Binary owner. [root]
20272343Sngie#
21272343Sngie# BINGRP	Binary group. [wheel]
22272343Sngie#
23272343Sngie# BINMODE	Binary mode. [555]
24272343Sngie#
25272343Sngie# NOBINMODE	Mode for non-executable files. [444]
26272343Sngie#
27272343Sngie# LIBDIR	Base path for libraries. [/usr/lib]
28272343Sngie#
29272343Sngie# LIBCOMPATDIR	Base path for compat libraries. [/usr/lib/compat]
30272343Sngie#
31272343Sngie# LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
32272343Sngie#
33272343Sngie# LINTLIBDIR	Base path for lint libraries. [/usr/libdata/lint]
34272343Sngie#
35272343Sngie# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
36272343Sngie#
37272343Sngie# LIBOWN	Library owner. [${BINOWN}]
38272343Sngie#
39272343Sngie# LIBGRP	Library group. [${BINGRP}]
40272343Sngie#
41272343Sngie# LIBMODE	Library mode. [${NOBINMODE}]
42272343Sngie#
43272343Sngie#
44272343Sngie# KMODDIR	Base path for loadable kernel modules
45272343Sngie#		(see kld(4)). [/boot/kernel]
46272343Sngie#
47272343Sngie# KMODOWN	KLD owner. [${BINOWN}]
48272343Sngie#
49272343Sngie# KMODGRP	KLD group. [${BINGRP}]
50272343Sngie#
51272343Sngie# KMODMODE	KLD mode. [${BINMODE}]
52272343Sngie#
53272343Sngie#
54272343Sngie# SHAREDIR	Base path for architecture-independent ascii
55272343Sngie#		text files. [/usr/share]
56272343Sngie#
57272343Sngie# SHAREOWN	ASCII text file owner. [root]
58272343Sngie#
59272343Sngie# SHAREGRP	ASCII text file group. [wheel]
60272343Sngie#
61314817Sngie# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
62272343Sngie#
63272343Sngie#
64272343Sngie# DOCDIR	Base path for system documentation (e.g. PSD, USD,
65272343Sngie#		handbook, FAQ etc.). [${SHAREDIR}/doc]
66272343Sngie#
67272343Sngie# DOCOWN	Documentation owner. [${SHAREOWN}]
68272343Sngie#
69272343Sngie# DOCGRP	Documentation group. [${SHAREGRP}]
70272343Sngie#
71314817Sngie# DOCMODE	Documentation mode. [${NOBINMODE}]
72272343Sngie#
73272343Sngie#
74272343Sngie# INFODIR	Base path for GNU's hypertext system
75272343Sngie#		called Info (see info(1)). [${SHAREDIR}/info]
76272343Sngie#
77272343Sngie# INFOOWN	Info owner. [${SHAREOWN}]
78272343Sngie#
79272343Sngie# INFOGRP	Info group. [${SHAREGRP}]
80272343Sngie#
81272343Sngie# INFOMODE	Info mode. [${NOBINMODE}]
82272343Sngie#
83272343Sngie#
84272343Sngie# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
85272343Sngie#
86272343Sngie# MANOWN	Manual owner. [${SHAREOWN}]
87272343Sngie#
88272343Sngie# MANGRP	Manual group. [${SHAREGRP}]
89272343Sngie#
90272343Sngie# MANMODE	Manual mode. [${NOBINMODE}]
91272343Sngie#
92272343Sngie#
93272343Sngie# NLSDIR	Base path for National Language Support files
94272343Sngie#		installation. [${SHAREDIR}/nls]
95272343Sngie#
96272343Sngie# NLSOWN	National Language Support files owner. [${SHAREOWN}]
97272343Sngie#
98272343Sngie# NLSGRP	National Language Support files group. [${SHAREGRP}]
99272343Sngie#
100272343Sngie# NLSMODE	National Language Support files mode. [${NOBINMODE}]
101272343Sngie#
102272343Sngie# INCLUDEDIR	Base path for standard C include files [/usr/include]
103272343Sngie
104272343Sngie.if !target(__<bsd.own.mk>__)
105272343Sngie__<bsd.own.mk>__:
106272343Sngie
107272343Sngie.if !defined(_WITHOUT_SRCCONF)
108272343SngieSRCCONF?=	/etc/src.conf
109272343Sngie.if exists(${SRCCONF})
110272343Sngie.include "${SRCCONF}"
111272343Sngie.endif
112272343Sngie.endif
113272343Sngie
114272343Sngie# Binaries
115272343SngieBINOWN?=	root
116272343SngieBINGRP?=	wheel
117272343SngieBINMODE?=	555
118272343SngieNOBINMODE?=	444
119272343Sngie
120272343Sngie.if defined(MODULES_WITH_WORLD)
121272343SngieKMODDIR?=	/boot/modules
122272343Sngie.else
123272343SngieKMODDIR?=	/boot/kernel
124272343Sngie.endif
125272343SngieKMODOWN?=	${BINOWN}
126272343SngieKMODGRP?=	${BINGRP}
127272343SngieKMODMODE?=	${BINMODE}
128272343Sngie
129272343SngieLIBDIR?=	/usr/lib
130272343SngieLIBCOMPATDIR?=	/usr/lib/compat
131272343SngieLIBDATADIR?=	/usr/libdata
132272343SngieLINTLIBDIR?=	/usr/libdata/lint
133272343SngieSHLIBDIR?=	${LIBDIR}
134272343SngieLIBOWN?=	${BINOWN}
135272343SngieLIBGRP?=	${BINGRP}
136272343SngieLIBMODE?=	${NOBINMODE}
137272343Sngie
138272343Sngie
139272343Sngie# Share files
140272343SngieSHAREDIR?=	/usr/share
141272343SngieSHAREOWN?=	root
142272343SngieSHAREGRP?=	wheel
143272343SngieSHAREMODE?=	${NOBINMODE}
144272343Sngie
145272343SngieMANDIR?=	${SHAREDIR}/man/man
146272343SngieMANOWN?=	${SHAREOWN}
147272343SngieMANGRP?=	${SHAREGRP}
148272343SngieMANMODE?=	${NOBINMODE}
149272343Sngie
150272343SngieDOCDIR?=	${SHAREDIR}/doc
151272343SngieDOCOWN?=	${SHAREOWN}
152272343SngieDOCGRP?=	${SHAREGRP}
153272343SngieDOCMODE?=	${NOBINMODE}
154272343Sngie
155272343SngieINFODIR?=	${SHAREDIR}/info
156272343SngieINFOOWN?=	${SHAREOWN}
157272343SngieINFOGRP?=	${SHAREGRP}
158272343SngieINFOMODE?=	${NOBINMODE}
159272343Sngie
160272343SngieNLSDIR?=	${SHAREDIR}/nls
161272343SngieNLSOWN?=	${SHAREOWN}
162272343SngieNLSGRP?=	${SHAREGRP}
163272343SngieNLSMODE?=	${NOBINMODE}
164272343Sngie
165272343SngieDEFAULT_THREAD_LIB?=	libthr
166
167INCLUDEDIR?=	/usr/include
168
169# Common variables
170.if !defined(DEBUG_FLAGS)
171STRIP?=		-s
172.endif
173
174COMPRESS_CMD?=	gzip -cn
175COMPRESS_EXT?=	.gz
176
177.if !defined(_WITHOUT_SRCCONF)
178#
179# Define MK_* variables (which are either "yes" or "no") for users
180# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
181# make(1) environment.
182# These should be tested with `== "no"' or `!= "no"' in makefiles.
183# The NO_* variables should only be set by makefiles.
184#
185
186#
187# Supported NO_* options (if defined, MK_* will be forced to "no",
188# regardless of user's setting).
189#
190.for var in \
191    INSTALLLIB \
192    MAN \
193    PROFILE
194.if defined(NO_${var})
195WITHOUT_${var}=
196.endif
197.endfor
198
199#
200# Compat NO_* options (same as above, except their use is deprecated).
201#
202.if !defined(BURN_BRIDGES)
203.for var in \
204    ACPI \
205    ATM \
206    AUDIT \
207    AUTHPF \
208    BIND \
209    BIND_DNSSEC \
210    BIND_ETC \
211    BIND_LIBS_LWRES \
212    BIND_MTREE \
213    BIND_NAMED \
214    BIND_UTILS \
215    BLUETOOTH \
216    BOOT \
217    CALENDAR \
218    CPP \
219    CRYPT \
220    CVS \
221    CXX \
222    DICT \
223    DYNAMICROOT \
224    EXAMPLES \
225    FORTH \
226    FP_LIBC \
227    GAMES \
228    GCOV \
229    GDB \
230    GNU \
231    GPIB \
232    GROFF \
233    HTML \
234    I4B \
235    INET6 \
236    INFO \
237    IPFILTER \
238    IPX \
239    KERBEROS \
240    LIB32 \
241    LIBPTHREAD \
242    LIBTHR \
243    LOCALES \
244    LPR \
245    MAILWRAPPER \
246    NETCAT \
247    NIS \
248    NLS \
249    NLS_CATALOGS \
250    NS_CACHING \
251    OBJC \
252    OPENSSH \
253    OPENSSL \
254    PAM \
255    PF \
256    RCMDS \
257    RCS \
258    RESCUE \
259    SENDMAIL \
260    SETUID_LOGIN \
261    SHAREDOCS \
262    SYSCONS \
263    TCSH \
264    TOOLCHAIN \
265    USB \
266    WPA_SUPPLICANT_EAPOL
267.if defined(NO_${var})
268#.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
269WITHOUT_${var}=
270.endif
271.endfor
272.endif # !defined(BURN_BRIDGES)
273
274#
275# Older-style variables that enabled behaviour when set.
276#
277.if defined(YES_HESIOD)
278WITH_HESIOD=
279.endif
280.if defined(MAKE_IDEA)
281WITH_IDEA=
282.endif
283
284#
285# MK_* options which default to "yes".
286#
287.for var in \
288    ACPI \
289    ASSERT_DEBUG \
290    ATM \
291    AUDIT \
292    AUTHPF \
293    BIND \
294    BIND_DNSSEC \
295    BIND_ETC \
296    BIND_LIBS_LWRES \
297    BIND_MTREE \
298    BIND_NAMED \
299    BIND_UTILS \
300    BLUETOOTH \
301    BOOT \
302    BZIP2 \
303    CALENDAR \
304    CDDL \
305    CPP \
306    CRYPT \
307    CVS \
308    CXX \
309    DICT \
310    DYNAMICROOT \
311    EXAMPLES \
312    FORTH \
313    FP_LIBC \
314    GAMES \
315    GCOV \
316    GDB \
317    GNU \
318    GPIB \
319    GROFF \
320    HTML \
321    I4B \
322    INET6 \
323    INFO \
324    INSTALLLIB \
325    IPFILTER \
326    IPX \
327    KERBEROS \
328    KVM \
329    LIB32 \
330    LIBPTHREAD \
331    LIBKSE \
332    LIBTHR \
333    LOCALES \
334    LPR \
335    MAILWRAPPER \
336    MAN \
337    NCP \
338    NETCAT \
339    NIS \
340    NLS \
341    NLS_CATALOGS \
342    NS_CACHING \
343    OBJC \
344    OPENSSH \
345    OPENSSL \
346    PAM \
347    PF \
348    PROFILE \
349    RCMDS \
350    RCS \
351    RESCUE \
352    SENDMAIL \
353    SETUID_LOGIN \
354    SHAREDOCS \
355    SSP \
356    SYMVER \
357    SYSCONS \
358    TCSH \
359    TOOLCHAIN \
360    USB \
361    WPA_SUPPLICANT_EAPOL \
362    ZONEINFO \
363    ZFS
364.if defined(WITH_${var}) && defined(WITHOUT_${var})
365.error WITH_${var} and WITHOUT_${var} can't both be set.
366.endif
367.if defined(MK_${var})
368.error MK_${var} can't be set by a user.
369.endif
370.if defined(WITHOUT_${var})
371MK_${var}:=	no
372.else
373MK_${var}:=	yes
374.endif
375.endfor
376
377#
378# MK_* options which default to "no".
379#
380.for var in \
381    BIND_LIBS \
382    HESIOD \
383    IDEA
384.if defined(WITH_${var}) && defined(WITHOUT_${var})
385.error WITH_${var} and WITHOUT_${var} can't both be set.
386.endif
387.if defined(MK_${var})
388.error MK_${var} can't be set by a user.
389.endif
390.if defined(WITH_${var})
391MK_${var}:=	yes
392.else
393MK_${var}:=	no
394.endif
395.endfor
396
397#
398# Force some options off if their dependencies are off.
399# Order is somewhat important.
400#
401.if ${MK_LIBPTHREAD} == "no"
402MK_LIBKSE:=	no
403MK_LIBTHR:=	no
404.endif
405
406.if ${MK_LIBKSE} == "no" && ${MK_LIBTHR} == "no"
407MK_BIND:=	no
408.endif
409
410.if ${MK_BIND} == "no"
411MK_BIND_DNSSEC:= no
412MK_BIND_ETC:=	no
413MK_BIND_LIBS:=	no
414MK_BIND_LIBS_LWRES:= no
415MK_BIND_MTREE:=	no
416MK_BIND_NAMED:=	no
417MK_BIND_UTILS:=	no
418.endif
419
420.if ${MK_BIND_MTREE} == "no"
421MK_BIND_ETC:=	no
422.endif
423
424.if ${MK_CDDL} == "no"
425MK_ZFS:=	no
426.endif
427
428.if ${MK_CRYPT} == "no"
429MK_OPENSSL:=	no
430MK_OPENSSH:=	no
431MK_KERBEROS:=	no
432.endif
433
434.if ${MK_IPX} == "no"
435MK_NCP:=	no
436.endif
437
438.if ${MK_OPENSSL} == "no"
439MK_OPENSSH:=	no
440MK_KERBEROS:=	no
441.endif
442
443.if ${MK_PF} == "no"
444MK_AUTHPF:=	no
445.endif
446
447.if ${MK_TOOLCHAIN} == "no"
448MK_GDB:=	no
449.endif
450
451#
452# Set defaults for the MK_*_SUPPORT variables.
453#
454
455#
456# MK_*_SUPPORT options which default to "yes" unless their corresponding
457# MK_* variable is set to "no".
458#
459.for var in \
460    BZIP2 \
461    GNU \
462    INET6 \
463    IPX \
464    KERBEROS \
465    KVM \
466    PAM
467.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
468.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
469.endif
470.if defined(MK_${var}_SUPPORT)
471.error MK_${var}_SUPPORT can't be set by a user.
472.endif
473.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
474MK_${var}_SUPPORT:= no
475.else
476MK_${var}_SUPPORT:= yes
477.endif
478.endfor
479
480#
481# MK_* options whose default value depends on another option.
482#
483.for vv in \
484    GSSAPI/KERBEROS
485.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
486.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
487.endif
488.if defined(MK_${vv:H})
489.error MK_${vv:H} can't be set by a user.
490.endif
491.if defined(WITH_${vv:H})
492MK_${vv:H}:=	yes
493.elif defined(WITHOUT_${vv:H})
494MK_${vv:H}:=	no
495.else
496MK_${vv:H}:=	${MK_${vv:T}}
497.endif
498.endfor
499
500.endif # !_WITHOUT_SRCCONF
501
502.endif	# !target(__<bsd.own.mk>__)
503