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