bsd.own.mk revision 172832
1# $FreeBSD: head/share/mk/bsd.own.mk 172832 2007-10-20 19:01:50Z ru $
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	KLD owner. [${BINOWN}]
48#
49# KMODGRP	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
165DEFAULT_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    FORTRAN \
227    FP_LIBC \
228    GAMES \
229    GCOV \
230    GDB \
231    GNU \
232    GPIB \
233    GROFF \
234    HTML \
235    I4B \
236    INET6 \
237    INFO \
238    IPFILTER \
239    IPX \
240    KERBEROS \
241    LIB32 \
242    LIBPTHREAD \
243    LIBTHR \
244    LOCALES \
245    LPR \
246    MAILWRAPPER \
247    NETCAT \
248    NIS \
249    NLS \
250    NLS_CATALOGS \
251    NS_CACHING \
252    OBJC \
253    OPENSSH \
254    OPENSSL \
255    PAM \
256    PF \
257    RCMDS \
258    RCS \
259    RESCUE \
260    SENDMAIL \
261    SETUID_LOGIN \
262    SHAREDOCS \
263    SYSCONS \
264    TCSH \
265    TOOLCHAIN \
266    USB \
267    WPA_SUPPLICANT_EAPOL
268.if defined(NO_${var})
269#.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
270WITHOUT_${var}=
271.endif
272.endfor
273.endif # !defined(BURN_BRIDGES)
274
275#
276# Older-style variables that enabled behaviour when set.
277#
278.if defined(YES_HESIOD)
279WITH_HESIOD=
280.endif
281.if defined(MAKE_IDEA)
282WITH_IDEA=
283.endif
284
285#
286# MK_* options which default to "yes".
287#
288.for var in \
289    ACPI \
290    ASSERT_DEBUG \
291    ATM \
292    AUDIT \
293    AUTHPF \
294    BIND \
295    BIND_DNSSEC \
296    BIND_ETC \
297    BIND_LIBS_LWRES \
298    BIND_MTREE \
299    BIND_NAMED \
300    BIND_UTILS \
301    BLUETOOTH \
302    BOOT \
303    BZIP2 \
304    CALENDAR \
305    CDDL \
306    CPP \
307    CRYPT \
308    CVS \
309    CXX \
310    DICT \
311    DYNAMICROOT \
312    EXAMPLES \
313    FORTH \
314    FORTRAN \
315    FP_LIBC \
316    GAMES \
317    GCOV \
318    GDB \
319    GNU \
320    GPIB \
321    GROFF \
322    HTML \
323    I4B \
324    INET6 \
325    INFO \
326    INSTALLLIB \
327    IPFILTER \
328    IPX \
329    KERBEROS \
330    KVM \
331    LIB32 \
332    LIBPTHREAD \
333    LIBKSE \
334    LIBTHR \
335    LOCALES \
336    LPR \
337    MAILWRAPPER \
338    MAN \
339    NCP \
340    NETCAT \
341    NIS \
342    NLS \
343    NLS_CATALOGS \
344    NS_CACHING \
345    OBJC \
346    OPENSSH \
347    OPENSSL \
348    PAM \
349    PF \
350    PROFILE \
351    RCMDS \
352    RCS \
353    RESCUE \
354    SENDMAIL \
355    SETUID_LOGIN \
356    SHAREDOCS \
357    SSP \
358    SYMVER \
359    SYSCONS \
360    TCSH \
361    TOOLCHAIN \
362    USB \
363    WPA_SUPPLICANT_EAPOL \
364    ZONEINFO \
365    ZFS
366.if defined(WITH_${var}) && defined(WITHOUT_${var})
367.error WITH_${var} and WITHOUT_${var} can't both be set.
368.endif
369.if defined(MK_${var})
370.error MK_${var} can't be set by a user.
371.endif
372.if defined(WITHOUT_${var})
373MK_${var}:=	no
374.else
375MK_${var}:=	yes
376.endif
377.endfor
378
379#
380# MK_* options which default to "no".
381#
382.for var in \
383    BIND_LIBS \
384    HESIOD \
385    IDEA
386.if defined(WITH_${var}) && defined(WITHOUT_${var})
387.error WITH_${var} and WITHOUT_${var} can't both be set.
388.endif
389.if defined(MK_${var})
390.error MK_${var} can't be set by a user.
391.endif
392.if defined(WITH_${var})
393MK_${var}:=	yes
394.else
395MK_${var}:=	no
396.endif
397.endfor
398
399#
400# Force some options off if their dependencies are off.
401# Order is somewhat important.
402#
403.if ${MK_LIBPTHREAD} == "no"
404MK_LIBKSE:=	no
405MK_LIBTHR:=	no
406.endif
407
408.if ${MK_LIBKSE} == "no" && ${MK_LIBTHR} == "no"
409MK_BIND:=	no
410.endif
411
412.if ${MK_BIND} == "no"
413MK_BIND_DNSSEC:= no
414MK_BIND_ETC:=	no
415MK_BIND_LIBS:=	no
416MK_BIND_LIBS_LWRES:= no
417MK_BIND_MTREE:=	no
418MK_BIND_NAMED:=	no
419MK_BIND_UTILS:=	no
420.endif
421
422.if ${MK_BIND_MTREE} == "no"
423MK_BIND_ETC:=	no
424.endif
425
426.if ${MK_CDDL} == "no"
427MK_ZFS:=	no
428.endif
429
430.if ${MK_CRYPT} == "no"
431MK_OPENSSL:=	no
432MK_OPENSSH:=	no
433MK_KERBEROS:=	no
434.endif
435
436.if ${MK_IPX} == "no"
437MK_NCP:=	no
438.endif
439
440.if ${MK_OPENSSL} == "no"
441MK_OPENSSH:=	no
442MK_KERBEROS:=	no
443.endif
444
445.if ${MK_PF} == "no"
446MK_AUTHPF:=	no
447.endif
448
449.if ${MK_TOOLCHAIN} == "no"
450MK_GDB:=	no
451.endif
452
453#
454# Set defaults for the MK_*_SUPPORT variables.
455#
456
457#
458# MK_*_SUPPORT options which default to "yes" unless their corresponding
459# MK_* variable is set to "no".
460#
461.for var in \
462    BZIP2 \
463    GNU \
464    INET6 \
465    IPX \
466    KERBEROS \
467    KVM \
468    PAM
469.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
470.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
471.endif
472.if defined(MK_${var}_SUPPORT)
473.error MK_${var}_SUPPORT can't be set by a user.
474.endif
475.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
476MK_${var}_SUPPORT:= no
477.else
478MK_${var}_SUPPORT:= yes
479.endif
480.endfor
481.endif # !_WITHOUT_SRCCONF
482
483.endif	# !target(__<bsd.own.mk>__)
484