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