pkgsrc/shells/ast-ksh/Makefile.common

84 lines
2.5 KiB
Text

# $NetBSD: Makefile.common,v 1.36 2020/04/17 21:28:01 ad Exp $
#
# used by shells/ast-ksh/Makefile
# used by shells/static-ast-ksh/Makefile
DISTNAME= ast-ksh-${ASTKSH_VERSION}
PKGNAME= ast-ksh-${ASTKSH_VERSION:S/-//g}
CATEGORIES= shells
# originally at http://www2.research.att.com/~gsf/download/tgz/
# but it requires authentication
MASTER_SITES= ${MASTER_SITE_LOCAL}
DISTFILES= INIT.${ASTKSH_VERSION}.tgz ast-ksh.${ASTKSH_VERSION}.tgz
MAINTAINER= pkgsrc-users@NetBSD.org
HOMEPAGE= http://www.kornshell.com/
COMMENT= Official AT&T release of KornShell 93
LICENSE= epl-v1.0
USE_TOOLS= bash
NOT_FOR_PLATFORM= Interix-*-* # taking nearly a day to build and crash!
CONFLICTS= static-ast-ksh-[0-9]*
KSH93_MAKEFLAGS=
ASTKSH_VERSION= 2012-08-01
WRKSRC= ${WRKDIR}
MAKE_FLAGS+= CC=${CC:Q} CCFLAGS=${CFLAGS:M*:Q}
.include "../../mk/bsd.prefs.mk"
.if ${OPSYS} == "NetBSD"
PDKSH= ${TOOLS_PATH.bash}
KSH93_MAKEFLAGS+= "SHELL=${PDKSH}"
KSH93_MAKEFLAGS+= "CCFLAGS=-D_NETBSD_SOURCE"
.endif
# Link with libm to fix sfcvt link error -
# this is kind of a hack -
# better would be to fix the 'meta makefile' to pass this
# or to use the ksh-provided math routines.
KSH93_MAKEFLAGS+= LDFLAGS=-lm
.if ${OPSYS} == "SunOS"
# need c99 and _XPG6 in order to avoid patching libast/features/standards
# __EXTENSIONS__ is needed in case of __STDC__ == 1 (i.e. -std=c99 not gnu99)
# for things like mamake, ratz and some others for now.
USE_LANGUAGES+= c99
KSH93_MAKEFLAGS+= CCFLAGS="-D_XPG6 -D__EXTENSIONS__"
.endif
PKG_SHELL= bin/ksh93
INSTALLATION_DIRS= bin ${PKGMANDIR}/man1
# ${KSH93_MAKEFLAGS} is set as "LDFLAGS=-static" only when built as a
# static binary.
#
# XXX Note that 'make' here is not an executable command name, but a target
# name which the ./bin/package script uses.
do-build:
@cd ${WRKSRC:Q} && \
${SETENV} SHELL=${PDKSH:Q} \
${PDKSH:Q} ./bin/package make ${KSH93_MAKEFLAGS}
do-install:
@set -e; \
arch=`${WRKSRC}/bin/package host`; \
${INSTALL_PROGRAM} ${WRKSRC}/arch/"$${arch}"/bin/ksh \
${DESTDIR}${PREFIX}/bin/ksh93; \
${INSTALL_MAN} ${WRKSRC}/arch/"$${arch}"/man/man1/sh.1 \
${DESTDIR}${PREFIX}/${PKGMANDIR}/man1/ksh93.1
# Part of regression test
do-test:
@set -e; \
arch=`${WRKSRC}/bin/package host`; \
cd ${WRKSRC:Q}/src/cmd/ksh93/tests && \
${SETENV} SHELL=${WRKSRC}/arch/"$${arch}"/bin/ksh \
${WRKSRC}/arch/"$${arch}"/bin/ksh shtests
# XXX Their 'test' target needs nmake (Korn's another tool)
# @cd ${WRKSRC}; \
# ${SETENV} SHELL=${PDKSH} ${PDKSH} ./bin/package test