]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - share/mk/bsd.own.mk
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.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 # DEBUGDIR      Base path for standalone debug files. [/usr/lib/debug]
47 #
48 # DEBUGMODE     Mode for debug files. [${NOBINMODE}]
49 #
50 #
51 # KMODDIR       Base path for loadable kernel modules
52 #               (see kld(4)). [/boot/kernel]
53 #
54 # KMODOWN       Kernel and KLD owner. [${BINOWN}]
55 #
56 # KMODGRP       Kernel and KLD group. [${BINGRP}]
57 #
58 # KMODMODE      KLD mode. [${BINMODE}]
59 #
60 #
61 # SHAREDIR      Base path for architecture-independent ascii
62 #               text files. [/usr/share]
63 #
64 # SHAREOWN      ASCII text file owner. [root]
65 #
66 # SHAREGRP      ASCII text file group. [wheel]
67 #
68 # SHAREMODE     ASCII text file mode. [${NOBINMODE}]
69 #
70 #
71 # CONFDIR       Base path for configuration files. [/etc]
72 #
73 # CONFOWN       Configuration file owner. [root]
74 #
75 # CONFGRP       Configuration file group. [wheel]
76 #
77 # CONFMODE      Configuration file mode. [644]
78 #
79 #
80 # DOCDIR        Base path for system documentation (e.g. PSD, USD,
81 #               handbook, FAQ etc.). [${SHAREDIR}/doc]
82 #
83 # DOCOWN        Documentation owner. [${SHAREOWN}]
84 #
85 # DOCGRP        Documentation group. [${SHAREGRP}]
86 #
87 # DOCMODE       Documentation mode. [${NOBINMODE}]
88 #
89 #
90 # INFODIR       Base path for GNU's hypertext system
91 #               called Info (see info(1)). [${SHAREDIR}/info]
92 #
93 # INFOOWN       Info owner. [${SHAREOWN}]
94 #
95 # INFOGRP       Info group. [${SHAREGRP}]
96 #
97 # INFOMODE      Info mode. [${NOBINMODE}]
98 #
99 #
100 # MANDIR        Base path for manual installation. [${SHAREDIR}/man/man]
101 #
102 # MANOWN        Manual owner. [${SHAREOWN}]
103 #
104 # MANGRP        Manual group. [${SHAREGRP}]
105 #
106 # MANMODE       Manual mode. [${NOBINMODE}]
107 #
108 #
109 # NLSDIR        Base path for National Language Support files
110 #               installation. [${SHAREDIR}/nls]
111 #
112 # NLSOWN        National Language Support files owner. [${SHAREOWN}]
113 #
114 # NLSGRP        National Language Support files group. [${SHAREGRP}]
115 #
116 # NLSMODE       National Language Support files mode. [${NOBINMODE}]
117 #
118 # INCLUDEDIR    Base path for standard C include files [/usr/include]
119
120 .if !target(__<bsd.own.mk>__)
121 __<bsd.own.mk>__:
122
123 .if !defined(_WITHOUT_SRCCONF)
124 SRCCONF?=       /etc/src.conf
125 .if exists(${SRCCONF})
126 .include "${SRCCONF}"
127 .endif
128 .endif
129
130 # Binaries
131 BINOWN?=        root
132 BINGRP?=        wheel
133 BINMODE?=       555
134 NOBINMODE?=     444
135
136 .if defined(MODULES_WITH_WORLD)
137 KMODDIR?=       /boot/modules
138 .else
139 KMODDIR?=       /boot/kernel
140 .endif
141 KMODOWN?=       ${BINOWN}
142 KMODGRP?=       ${BINGRP}
143 KMODMODE?=      ${BINMODE}
144
145 LIBDIR?=        /usr/lib
146 LIBCOMPATDIR?=  /usr/lib/compat
147 LIBDATADIR?=    /usr/libdata
148 LIBEXECDIR?=    /usr/libexec
149 LINTLIBDIR?=    /usr/libdata/lint
150 SHLIBDIR?=      ${LIBDIR}
151 LIBOWN?=        ${BINOWN}
152 LIBGRP?=        ${BINGRP}
153 LIBMODE?=       ${NOBINMODE}
154
155 DEBUGDIR?=      /usr/lib/debug
156 DEBUGMODE?=     ${NOBINMODE}
157
158
159 # Share files
160 SHAREDIR?=      /usr/share
161 SHAREOWN?=      root
162 SHAREGRP?=      wheel
163 SHAREMODE?=     ${NOBINMODE}
164
165 CONFDIR?=       /etc
166 CONFOWN?=       root
167 CONFGRP?=       wheel
168 CONFMODE?=      644
169
170 MANDIR?=        ${SHAREDIR}/man/man
171 MANOWN?=        ${SHAREOWN}
172 MANGRP?=        ${SHAREGRP}
173 MANMODE?=       ${NOBINMODE}
174
175 DOCDIR?=        ${SHAREDIR}/doc
176 DOCOWN?=        ${SHAREOWN}
177 DOCGRP?=        ${SHAREGRP}
178 DOCMODE?=       ${NOBINMODE}
179
180 INFODIR?=       ${SHAREDIR}/info
181 INFOOWN?=       ${SHAREOWN}
182 INFOGRP?=       ${SHAREGRP}
183 INFOMODE?=      ${NOBINMODE}
184
185 NLSDIR?=        ${SHAREDIR}/nls
186 NLSOWN?=        ${SHAREOWN}
187 NLSGRP?=        ${SHAREGRP}
188 NLSMODE?=       ${NOBINMODE}
189
190 INCLUDEDIR?=    /usr/include
191
192 #
193 # install(1) parameters.
194 #
195 HRDLINK?=       -l h
196 SYMLINK?=       -l s
197
198 INSTALL_LINK?=          ${INSTALL} ${HRDLINK}
199 INSTALL_SYMLINK?=       ${INSTALL} ${SYMLINK}
200
201 # Common variables
202 .if !defined(DEBUG_FLAGS)
203 STRIP?=         -s
204 .endif
205
206 COMPRESS_CMD?=  gzip -cn
207 COMPRESS_EXT?=  .gz
208
209 .if !defined(_WITHOUT_SRCCONF)
210 #
211 # Define MK_* variables (which are either "yes" or "no") for users
212 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
213 # make(1) environment.
214 # These should be tested with `== "no"' or `!= "no"' in makefiles.
215 # The NO_* variables should only be set by makefiles.
216 #
217
218 #
219 # Supported NO_* options (if defined, MK_* will be forced to "no",
220 # regardless of user's setting).
221 #
222 .for var in \
223     CTF \
224     DEBUG_FILES \
225     INSTALLLIB \
226     MAN \
227     PROFILE
228 .if defined(NO_${var})
229 .if defined(WITH_${var})
230 .warning unsetting WITH_${var}
231 .undef WITH_${var}
232 .if defined(WITH_${var})
233 .error wtf
234 .endif
235 .endif
236 WITHOUT_${var}=
237 .endif
238 .endfor
239
240 #
241 # Compat NO_* options (same as above, except their use is deprecated).
242 #
243 .if !defined(BURN_BRIDGES)
244 .for var in \
245     ACPI \
246     ATM \
247     AUDIT \
248     AUTHPF \
249     BIND \
250     BIND_DNSSEC \
251     BIND_ETC \
252     BIND_LIBS_LWRES \
253     BIND_MTREE \
254     BIND_NAMED \
255     BIND_UTILS \
256     BLUETOOTH \
257     BOOT \
258     CALENDAR \
259     CPP \
260     CRYPT \
261     CVS \
262     CXX \
263     DICT \
264     DYNAMICROOT \
265     EXAMPLES \
266     FORTH \
267     FP_LIBC \
268     GAMES \
269     GCOV \
270     GDB \
271     GNU \
272     GPIB \
273     GROFF \
274     HTML \
275     INET6 \
276     INFO \
277     IPFILTER \
278     IPX \
279     KERBEROS \
280     LIB32 \
281     LIBPTHREAD \
282     LIBTHR \
283     LOCALES \
284     LPR \
285     MAILWRAPPER \
286     NETCAT \
287     NIS \
288     NLS \
289     NLS_CATALOGS \
290     NS_CACHING \
291     OPENSSH \
292     OPENSSL \
293     PAM \
294     PF \
295     RCMDS \
296     RCS \
297     RESCUE \
298     SENDMAIL \
299     SETUID_LOGIN \
300     SHAREDOCS \
301     SYSCONS \
302     TCSH \
303     TOOLCHAIN \
304     USB \
305     WPA_SUPPLICANT_EAPOL
306 .if defined(NO_${var})
307 #.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
308 WITHOUT_${var}=
309 .endif
310 .endfor
311 .endif # !defined(BURN_BRIDGES)
312
313 #
314 # Older-style variables that enabled behaviour when set.
315 #
316 .if defined(YES_HESIOD)
317 WITH_HESIOD=
318 .endif
319 .if defined(MAKE_IDEA)
320 WITH_IDEA=
321 .endif
322
323 __DEFAULT_YES_OPTIONS = \
324     ACCT \
325     ACPI \
326     AMD \
327     APM \
328     ASSERT_DEBUG \
329     AT \
330     ATM \
331     AUDIT \
332     AUTHPF \
333     BIND \
334     BIND_DNSSEC \
335     BIND_ETC \
336     BIND_LIBS_LWRES \
337     BIND_MTREE \
338     BIND_NAMED \
339     BIND_UTILS \
340     BINUTILS \
341     BLUETOOTH \
342     BOOT \
343     BSD_CPIO \
344     BSNMP \
345     SOURCELESS \
346     SOURCELESS_HOST \
347     SOURCELESS_UCODE \
348     BZIP2 \
349     CALENDAR \
350     CDDL \
351     CPP \
352     CRYPT \
353     CTM \
354     CVS \
355     CXX \
356     DICT \
357     DYNAMICROOT \
358     EXAMPLES \
359     FLOPPY \
360     FORTH \
361     FP_LIBC \
362     FREEBSD_UPDATE \
363     GAMES \
364     GCC \
365     GCOV \
366     GDB \
367     GNU \
368     GPIB \
369     GPIO \
370     GROFF \
371     HTML \
372     INET \
373     INET6 \
374     INFO \
375     INSTALLLIB \
376     IPFILTER \
377     IPFW \
378     IPX \
379     JAIL \
380     KERBEROS \
381     KERNEL_SYMBOLS \
382     KVM \
383     LEGACY_CONSOLE \
384     LIB32 \
385     LIBPTHREAD \
386     LIBTHR \
387     LOCALES \
388     LOCATE \
389     LPR \
390     MAIL \
391     MAILWRAPPER \
392     MAKE \
393     MAN \
394     NCP \
395     NDIS \
396     NETCAT \
397     NETGRAPH \
398     NIS \
399     NLS \
400     NLS_CATALOGS \
401     NS_CACHING \
402     NTP \
403     OPENSSH \
404     OPENSSL \
405     PAM \
406     PC_SYSINSTALL \
407     PF \
408     PKGTOOLS \
409     PMC \
410     PORTSNAP \
411     PPP \
412     PROFILE \
413     QUOTAS \
414     RCMDS \
415     RCS \
416     RESCUE \
417     ROUTED \
418     SENDMAIL \
419     SETUID_LOGIN \
420     SHAREDOCS \
421     SSP \
422     SYSINSTALL \
423     SYMVER \
424     SYSCONS \
425     TCSH \
426     TELNET \
427     TEXTPROC \
428     TOOLCHAIN \
429     USB \
430     UTMPX \
431     WIRELESS \
432     WPA_SUPPLICANT_EAPOL \
433     ZFS \
434     ZONEINFO
435
436 __DEFAULT_NO_OPTIONS = \
437     BSD_GREP \
438     BIND_IDN \
439     BIND_LARGE_FILE \
440     BIND_LIBS \
441     BIND_SIGCHASE \
442     BIND_XML \
443     CLANG_EXTRAS \
444     CLANG_IS_CC \
445     CTF \
446     DEBUG_FILES \
447     HESIOD \
448     ICONV \
449     IDEA \
450     NMTREE \
451     OFED \
452     OPENSSH_NONE_CIPHER \
453     SHARED_TOOLCHAIN
454
455 #
456 # Default behaviour of some options depends on the architecture.  Unfortunately
457 # this means that we have to test TARGET_ARCH (the buildworld case) as well
458 # as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
459 # used at all in bsd.*.mk, but we have to make an exception here if we want
460 # to allow defaults for some things like clang and fdt to vary by target
461 # architecture.
462 #
463 .if defined(TARGET_ARCH)
464 __T=${TARGET_ARCH}
465 .else
466 __T=${MACHINE_ARCH}
467 .endif
468 # Clang is only for x86 and powerpc right now, by default.
469 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
470 __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
471 .else
472 __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
473 .endif
474 # FDT is needed only for arm and powerpc
475 .if ${__T:Marm*} || ${__T:Mpowerpc*}
476 __DEFAULT_YES_OPTIONS+=FDT
477 .else
478 __DEFAULT_NO_OPTIONS+=FDT
479 .endif
480 .undef __T
481
482 #
483 # MK_* options which default to "yes".
484 #
485 .for var in ${__DEFAULT_YES_OPTIONS}
486 .if defined(WITH_${var}) && defined(WITHOUT_${var})
487 .error WITH_${var} and WITHOUT_${var} can't both be set.
488 .endif
489 .if defined(MK_${var})
490 .error MK_${var} can't be set by a user.
491 .endif
492 .if defined(WITHOUT_${var})
493 MK_${var}:=     no
494 .else
495 MK_${var}:=     yes
496 .endif
497 .endfor
498 .undef __DEFAULT_YES_OPTIONS
499
500 #
501 # MK_* options which default to "no".
502 #
503 .for var in ${__DEFAULT_NO_OPTIONS}
504 .if defined(WITH_${var}) && defined(WITHOUT_${var})
505 .error WITH_${var} and WITHOUT_${var} can't both be set.
506 .endif
507 .if defined(MK_${var})
508 .error MK_${var} can't be set by a user.
509 .endif
510 .if defined(WITH_${var})
511 MK_${var}:=     yes
512 .else
513 MK_${var}:=     no
514 .endif
515 .endfor
516 .undef __DEFAULT_NO_OPTIONS
517
518 #
519 # Force some options off if their dependencies are off.
520 # Order is somewhat important.
521 #
522 .if ${MK_LIBPTHREAD} == "no"
523 MK_LIBTHR:=     no
524 .endif
525
526 .if ${MK_LIBTHR} == "no"
527 MK_BIND:=       no
528 .endif
529
530 .if ${MK_BIND} == "no"
531 MK_BIND_DNSSEC:= no
532 MK_BIND_ETC:=   no
533 MK_BIND_LIBS:=  no
534 MK_BIND_LIBS_LWRES:= no
535 MK_BIND_MTREE:= no
536 MK_BIND_NAMED:= no
537 MK_BIND_UTILS:= no
538 .endif
539
540 .if ${MK_BIND_MTREE} == "no"
541 MK_BIND_ETC:=   no
542 .endif
543
544 .if ${MK_SOURCELESS} == "no"
545 MK_SOURCELESS_HOST:=    no
546 MK_SOURCELESS_UCODE:= no
547 .endif
548
549 .if ${MK_CDDL} == "no"
550 MK_ZFS:=        no
551 MK_CTF:=        no
552 .endif
553
554 .if ${MK_CRYPT} == "no"
555 MK_OPENSSL:=    no
556 MK_OPENSSH:=    no
557 MK_KERBEROS:=   no
558 .endif
559
560 .if ${MK_CXX} == "no"
561 MK_CLANG:=      no
562 MK_GROFF:=      no
563 .endif
564
565 .if ${MK_IPX} == "no"
566 MK_NCP:=        no
567 .endif
568
569 .if ${MK_MAIL} == "no"
570 MK_MAILWRAPPER:= no
571 MK_SENDMAIL:=   no
572 .endif
573
574 .if ${MK_NETGRAPH} == "no"
575 MK_ATM:=        no
576 MK_BLUETOOTH:=  no
577 .endif
578
579 .if ${MK_OPENSSL} == "no"
580 MK_OPENSSH:=    no
581 MK_KERBEROS:=   no
582 .endif
583
584 .if ${MK_PF} == "no"
585 MK_AUTHPF:=     no
586 .endif
587
588 .if ${MK_TEXTPROC} == "no"
589 MK_GROFF:=      no
590 .endif
591
592 .if ${MK_TOOLCHAIN} == "no"
593 MK_BINUTILS:=   no
594 MK_CLANG:=      no
595 MK_GCC:=        no
596 MK_GDB:=        no
597 .endif
598
599 .if ${MK_CLANG} == "no"
600 MK_CLANG_EXTRAS:= no
601 MK_CLANG_FULL:= no
602 MK_CLANG_IS_CC:= no
603 .endif
604
605 #
606 # Set defaults for the MK_*_SUPPORT variables.
607 #
608
609 #
610 # MK_*_SUPPORT options which default to "yes" unless their corresponding
611 # MK_* variable is set to "no".
612 #
613 .for var in \
614     BZIP2 \
615     GNU \
616     INET \
617     INET6 \
618     IPX \
619     KERBEROS \
620     KVM \
621     NETGRAPH \
622     PAM \
623     WIRELESS
624 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
625 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
626 .endif
627 .if defined(MK_${var}_SUPPORT)
628 .error MK_${var}_SUPPORT can't be set by a user.
629 .endif
630 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
631 MK_${var}_SUPPORT:= no
632 .else
633 MK_${var}_SUPPORT:= yes
634 .endif
635 .endfor
636
637 #
638 # MK_* options whose default value depends on another option.
639 #
640 .for vv in \
641     GSSAPI/KERBEROS \
642     MAN_UTILS/MAN
643 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
644 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
645 .endif
646 .if defined(MK_${vv:H})
647 .error MK_${vv:H} can't be set by a user.
648 .endif
649 .if defined(WITH_${vv:H})
650 MK_${vv:H}:=    yes
651 .elif defined(WITHOUT_${vv:H})
652 MK_${vv:H}:=    no
653 .else
654 MK_${vv:H}:=    ${MK_${vv:T}}
655 .endif
656 .endfor
657
658 #
659 # MK_* options that default to "yes" if the compiler is a C++11 compiler.
660 #
661 .include <bsd.compiler.mk>
662 .for var in \
663     LIBCPLUSPLUS
664 .if defined(WITH_${var}) && defined(WITHOUT_${var})
665 .error WITH_${var} and WITHOUT_${var} can't both be set.
666 .endif
667 .if defined(MK_${var})
668 .error MK_${var} can't be set by a user.
669 .endif
670 .if ${COMPILER_FEATURES:Mc++11}
671 .if defined(WITHOUT_${var})
672 MK_${var}:=     no
673 .else
674 MK_${var}:=     yes
675 .endif
676 .else
677 .if defined(WITH_${var})
678 MK_${var}:=     yes
679 .else
680 MK_${var}:=     no
681 .endif
682 .endif
683 .endfor
684
685 .if ${MK_CTF} != "no"
686 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
687 .elif defined(.PARSEDIR) || ${MAKE_VERSION} >= 9201210220
688 CTFCONVERT_CMD=
689 .else
690 CTFCONVERT_CMD= @:
691 .endif 
692
693 .endif # !_WITHOUT_SRCCONF
694
695 .endif  # !target(__<bsd.own.mk>__)