]> CyberLeo.Net >> Repos - FreeBSD/releng/9.1.git/blob - share/mk/bsd.own.mk
MFC r238935,238960:
[FreeBSD/releng/9.1.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     INSTALLLIB \
207     MAN \
208     PROFILE
209 .if defined(NO_${var})
210 WITHOUT_${var}=
211 .endif
212 .endfor
213
214 #
215 # Compat NO_* options (same as above, except their use is deprecated).
216 #
217 .if !defined(BURN_BRIDGES)
218 .for var in \
219     ACPI \
220     ATM \
221     AUDIT \
222     AUTHPF \
223     BIND \
224     BIND_DNSSEC \
225     BIND_ETC \
226     BIND_LIBS_LWRES \
227     BIND_MTREE \
228     BIND_NAMED \
229     BIND_UTILS \
230     BLUETOOTH \
231     BOOT \
232     CALENDAR \
233     CPP \
234     CRYPT \
235     CVS \
236     CXX \
237     DICT \
238     DYNAMICROOT \
239     EXAMPLES \
240     FORTH \
241     FP_LIBC \
242     GAMES \
243     GCOV \
244     GDB \
245     GNU \
246     GPIB \
247     GROFF \
248     HTML \
249     INET6 \
250     INFO \
251     IPFILTER \
252     IPX \
253     KERBEROS \
254     LIB32 \
255     LIBPTHREAD \
256     LIBTHR \
257     LOCALES \
258     LPR \
259     MAILWRAPPER \
260     NETCAT \
261     NIS \
262     NLS \
263     NLS_CATALOGS \
264     NS_CACHING \
265     OPENSSH \
266     OPENSSL \
267     PAM \
268     PF \
269     RCMDS \
270     RCS \
271     RESCUE \
272     SENDMAIL \
273     SETUID_LOGIN \
274     SHAREDOCS \
275     SYSCONS \
276     TCSH \
277     TOOLCHAIN \
278     USB \
279     WPA_SUPPLICANT_EAPOL
280 .if defined(NO_${var})
281 #.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
282 WITHOUT_${var}=
283 .endif
284 .endfor
285 .endif # !defined(BURN_BRIDGES)
286
287 #
288 # Older-style variables that enabled behaviour when set.
289 #
290 .if defined(YES_HESIOD)
291 WITH_HESIOD=
292 .endif
293 .if defined(MAKE_IDEA)
294 WITH_IDEA=
295 .endif
296
297 __DEFAULT_YES_OPTIONS = \
298     ACCT \
299     ACPI \
300     AMD \
301     APM \
302     ASSERT_DEBUG \
303     AT \
304     ATM \
305     AUDIT \
306     AUTHPF \
307     BIND \
308     BIND_DNSSEC \
309     BIND_ETC \
310     BIND_LIBS_LWRES \
311     BIND_MTREE \
312     BIND_NAMED \
313     BIND_UTILS \
314     BINUTILS \
315     BLUETOOTH \
316     BOOT \
317     BSD_CPIO \
318     BSNMP \
319     SOURCELESS \
320     SOURCELESS_HOST \
321     SOURCELESS_UCODE \
322     BZIP2 \
323     CALENDAR \
324     CDDL \
325     CPP \
326     CRYPT \
327     CTM \
328     CVS \
329     CXX \
330     DICT \
331     DYNAMICROOT \
332     EXAMPLES \
333     FLOPPY \
334     FORTH \
335     FP_LIBC \
336     FREEBSD_UPDATE \
337     GAMES \
338     GCC \
339     GCOV \
340     GDB \
341     GNU \
342     GPIB \
343     GPIO \
344     GROFF \
345     HTML \
346     INET \
347     INET6 \
348     INFO \
349     INSTALLLIB \
350     IPFILTER \
351     IPFW \
352     IPX \
353     JAIL \
354     KERBEROS \
355     KERNEL_SYMBOLS \
356     KVM \
357     LEGACY_CONSOLE \
358     LIB32 \
359     LIBPTHREAD \
360     LIBTHR \
361     LOCALES \
362     LOCATE \
363     LPR \
364     MAIL \
365     MAILWRAPPER \
366     MAKE \
367     MAN \
368     NCP \
369     NDIS \
370     NETCAT \
371     NETGRAPH \
372     NIS \
373     NLS \
374     NLS_CATALOGS \
375     NS_CACHING \
376     NTP \
377     OPENSSH \
378     OPENSSL \
379     PAM \
380     PF \
381     PKGTOOLS \
382     PMC \
383     PORTSNAP \
384     PPP \
385     PROFILE \
386     QUOTAS \
387     RCMDS \
388     RCS \
389     RESCUE \
390     ROUTED \
391     SENDMAIL \
392     SETUID_LOGIN \
393     SHAREDOCS \
394     SSP \
395     SYSINSTALL \
396     SYMVER \
397     SYSCONS \
398     TCSH \
399     TELNET \
400     TEXTPROC \
401     TOOLCHAIN \
402     USB \
403     UTMPX \
404     WIRELESS \
405     WPA_SUPPLICANT_EAPOL \
406     ZFS \
407     ZONEINFO
408
409 __DEFAULT_NO_OPTIONS = \
410     BSD_GREP \
411     BIND_IDN \
412     BIND_LARGE_FILE \
413     BIND_LIBS \
414     BIND_SIGCHASE \
415     BIND_XML \
416     CLANG_EXTRAS \
417     CLANG_IS_CC \
418     HESIOD \
419     ICONV \
420     IDEA \
421     LIBCPLUSPLUS \
422     OFED \
423     SHARED_TOOLCHAIN
424
425 #
426 # Default behaviour of some options depends on the architecture.  Unfortunately
427 # this means that we have to test TARGET_ARCH (the buildworld case) as well
428 # as MACHINE_ARCH (the non-buildworld case).  Normally TARGET_ARCH is not
429 # used at all in bsd.*.mk, but we have to make an exception here if we want
430 # to allow defaults for some things like clang and fdt to vary by target
431 # architecture.
432 #
433 .if defined(TARGET_ARCH)
434 __T=${TARGET_ARCH}
435 .else
436 __T=${MACHINE_ARCH}
437 .endif
438 # Clang is only for x86 and powerpc right now, by default.
439 .if ${__T} == "amd64" || ${__T} == "i386" || ${__T:Mpowerpc*}
440 __DEFAULT_YES_OPTIONS+=CLANG
441 .else
442 __DEFAULT_NO_OPTIONS+=CLANG
443 .endif
444 # FDT is needed only for arm and powerpc
445 .if ${__T:Marm*} || ${__T:Mpowerpc*}
446 __DEFAULT_YES_OPTIONS+=FDT
447 .else
448 __DEFAULT_NO_OPTIONS+=FDT
449 .endif
450 .undef __T
451
452 #
453 # MK_* options which default to "yes".
454 #
455 .for var in ${__DEFAULT_YES_OPTIONS}
456 .if defined(WITH_${var}) && defined(WITHOUT_${var})
457 .error WITH_${var} and WITHOUT_${var} can't both be set.
458 .endif
459 .if defined(MK_${var})
460 .error MK_${var} can't be set by a user.
461 .endif
462 .if defined(WITHOUT_${var})
463 MK_${var}:=     no
464 .else
465 MK_${var}:=     yes
466 .endif
467 .endfor
468 .undef __DEFAULT_YES_OPTIONS
469
470 #
471 # MK_* options which default to "no".
472 #
473 .for var in ${__DEFAULT_NO_OPTIONS}
474 .if defined(WITH_${var}) && defined(WITHOUT_${var})
475 .error WITH_${var} and WITHOUT_${var} can't both be set.
476 .endif
477 .if defined(MK_${var})
478 .error MK_${var} can't be set by a user.
479 .endif
480 .if defined(WITH_${var})
481 MK_${var}:=     yes
482 .else
483 MK_${var}:=     no
484 .endif
485 .endfor
486 .undef __DEFAULT_NO_OPTIONS
487
488 #
489 # Force some options off if their dependencies are off.
490 # Order is somewhat important.
491 #
492 .if ${MK_LIBPTHREAD} == "no"
493 MK_LIBTHR:=     no
494 .endif
495
496 .if ${MK_LIBTHR} == "no"
497 MK_BIND:=       no
498 .endif
499
500 .if ${MK_BIND} == "no"
501 MK_BIND_DNSSEC:= no
502 MK_BIND_ETC:=   no
503 MK_BIND_LIBS:=  no
504 MK_BIND_LIBS_LWRES:= no
505 MK_BIND_MTREE:= no
506 MK_BIND_NAMED:= no
507 MK_BIND_UTILS:= no
508 .endif
509
510 .if ${MK_BIND_MTREE} == "no"
511 MK_BIND_ETC:=   no
512 .endif
513
514 .if ${MK_SOURCELESS} == "no"
515 MK_SOURCELESS_HOST:=    no
516 MK_SOURCELESS_UCODE:= no
517 .endif
518
519 .if ${MK_CDDL} == "no"
520 MK_ZFS:=        no
521 .endif
522
523 .if ${MK_CLANG} == "no"
524 MK_CLANG_EXTRAS:= no
525 .endif
526
527 .if ${MK_CRYPT} == "no"
528 MK_OPENSSL:=    no
529 MK_OPENSSH:=    no
530 MK_KERBEROS:=   no
531 .endif
532
533 .if ${MK_CXX} == "no"
534 MK_CLANG:=      no
535 MK_GROFF:=      no
536 .endif
537
538 .if ${MK_IPX} == "no"
539 MK_NCP:=        no
540 .endif
541
542 .if ${MK_MAIL} == "no"
543 MK_MAILWRAPPER:= no
544 MK_SENDMAIL:=   no
545 .endif
546
547 .if ${MK_NETGRAPH} == "no"
548 MK_ATM:=        no
549 MK_BLUETOOTH:=  no
550 .endif
551
552 .if ${MK_OPENSSL} == "no"
553 MK_OPENSSH:=    no
554 MK_KERBEROS:=   no
555 .endif
556
557 .if ${MK_PF} == "no"
558 MK_AUTHPF:=     no
559 .endif
560
561 .if ${MK_TEXTPROC} == "no"
562 MK_GROFF:=      no
563 .endif
564
565 .if ${MK_TOOLCHAIN} == "no"
566 MK_BINUTILS:=   no
567 MK_CLANG:=      no
568 MK_GCC:=        no
569 MK_GDB:=        no
570 .endif
571
572 .if ${MK_CLANG} == "no"
573 MK_CLANG_IS_CC:= no
574 .endif
575
576 MK_LIBCPLUSPLUS?= no
577
578 MK_LIBCPLUSPLUS?= no
579
580 #
581 # Set defaults for the MK_*_SUPPORT variables.
582 #
583
584 #
585 # MK_*_SUPPORT options which default to "yes" unless their corresponding
586 # MK_* variable is set to "no".
587 #
588 .for var in \
589     BZIP2 \
590     GNU \
591     INET \
592     INET6 \
593     IPX \
594     KERBEROS \
595     KVM \
596     NETGRAPH \
597     PAM \
598     WIRELESS
599 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
600 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
601 .endif
602 .if defined(MK_${var}_SUPPORT)
603 .error MK_${var}_SUPPORT can't be set by a user.
604 .endif
605 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
606 MK_${var}_SUPPORT:= no
607 .else
608 MK_${var}_SUPPORT:= yes
609 .endif
610 .endfor
611
612 #
613 # MK_* options whose default value depends on another option.
614 #
615 .for vv in \
616     GSSAPI/KERBEROS \
617     MAN_UTILS/MAN
618 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
619 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
620 .endif
621 .if defined(MK_${vv:H})
622 .error MK_${vv:H} can't be set by a user.
623 .endif
624 .if defined(WITH_${vv:H})
625 MK_${vv:H}:=    yes
626 .elif defined(WITHOUT_${vv:H})
627 MK_${vv:H}:=    no
628 .else
629 MK_${vv:H}:=    ${MK_${vv:T}}
630 .endif
631 .endfor
632
633 .endif # !_WITHOUT_SRCCONF
634
635 .endif  # !target(__<bsd.own.mk>__)