bsd.own.mk revision 219019
1# $FreeBSD: head/share/mk/bsd.own.mk 219019 2011-02-25 00:04:39Z gabor $ 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 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}= 269WITHOUT_${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) 278WITH_HESIOD= 279.endif 280.if defined(MAKE_IDEA) 281WITH_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}) 413MK_${var}:= no 414.else 415MK_${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 ICONV \ 433 IDEA 434.if defined(WITH_${var}) && defined(WITHOUT_${var}) 435.error WITH_${var} and WITHOUT_${var} can't both be set. 436.endif 437.if defined(MK_${var}) 438.error MK_${var} can't be set by a user. 439.endif 440.if defined(WITH_${var}) 441MK_${var}:= yes 442.else 443MK_${var}:= no 444.endif 445.endfor 446 447# 448# Force some options off if their dependencies are off. 449# Order is somewhat important. 450# 451.if ${MK_LIBPTHREAD} == "no" 452MK_LIBTHR:= no 453.endif 454 455.if ${MK_LIBTHR} == "no" 456MK_BIND:= no 457.endif 458 459.if ${MK_BIND} == "no" 460MK_BIND_DNSSEC:= no 461MK_BIND_ETC:= no 462MK_BIND_LIBS:= no 463MK_BIND_LIBS_LWRES:= no 464MK_BIND_MTREE:= no 465MK_BIND_NAMED:= no 466MK_BIND_UTILS:= no 467.endif 468 469.if ${MK_BIND_MTREE} == "no" 470MK_BIND_ETC:= no 471.endif 472 473.if ${MK_CDDL} == "no" 474MK_ZFS:= no 475.endif 476 477.if ${MK_CRYPT} == "no" 478MK_OPENSSL:= no 479MK_OPENSSH:= no 480MK_KERBEROS:= no 481.endif 482 483.if ${MK_IPX} == "no" 484MK_NCP:= no 485.endif 486 487.if ${MK_MAIL} == "no" 488MK_MAILWRAPPER:= no 489MK_SENDMAIL:= no 490.endif 491 492.if ${MK_NETGRAPH} == "no" 493MK_ATM:= no 494MK_BLUETOOTH:= no 495.endif 496 497.if ${MK_OPENSSL} == "no" 498MK_OPENSSH:= no 499MK_KERBEROS:= no 500.endif 501 502.if ${MK_PF} == "no" 503MK_AUTHPF:= no 504.endif 505 506.if ${MK_TEXTPROC} == "no" 507MK_GROFF:= no 508.endif 509 510.if ${MK_TOOLCHAIN} == "no" 511MK_CLANG:= no 512MK_GDB:= no 513.endif 514 515# 516# Set defaults for the MK_*_SUPPORT variables. 517# 518 519# 520# MK_*_SUPPORT options which default to "yes" unless their corresponding 521# MK_* variable is set to "no". 522# 523.for var in \ 524 BZIP2 \ 525 GNU \ 526 INET6 \ 527 IPX \ 528 KERBEROS \ 529 KVM \ 530 NETGRAPH \ 531 PAM \ 532 WIRELESS 533.if defined(WITH_${var}_SUPPORT) && defined(WITHOUT_${var}_SUPPORT) 534.error WITH_${var}_SUPPORT and WITHOUT_${var}_SUPPORT can't both be set. 535.endif 536.if defined(MK_${var}_SUPPORT) 537.error MK_${var}_SUPPORT can't be set by a user. 538.endif 539.if defined(WITHOUT_${var}_SUPPORT) || ${MK_${var}} == "no" 540MK_${var}_SUPPORT:= no 541.else 542MK_${var}_SUPPORT:= yes 543.endif 544.endfor 545 546# 547# MK_* options whose default value depends on another option. 548# 549.for vv in \ 550 GSSAPI/KERBEROS \ 551 MAN_UTILS/MAN 552.if defined(WITH_${vv:H}) && defined(WITHOUT_${vv:H}) 553.error WITH_${vv:H} and WITHOUT_${vv:H} can't both be set. 554.endif 555.if defined(MK_${vv:H}) 556.error MK_${vv:H} can't be set by a user. 557.endif 558.if defined(WITH_${vv:H}) 559MK_${vv:H}:= yes 560.elif defined(WITHOUT_${vv:H}) 561MK_${vv:H}:= no 562.else 563MK_${vv:H}:= ${MK_${vv:T}} 564.endif 565.endfor 566 567.endif # !_WITHOUT_SRCCONF 568 569.endif # !target(__<bsd.own.mk>__) 570