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