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