[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.112

1.111     grant       1: # $NetBSD: bsd.prefs.mk,v 1.110 2003/04/15 05:29:46 grant 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.9       christos   16: .if exists(/usr/bin/uname)
                     17: UNAME=/usr/bin/uname
                     18: .elif exists(/bin/uname)
                     19: UNAME=/bin/uname
                     20: .else
                     21: UNAME=echo Unknown
                     22: .endif
                     23:
1.7       tv         24: .ifndef OPSYS
1.9       christos   25: OPSYS!=                        ${UNAME} -s
1.17      mycroft    26: .endif
1.16      hubertf    27: MAKEFLAGS+=            OPSYS=${OPSYS}
1.7       tv         28: .ifndef OS_VERSION
1.9       christos   29: OS_VERSION!=           ${UNAME} -r
1.66      abs        30: .endif
                     31: .ifndef LOWER_OS_VERSION
1.108     wiz        32: LOWER_OS_VERSION!=     echo ${OS_VERSION} | tr 'A-Z' 'a-z'
1.17      mycroft    33: .endif
1.16      hubertf    34: MAKEFLAGS+=            OS_VERSION=${OS_VERSION}
1.1       agc        35:
1.7       tv         36: # Preload these for architectures not in all variations of bsd.own.mk.
                     37: GNU_ARCH.alpha?=       alpha
1.70      fredb      38: GNU_ARCH.arm26?=       arm
1.7       tv         39: GNU_ARCH.arm32?=       arm
                     40: GNU_ARCH.i386?=                i386
1.12      christos   41: GNU_ARCH.i486?=                i386
                     42: GNU_ARCH.i586?=                i386
                     43: GNU_ARCH.i686?=                i386
1.70      fredb      44: GNU_ARCH.m68000?=      m68010
1.7       tv         45: GNU_ARCH.m68k?=                m68k
                     46: GNU_ARCH.mips?=                mipsel
1.41      rafal      47: GNU_ARCH.mipseb?=      mipseb
1.45      drochner   48: GNU_ARCH.mipsel?=      mipsel
1.7       tv         49: GNU_ARCH.ns32k?=       ns32k
1.47      mjl        50: GNU_ARCH.powerpc?=     powerpc
1.70      fredb      51: GNU_ARCH.sh3eb?=       sh
                     52: GNU_ARCH.sh3el?=       shle
1.7       tv         53: GNU_ARCH.sparc?=       sparc
1.57      skrll      54: GNU_ARCH.sparc64?=     sparc64
1.7       tv         55: GNU_ARCH.vax?=         vax
                     56: MACHINE_GNU_ARCH?=     ${GNU_ARCH.${MACHINE_ARCH}}
1.3       tv         57:
1.10      agc        58: .if ${OPSYS} == "NetBSD"
                     59: LOWER_OPSYS?=          netbsd
1.90      grant      60:
                     61: .elif ${OPSYS} == "FreeBSD"
                     62: LOWER_OPSYS?=          freebsd
                     63: LOWER_ARCH!=           ${UNAME} -p
                     64: MACHINE_ARCH=          ${LOWER_ARCH}
                     65: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
1.91      grant      66: .  if ${LOWER_ARCH} == "i386"
1.90      grant      67: LOWER_VENDOR?=         pc
1.91      grant      68: .  else
                     69: LOWER_VENDOR?=         unknown
                     70: .  endif
1.58      abs        71:
1.10      agc        72: .elif ${OPSYS} == "SunOS"
1.80      agc        73: .  if ${MACHINE_ARCH} == "sparc"
                     74: SPARC_TARGET_ARCH?=    sparcv7
                     75: .  elif ${MACHINE_ARCH} == "sun4"
                     76: MACHINE_ARCH=          sparc
1.81      bouyer     77: SPARC_TARGET_ARCH?=    sparcv7
1.80      agc        78: .  elif ${MACHINE_ARCH} == "i86pc"
                     79: MACHINE_ARCH=          i386
1.112   ! grant      80: .  elif ${MACHINE_ARCH} == "unknown"
        !            81: .    if !defined(LOWER_ARCH)
        !            82: LOWER_ARCH!=           ${UNAME} -p
        !            83: .    endif     # !defined(LOWER_ARCH)
        !            84: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
1.80      agc        85: .  endif
1.7       tv         86: LOWER_VENDOR?=         sun
1.112   ! grant      87: LOWER_OPSYS?=          solaris
1.58      abs        88:
1.10      agc        89: .elif ${OPSYS} == "Linux"
                     90: LOWER_OPSYS?=          linux
1.100     jschauma   91: MACHINE_ARCH:=          ${MACHINE_ARCH:C/i.86/i386/}
1.102     jschauma   92: .  if !defined(LOWER_ARCH)
                     93: LOWER_ARCH!=           ${UNAME} -m | sed -e 's/i.86/i386/'
                     94: .  endif # !defined(LOWER_ARCH)
1.80      agc        95: .  if ${MACHINE_ARCH} == "unknown"
1.35      abs        96: MACHINE_ARCH=          ${LOWER_ARCH}
1.16      hubertf    97: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
1.106     jschauma   98: .  endif
                     99: .  if exists(/etc/debian_version)
                    100: LOWER_VENDOR?=         debian
                    101: .  elif exists(/etc/mandrake-release)
                    102: LOWER_VENDOR?=         mandrake
                    103: .  elif exists(/etc/redhat-version)
                    104: LOWER_VENDOR?=         redhat
                    105: .  elif exists(/etc/slackware-version)
                    106: LOWER_VENDOR?=         slackware
                    107: .  elif ${LOWER_ARCH} == "i386"
                    108: LOWER_VENDOR?=          pc
                    109: .  else
                    110: LOWER_VENDOR?=          unknown
1.16      hubertf   111: .  endif
1.12      christos  112:
1.61      agc       113: .elif ${OPSYS} == "Darwin"
                    114: LOWER_OPSYS?=          darwin
                    115: LOWER_ARCH!=           ${UNAME} -p
                    116: MACHINE_ARCH=          ${LOWER_ARCH}
                    117: MAKEFLAGS+=            LOWER_ARCH=${LOWER_ARCH}
                    118: LOWER_VENDOR?=         apple
1.94      jschauma  119:
                    120: .elif ${OPSYS:MIRIX*} != ""
1.109     jschauma  121: LOWER_ARCH!=            ${UNAME} -p
1.94      jschauma  122: LOWER_OPSYS?=          irix${OS_VERSION:C/\.[0-9]//}
                    123: LOWER_VENDOR?=         sgi
1.61      agc       124:
1.10      agc       125: .elif !defined(LOWER_OPSYS)
1.101     jschauma  126: LOWER_OPSYS!=          echo ${OPSYS} | tr A-Z a-z
1.17      mycroft   127: .endif
1.58      abs       128:
1.16      hubertf   129: MAKEFLAGS+=            LOWER_OPSYS=${LOWER_OPSYS}
1.7       tv        130:
                    131: LOWER_VENDOR?=
                    132: LOWER_ARCH?=           ${MACHINE_GNU_ARCH}
                    133:
                    134: MACHINE_PLATFORM?=     ${OPSYS}-${OS_VERSION}-${MACHINE_ARCH}
1.70      fredb     135: MACHINE_GNU_PLATFORM?= ${LOWER_ARCH}-${LOWER_VENDOR}-${LOWER_OPSYS}${APPEND_ELF}
1.59      agc       136:
1.60      tron      137: # Needed on NetBSD and SunOS (zoularis) to prevent an "install:" target
                    138: # from being created in bsd.own.mk.
                    139: NEED_OWN_INSTALL_TARGET=no
1.65      tv        140:
                    141: # This prevents default use of the cross-tool harness in the "src" tree,
                    142: # in the odd possible case of someone extracting "pkgsrc" underneath "src".
                    143: USETOOLS=              no
                    144: MAKE_ENV+=             USETOOLS=no
1.71      schmonz   145:
                    146: # Set this before <bsd.own.mk> does, since it doesn't know about Darwin
                    147: .if ${OPSYS} == "Darwin"
                    148: OBJECT_FMT?=           Mach-O
                    149: .endif
1.60      tron      150:
1.73      jlam      151: .include <bsd.own.mk>
                    152:
1.72      jlam      153: # /usr/share/mk/bsd.own.mk on NetBSD 1.3 does not define OBJECT_FMT
                    154: .if ${MACHINE_PLATFORM:MNetBSD-1.3*} != ""
                    155: .if ${MACHINE_ARCH} == "alpha" || \
                    156: ${MACHINE_ARCH} == "mipsel" || ${MACHINE_ARCH} == "mipseb" || \
                    157: ${MACHINE_ARCH} == "powerpc" || ${MACHINE_ARCH} == "sparc64"
                    158: OBJECT_FMT?=           ELF
                    159: .else
                    160: OBJECT_FMT?=           a.out
                    161: .endif
                    162: .endif
1.60      tron      163:
1.59      agc       164: # include the defaults file
                    165: .if exists(${.CURDIR}/../../mk/bsd.pkg.defaults.mk)
                    166: .include "${.CURDIR}/../../mk/bsd.pkg.defaults.mk"
                    167: .elif exists(${.CURDIR}/../mk/bsd.pkg.defaults.mk)
                    168: .include "${.CURDIR}/../mk/bsd.pkg.defaults.mk"
                    169: .elif exists(${.CURDIR}/mk/bsd.pkg.defaults.mk)
                    170: .include "${.CURDIR}/mk/bsd.pkg.defaults.mk"
1.70      fredb     171: .endif
                    172:
                    173: .if ${OPSYS} == "NetBSD"
                    174: . if ${OBJECT_FMT} == "ELF" && \
                    175:     (${MACHINE_GNU_ARCH} == "arm" || \
                    176:      ${MACHINE_ARCH} == "i386" || \
                    177:      ${MACHINE_ARCH} == "m68k" || \
                    178:      ${MACHINE_ARCH} == "m68000" || \
                    179:      ${MACHINE_GNU_ARCH} == "sh" || \
                    180:      ${MACHINE_GNU_ARCH} == "shle" || \
                    181:      ${MACHINE_ARCH} == "sparc" || \
                    182:      ${MACHINE_ARCH} == "vax")
                    183: APPEND_ELF=            elf
                    184: . endif
1.48      abs       185: .endif
1.7       tv        186:
                    187: SHAREOWN?=             ${DOCOWN}
                    188: SHAREGRP?=             ${DOCGRP}
                    189: SHAREMODE?=            ${DOCMODE}
1.1       agc       190:
1.3       tv        191: .if defined(PREFIX) && (${PREFIX} != ${__PREFIX_SET__})
1.2       tv        192: .BEGIN:
                    193:        @${ECHO_MSG} "You can NOT set PREFIX manually or in mk.conf.  Set LOCALBASE or X11BASE"
                    194:        @${ECHO_MSG} "depending on your needs.  See the pkg system documentation for more info."
                    195:        @${FALSE}
1.14      itojun    196: .endif
                    197:
1.7       tv        198: # Preload all default values for CFLAGS, LDFLAGS, etc. before bsd.pkg.mk
                    199: # or a pkg Makefile modifies them.
1.6       tv        200: .include <sys.mk>
1.5       tv        201:
1.42      skrll     202: # Load the OS-specific definitions for program variables.  Default to loading
                    203: # the NetBSD ones if an OS-specific file doesn't exist.
                    204: .if exists(${.CURDIR}/../../mk/defs.${OPSYS}.mk)
                    205: .include "${.CURDIR}/../../mk/defs.${OPSYS}.mk"
                    206: .elif exists(${.CURDIR}/../mk/defs.${OPSYS}.mk)
                    207: .include "${.CURDIR}/../mk/defs.${OPSYS}.mk"
                    208: .elif exists(${.CURDIR}/mk/defs.${OPSYS}.mk)
                    209: .include "${.CURDIR}/mk/defs.${OPSYS}.mk"
                    210: .elif exists(${.CURDIR}/../../mk/defs.NetBSD.mk)
                    211: .include "${.CURDIR}/../../mk/defs.NetBSD.mk"
                    212: .elif exists(${.CURDIR}/../mk/defs.NetBSD.mk)
                    213: .include "${.CURDIR}/../mk/defs.NetBSD.mk"
                    214: .else exists(${.CURDIR}/mk/defs.NetBSD.mk)
                    215: .include "${.CURDIR}/mk/defs.NetBSD.mk"
1.97      schmonz   216: .endif
                    217:
                    218: # if the system is IPv6-ready, compile with IPv6 support turned on.
                    219: .if empty(_OPSYS_HAS_INET6:M[nN][oO]) && !defined(USE_SOCKS)
                    220: USE_INET6?=            YES
                    221: .else
                    222: USE_INET6?=            NO
1.42      skrll     223: .endif
1.22      agc       224:
1.36      abs       225: LOCALBASE?=            ${DESTDIR}/usr/pkg
1.87      jlam      226: .if ${OPSYS} == "SunOS"
                    227: # On Solaris, we default to using OpenWindows for X11.
                    228: X11BASE?=               ${DESTDIR}/usr/openwin
                    229: .else
1.22      agc       230: X11BASE?=              ${DESTDIR}/usr/X11R6
1.87      jlam      231: .endif
1.22      agc       232: CROSSBASE?=            ${LOCALBASE}/cross
1.77      rh        233:
                    234: # Set X11PREFIX to reflect the install directory of X11 packages.
                    235: # Set XMKMF_CMD properly if xpkgwedge is installed.
                    236: #
                    237: # The check for the existence of ${X11BASE}/lib/X11/config/xpkgwedge.def
                    238: # is to catch users of xpkgwedge<1.0.
                    239: #
                    240: XMKMF?=                        ${XMKMF_CMD} ${XMKMF_FLAGS} -a
                    241: XMKMF_FLAGS?=          # empty
                    242: .if exists(${LOCALBASE}/lib/X11/config/xpkgwedge.def) || \
                    243:     exists(${X11BASE}/lib/X11/config/xpkgwedge.def)
                    244: HAVE_XPKGWEDGE=                yes
                    245: X11PREFIX=             ${LOCALBASE}
                    246: XMKMF_CMD?=            ${X11PREFIX}/bin/pkgxmkmf
                    247: .else
                    248: X11PREFIX=             ${X11BASE}
                    249: XMKMF_CMD?=            ${X11PREFIX}/bin/xmkmf
                    250: .endif
                    251:
1.107     jlam      252: # RPATH_FLAG publicly exports the linker flag used to specify run-time
                    253: # library search paths.
                    254: #
                    255: RPATH_FLAG?=   ${_OPSYS_RPATH_NAME}
1.110     grant     256:
                    257: # WHOLE_ARCHIVE_FLAG and NO_WHOLE_ARCHIVE_FLAG publically export the
                    258: # linker flags to extract all symbols from a static archive.
                    259: WHOLE_ARCHIVE_FLAG?=   ${_OPSYS_WHOLE_ARCHIVE_FLAG}
                    260: NO_WHOLE_ARCHIVE_FLAG?=        ${_OPSYS_NO_WHOLE_ARCHIVE_FLAG}
1.26      agc       261:
1.22      agc       262: .ifndef DIGEST
                    263: DIGEST:=               ${LOCALBASE}/bin/digest
                    264: MAKEFLAGS+=            DIGEST=${DIGEST}
                    265: .endif
1.26      agc       266:
                    267: # Only add the DIGEST_VERSION value to MAKEFLAGS when we know
                    268: # we've got a valid version number, retrieved from the digest(1)
                    269: # binary. This is different to PKGTOOLS_VERSION, since, in that
1.78      wiz       270: # case, the build dies when pkg_info(1) is out of date.
1.22      agc       271:
1.25      agc       272: .if !exists(${DIGEST})
                    273: DIGEST_VERSION=                20010301
                    274: .elif !defined(DIGEST_VERSION)
                    275: DIGEST_VERSION!=       ${DIGEST} -V 2>/dev/null
1.22      agc       276: MAKEFLAGS+=            DIGEST_VERSION="${DIGEST_VERSION}"
1.23      wiz       277: .endif
                    278:
1.79      jlam      279: PKG_DBDIR?=    ${DESTDIR}/var/db/pkg
1.93      wiz       280: PKG_ADD?=      PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_add
1.79      jlam      281: PKG_ADMIN?=    PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_admin
                    282: PKG_CREATE?=   PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_create
                    283: PKG_DELETE?=   PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_delete
                    284: PKG_INFO?=     PKG_DBDIR=${PKG_DBDIR} ${PKG_TOOLS_BIN}/pkg_info
                    285:
1.23      wiz       286: .ifndef PKGTOOLS_VERSION
1.79      jlam      287: PKGTOOLS_VERSION!=     ${PKG_INFO} -V 2>/dev/null || echo 20010302
                    288: MAKEFLAGS+=            PKGTOOLS_VERSION="${PKGTOOLS_VERSION}"
1.28      tron      289: .endif
                    290:
1.31      tron      291: .if (${OPSYS} == SunOS) && !defined(ZOULARIS_VERSION)
1.32      hubertf   292: .if !exists(${ZOULARISBASE}/share/mk/zoularis.mk)
1.28      tron      293: ZOULARIS_VERSION=      20000522
                    294: .else
1.32      hubertf   295: .include "${ZOULARISBASE}/share/mk/zoularis.mk"
1.28      tron      296: .endif
                    297: MAKEFLAGS+=            ZOULARIS_VERSION="${ZOULARIS_VERSION}"
1.69      jlam      298: .endif
1.82      jlam      299:
                    300: _PKGSRCDIR?=           ${.CURDIR:C|/[^/]*/[^/]*$||}
                    301: PKGPATH?=              ${.CURDIR:C|.*/([^/]*/[^/]*)$|\1|}
                    302:
                    303: DISTDIR?=              ${_PKGSRCDIR}/distfiles
                    304: PACKAGES?=             ${_PKGSRCDIR}/packages
                    305: TEMPLATES?=            ${_PKGSRCDIR}/templates
                    306:
                    307: PATCHDIR?=             ${.CURDIR}/patches
                    308: SCRIPTDIR?=            ${.CURDIR}/scripts
                    309: FILESDIR?=             ${.CURDIR}/files
                    310: PKGDIR?=               ${.CURDIR}
                    311:
                    312: # If WRKOBJDIR is set, use that tree to build
1.88      jlam      313: .if defined(WRKOBJDIR)
1.82      jlam      314: BUILD_DIR?=            ${WRKOBJDIR}/${PKGPATH}
                    315: .else
1.105     jlam      316: BUILD_DIR!=            cd ${.CURDIR} && ${PWD_CMD}
                    317: .endif
1.82      jlam      318:
                    319: # If OBJHOSTNAME is set, use first component of hostname in directory name.
                    320: # If OBJMACHINE is set, use ${MACHINE_ARCH} in the working directory name.
                    321: #
                    322: .if defined(OBJHOSTNAME)
                    323: .  if !defined(_HOSTNAME)
1.93      wiz       324: _HOSTNAME!=            ${UNAME} -n
1.82      jlam      325: MAKEFLAGS+=            _HOSTNAME=${_HOSTNAME}
                    326: .  endif
                    327: WRKDIR_BASENAME?=      work.${_HOSTNAME:C|\..*||}
1.89      jlam      328: MAKEFLAGS+=            OBJHOSTNAME="${OBJHOSTNAME}"
1.82      jlam      329: .elif defined(OBJMACHINE)
                    330: WRKDIR_BASENAME?=      work.${MACHINE_ARCH}
1.89      jlam      331: MAKEFLAGS+=            OBJMACHINE="${OBJMACHINE}"
1.82      jlam      332: .else
                    333: WRKDIR_BASENAME?=      work
1.93      wiz       334: .endif
1.82      jlam      335:
                    336: WRKDIR?=               ${BUILD_DIR}/${WRKDIR_BASENAME}
1.18      rh        337:
1.104     jlam      338: .endif # BSD_PKG_MK

CVSweb <webmaster@jp.NetBSD.org>