bsd.own.mk revision 223209
1# $FreeBSD: head/share/mk/bsd.own.mk 223209 2011-06-17 21:30:21Z ed $ 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) 110SRCCONF?= /etc/src.conf 111.if exists(${SRCCONF}) 112.include "${SRCCONF}" 113.endif 114.endif 115 116# Binaries 117BINOWN?= root 118BINGRP?= wheel 119BINMODE?= 555 120NOBINMODE?= 444 121 122.if defined(MODULES_WITH_WORLD) 123KMODDIR?= /boot/modules 124.else 125KMODDIR?= /boot/kernel 126.endif 127KMODOWN?= ${BINOWN} 128KMODGRP?= ${BINGRP} 129KMODMODE?= ${BINMODE} 130 131LIBDIR?= /usr/lib 132LIBCOMPATDIR?= /usr/lib/compat 133LIBDATADIR?= /usr/libdata 134LIBEXECDIR?= /usr/libexec 135LINTLIBDIR?= /usr/libdata/lint 136SHLIBDIR?= ${LIBDIR} 137LIBOWN?= ${BINOWN} 138LIBGRP?= ${BINGRP} 139LIBMODE?= ${NOBINMODE} 140 141 142# Share files 143SHAREDIR?= /usr/share 144SHAREOWN?= root 145SHAREGRP?= wheel 146SHAREMODE?= ${NOBINMODE} 147 148MANDIR?= ${SHAREDIR}/man/man 149MANOWN?= ${SHAREOWN} 150MANGRP?= ${SHAREGRP} 151MANMODE?= ${NOBINMODE} 152 153DOCDIR?= ${SHAREDIR}/doc 154DOCOWN?= ${SHAREOWN} 155DOCGRP?= ${SHAREGRP} 156DOCMODE?= ${NOBINMODE} 157 158INFODIR?= ${SHAREDIR}/info 159INFOOWN?= ${SHAREOWN} 160INFOGRP?= ${SHAREGRP} 161INFOMODE?= ${NOBINMODE} 162 163NLSDIR?= ${SHAREDIR}/nls 164NLSOWN?= ${SHAREOWN} 165NLSGRP?= ${SHAREGRP} 166NLSMODE?= ${NOBINMODE} 167 168INCLUDEDIR?= /usr/include 169 170# Common variables 171.if !defined(DEBUG_FLAGS) 172STRIP?= -s 173.endif 174 175COMPRESS_CMD?= gzip -cn 176COMPRESS_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}) 196WITHOUT_${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 OPENSSH \ 252 OPENSSL \ 253 PAM \ 254 PF \ 255 RCMDS \ 256 RCS \ 257 RESCUE \ 258 SENDMAIL \ 259 SETUID_LOGIN \ 260 SHAREDOCS \ 261 SYSCONS \ 262 TCSH \ 263 TOOLCHAIN \ 264 USB \ 265 WPA_SUPPLICANT_EAPOL 266.if defined(NO_${var}) 267#.warning NO_${var} is deprecated in favour of WITHOUT_${var}= 268WITHOUT_${var}= 269.endif 270.endfor 271.endif # !defined(BURN_BRIDGES) 272 273# 274# Older-style variables that enabled behaviour when set. 275# 276.if defined(YES_HESIOD) 277WITH_HESIOD= 278.endif 279.if defined(MAKE_IDEA) 280WITH_IDEA= 281.endif 282 283__DEFAULT_YES_OPTIONS = \ 284 ACCT \ 285 ACPI \ 286 AMD \ 287 APM \ 288 ASSERT_DEBUG \ 289 AT \ 290 ATM \ 291 AUDIT \ 292 AUTHPF \ 293 BIND \ 294 BIND_DNSSEC \ 295 BIND_ETC \ 296 BIND_LIBS_LWRES \ 297 BIND_MTREE \ 298 BIND_NAMED \ 299 BIND_UTILS \ 300 BINUTILS \ 301 BLUETOOTH \ 302 BOOT \ 303 BSD_CPIO \ 304 BSNMP \ 305 BZIP2 \ 306 CALENDAR \ 307 CDDL \ 308 CPP \ 309 CRYPT \ 310 CTM \ 311 CVS \ 312 CXX \ 313 DICT \ 314 DYNAMICROOT \ 315 EXAMPLES \ 316 FLOPPY \ 317 FORTH \ 318 FP_LIBC \ 319 FREEBSD_UPDATE \ 320 GAMES \ 321 GCC \ 322 GCOV \ 323 GDB \ 324 GNU \ 325 GPIB \ 326 GPIO \ 327 GROFF \ 328 HTML \ 329 INET \ 330 INET6 \ 331 INFO \ 332 INSTALLLIB \ 333 IPFILTER \ 334 IPFW \ 335 IPX \ 336 JAIL \ 337 KERBEROS \ 338 KERNEL_SYMBOLS \ 339 KVM \ 340 LEGACY_CONSOLE \ 341 LIB32 \ 342 LIBPTHREAD \ 343 LIBTHR \ 344 LOCALES \ 345 LOCATE \ 346 LPR \ 347 MAIL \ 348 MAILWRAPPER \ 349 MAKE \ 350 MAN \ 351 NCP \ 352 NDIS \ 353 NETCAT \ 354 NETGRAPH \ 355 NIS \ 356 NLS \ 357 NLS_CATALOGS \ 358 NS_CACHING \ 359 NTP \ 360 OPENSSH \ 361 OPENSSL \ 362 PAM \ 363 PF \ 364 PKGTOOLS \ 365 PMC \ 366 PORTSNAP \ 367 PPP \ 368 PROFILE \ 369 QUOTAS \ 370 RCMDS \ 371 RCS \ 372 RESCUE \ 373 ROUTED \ 374 SENDMAIL \ 375 SETUID_LOGIN \ 376 SHAREDOCS \ 377 SSP \ 378 SYSINSTALL \ 379 SYMVER \ 380 SYSCONS \ 381 TCSH \ 382 TELNET \ 383 TEXTPROC \ 384 TOOLCHAIN \ 385 USB \ 386 UTMPX \ 387 WIRELESS \ 388 WPA_SUPPLICANT_EAPOL \ 389 ZFS \ 390 ZONEINFO 391 392__DEFAULT_NO_OPTIONS = \ 393 BSD_GREP \ 394 BIND_IDN \ 395 BIND_LARGE_FILE \ 396 BIND_LIBS \ 397 BIND_SIGCHASE \ 398 BIND_XML \ 399 HESIOD \ 400 ICONV \ 401 IDEA \ 402 OFED 403 404# 405# Default behaviour of some options depends on the architecture. Unfortunately 406# this means that we have to test TARGET_ARCH (the buildworld case) as well 407# as MACHINE_ARCH (the non-buildworld case). Normally TARGET_ARCH is not 408# used at all in bsd.*.mk, but we have to make an exception here if we want 409# to allow defaults for some things like clang and fdt to vary by target 410# architecture. 411# 412.if defined(TARGET_ARCH) 413__T=${TARGET_ARCH} 414.else 415__T=${MACHINE_ARCH} 416.endif 417# Clang is only for x86 and 32-bit powerpc right now, by default. 418.if ${__T} == "amd64" || ${__T} == "i386" || ${__T} == "powerpc" 419__DEFAULT_YES_OPTIONS+=CLANG 420.else 421__DEFAULT_NO_OPTIONS+=CLANG 422.endif 423# FDT is needed only for arm and powerpc (and not powerpc64) 424.if ${__T} == "arm" || ${__T} == "armeb" || ${__T} == "powerpc" 425__DEFAULT_YES_OPTIONS+=FDT 426.else 427__DEFAULT_NO_OPTIONS+=FDT 428.endif 429.undef __T 430 431# 432# MK_* options which default to "yes". 433# 434.for var in ${__DEFAULT_YES_OPTIONS} 435.if defined(WITH_${var}) && defined(WITHOUT_${var}) 436.error WITH_${var} and WITHOUT_${var} can't both be set. 437.endif 438.if defined(MK_${var}) 439.error MK_${var} can't be set by a user. 440.endif 441.if defined(WITHOUT_${var}) 442MK_${var}:= no 443.else 444MK_${var}:= yes 445.endif 446.endfor 447.undef __DEFAULT_YES_OPTIONS 448 449# 450# MK_* options which default to "no". 451# 452.for var in ${__DEFAULT_NO_OPTIONS} 453.if defined(WITH_${var}) && defined(WITHOUT_${var}) 454.error WITH_${var} and WITHOUT_${var} can't both be set. 455.endif 456.if defined(MK_${var}) 457.error MK_${var} can't be set by a user. 458.endif 459.if defined(WITH_${var}) 460MK_${var}:= yes 461.else 462MK_${var}:= no 463.endif 464.endfor 465.undef __DEFAULT_NO_OPTIONS 466 467# 468# Force some options off if their dependencies are off. 469# Order is somewhat important. 470# 471.if ${MK_LIBPTHREAD} == "no" 472MK_LIBTHR:= no 473.endif 474 475.if ${MK_LIBTHR} == "no" 476MK_BIND:= no 477.endif 478 479.if ${MK_BIND} == "no" 480MK_BIND_DNSSEC:= no 481MK_BIND_ETC:= no 482MK_BIND_LIBS:= no 483MK_BIND_LIBS_LWRES:= no 484MK_BIND_MTREE:= no 485MK_BIND_NAMED:= no 486MK_BIND_UTILS:= no 487.endif 488 489.if ${MK_BIND_MTREE} == "no" 490MK_BIND_ETC:= no 491.endif 492 493.if ${MK_CDDL} == "no" 494MK_ZFS:= no 495.endif 496 497.if ${MK_CRYPT} == "no" 498MK_OPENSSL:= no 499MK_OPENSSH:= no 500MK_KERBEROS:= no 501.endif 502 503.if ${MK_CXX} == "no" 504MK_CLANG:= no 505MK_GROFF:= no 506.endif 507 508.if ${MK_IPX} == "no" 509MK_NCP:= no 510.endif 511 512.if ${MK_MAIL} == "no" 513MK_MAILWRAPPER:= no 514MK_SENDMAIL:= no 515.endif 516 517.if ${MK_NETGRAPH} == "no" 518MK_ATM:= no 519MK_BLUETOOTH:= no 520.endif 521 522.if ${MK_OPENSSL} == "no" 523MK_OPENSSH:= no 524MK_KERBEROS:= no 525.endif 526 527.if ${MK_PF} == "no" 528MK_AUTHPF:= no 529.endif 530 531.if ${MK_TEXTPROC} == "no" 532MK_GROFF:= no 533.endif 534 535.if ${MK_TOOLCHAIN} == "no" 536MK_BINUTILS:= no 537MK_CLANG:= no 538MK_GCC:= no 539MK_GDB:= no 540.endif 541 542# 543# Set defaults for the MK_*_SUPPORT variables. 544# 545 546# 547# MK_*_SUPPORT options which default to "yes" unless their corresponding 548# MK_* variable is set to "no". 549# 550.for var in \ 551 BZIP2 \ 552 GNU \ 553 INET \ 554 INET6 \ 555 IPX \ 556 KERBEROS \ 557 KVM \ 558 NETGRAPH \ 559 PAM \ 560 WIRELESS 561.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) 562.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. 563.endif 564.if defined(MK_${var}_SUPPORT) 565.error MK_${var}_SUPPORT can't be set by a user. 566.endif 567.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 568MK_${var}_SUPPORT:= no 569.else 570MK_${var}_SUPPORT:= yes 571.endif 572.endfor 573 574# 575# MK_* options whose default value depends on another option. 576# 577.for vv in \ 578 GSSAPI/KERBEROS \ 579 MAN_UTILS/MAN 580.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) 581.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. 582.endif 583.if defined(MK_${vv:H}) 584.error MK_${vv:H} can't be set by a user. 585.endif 586.if defined(WITH_${vv:H}) 587MK_${vv:H}:= yes 588.elif defined(WITHOUT_${vv:H}) 589MK_${vv:H}:= no 590.else 591MK_${vv:H}:= ${MK_${vv:T}} 592.endif 593.endfor 594 595.endif # !_WITHOUT_SRCCONF 596 597.endif # !target(__<bsd.own.mk>__) 598