]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - share/mk/bsd.own.mk
Merge tcpdump-4.1.1.
[FreeBSD/FreeBSD.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 # LINTLIBDIR    Base path for lint libraries. [/usr/libdata/lint]
34 #
35 # SHLIBDIR      Base path for shared libraries. [${LIBDIR}]
36 #
37 # LIBOWN        Library owner. [${BINOWN}]
38 #
39 # LIBGRP        Library group. [${BINGRP}]
40 #
41 # LIBMODE       Library mode. [${NOBINMODE}]
42 #
43 #
44 # KMODDIR       Base path for loadable kernel modules
45 #               (see kld(4)). [/boot/kernel]
46 #
47 # KMODOWN       Kernel and KLD owner. [${BINOWN}]
48 #
49 # KMODGRP       Kernel and KLD group. [${BINGRP}]
50 #
51 # KMODMODE      KLD mode. [${BINMODE}]
52 #
53 #
54 # SHAREDIR      Base path for architecture-independent ascii
55 #               text files. [/usr/share]
56 #
57 # SHAREOWN      ASCII text file owner. [root]
58 #
59 # SHAREGRP      ASCII text file group. [wheel]
60 #
61 # SHAREMODE     ASCII text file mode. [${NOBINMODE}]
62 #
63 #
64 # DOCDIR        Base path for system documentation (e.g. PSD, USD,
65 #               handbook, FAQ etc.). [${SHAREDIR}/doc]
66 #
67 # DOCOWN        Documentation owner. [${SHAREOWN}]
68 #
69 # DOCGRP        Documentation group. [${SHAREGRP}]
70 #
71 # DOCMODE       Documentation mode. [${NOBINMODE}]
72 #
73 #
74 # INFODIR       Base path for GNU's hypertext system
75 #               called Info (see info(1)). [${SHAREDIR}/info]
76 #
77 # INFOOWN       Info owner. [${SHAREOWN}]
78 #
79 # INFOGRP       Info group. [${SHAREGRP}]
80 #
81 # INFOMODE      Info mode. [${NOBINMODE}]
82 #
83 #
84 # MANDIR        Base path for manual installation. [${SHAREDIR}/man/man]
85 #
86 # MANOWN        Manual owner. [${SHAREOWN}]
87 #
88 # MANGRP        Manual group. [${SHAREGRP}]
89 #
90 # MANMODE       Manual mode. [${NOBINMODE}]
91 #
92 #
93 # NLSDIR        Base path for National Language Support files
94 #               installation. [${SHAREDIR}/nls]
95 #
96 # NLSOWN        National Language Support files owner. [${SHAREOWN}]
97 #
98 # NLSGRP        National Language Support files group. [${SHAREGRP}]
99 #
100 # NLSMODE       National Language Support files mode. [${NOBINMODE}]
101 #
102 # INCLUDEDIR    Base path for standard C include files [/usr/include]
103
104 .if !target(__<bsd.own.mk>__)
105 __<bsd.own.mk>__:
106
107 .if !defined(_WITHOUT_SRCCONF)
108 SRCCONF?=       /etc/src.conf
109 .if exists(${SRCCONF})
110 .include "${SRCCONF}"
111 .endif
112 .endif
113
114 # Binaries
115 BINOWN?=        root
116 BINGRP?=        wheel
117 BINMODE?=       555
118 NOBINMODE?=     444
119
120 .if defined(MODULES_WITH_WORLD)
121 KMODDIR?=       /boot/modules
122 .else
123 KMODDIR?=       /boot/kernel
124 .endif
125 KMODOWN?=       ${BINOWN}
126 KMODGRP?=       ${BINGRP}
127 KMODMODE?=      ${BINMODE}
128
129 LIBDIR?=        /usr/lib
130 LIBCOMPATDIR?=  /usr/lib/compat
131 LIBDATADIR?=    /usr/libdata
132 LINTLIBDIR?=    /usr/libdata/lint
133 SHLIBDIR?=      ${LIBDIR}
134 LIBOWN?=        ${BINOWN}
135 LIBGRP?=        ${BINGRP}
136 LIBMODE?=       ${NOBINMODE}
137
138
139 # Share files
140 SHAREDIR?=      /usr/share
141 SHAREOWN?=      root
142 SHAREGRP?=      wheel
143 SHAREMODE?=     ${NOBINMODE}
144
145 MANDIR?=        ${SHAREDIR}/man/man
146 MANOWN?=        ${SHAREOWN}
147 MANGRP?=        ${SHAREGRP}
148 MANMODE?=       ${NOBINMODE}
149
150 DOCDIR?=        ${SHAREDIR}/doc
151 DOCOWN?=        ${SHAREOWN}
152 DOCGRP?=        ${SHAREGRP}
153 DOCMODE?=       ${NOBINMODE}
154
155 INFODIR?=       ${SHAREDIR}/info
156 INFOOWN?=       ${SHAREOWN}
157 INFOGRP?=       ${SHAREGRP}
158 INFOMODE?=      ${NOBINMODE}
159
160 NLSDIR?=        ${SHAREDIR}/nls
161 NLSOWN?=        ${SHAREOWN}
162 NLSGRP?=        ${SHAREGRP}
163 NLSMODE?=       ${NOBINMODE}
164
165 INCLUDEDIR?=    /usr/include
166
167 # Common variables
168 .if !defined(DEBUG_FLAGS)
169 STRIP?=         -s
170 .endif
171
172 COMPRESS_CMD?=  gzip -cn
173 COMPRESS_EXT?=  .gz
174
175 .if !defined(_WITHOUT_SRCCONF)
176 #
177 # Define MK_* variables (which are either "yes" or "no") for users
178 # to set via WITH_*/WITHOUT_* in /etc/src.conf and override in the
179 # make(1) environment.
180 # These should be tested with `== "no"' or `!= "no"' in makefiles.
181 # The NO_* variables should only be set by makefiles.
182 #
183
184 #
185 # Supported NO_* options (if defined, MK_* will be forced to "no",
186 # regardless of user's setting).
187 #
188 .for var in \
189     INSTALLLIB \
190     MAN \
191     PROFILE
192 .if defined(NO_${var})
193 WITHOUT_${var}=
194 .endif
195 .endfor
196
197 #
198 # Compat NO_* options (same as above, except their use is deprecated).
199 #
200 .if !defined(BURN_BRIDGES)
201 .for var in \
202     ACPI \
203     ATM \
204     AUDIT \
205     AUTHPF \
206     BIND \
207     BIND_DNSSEC \
208     BIND_ETC \
209     BIND_LIBS_LWRES \
210     BIND_MTREE \
211     BIND_NAMED \
212     BIND_UTILS \
213     BLUETOOTH \
214     BOOT \
215     CALENDAR \
216     CPP \
217     CRYPT \
218     CVS \
219     CXX \
220     DICT \
221     DYNAMICROOT \
222     EXAMPLES \
223     FORTH \
224     FP_LIBC \
225     GAMES \
226     GCOV \
227     GDB \
228     GNU \
229     GPIB \
230     GROFF \
231     HTML \
232     INET6 \
233     INFO \
234     IPFILTER \
235     IPX \
236     KERBEROS \
237     LIB32 \
238     LIBPTHREAD \
239     LIBTHR \
240     LOCALES \
241     LPR \
242     MAILWRAPPER \
243     NETCAT \
244     NIS \
245     NLS \
246     NLS_CATALOGS \
247     NS_CACHING \
248     OBJC \
249     OPENSSH \
250     OPENSSL \
251     PAM \
252     PF \
253     RCMDS \
254     RCS \
255     RESCUE \
256     SENDMAIL \
257     SETUID_LOGIN \
258     SHAREDOCS \
259     SYSCONS \
260     TCSH \
261     TOOLCHAIN \
262     USB \
263     WPA_SUPPLICANT_EAPOL
264 .if defined(NO_${var})
265 #.warning NO_${var} is deprecated in favour of WITHOUT_${var}=
266 WITHOUT_${var}=
267 .endif
268 .endfor
269 .endif # !defined(BURN_BRIDGES)
270
271 #
272 # Older-style variables that enabled behaviour when set.
273 #
274 .if defined(YES_HESIOD)
275 WITH_HESIOD=
276 .endif
277 .if defined(MAKE_IDEA)
278 WITH_IDEA=
279 .endif
280
281 #
282 # Default behaviour of MK_CLANG depends on the architecture.
283 #
284 .if ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "i386" || \
285     ${MACHINE_ARCH} == "powerpc"
286 _clang_yes=CLANG
287 _clang_no=
288 .else
289 _clang_yes=
290 _clang_no=CLANG
291 .endif
292
293 #
294 # MK_* options which default to "yes".
295 #
296 .for var in \
297     ACCT \
298     ACPI \
299     AMD \
300     APM \
301     ASSERT_DEBUG \
302     AT \
303     ATM \
304     AUDIT \
305     AUTHPF \
306     BIND \
307     BIND_DNSSEC \
308     BIND_ETC \
309     BIND_LIBS_LWRES \
310     BIND_MTREE \
311     BIND_NAMED \
312     BIND_UTILS \
313     BLUETOOTH \
314     BOOT \
315     BSD_CPIO \
316     BSNMP \
317     BZIP2 \
318     CALENDAR \
319     CDDL \
320     ${_clang_yes} \
321     CPP \
322     CRYPT \
323     CTM \
324     CVS \
325     CXX \
326     DICT \
327     DYNAMICROOT \
328     EXAMPLES \
329     FLOPPY \
330     FORTH \
331     FP_LIBC \
332     FREEBSD_UPDATE \
333     GAMES \
334     GCOV \
335     GDB \
336     GNU \
337     GPIB \
338     GROFF \
339     HTML \
340     INET6 \
341     INFO \
342     INSTALLLIB \
343     IPFILTER \
344     IPFW \
345     IPX \
346     JAIL \
347     KERBEROS \
348     KVM \
349     LEGACY_CONSOLE \
350     LIB32 \
351     LIBPTHREAD \
352     LIBTHR \
353     LOCALES \
354     LOCATE \
355     LPR \
356     MAIL \
357     MAILWRAPPER \
358     MAKE \
359     MAN \
360     NCP \
361     NDIS \
362     NETCAT \
363     NETGRAPH \
364     NIS \
365     NLS \
366     NLS_CATALOGS \
367     NS_CACHING \
368     NTP \
369     OBJC \
370     OPENSSH \
371     OPENSSL \
372     PAM \
373     PF \
374     PKGTOOLS \
375     PMC \
376     PORTSNAP \
377     PPP \
378     PROFILE \
379     QUOTAS \
380     RCMDS \
381     RCS \
382     RESCUE \
383     ROUTED \
384     SENDMAIL \
385     SETUID_LOGIN \
386     SHAREDOCS \
387     SSP \
388     SYSINSTALL \
389     SYMVER \
390     SYSCONS \
391     TCSH \
392     TELNET \
393     TEXTPROC \
394     TOOLCHAIN \
395     USB \
396     WIRELESS \
397     WPA_SUPPLICANT_EAPOL \
398     ZFS \
399     ZONEINFO
400 .if defined(WITH_${var}) && defined(WITHOUT_${var})
401 .error WITH_${var} and WITHOUT_${var} can't both be set.
402 .endif
403 .if defined(MK_${var})
404 .error MK_${var} can't be set by a user.
405 .endif
406 .if defined(WITHOUT_${var})
407 MK_${var}:=     no
408 .else
409 MK_${var}:=     yes
410 .endif
411 .endfor
412
413 #
414 # MK_* options which default to "no".
415 #
416 .for var in \
417     BIND_IDN \
418     BIND_LARGE_FILE \
419     BIND_LIBS \
420     BIND_SIGCHASE \
421     BIND_XML \
422     BSD_GREP \
423     ${_clang_no} \
424     FDT \
425     GPIO \
426     HESIOD \
427     IDEA
428 .if defined(WITH_${var}) && defined(WITHOUT_${var})
429 .error WITH_${var} and WITHOUT_${var} can't both be set.
430 .endif
431 .if defined(MK_${var})
432 .error MK_${var} can't be set by a user.
433 .endif
434 .if defined(WITH_${var})
435 MK_${var}:=     yes
436 .else
437 MK_${var}:=     no
438 .endif
439 .endfor
440
441 #
442 # Force some options off if their dependencies are off.
443 # Order is somewhat important.
444 #
445 .if ${MK_LIBPTHREAD} == "no"
446 MK_LIBTHR:=     no
447 .endif
448
449 .if ${MK_LIBTHR} == "no"
450 MK_BIND:=       no
451 .endif
452
453 .if ${MK_BIND} == "no"
454 MK_BIND_DNSSEC:= no
455 MK_BIND_ETC:=   no
456 MK_BIND_LIBS:=  no
457 MK_BIND_LIBS_LWRES:= no
458 MK_BIND_MTREE:= no
459 MK_BIND_NAMED:= no
460 MK_BIND_UTILS:= no
461 .endif
462
463 .if ${MK_BIND_MTREE} == "no"
464 MK_BIND_ETC:=   no
465 .endif
466
467 .if ${MK_CDDL} == "no"
468 MK_ZFS:=        no
469 .endif
470
471 .if ${MK_CRYPT} == "no"
472 MK_OPENSSL:=    no
473 MK_OPENSSH:=    no
474 MK_KERBEROS:=   no
475 .endif
476
477 .if ${MK_IPX} == "no"
478 MK_NCP:=        no
479 .endif
480
481 .if ${MK_MAIL} == "no"
482 MK_MAILWRAPPER:= no
483 MK_SENDMAIL:=   no
484 .endif
485
486 .if ${MK_NETGRAPH} == "no"
487 MK_ATM:=        no
488 MK_BLUETOOTH:=  no
489 .endif
490
491 .if ${MK_OPENSSL} == "no"
492 MK_OPENSSH:=    no
493 MK_KERBEROS:=   no
494 .endif
495
496 .if ${MK_PF} == "no"
497 MK_AUTHPF:=     no
498 .endif
499
500 .if ${MK_TEXTPROC} == "no"
501 MK_GROFF:=      no
502 .endif
503
504 .if ${MK_TOOLCHAIN} == "no"
505 MK_CLANG:=      no
506 MK_GDB:=        no
507 .endif
508
509 #
510 # Set defaults for the MK_*_SUPPORT variables.
511 #
512
513 #
514 # MK_*_SUPPORT options which default to "yes" unless their corresponding
515 # MK_* variable is set to "no".
516 #
517 .for var in \
518     BZIP2 \
519     GNU \
520     INET6 \
521     IPX \
522     KERBEROS \
523     KVM \
524     NETGRAPH \
525     PAM \
526     WIRELESS
527 .if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT)
528 .error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set.
529 .endif
530 .if defined(MK_${var}_SUPPORT)
531 .error MK_${var}_SUPPORT can't be set by a user.
532 .endif
533 .if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no"
534 MK_${var}_SUPPORT:= no
535 .else
536 MK_${var}_SUPPORT:= yes
537 .endif
538 .endfor
539
540 #
541 # MK_* options whose default value depends on another option.
542 #
543 .for vv in \
544     GSSAPI/KERBEROS \
545     MAN_UTILS/MAN
546 .if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H})
547 .error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set.
548 .endif
549 .if defined(MK_${vv:H})
550 .error MK_${vv:H} can't be set by a user.
551 .endif
552 .if defined(WITH_${vv:H})
553 MK_${vv:H}:=    yes
554 .elif defined(WITHOUT_${vv:H})
555 MK_${vv:H}:=    no
556 .else
557 MK_${vv:H}:=    ${MK_${vv:T}}
558 .endif
559 .endfor
560
561 .endif # !_WITHOUT_SRCCONF
562
563 .endif  # !target(__<bsd.own.mk>__)