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