[BACK]Return to Makefile.common CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / editors / emacs21

File: [cvs.NetBSD.org] / pkgsrc / editors / emacs21 / Makefile.common (download)

Revision 1.13, Sat Apr 6 20:27:20 2013 UTC (10 years, 11 months ago) by rodent
Branch: MAIN
CVS Tags: pkgsrc-2013Q3-base, pkgsrc-2013Q3, pkgsrc-2013Q2-base, pkgsrc-2013Q2
Changes since 1.12: +2 -2 lines

Resolves:
"INFO_FILES should be set to YES or yes."
"Packages that install info files should set INFO_FILES."
Makefile and PLIST warning, respectively.

# $NetBSD: Makefile.common,v 1.13 2013/04/06 20:27:20 rodent Exp $
#
# used by editors/emacs21/Makefile
# used by editors/emacs21-nox11/Makefile

DISTNAME=	emacs-${EMACSVERSION}a
PKGNAME?=	emacs21-${EMACSVERSION}a

MASTER_SITES=	${MASTER_SITE_GNU:=emacs/}
MAINTAINER=	pkgsrc-users@NetBSD.org
HOMEPAGE=	http://www.gnu.org/software/emacs/emacs.html
COMMENT=	GNU editing macros (editor)

CONFLICTS=	mule-[0-9]*

USE_TOOLS+=		gmake perl:run
GNU_CONFIGURE=		yes

PATCHDIR=	${.CURDIR}/../../editors/emacs21/patches
FILESDIR=	${.CURDIR}/../../editors/emacs21/files
DISTINFO_FILE=	${.CURDIR}/../../editors/emacs21/distinfo
PLIST_SRC=	${.CURDIR}/../../editors/emacs21/PLIST

# needed for 21.4a, can probably go away on next update
EMACSVERSION=	21.4
WRKSRC=		${WRKDIR}/emacs-${EMACSVERSION}
PLIST_SUBST+=	EMACSVERSION=${EMACSVERSION:Q}

MAKEFLAGS+=	EMACSLOADPATH=${WRKSRC}/lisp

# build PATH in the dumped emacs is not a problem
CHECK_WRKREF_SKIP+=	bin/emacs
CHECK_WRKREF_SKIP+=	bin/emacs-${EMACSVERSION}

CONFIGURE_ARGS+=	--srcdir=${WRKSRC:Q}
INSTALL_MAKE_FLAGS+=	prefix=${DESTDIR}${PREFIX}
INSTALL_MAKE_FLAGS+=	mandir=${DESTDIR}${PREFIX}/${PKGMANDIR}
INSTALL_MAKE_FLAGS+=	infodir=${DESTDIR}${PREFIX}/${PKGINFODIR}

.include "../../mk/bsd.prefs.mk"

# This matches NetBSD <1.7 releases and 1.6A-1.6P, where ld is <2.13.2.1.
.if (${OPSYS} == "NetBSD" && \
    (empty(OS_VERSION:M1.[0-5]*) && \
     empty(OS_VERSION:M1.6_*) && \
     empty(OS_VERSION:M1.6) && \
     empty(OS_VERSION:M1.6.[0-9]*) && \
     empty(OS_VERSION:M1.6[A-P]*))) || \
    ${OPSYS} == "DragonFly"
# If using GNU ld 2.13.2.1 or later, avoid creating combined reloc
# sections and .data reloc sections, both of which Emacs can't handle
# properly.  Analyzed by Stephen Ma.
LDFLAGS+=	-Wl,-z,nocombreloc
.endif

# Use terminfo on NetBSD-6.
# We cannot use terminfo.*.mk as emacs WILL force a link to termcap,
# but this is fine for us.
.if (${OPSYS} == "NetBSD") && exists(/usr/include/term.h)
CPPFLAGS+=	-DTERMINFO
.endif

.if (${OPSYS} == "DragonFly") && exists(/usr/lib/crtn.o)
CPPFLAGS+=	-DDFLY_CRT_USRLIB
.endif

PLIST_VARS+=	fns.el
.if ${OPSYS} == "Darwin"
PLIST_SUBST+=	DOCTAIL=""
.else
PLIST.fns.el=	yes
PLIST_SUBST+=	DOCTAIL="-${EMACSVERSION}.1"
.endif

# Disable W^X.
.if ${OPSYS} == "OpenBSD"
LDFLAGS+=	-Z
.endif

.include "../../mk/compiler.mk"
.if !empty(CC_VERSION:Mgcc-3.*)
CFLAGS+=	-fno-zero-initialized-in-bss
.endif

INFO_FILES=	yes
REPLACE_PERL=	lib-src/grep-changelog

post-extract:
	${CP} ${FILESDIR}/site-init.el ${WRKSRC}/lisp
	${CP} ${FILESDIR}/amd64.h ${WRKSRC}/src/m
	${CP} ${FILESDIR}/powermac.h ${WRKSRC}/src/m
	${CP} ${FILESDIR}/darwin.h ${WRKSRC}/src/s
	${CP} ${FILESDIR}/dragonfly.h ${WRKSRC}/src/s
	${CP} ${FILESDIR}/unexmacosx.c ${WRKSRC}/src
	${CP} ${FILESDIR}/sh3el.h ${WRKSRC}/src/m

# for patch-ba
post-build:
	cd ${WRKSRC}/lisp && \
	   rm sort.elc && ${MAKE_PROGRAM} sort.elc && \
	   rm mail/smtpmail.elc && ${MAKE_PROGRAM} mail/smtpmail.elc && \
	   rm fast-lock.elc && ${MAKE_PROGRAM} fast-lock.elc

pre-install:
	@${FIND} ${WRKSRC} -type f -name "*.orig" -print | ${XARGS} ${RM} -f

post-install:
	${CHOWN} -R ${SHAREOWN}:${SHAREGRP} ${DESTDIR}${PREFIX}/share/emacs
	${CHMOD} -R go-w ${DESTDIR}${PREFIX}/share/emacs