]> CyberLeo.Net >> Repos - FreeBSD/stable/8.git/blob - share/mk/bsd.own.mk
MFC 206082,206179,207056,207057,210612,210636,210656,212423,212426,228121,
[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 WITHOUT_${var}=
212 .endif
213 .endfor
214
215 #
216 # Compat NO_* options (same as above, except their use is deprecated).
217 #
218 .if !defined(BURN_BRIDGES)
219 .for var in \
220     ACPI \
221     ATM \
222     AUDIT \
223     AUTHPF \
224     BIND \
225     BIND_DNSSEC \
226     BIND_ETC \
227     BIND_LIBS_LWRES \
228     BIND_MTREE \
229     BIND_NAMED \
230     BIND_UTILS \
231     BLUETOOTH \
232     BOOT \
233     CALENDAR \
234     CPP \
235     CRYPT \
236     CVS \
237     CXX \
238     DICT \
239     DYNAMICROOT \
240     EXAMPLES \
241     FORTH \
242     FP_LIBC \
243     GAMES \
244     GCOV \
245     GDB \
246     GNU \
247     GPIB \
248     GROFF \
249     HTML \
250     INET6 \
251     INFO \
252     IPFILTER \
253     IPX \
254     KERBEROS \
255     LIB32 \
256     LIBPTHREAD \
257     LIBTHR \
258     LOCALES \
259     LPR \
260     MAILWRAPPER \
261     NETCAT \
262     NIS \
263     NLS \
264     NLS_CATALOGS \
265     NS_CACHING \
266     OBJC \
267     OPENSSH \
268     OPENSSL \
269     PAM \
270     PF \
271     RCMDS \
272     RCS \
273     RESCUE \
274     SENDMAIL \
275     SETUID_LOGIN \
276     SHAREDOCS \
277     SYSCONS \
278     TCSH \
279     TOOLCHAIN \
280     USB \
281     WPA_SUPPLICANT_EAPOL
282 .if defined(NO_${var})
283 #.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
284 WITHOUT_${var}=
285 .endif
286 .endfor
287 .endif # !defined(BURN_BRIDGES)
288
289 #
290 # Older-style variables that enabled behaviour when set.
291 #
292 .if defined(YES_HESIOD)
293 WITH_HESIOD=
294 .endif
295 .if defined(MAKE_IDEA)
296 WITH_IDEA=
297 .endif
298
299 #
300 # MK_* options which default to "yes".
301 #
302 .for var in \
303     ACCT \
304     ACPI \
305     AMD \
306     APM \
307     ASSERT_DEBUG \
308     AT \
309     ATM \
310     AUDIT \
311     AUTHPF \
312     BIND \
313     BIND_DNSSEC \
314     BIND_ETC \
315     BIND_LIBS_LWRES \
316     BIND_MTREE \
317     BIND_NAMED \
318     BIND_UTILS \
319     BINUTILS \
320     BLUETOOTH \
321     BOOT \
322     BSD_CPIO \
323     BSNMP \
324     BZIP2 \
325     CALENDAR \
326     CDDL \
327     CPP \
328     CRYPT \
329     CTM \
330     CVS \
331     CXX \
332     DICT \
333     DYNAMICROOT \
334     EXAMPLES \
335     FLOPPY \
336     FORTH \
337     FP_LIBC \
338     FREEBSD_UPDATE \
339     GAMES \
340     GCC \
341     GCOV \
342     GDB \
343     GNU \
344     GNU_GREP \
345     GPIB \
346     GROFF \
347     HTML \
348     INET \
349     INET6 \
350     INFO \
351     INSTALLLIB \
352     IPFILTER \
353     IPFW \
354     IPX \
355     JAIL \
356     KERBEROS \
357     KVM \
358     LEGACY_CONSOLE \
359     LIB32 \
360     LIBPTHREAD \
361     LIBTHR \
362     LOCALES \
363     LOCATE \
364     LPR \
365     MAIL \
366     MAILWRAPPER \
367     MAKE \
368     MAN \
369     NCP \
370     NDIS \
371     NETCAT \
372     NETGRAPH \
373     NIS \
374     NLS \
375     NLS_CATALOGS \
376     NS_CACHING \
377     NTP \
378     OBJC \
379     OPENSSH \
380     OPENSSL \
381     PAM \
382     PF \
383     PKGTOOLS \
384     PMC \
385     PORTSNAP \
386     PPP \
387     PROFILE \
388     QUOTAS \
389     RCMDS \
390     RCS \
391     RESCUE \
392     ROUTED \
393     SENDMAIL \
394     SETUID_LOGIN \
395     SHAREDOCS \
396     SSP \
397     SYSINSTALL \
398     SYMVER \
399     SYSCONS \
400     TCSH \
401     TELNET \
402     TEXTPROC \
403     TOOLCHAIN \
404     USB \
405     WIRELESS \
406     WPA_SUPPLICANT_EAPOL \
407     ZFS \
408     ZONEINFO
409 .if defined(WITH_${var}) && defined(WITHOUT_${var})
410 .error WITH_${var} and WITHOUT_${var} can't both be set.
411 .endif
412 .if defined(MK_${var})
413 .error MK_${var} can't be set by a user.
414 .endif
415 .if defined(WITHOUT_${var})
416 MK_${var}:=     no
417 .else
418 MK_${var}:=     yes
419 .endif
420 .endfor
421
422 #
423 # MK_* options which default to "no".
424 #
425 .for var in \
426     BIND_IDN \
427     BIND_LARGE_FILE \
428     BIND_LIBS \
429     BIND_SIGCHASE \
430     BIND_XML \
431     CTF \
432     HESIOD \
433     IDEA
434 .if defined(WITH_${var}) && defined(WITHOUT_${var})
435 .error WITH_${var} and WITHOUT_${var} can't both be set.
436 .endif
437 .if defined(MK_${var})
438 .error MK_${var} can't be set by a user.
439 .endif
440 .if defined(WITH_${var})
441 MK_${var}:=     yes
442 .else
443 MK_${var}:=     no
444 .endif
445 .endfor
446
447 #
448 # Force some options off if their dependencies are off.
449 # Order is somewhat important.
450 #
451 .if ${MK_LIBPTHREAD} == "no"
452 MK_LIBTHR:=     no
453 .endif
454
455 .if ${MK_LIBTHR} == "no"
456 MK_BIND:=       no
457 .endif
458
459 .if ${MK_BIND} == "no"
460 MK_BIND_DNSSEC:= no
461 MK_BIND_ETC:=   no
462 MK_BIND_LIBS:=  no
463 MK_BIND_LIBS_LWRES:= no
464 MK_BIND_MTREE:= no
465 MK_BIND_NAMED:= no
466 MK_BIND_UTILS:= no
467 .endif
468
469 .if ${MK_BIND_MTREE} == "no"
470 MK_BIND_ETC:=   no
471 .endif
472
473 .if ${MK_CDDL} == "no"
474 MK_ZFS:=        no
475 MK_CTF:=        no
476 .endif
477
478 .if ${MK_CRYPT} == "no"
479 MK_OPENSSL:=    no
480 MK_OPENSSH:=    no
481 MK_KERBEROS:=   no
482 .endif
483
484 .if ${MK_IPX} == "no"
485 MK_NCP:=        no
486 .endif
487
488 .if ${MK_MAIL} == "no"
489 MK_MAILWRAPPER:= no
490 MK_SENDMAIL:=   no
491 .endif
492
493 .if ${MK_NETGRAPH} == "no"
494 MK_ATM:=        no
495 MK_BLUETOOTH:=  no
496 .endif
497
498 .if ${MK_OPENSSL} == "no"
499 MK_OPENSSH:=    no
500 MK_KERBEROS:=   no
501 .endif
502
503 .if ${MK_PF} == "no"
504 MK_AUTHPF:=     no
505 .endif
506
507 .if ${MK_TEXTPROC} == "no"
508 MK_GROFF:=      no
509 .endif
510
511 .if ${MK_TOOLCHAIN} == "no"
512 MK_BINUTILS:=   no
513 MK_GCC:=        no
514 MK_GDB:=        no
515 .endif
516
517 #
518 # Set defaults for the MK_*_SUPPORT variables.
519 #
520
521 #
522 # MK_*_SUPPORT options which default to "yes" unless their corresponding
523 # MK_* variable is set to "no".
524 #
525 .for var in \
526     BZIP2 \
527     GNU \
528     INET \
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"
543 MK_${var}_SUPPORT:= no
544 .else
545 MK_${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})
562 MK_${vv:H}:=    yes
563 .elif defined(WITHOUT_${vv:H})
564 MK_${vv:H}:=    no
565 .else
566 MK_${vv:H}:=    ${MK_${vv:T}}
567 .endif
568 .endfor
569
570 .if ${MK_CTF} != "no"
571 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
572 .elif ${MAKE_VERSION} >= 5201111300
573 CTFCONVERT_CMD=
574 .else
575 CTFCONVERT_CMD= @:
576 .endif 
577
578 .endif # !_WITHOUT_SRCCONF
579
580 .endif  # !target(__<bsd.own.mk>__)