]> CyberLeo.Net >> Repos - FreeBSD/stable/9.git/blob - share/mk/bsd.own.mk
Undo accidental MFC of GPL_DTC in r252827
[FreeBSD/stable/9.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     LIBCPLUSPLUS \
451     NMTREE \
452     OFED \
453     OPENSSH_NONE_CIPHER \
454     SHARED_TOOLCHAIN
455
456 #
457 # Default behaviour of some options depends on the architecture.  Unfortunately
458 # this means that we have to test TARGET_ARCH (the buildworld case) as well
459 # as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
460 # used at all in bsd.*.mk, but we have to make an exception here if we want
461 # to allow defaults for some things like clang and fdt to vary by target
462 # architecture.
463 #
464 .if defined(TARGET_ARCH)
465 __T=${TARGET_ARCH}
466 .else
467 __T=${MACHINE_ARCH}
468 .endif
469 # Clang is only for x86 and powerpc right now, by default.
470 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
471 __DEFAULT_YES_OPTIONS+=CLANG CLANG_FULL
472 .else
473 __DEFAULT_NO_OPTIONS+=CLANG CLANG_FULL
474 .endif
475 # FDT is needed only for arm and powerpc
476 .if ${__T:Marm*} || ${__T:Mpowerpc*}
477 __DEFAULT_YES_OPTIONS+=FDT
478 .else
479 __DEFAULT_NO_OPTIONS+=FDT
480 .endif
481 .undef __T
482
483 #
484 # MK_* options which default to "yes".
485 #
486 .for var in ${__DEFAULT_YES_OPTIONS}
487 .if defined(WITH_${var}) && defined(WITHOUT_${var})
488 .error WITH_${var} and WITHOUT_${var} can't both be set.
489 .endif
490 .if defined(MK_${var})
491 .error MK_${var} can't be set by a user.
492 .endif
493 .if defined(WITHOUT_${var})
494 MK_${var}:=     no
495 .else
496 MK_${var}:=     yes
497 .endif
498 .endfor
499 .undef __DEFAULT_YES_OPTIONS
500
501 #
502 # MK_* options which default to "no".
503 #
504 .for var in ${__DEFAULT_NO_OPTIONS}
505 .if defined(WITH_${var}) && defined(WITHOUT_${var})
506 .error WITH_${var} and WITHOUT_${var} can't both be set.
507 .endif
508 .if defined(MK_${var})
509 .error MK_${var} can't be set by a user.
510 .endif
511 .if defined(WITH_${var})
512 MK_${var}:=     yes
513 .else
514 MK_${var}:=     no
515 .endif
516 .endfor
517 .undef __DEFAULT_NO_OPTIONS
518
519 #
520 # Force some options off if their dependencies are off.
521 # Order is somewhat important.
522 #
523 .if ${MK_LIBPTHREAD} == "no"
524 MK_LIBTHR:=     no
525 .endif
526
527 .if ${MK_LIBTHR} == "no"
528 MK_BIND:=       no
529 .endif
530
531 .if ${MK_BIND} == "no"
532 MK_BIND_DNSSEC:= no
533 MK_BIND_ETC:=   no
534 MK_BIND_LIBS:=  no
535 MK_BIND_LIBS_LWRES:= no
536 MK_BIND_MTREE:= no
537 MK_BIND_NAMED:= no
538 MK_BIND_UTILS:= no
539 .endif
540
541 .if ${MK_BIND_MTREE} == "no"
542 MK_BIND_ETC:=   no
543 .endif
544
545 .if ${MK_SOURCELESS} == "no"
546 MK_SOURCELESS_HOST:=    no
547 MK_SOURCELESS_UCODE:= no
548 .endif
549
550 .if ${MK_CDDL} == "no"
551 MK_ZFS:=        no
552 MK_CTF:=        no
553 .endif
554
555 .if ${MK_CRYPT} == "no"
556 MK_OPENSSL:=    no
557 MK_OPENSSH:=    no
558 MK_KERBEROS:=   no
559 .endif
560
561 .if ${MK_CXX} == "no"
562 MK_CLANG:=      no
563 MK_GROFF:=      no
564 .endif
565
566 .if ${MK_IPX} == "no"
567 MK_NCP:=        no
568 .endif
569
570 .if ${MK_MAIL} == "no"
571 MK_MAILWRAPPER:= no
572 MK_SENDMAIL:=   no
573 .endif
574
575 .if ${MK_NETGRAPH} == "no"
576 MK_ATM:=        no
577 MK_BLUETOOTH:=  no
578 .endif
579
580 .if ${MK_OPENSSL} == "no"
581 MK_OPENSSH:=    no
582 MK_KERBEROS:=   no
583 .endif
584
585 .if ${MK_PF} == "no"
586 MK_AUTHPF:=     no
587 .endif
588
589 .if ${MK_TEXTPROC} == "no"
590 MK_GROFF:=      no
591 .endif
592
593 .if ${MK_TOOLCHAIN} == "no"
594 MK_BINUTILS:=   no
595 MK_CLANG:=      no
596 MK_GCC:=        no
597 MK_GDB:=        no
598 .endif
599
600 .if ${MK_CLANG} == "no"
601 MK_CLANG_EXTRAS:= no
602 MK_CLANG_FULL:= no
603 MK_CLANG_IS_CC:= no
604 .endif
605
606 MK_LIBCPLUSPLUS?= no
607
608 MK_LIBCPLUSPLUS?= no
609
610 #
611 # Set defaults for the MK_*_SUPPORT variables.
612 #
613
614 #
615 # MK_*_SUPPORT options which default to "yes" unless their corresponding
616 # MK_* variable is set to "no".
617 #
618 .for var in \
619     BZIP2 \
620     GNU \
621     INET \
622     INET6 \
623     IPX \
624     KERBEROS \
625     KVM \
626     NETGRAPH \
627     PAM \
628     WIRELESS
629 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
630 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
631 .endif
632 .if defined(MK_${var}_SUPPORT)
633 .error MK_${var}_SUPPORT can't be set by a user.
634 .endif
635 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
636 MK_${var}_SUPPORT:= no
637 .else
638 MK_${var}_SUPPORT:= yes
639 .endif
640 .endfor
641
642 #
643 # MK_* options whose default value depends on another option.
644 #
645 .for vv in \
646     GSSAPI/KERBEROS \
647     MAN_UTILS/MAN
648 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
649 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
650 .endif
651 .if defined(MK_${vv:H})
652 .error MK_${vv:H} can't be set by a user.
653 .endif
654 .if defined(WITH_${vv:H})
655 MK_${vv:H}:=    yes
656 .elif defined(WITHOUT_${vv:H})
657 MK_${vv:H}:=    no
658 .else
659 MK_${vv:H}:=    ${MK_${vv:T}}
660 .endif
661 .endfor
662
663 .if ${MK_CTF} != "no"
664 CTFCONVERT_CMD= ${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
665 .elif defined(.PARSEDIR) || ${MAKE_VERSION} >= 9201210220
666 CTFCONVERT_CMD=
667 .else
668 CTFCONVERT_CMD= @:
669 .endif 
670
671 .endif # !_WITHOUT_SRCCONF
672
673 .endif  # !target(__<bsd.own.mk>__)