[BACK]Return to bsd.prefs.mk CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / mk

Annotation of pkgsrc/mk/bsd.prefs.mk, Revision 1.177.2.6

1.177.2.6! tv          1: # $NetBSD: bsd.prefs.mk,v 1.177.2.5 2005/02/11 15:27:57 tv Exp $
1.1       agc         2: #
                      3: # Make file, included to get the site preferences, if any.  Should
                      4: # only be included by package Makefiles before any .if defined()
1.7       tv          5: # statements or modifications to "passed" variables (CFLAGS, LDFLAGS, ...),
                      6: # to make sure any variables defined in /etc/mk.conf, $MAKECONF, or
                      7: # the system defaults (sys.mk and bsd.own.mk) are used.
1.4       hubertf     8:
1.5       tv          9: # Do not recursively include mk.conf, redefine OPSYS, include bsd.own.mk, etc.
1.104     jlam       10: .ifndef BSD_PKG_MK
1.5       tv         11:
1.7       tv         12: # Let mk.conf know that this is pkgsrc.
1.104     jlam       13: BSD_PKG_MK=1
1.7       tv         14: __PREFIX_SET__:=${PREFIX}
1.1       agc        15:
1.149     jlam       16: # Expand MAKE to a full path.
                     17: .if !defined(_MAKE)
                     18: _MAKE:=        ${MAKE}
                     19: .  for _dir_ in ${PATH:C/\:/ /g}
                     20: .    if empty(_MAKE:M/*)
                     21: .      if exists(${_dir_}/${MAKE})
                     22: _MAKE:=        ${_dir_}/${MAKE}
                     23: .      endif
                     24: .    endif
                     25: .  endfor
                     26: .  if !empty(_MAKE:M/*)
1.150     jlam       27: MAKEFLAGS+=    _MAKE=${_MAKE:Q}
1.149     jlam       28: .  endif
                     29: .endif
                     30: MAKE:= ${_MAKE}
                     31:
1.9       christos   32: .if exists(/usr/bin/uname)
                     33: UNAME=/usr/bin/uname
                     34: .elif exists(/bin/uname)
                     35: UNAME=/bin/uname
                     36: .else
                     37: UNAME=echo Unknown
                     38: .endif
                     39:
1.156     recht      40: .if exists(/usr/bin/cut)
                     41: CUT=/usr/bin/cut
                     42: .elif exists(/bin/cut)
                     43: CUT=/bin/cut
                     44: .else
                     45: CUT=echo Unknown
                     46: .endif
                     47:
1.7       tv         48: .ifndef OPSYS
1.132     reed       49: OPSYS!=                        ${UNAME} -s | tr -d /
1.17      mycroft    50: .endif
1.16      hubertf    51: MAKEFLAGS+=            OPSYS=${OPSYS}
1.7       tv         52: .ifndef OS_VERSION
1.9       christos   53: OS_VERSION!=           ${UNAME} -r
1.66      abs        54: .endif
                     55: .ifndef LOWER_OS_VERSION
1.108     wiz        56: LOWER_OS_VERSION!=     echo ${OS_VERSION} | tr 'A-Z' 'a-z'
1.17      mycroft    57: .endif
1.16      hubertf    58: MAKEFLAGS+=            OS_VERSION=${OS_VERSION}
1.1       agc        59:
1.7       tv         60: # Preload these for architectures not in all variations of bsd.own.mk.
                     61: GNU_ARCH.alpha?=       alpha
1.70      fredb      62: GNU_ARCH.arm26?=       arm
1.7       tv         63: GNU_ARCH.arm32?=       arm
                     64: GNU_ARCH.i386?=                i386
1.12      christos   65: GNU_ARCH.i486?=                i386
                     66: GNU_ARCH.i586?=                i386
                     67: GNU_ARCH.i686?=                i386
1.70      fredb      68: GNU_ARCH.m68000?=      m68010
1.7       tv         69: GNU_ARCH.m68k?=                m68k
                     70: GNU_ARCH.mips?=                mipsel
1.41      rafal      71: GNU_ARCH.mipseb?=      mipseb
1.45      drochner   72: GNU_ARCH.mipsel?=      mipsel
1.7       tv         73: GNU_ARCH.ns32k?=       ns32k
1.47      mjl        74: GNU_ARCH.powerpc?=     powerpc
1.177.2.6! tv         75: GNU_ARCH.rs6000?=      rs6000
1.70      fredb      76: GNU_ARCH.sh3eb?=       sh
                     77: GNU_ARCH.sh3el?=       shle
1.7       tv         78: GNU_ARCH.sparc?=       sparc
1.57      skrll      79: GNU_ARCH.sparc64?=     sparc64
1.7       tv         80: GNU_ARCH.vax?=         vax
                     81: MACHINE_GNU_ARCH?=     ${GNU_ARCH.${MACHINE_ARCH}}
1.3       tv         82:
1.10      agc        83: .if ${OPSYS} == "NetBSD"
                     84: LOWER_OPSYS?=          netbsd
1.135     reed       85:
                     86: .elif ${OPSYS} == "BSDOS"
                     87: LOWER_OPSYS?=          bsdi
1.90      grant      88:
                     89: .elif ${OPSYS} == "FreeBSD"
                     90: LOWER_OPSYS?=          freebsd
                     91: LOWER_ARCH!=           ${UNAME} -p
                     92: MACHINE_ARCH=          ${LOWER_ARCH}
                     93: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
1.156     recht      94: LOWER_OPSYS_VERSUFFIX!=        echo ${LOWER_OS_VERSION} | ${CUT} -c -1
1.91      grant      95: .  if ${LOWER_ARCH} == "i386"
1.90      grant      96: LOWER_VENDOR?=         pc
1.91      grant      97: .  else
                     98: LOWER_VENDOR?=         unknown
                     99: .  endif
1.58      abs       100:
1.176     wiz       101: .elif ${OPSYS} == "DragonFly"
                    102: LOWER_OPSYS?=          dragonfly
                    103: LOWER_ARCH!=           ${UNAME} -p
                    104: MACHINE_ARCH=          ${LOWER_ARCH}
                    105: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
                    106: LOWER_OPSYS_VERSUFFIX!=        echo ${LOWER_OS_VERSION} | ${CUT} -c -1
                    107: LOWER_VENDOR?=         pc
                    108:
1.10      agc       109: .elif ${OPSYS} == "SunOS"
1.80      agc       110: .  if ${MACHINE_ARCH} == "sparc"
                    111: SPARC_TARGET_ARCH?=    sparcv7
                    112: .  elif ${MACHINE_ARCH} == "sun4"
                    113: MACHINE_ARCH=          sparc
1.81      bouyer    114: SPARC_TARGET_ARCH?=    sparcv7
1.80      agc       115: .  elif ${MACHINE_ARCH} == "i86pc"
                    116: MACHINE_ARCH=          i386
1.112     grant     117: .  elif ${MACHINE_ARCH} == "unknown"
                    118: .    if !defined(LOWER_ARCH)
                    119: LOWER_ARCH!=           ${UNAME} -p
                    120: .    endif     # !defined(LOWER_ARCH)
                    121: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
1.80      agc       122: .  endif
1.7       tv        123: LOWER_VENDOR?=         sun
1.112     grant     124: LOWER_OPSYS?=          solaris
1.130     grant     125: LOWER_OPSYS_VERSUFFIX= 2
1.58      abs       126:
1.10      agc       127: .elif ${OPSYS} == "Linux"
                    128: LOWER_OPSYS?=          linux
1.100     jschauma  129: MACHINE_ARCH:=          ${MACHINE_ARCH:C/i.86/i386/}
1.174     ben       130: MACHINE_ARCH:=         ${MACHINE_ARCH:C/ppc/powerpc/}
1.102     jschauma  131: .  if !defined(LOWER_ARCH)
1.175     martti    132: LOWER_ARCH!=           ${UNAME} -m | sed -e 's/i.86/i386/' -e 's/ppc/powerpc/'
1.102     jschauma  133: .  endif # !defined(LOWER_ARCH)
1.115     abs       134: .  if ${MACHINE_ARCH} == "unknown" || ${MACHINE_ARCH} == ""
1.35      abs       135: MACHINE_ARCH=          ${LOWER_ARCH}
1.16      hubertf   136: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
1.106     jschauma  137: .  endif
                    138: .  if exists(/etc/debian_version)
                    139: LOWER_VENDOR?=         debian
                    140: .  elif exists(/etc/mandrake-release)
                    141: LOWER_VENDOR?=         mandrake
                    142: .  elif exists(/etc/redhat-version)
                    143: LOWER_VENDOR?=         redhat
                    144: .  elif exists(/etc/slackware-version)
                    145: LOWER_VENDOR?=         slackware
                    146: .  elif ${LOWER_ARCH} == "i386"
                    147: LOWER_VENDOR?=          pc
                    148: .  else
                    149: LOWER_VENDOR?=          unknown
1.16      hubertf   150: .  endif
1.12      christos  151:
1.61      agc       152: .elif ${OPSYS} == "Darwin"
                    153: LOWER_OPSYS?=          darwin
                    154: LOWER_ARCH!=           ${UNAME} -p
                    155: MACHINE_ARCH=          ${LOWER_ARCH}
                    156: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
                    157: LOWER_VENDOR?=         apple
1.94      jschauma  158:
                    159: .elif ${OPSYS:MIRIX*} != ""
1.113     jschauma  160: LOWER_ARCH!=           ${UNAME} -p
                    161: LOWER_OPSYS?=          irix${OS_VERSION}
1.94      jschauma  162: LOWER_VENDOR?=         sgi
1.61      agc       163:
1.157     tv        164: .elif ${OPSYS} == "Interix"
                    165: LOWER_OPSYS?=          interix3
                    166: LOWER_VENDOR?=         pc
                    167:
1.177     grant     168: .elif ${OPSYS} == "OSF1"
                    169: LOWER_ARCH!=           ${UNAME} -p
                    170: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
                    171: MACHINE_ARCH?=         ${LOWER_ARCH}
                    172: OS_VERSION!=           echo ${OS_VERSION} | sed -e 's/^V//'
                    173: LOWER_OPSYS?=          osf${OS_VERSION}
                    174: LOWER_VENDOR?=         dec
                    175:
1.177.2.6! tv        176: .elif ${OPSYS} == "AIX"
        !           177: LOWER_ARCH!=           _cpuid=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $$1 }'`; \
        !           178:                        if /usr/sbin/lsattr -El $$_cpuid | grep ' POWER' >/dev/null 2>&1; then \
        !           179:                                echo rs6000; \
        !           180:                        else \
        !           181:                                echo powerpc; \
        !           182:                        fi
        !           183: MACHINE_ARCH?=         ${LOWER_ARCH}
        !           184: .  if exists(/usr/bin/oslevel)
        !           185: _OS_VERSION!=          /usr/bin/oslevel
        !           186: .  else
        !           187: _OS_VERSION!=          echo `${UNAME} -v`.`${UNAME} -r`
        !           188: .  endif
        !           189: OS_VERSION!=           echo ${_OS_VERSION} | sed -e 's,\([0-9]*\.[0-9]*\).*,\1,'
        !           190: LOWER_OS_VERSION=      ${OS_VERSION}
        !           191: LOWER_OPSYS_VERSUFFIX= ${_OS_VERSION}
        !           192: LOWER_OPSYS?=          aix
        !           193: LOWER_VENDOR?=         ibm
        !           194:
1.10      agc       195: .elif !defined(LOWER_OPSYS)
1.101     jschauma  196: LOWER_OPSYS!=          echo ${OPSYS} | tr A-Z a-z
1.17      mycroft   197: .endif
1.58      abs       198:
1.16      hubertf   199: MAKEFLAGS+=            LOWER_OPSYS=${LOWER_OPSYS}
1.7       tv        200:
                    201: LOWER_VENDOR?=
                    202: LOWER_ARCH?=           ${MACHINE_GNU_ARCH}
                    203:
                    204: MACHINE_PLATFORM?=     ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
1.131     fredb     205: MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}${APPEND_ELF}${LOWER_OPSYS_VERSUFFIX}
1.59      agc       206:
1.152     grant     207: # Needed to prevent an "install:" target from being created in bsd.own.mk.
1.60      tron      208: NEED_OWN_INSTALL_TARGET=no
1.65      tv        209:
                    210: # This prevents default use of the cross-tool harness in the "src" tree,
                    211: # in the odd possible case of someone extracting "pkgsrc" underneath "src".
                    212: USETOOLS=              no
                    213: MAKE_ENV+=             USETOOLS=no
1.71      schmonz   214:
                    215: # Set this before <bsd.own.mk> does, since it doesn't know about Darwin
                    216: .if ${OPSYS} == "Darwin"
                    217: OBJECT_FMT?=           Mach-O
                    218: .endif
1.60      tron      219:
1.73      jlam      220: .include <bsd.own.mk>
                    221:
1.72      jlam      222: # /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT
1.134     grant     223: .if !empty(MACHINE_PLATFORM:MNetBSD-1.3*)
1.126     grant     224: .  if ${MACHINE_ARCH} == "alpha" || \
                    225:       ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
                    226:       ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
1.72      jlam      227: OBJECT_FMT?=           ELF
1.126     grant     228: .  else
1.72      jlam      229: OBJECT_FMT?=           a.out
1.134     grant     230: .  endif
                    231: # override what bootstrap-pkgsrc sets, which isn't right for NetBSD
                    232: # 1.4.
                    233: # XXX other ELF platforms in 1.4 need to be added to here.
                    234: .elif !empty(MACHINE_PLATFORM:MNetBSD-1.4*)
                    235: .  if ${MACHINE_ARCH} == "alpha" || \
                    236:       ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
                    237:       ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
                    238: OBJECT_FMT=            ELF
                    239: .  else
                    240: OBJECT_FMT=            a.out
1.127     itojun    241: .  endif
                    242: .endif
                    243:
                    244: .if ${OPSYS} == "OpenBSD"
                    245: .  if defined(ELF_TOOLCHAIN) && ${ELF_TOOLCHAIN} == "yes"
                    246: OBJECT_FMT?=   ELF
                    247: .  else
                    248: OBJECT_FMT?=   a.out
1.126     grant     249: .  endif
1.177.2.6! tv        250: .elif ${OPSYS} == "DragonFly"
        !           251: OBJECT_FMT=    ELF
        !           252: .elif ${OPSYS} == "AIX"
        !           253: OBJECT_FMT=    XCOFF
1.176     wiz       254: .endif
                    255:
1.167     jlam      256: # Calculate depth
1.170     jlam      257: .if exists(${.CURDIR}/mk/bsd.pkg.mk)
1.171     jlam      258: _PKGSRC_TOPDIR=        ${.CURDIR}
1.167     jlam      259: .elif exists(${.CURDIR}/../mk/bsd.pkg.mk)
1.171     jlam      260: _PKGSRC_TOPDIR=        ${.CURDIR}/..
1.170     jlam      261: .elif exists(${.CURDIR}/../../mk/bsd.pkg.mk)
1.171     jlam      262: _PKGSRC_TOPDIR=        ${.CURDIR}/../..
1.167     jlam      263: .endif
                    264:
1.59      agc       265: # include the defaults file
1.171     jlam      266: .if exists(${_PKGSRC_TOPDIR}/mk/defaults/mk.conf)
                    267: .  include "${_PKGSRC_TOPDIR}/mk/defaults/mk.conf"
1.70      fredb     268: .endif
                    269:
                    270: .if ${OPSYS} == "NetBSD"
1.126     grant     271: .  if ${OBJECT_FMT} == "ELF" && \
                    272:    (${MACHINE_GNU_ARCH} == "arm" || \
                    273:     ${MACHINE_ARCH} == "i386" || \
                    274:     ${MACHINE_ARCH} == "m68k" || \
                    275:     ${MACHINE_ARCH} == "m68000" || \
                    276:     ${MACHINE_GNU_ARCH} == "sh" || \
                    277:     ${MACHINE_GNU_ARCH} == "shle" || \
                    278:     ${MACHINE_ARCH} == "sparc" || \
                    279:     ${MACHINE_ARCH} == "vax")
1.70      fredb     280: APPEND_ELF=            elf
1.126     grant     281: .  endif
1.48      abs       282: .endif
1.7       tv        283:
                    284: SHAREOWN?=             ${DOCOWN}
                    285: SHAREGRP?=             ${DOCGRP}
                    286: SHAREMODE?=            ${DOCMODE}
1.1       agc       287:
1.3       tv        288: .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
1.2       tv        289: .BEGIN:
                    290:        @${ECHO_MSG} "You can NOT set PREFIX manually or in mk.conf.  Set LOCALBASE or X11BASE"
                    291:        @${ECHO_MSG} "depending on your needs.  See the pkg system documentation for more info."
                    292:        @${FALSE}
1.14      itojun    293: .endif
                    294:
1.7       tv        295: # Preload all default values for CFLAGS, LDFLAGS, etc. before bsd.pkg.mk
                    296: # or a pkg Makefile modifies them.
1.6       tv        297: .include <sys.mk>
1.5       tv        298:
1.42      skrll     299: # Load the OS-specific definitions for program variables.  Default to loading
                    300: # the NetBSD ones if an OS-specific file doesn't exist.
1.171     jlam      301: .if exists(${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk)
                    302: .  include "${_PKGSRC_TOPDIR}/mk/platform/${OPSYS}.mk"
1.177.2.5  tv        303: .else
1.171     jlam      304: .  include "${_PKGSRC_TOPDIR}/mk/platform/NetBSD.mk"
1.177.2.5  tv        305: PKG_FAIL_REASON+=      "missing mk/platform/${OPSYS}.mk"
1.97      schmonz   306: .endif
                    307:
1.160     tv        308: PKGDIRMODE?=           755
1.177.2.1  tv        309:
1.177.2.2  tv        310: .if make(package) || make(real-su-package) || \
                    311:     make(show-var) || make(show-vars)
1.177.2.1  tv        312: PKG_PHASES=    fetch checksum depends extract patch tools wrapper configure build test install package
1.177.2.3  tv        313: .elif make(install) || make(real-su-install) || \
1.177.2.2  tv        314:       make(replace) || make(real-su-replace) || \
                    315:       make(plist) || make(do-shlib-handling)
1.177.2.1  tv        316: PKG_PHASES=    fetch checksum depends extract patch tools wrapper configure build test install
                    317: .elif make(test)
                    318: PKG_PHASES=    fetch checksum depends extract patch tools wrapper configure build test
                    319: .elif make(build)
                    320: PKG_PHASES=    fetch checksum depends extract patch tools wrapper configure build
                    321: .elif make(configure)
                    322: PKG_PHASES=    fetch checksum depends extract patch tools wrapper configure
                    323: .elif make(wrapper)
                    324: PKG_PHASES=    fetch checksum depends extract patch tools wrapper
                    325: .elif make(tools)
                    326: PKG_PHASES=    fetch checksum depends extract patch tools
                    327: .elif make(patch)
                    328: PKG_PHASES=    fetch checksum depends extract patch
                    329: .elif make(extract)
                    330: PKG_PHASES=    fetch checksum depends extract
1.177.2.3  tv        331: .elif make(depends) || \
1.177.2.4  tv        332:       make(show-depends-dirs) || make(print-summary-data)
1.177.2.1  tv        333: PKG_PHASES=    fetch checksum depends
                    334: .elif make(checksum)
                    335: PKG_PHASES=    fetch checksum
1.177.2.3  tv        336: .elif make(fetch) || \
                    337:       make(fetch-list-one-pkg)
1.177.2.1  tv        338: PKG_PHASES=    fetch
                    339: .else
                    340: PKG_PHASES=    # empty
                    341: .endif
1.140     jlam      342:
1.142     jlam      343: # Set the style of installation to be performed for the package.  The
                    344: # funky make variable modifiers just select the first word of the value
                    345: # stored in the referenced variable.
                    346: #
                    347: .for _pref_ in ${PKG_INSTALLATION_PREFS}
                    348: .  if !empty(PKG_INSTALLATION_TYPES:M${_pref_})
                    349: PKG_INSTALLATION_TYPE?=        ${PKG_INSTALLATION_TYPES:M${_pref_}:S/^/_pkginsttype_/1:M_pkginsttype_*:S/^_pkginsttype_//}
                    350: .  endif
                    351: .endfor
                    352: PKG_INSTALLATION_TYPE?=        none
                    353:
1.97      schmonz   354: # if the system is IPv6-ready, compile with IPv6 support turned on.
1.136     tron      355: .if defined(USE_INET6)
1.139     agc       356: .  if empty(USE_INET6:M[Yy][Ee][Ss]) || defined(USE_SOCKS)
1.136     tron      357: USE_INET6=             NO
1.139     agc       358: .  else
1.164     jlam      359: PKG_DEFAULT_OPTIONS+=  inet6
1.136     tron      360: USE_INET6=             YES
1.139     agc       361: .  endif
1.136     tron      362: .elif empty(_OPSYS_HAS_INET6:M[nN][oO]) && !defined(USE_SOCKS)
1.164     jlam      363: PKG_DEFAULT_OPTIONS+=  inet6
1.136     tron      364: USE_INET6=             YES
                    365: .else
                    366: USE_INET6=             NO
                    367: .endif
1.22      agc       368:
1.36      abs       369: LOCALBASE?=            ${DESTDIR}/usr/pkg
1.87      jlam      370: .if ${OPSYS} == "SunOS"
                    371: # On Solaris, we default to using OpenWindows for X11.
1.163     xtraeme   372: X11BASE?=      ${DESTDIR}/usr/openwin
                    373: .elif !defined(X11_TYPE) || defined(X11_TYPE) && !empty(X11_TYPE:Mnative)
                    374: X11BASE?=      ${DESTDIR}/usr/X11R6
1.87      jlam      375: .endif
1.163     xtraeme   376: CROSSBASE?=    ${LOCALBASE}/cross
1.77      rh        377:
1.142     jlam      378: # If xpkgwedge.def is found, then clearly we're using xpkgwedge.
                    379: .if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
                    380:     exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
                    381: USE_XPKGWEDGE=  yes
                    382: .else
1.158     agc       383: USE_XPKGWEDGE?=        yes
1.142     jlam      384: .endif
                    385:
                    386: .if defined(_OPSYS_NEEDS_XPKGWEDGE) && \
                    387:     !empty(_OPSYS_NEEDS_XPKGWEDGE:M[yY][eE][sS])
                    388: USE_XPKGWEDGE= yes
                    389: .endif
                    390:
                    391: .if ${PKG_INSTALLATION_TYPE} == "pkgviews"
                    392: USE_XPKGWEDGE=         yes
                    393: _XPKGWEDGE_REQD=       1.9
                    394: .endif
                    395:
1.77      rh        396: # Set X11PREFIX to reflect the install directory of X11 packages.
                    397: # Set XMKMF_CMD properly if xpkgwedge is installed.
                    398: #
                    399: # The check for the existence of ${X11BASE}/lib/X11/config/xpkgwedge.def
                    400: # is to catch users of xpkgwedge<1.0.
                    401: #
                    402: XMKMF?=                        ${XMKMF_CMD} ${XMKMF_FLAGS} -a
                    403: XMKMF_FLAGS?=          # empty
1.142     jlam      404: .if !empty(USE_XPKGWEDGE:M[Yy][Ee][Ss])
1.77      rh        405: X11PREFIX=             ${LOCALBASE}
                    406: XMKMF_CMD?=            ${X11PREFIX}/bin/pkgxmkmf
                    407: .else
                    408: X11PREFIX=             ${X11BASE}
                    409: XMKMF_CMD?=            ${X11PREFIX}/bin/xmkmf
                    410: .endif
                    411:
1.122     jlam      412: DEPOT_SUBDIR?=         packages
                    413: DEPOTBASE=             ${LOCALBASE}/${DEPOT_SUBDIR}
                    414:
1.165     jlam      415: # LINK_RPATH_FLAG publicly exports the linker flag used to set the
                    416: # run-time library search path.
1.107     jlam      417: #
1.165     jlam      418: .if defined(_OPSYS_LINKER_RPATH_FLAG)
                    419: LINKER_RPATH_FLAG=     ${_OPSYS_LINKER_RPATH_FLAG}
                    420: .else
                    421: LINKER_RPATH_FLAG?=    ${_LINKER_RPATH_FLAG}
                    422: .endif
                    423:
                    424: # COMPILER_RPATH_FLAG publicly exports the compiler flag used to pass
                    425: # run-time library search path directives to the linker.
                    426: #
                    427: .if defined(_OPSYS_COMPILER_RPATH_FLAG)
                    428: COMPILER_RPATH_FLAG=   ${_OPSYS_COMPILER_RPATH_FLAG}
                    429: .else
                    430: COMPILER_RPATH_FLAG?=  ${_COMPILER_RPATH_FLAG}
                    431: .endif
1.110     grant     432:
                    433: # WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the
                    434: # linker flags to extract all symbols from a static archive.
                    435: WHOLE_ARCHIVE_FLAG?=   ${_OPSYS_WHOLE_ARCHIVE_FLAG}
                    436: NO_WHOLE_ARCHIVE_FLAG?=        ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG}
1.26      agc       437:
1.22      agc       438: .ifndef DIGEST
                    439: DIGEST:=               ${LOCALBASE}/bin/digest
                    440: MAKEFLAGS+=            DIGEST=${DIGEST}
                    441: .endif
1.26      agc       442:
                    443: # Only add the DIGEST_VERSION value to MAKEFLAGS when we know
                    444: # we've got a valid version number, retrieved from the digest(1)
                    445: # binary. This is different to PKGTOOLS_VERSION, since, in that
1.78      wiz       446: # case, the build dies when pkg_info(1) is out of date.
1.22      agc       447:
1.25      agc       448: .if !exists(${DIGEST})
                    449: DIGEST_VERSION=                20010301
                    450: .elif !defined(DIGEST_VERSION)
                    451: DIGEST_VERSION!=       ${DIGEST} -V 2>/dev/null
1.150     jlam      452: MAKEFLAGS+=            DIGEST_VERSION=${DIGEST_VERSION}
1.23      wiz       453: .endif
                    454:
1.122     jlam      455: # This is the package database directory for the default view.
                    456: PKG_DBDIR?=            ${DESTDIR}/var/db/pkg
                    457:
                    458: # _PKG_DBDIR is the actual packages database directory where we register
                    459: # packages.
                    460: #
                    461: .if ${PKG_INSTALLATION_TYPE} == "overwrite"
                    462: _PKG_DBDIR=            ${PKG_DBDIR}
                    463: .elif ${PKG_INSTALLATION_TYPE} == "pkgviews"
                    464: _PKG_DBDIR=            ${DEPOTBASE}
                    465: .endif
                    466:
1.121     jlam      467: PKG_ADD_CMD?=          ${PKG_TOOLS_BIN}/pkg_add
                    468: PKG_ADMIN_CMD?=                ${PKG_TOOLS_BIN}/pkg_admin
                    469: PKG_CREATE_CMD?=       ${PKG_TOOLS_BIN}/pkg_create
                    470: PKG_DELETE_CMD?=       ${PKG_TOOLS_BIN}/pkg_delete
                    471: PKG_INFO_CMD?=         ${PKG_TOOLS_BIN}/pkg_info
1.122     jlam      472: PKG_VIEW_CMD?=         ${PKG_TOOLS_BIN}/pkg_view
                    473: LINKFARM_CMD?=         ${PKG_TOOLS_BIN}/linkfarm
                    474:
1.151     jlam      475: .if !defined(PKGTOOLS_VERSION)
                    476: PKGTOOLS_VERSION!=     ${PKG_INFO_CMD} -V 2>/dev/null || echo 20010302
                    477: MAKEFLAGS+=            PKGTOOLS_VERSION=${PKGTOOLS_VERSION}
                    478: .endif
                    479:
1.122     jlam      480: # The binary pkg_install tools all need to consistently to refer to the
                    481: # correct package database directory.
                    482: #
1.154     jlam      483: .if ${PKGTOOLS_VERSION} < 20030823
1.151     jlam      484: PKGTOOLS_ENV?=         PKG_DBDIR=${_PKG_DBDIR}
                    485: PKGTOOLS_ARGS?=                # empty
                    486: .else
                    487: PKGTOOLS_ENV?=         # empty
1.122     jlam      488: PKGTOOLS_ARGS?=                -K ${_PKG_DBDIR}
1.151     jlam      489: .endif
1.121     jlam      490:
1.122     jlam      491: # Views are rooted in ${LOCALBASE}, all packages are depoted in
                    492: # ${DEPOTBASE}, and the package database directory for the default view
                    493: # is in ${PKG_DBDIR}.
                    494: #
                    495: PKG_VIEW_ARGS?=                -W ${LOCALBASE} -d ${DEPOTBASE} -k ${PKG_DBDIR}
                    496:
1.151     jlam      497: PKG_ADD?=              ${PKGTOOLS_ENV} ${PKG_ADD_CMD} ${PKGTOOLS_ARGS}
                    498: PKG_ADMIN?=            ${PKGTOOLS_ENV} ${PKG_ADMIN_CMD} ${PKGTOOLS_ARGS}
                    499: PKG_CREATE?=           ${PKGTOOLS_ENV} ${PKG_CREATE_CMD} ${PKGTOOLS_ARGS}
                    500: PKG_DELETE?=           ${PKGTOOLS_ENV} ${PKG_DELETE_CMD} ${PKGTOOLS_ARGS}
                    501: PKG_INFO?=             ${PKGTOOLS_ENV} ${PKG_INFO_CMD} ${PKGTOOLS_ARGS}
                    502: PKG_VIEW?=             ${PKGTOOLS_ENV} ${PKG_VIEW_CMD} ${PKG_VIEW_ARGS}
1.122     jlam      503: LINKFARM?=             ${LINKFARM_CMD}
1.125     jlam      504:
                    505: # "${PKG_BEST_EXISTS} pkgpattern" prints out the name of the installed
                    506: # package that best matches pkgpattern.  Use this instead of
                    507: # "${PKG_INFO} -e pkgpattern" if the latter would return more than one
                    508: # package name.
                    509: #
1.144     jlam      510: PKG_BEST_EXISTS?=      ${PKG_ADMIN} -b -d ${_PKG_DBDIR} -S lsbest
1.79      jlam      511:
1.142     jlam      512: USE_BUILDLINK3?=       no      # default to not using buildlink3
                    513: .if ${PKG_INSTALLATION_TYPE} == "pkgviews"
                    514: USE_BUILDLINK3=                yes     # pkgviews requires buildlink3
                    515: .endif
                    516:
1.152     grant     517: .if exists(${LOCALBASE}/bsd/share/mk/zoularis.mk)
                    518: PKG_FAIL_REASON+=      'You appear to have a deprecated Zoularis installation.'
                    519: PKG_FAIL_REASON+=      'Please update your system to bootstrap-pkgsrc and remove the'
                    520: PKG_FAIL_REASON+=      '${LOCALBASE}/bsd directory.'
1.153     grant     521: PKG_FAIL_REASON+=      'See http://mail-index.NetBSD.org/tech-pkg/2004/02/14/0004.html'
                    522: PKG_FAIL_REASON+=      'for more details.'
1.69      jlam      523: .endif
1.82      jlam      524:
                    525: PKGPATH?=              ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|}
1.173     jlam      526: .if !defined(_PKGSRCDIR)
                    527: _PKGSRCDIR!=           cd ${_PKGSRC_TOPDIR} && ${PWD_CMD}
                    528: MAKEFLAGS+=            _PKGSRCDIR=${_PKGSRCDIR:Q}
1.171     jlam      529: .endif
1.173     jlam      530: PKGSRCDIR=             ${_PKGSRCDIR}
1.82      jlam      531:
1.171     jlam      532: DISTDIR?=              ${PKGSRCDIR}/distfiles
                    533: PACKAGES?=             ${PKGSRCDIR}/packages
                    534: TEMPLATES?=            ${PKGSRCDIR}/templates
1.82      jlam      535:
                    536: PATCHDIR?=             ${.CURDIR}/patches
                    537: SCRIPTDIR?=            ${.CURDIR}/scripts
                    538: FILESDIR?=             ${.CURDIR}/files
                    539: PKGDIR?=               ${.CURDIR}
1.120     gavan     540:
                    541: _PKGSRC_DEPS?=         # empty
1.82      jlam      542:
                    543: # If WRKOBJDIR is set, use that tree to build
1.88      jlam      544: .if defined(WRKOBJDIR)
1.82      jlam      545: BUILD_DIR?=            ${WRKOBJDIR}/${PKGPATH}
                    546: .else
1.105     jlam      547: BUILD_DIR!=            cd ${.CURDIR} && ${PWD_CMD}
                    548: .endif
1.82      jlam      549:
                    550: # If OBJHOSTNAME is set, use first component of hostname in directory name.
                    551: # If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
                    552: #
                    553: .if defined(OBJHOSTNAME)
                    554: .  if !defined(_HOSTNAME)
1.93      wiz       555: _HOSTNAME!=            ${UNAME} -n
1.82      jlam      556: MAKEFLAGS+=            _HOSTNAME=${_HOSTNAME}
                    557: .  endif
                    558: WRKDIR_BASENAME?=      work.${_HOSTNAME:C|\..*||}
1.150     jlam      559: MAKEFLAGS+=            OBJHOSTNAME=${OBJHOSTNAME}
1.82      jlam      560: .elif defined(OBJMACHINE)
                    561: WRKDIR_BASENAME?=      work.${MACHINE_ARCH}
1.150     jlam      562: MAKEFLAGS+=            OBJMACHINE=${OBJMACHINE}
1.82      jlam      563: .else
                    564: WRKDIR_BASENAME?=      work
1.93      wiz       565: .endif
1.82      jlam      566:
                    567: WRKDIR?=               ${BUILD_DIR}/${WRKDIR_BASENAME}
1.119     jlam      568:
                    569: # There are many uses for a common log file, so define one that may be
1.162     wiz       570: # picked up and used by tools.mk, bsd.buildlink3.mk, etc.
1.119     jlam      571: #
                    572: WRKLOG?=               ${WRKDIR}/.work.log
1.128     grant     573:
1.164     jlam      574: PKG_DEFAULT_OPTIONS?=  # empty
                    575: PKG_OPTIONS?=          # empty
                    576:
1.177.2.5  tv        577: # we want this *before* compiler.mk, so that compiler.mk paths override them
                    578: PREPEND_PATH+=         ${LOCALBASE}/bin ${USE_IMAKE:D${X11BASE}/bin}
                    579:
1.168     jlam      580: # Wrapper framework definitions
1.177.2.5  tv        581: .include "${PKGSRCDIR}/mk/wrapper/wrapper-defs.mk"
1.168     jlam      582:
1.177.2.1  tv        583: .if !defined(DEPENDS_TARGET)
                    584: .  if make(package)
                    585: DEPENDS_TARGET=        package
                    586: .  elif make(update)
                    587: .    if defined(UPDATE_TARGET) && ${UPDATE_TARGET} == "replace"
                    588: DEPENDS_TARGET=        ${UPDATE_TARGET}
                    589: .    else
                    590: DEPENDS_TARGET=        update
                    591: .    endif
                    592: .  elif make(bin-install)
                    593: DEPENDS_TARGET=        bin-install
                    594: .  else
                    595: DEPENDS_TARGET=        reinstall
                    596: .  endif
                    597: .endif
                    598:
                    599: .if !defined(UPDATE_TARGET)
                    600: .  if ${DEPENDS_TARGET} == "update"
                    601: .    if make(package)
                    602: UPDATE_TARGET= package
                    603: .    else
                    604: UPDATE_TARGET= install
                    605: .    endif
                    606: .  endif
                    607: .endif
                    608: UPDATE_TARGET?=        ${DEPENDS_TARGET}
                    609:
1.104     jlam      610: .endif # BSD_PKG_MK

CVSweb <webmaster@jp.NetBSD.org>