bsd.own.mk revision 218933
1# $FreeBSD: head/share/mk/bsd.own.mk 218933 2011-02-22 04:03:33Z imp $
2#
3# The include file <bsd.own.mk> set common variables for owner,
4# group, mode, and directories. Defaults are in brackets.
5#
6#
7# +++ variables +++
8#
9# DESTDIR	Change the tree where the file gets installed. [not set]
10#
11# DISTDIR	Change the tree where the file for a distribution
12# 		gets installed (see /usr/src/release/Makefile). [not set]
13#
14# COMPRESS_CMD	Program to compress documents.
15#		Output is to stdout. [gzip -cn]
16#
17# COMPRESS_EXT	File name extension of ${COMPRESS_CMD} command. [.gz]
18#
19# BINOWN	Binary owner. [root]
20#
21# BINGRP	Binary group. [wheel]
22#
23# BINMODE	Binary mode. [555]
24#
25# NOBINMODE	Mode for non-executable files. [444]
26#
27# LIBDIR	Base path for libraries. [/usr/lib]
28#
29# LIBCOMPATDIR	Base path for compat libraries. [/usr/lib/compat]
30#
31# LIBDATADIR	Base path for misc. utility data files. [/usr/libdata]
32#
33# LIBEXECDIR	Base path for system daemons and utilities. [/usr/libexec]
34#
35# LINTLIBDIR	Base path for lint libraries. [/usr/libdata/lint]
36#
37# SHLIBDIR	Base path for shared libraries. [${LIBDIR}]
38#
39# LIBOWN	Library owner. [${BINOWN}]
40#
41# LIBGRP	Library group. [${BINGRP}]
42#
43# LIBMODE	Library mode. [${NOBINMODE}]
44#
45#
46# KMODDIR	Base path for loadable kernel modules
47#		(see kld(4)). [/boot/kernel]
48#
49# KMODOWN	Kernel and KLD owner. [${BINOWN}]
50#
51# KMODGRP	Kernel and KLD group. [${BINGRP}]
52#
53# KMODMODE	KLD mode. [${BINMODE}]
54#
55#
56# SHAREDIR	Base path for architecture-independent ascii
57#		text files. [/usr/share]
58#
59# SHAREOWN	ASCII text file owner. [root]
60#
61# SHAREGRP	ASCII text file group. [wheel]
62#
63# SHAREMODE	ASCII text file mode. [${NOBINMODE}]
64#
65#
66# DOCDIR	Base path for system documentation (e.g. PSD, USD,
67#		handbook, FAQ etc.). [${SHAREDIR}/doc]
68#
69# DOCOWN	Documentation owner. [${SHAREOWN}]
70#
71# DOCGRP	Documentation group. [${SHAREGRP}]
72#
73# DOCMODE	Documentation mode. [${NOBINMODE}]
74#
75#
76# INFODIR	Base path for GNU's hypertext system
77#		called Info (see info(1)). [${SHAREDIR}/info]
78#
79# INFOOWN	Info owner. [${SHAREOWN}]
80#
81# INFOGRP	Info group. [${SHAREGRP}]
82#
83# INFOMODE	Info mode. [${NOBINMODE}]
84#
85#
86# MANDIR	Base path for manual installation. [${SHAREDIR}/man/man]
87#
88# MANOWN	Manual owner. [${SHAREOWN}]
89#
90# MANGRP	Manual group. [${SHAREGRP}]
91#
92# MANMODE	Manual mode. [${NOBINMODE}]
93#
94#
95# NLSDIR	Base path for National Language Support files
96#		installation. [${SHAREDIR}/nls]
97#
98# NLSOWN	National Language Support files owner. [${SHAREOWN}]
99#
100# NLSGRP	National Language Support files group. [${SHAREGRP}]
101#
102# NLSMODE	National Language Support files mode. [${NOBINMODE}]
103#
104# INCLUDEDIR	Base path for standard C include files [/usr/include]
105
106.if !target(__<bsd.own.mk>__)
107__<bsd.own.mk>__:
108
109.if !defined(_WITHOUT_SRCCONF)
110SRCCONF?=	/etc/src.conf
111.if exists(${SRCCONF})
112.include "${SRCCONF}"
113.endif
114.endif
115
116# Binaries
117BINOWN?=	root
118BINGRP?=	wheel
119BINMODE?=	555
120NOBINMODE?=	444
121
122.if defined(MODULES_WITH_WORLD)
123KMODDIR?=	/boot/modules
124.else
125KMODDIR?=	/boot/kernel
126.endif
127KMODOWN?=	${BINOWN}
128KMODGRP?=	${BINGRP}
129KMODMODE?=	${BINMODE}
130
131LIBDIR?=	/usr/lib
132LIBCOMPATDIR?=	/usr/lib/compat
133LIBDATADIR?=	/usr/libdata
134LIBEXECDIR?=	/usr/libexec
135LINTLIBDIR?=	/usr/libdata/lint
136SHLIBDIR?=	${LIBDIR}
137LIBOWN?=	${BINOWN}
138LIBGRP?=	${BINGRP}
139LIBMODE?=	${NOBINMODE}
140
141
142# Share files
143SHAREDIR?=	/usr/share
144SHAREOWN?=	root
145SHAREGRP?=	wheel
146SHAREMODE?=	${NOBINMODE}
147
148MANDIR?=	${SHAREDIR}/man/man
149MANOWN?=	${SHAREOWN}
150MANGRP?=	${SHAREGRP}
151MANMODE?=	${NOBINMODE}
152
153DOCDIR?=	${SHAREDIR}/doc
154DOCOWN?=	${SHAREOWN}
155DOCGRP?=	${SHAREGRP}
156DOCMODE?=	${NOBINMODE}
157
158INFODIR?=	${SHAREDIR}/info
159INFOOWN?=	${SHAREOWN}
160INFOGRP?=	${SHAREGRP}
161INFOMODE?=	${NOBINMODE}
162
163NLSDIR?=	${SHAREDIR}/nls
164NLSOWN?=	${SHAREOWN}
165NLSGRP?=	${SHAREGRP}
166NLSMODE?=	${NOBINMODE}
167
168INCLUDEDIR?=	/usr/include
169
170# Common variables
171.if !defined(DEBUG_FLAGS)
172STRIP?=		-s
173.endif
174
175COMPRESS_CMD?=	gzip -cn
176COMPRESS_EXT?=	.gz
177
178.if !defined(_WITHOUT_SRCCONF)
179#
180# Define MK_* variables (which are either "yes" or "no") for users
181# to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
182# make(1) environment.
183# These should be tested with `== "no"' or `!= "no"' in makefiles.
184# The NO_* variables should only be set by makefiles.
185#
186
187#
188# Supported NO_* options (if defined, MK_* will be forced to "no",
189# regardless of user's setting).
190#
191.for var in \
192    INSTALLLIB \
193    MAN \
194    PROFILE
195.if defined(NO_${var})
196WITHOUT_${var}=
197.endif
198.endfor
199
200#
201# Compat NO_* options (same as above, except their use is deprecated).
202#
203.if !defined(BURN_BRIDGES)
204.for var in \
205    ACPI \
206    ATM \
207    AUDIT \
208    AUTHPF \
209    BIND \
210    BIND_DNSSEC \
211    BIND_ETC \
212    BIND_LIBS_LWRES \
213    BIND_MTREE \
214    BIND_NAMED \
215    BIND_UTILS \
216    BLUETOOTH \
217    BOOT \
218    CALENDAR \
219    CPP \
220    CRYPT \
221    CVS \
222    CXX \
223    DICT \
224    DYNAMICROOT \
225    EXAMPLES \
226    FORTH \
227    FP_LIBC \
228    GAMES \
229    GCOV \
230    GDB \
231    GNU \
232    GPIB \
233    GROFF \
234    HTML \
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    ACCT \
289    ACPI \
290    AMD \
291    APM \
292    ASSERT_DEBUG \
293    AT \
294    ATM \
295    AUDIT \
296    AUTHPF \
297    BIND \
298    BIND_DNSSEC \
299    BIND_ETC \
300    BIND_LIBS_LWRES \
301    BIND_MTREE \
302    BIND_NAMED \
303    BIND_UTILS \
304    BLUETOOTH \
305    BOOT \
306    BSD_CPIO \
307    BSNMP \
308    BZIP2 \
309    CALENDAR \
310    CDDL \
311    CLANG \
312    CPP \
313    CRYPT \
314    CTM \
315    CVS \
316    CXX \
317    DICT \
318    DYNAMICROOT \
319    EXAMPLES \
320    FDT \
321    FLOPPY \
322    FORTH \
323    FP_LIBC \
324    FREEBSD_UPDATE \
325    GAMES \
326    GCOV \
327    GDB \
328    GNU \
329    GPIB \
330    GROFF \
331    HTML \
332    INET6 \
333    INFO \
334    INSTALLLIB \
335    IPFILTER \
336    IPFW \
337    IPX \
338    JAIL \
339    KERBEROS \
340    KVM \
341    LEGACY_CONSOLE \
342    LIB32 \
343    LIBPTHREAD \
344    LIBTHR \
345    LOCALES \
346    LOCATE \
347    LPR \
348    MAIL \
349    MAILWRAPPER \
350    MAKE \
351    MAN \
352    NCP \
353    NDIS \
354    NETCAT \
355    NETGRAPH \
356    NIS \
357    NLS \
358    NLS_CATALOGS \
359    NS_CACHING \
360    NTP \
361    OBJC \
362    OPENSSH \
363    OPENSSL \
364    PAM \
365    PF \
366    PKGTOOLS \
367    PMC \
368    PORTSNAP \
369    PPP \
370    PROFILE \
371    QUOTAS \
372    RCMDS \
373    RCS \
374    RESCUE \
375    ROUTED \
376    SENDMAIL \
377    SETUID_LOGIN \
378    SHAREDOCS \
379    SSP \
380    SYSINSTALL \
381    SYMVER \
382    SYSCONS \
383    TCSH \
384    TELNET \
385    TEXTPROC \
386    TOOLCHAIN \
387    USB \
388    WIRELESS \
389    WPA_SUPPLICANT_EAPOL \
390    ZFS \
391    ZONEINFO
392.if defined(WITH_${var}) && defined(WITHOUT_${var})
393.error WITH_${var} and WITHOUT_${var} can't both be set.
394.endif
395.if defined(MK_${var})
396.error MK_${var} can't be set by a user.
397.endif
398.if defined(WITHOUT_${var})
399MK_${var}:=	no
400.else
401MK_${var}:=	yes
402.endif
403.endfor
404
405#
406# MK_* options which default to "no".
407#
408.for var in \
409    BIND_IDN \
410    BIND_LARGE_FILE \
411    BIND_LIBS \
412    BIND_SIGCHASE \
413    BIND_XML \
414    BSD_GREP \
415    GPIO \
416    HESIOD \
417    IDEA
418.if defined(WITH_${var}) && defined(WITHOUT_${var})
419.error WITH_${var} and WITHOUT_${var} can't both be set.
420.endif
421.if defined(MK_${var})
422.error MK_${var} can't be set by a user.
423.endif
424.if defined(WITH_${var})
425MK_${var}:=	yes
426.else
427MK_${var}:=	no
428.endif
429.endfor
430
431#
432# Force some options off if their dependencies are off.
433# Order is somewhat important.
434#
435.if ${MK_LIBPTHREAD} == "no"
436MK_LIBTHR:=	no
437.endif
438
439.if ${MK_LIBTHR} == "no"
440MK_BIND:=	no
441.endif
442
443.if ${MK_BIND} == "no"
444MK_BIND_DNSSEC:= no
445MK_BIND_ETC:=	no
446MK_BIND_LIBS:=	no
447MK_BIND_LIBS_LWRES:= no
448MK_BIND_MTREE:=	no
449MK_BIND_NAMED:=	no
450MK_BIND_UTILS:=	no
451.endif
452
453.if ${MK_BIND_MTREE} == "no"
454MK_BIND_ETC:=	no
455.endif
456
457.if ${MK_CDDL} == "no"
458MK_ZFS:=	no
459.endif
460
461.if ${MK_CRYPT} == "no"
462MK_OPENSSL:=	no
463MK_OPENSSH:=	no
464MK_KERBEROS:=	no
465.endif
466
467.if ${MK_IPX} == "no"
468MK_NCP:=	no
469.endif
470
471.if ${MK_MAIL} == "no"
472MK_MAILWRAPPER:= no
473MK_SENDMAIL:=	no
474.endif
475
476.if ${MK_NETGRAPH} == "no"
477MK_ATM:=	no
478MK_BLUETOOTH:=	no
479.endif
480
481.if ${MK_OPENSSL} == "no"
482MK_OPENSSH:=	no
483MK_KERBEROS:=	no
484.endif
485
486.if ${MK_PF} == "no"
487MK_AUTHPF:=	no
488.endif
489
490.if ${MK_TEXTPROC} == "no"
491MK_GROFF:=	no
492.endif
493
494.if ${MK_TOOLCHAIN} == "no"
495MK_CLANG:=	no
496MK_GDB:=	no
497.endif
498
499#
500# Set defaults for the MK_*_SUPPORT variables.
501#
502
503#
504# MK_*_SUPPORT options which default to "yes" unless their corresponding
505# MK_* variable is set to "no".
506#
507.for var in \
508    BZIP2 \
509    GNU \
510    INET6 \
511    IPX \
512    KERBEROS \
513    KVM \
514    NETGRAPH \
515    PAM \
516    WIRELESS
517.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
518.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
519.endif
520.if defined(MK_${var}_SUPPORT)
521.error MK_${var}_SUPPORT can't be set by a user.
522.endif
523.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
524MK_${var}_SUPPORT:= no
525.else
526MK_${var}_SUPPORT:= yes
527.endif
528.endfor
529
530#
531# MK_* options whose default value depends on another option.
532#
533.for vv in \
534    GSSAPI/KERBEROS \
535    MAN_UTILS/MAN
536.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
537.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
538.endif
539.if defined(MK_${vv:H})
540.error MK_${vv:H} can't be set by a user.
541.endif
542.if defined(WITH_${vv:H})
543MK_${vv:H}:=	yes
544.elif defined(WITHOUT_${vv:H})
545MK_${vv:H}:=	no
546.else
547MK_${vv:H}:=	${MK_${vv:T}}
548.endif
549.endfor
550
551.endif # !_WITHOUT_SRCCONF
552
553.endif	# !target(__<bsd.own.mk>__)
554