freebsd-ports/editors/emacs21/Makefile
Bryan Drewery c93dfc2e9f SSP support has been added to ports with WITH_SSP for i386 and amd64
on FreeBSD 10, and amd64 on earlier versions.

SSP_UNSAFE is added to disable in a port if it fails to build, but
this should only be used in rare circumstances such as kernel modules.
Otherwise, the port may just be failing due to lack of respecting
LDFLAGS.

On FreeBSD 10, this uses an ldscript in /usr/lib/libc.so to pull in
libssp_nonshared.a to address issues linking on i386 [1].

On earlier FreeBSD versions the WITH_SSP knob will add -lssp_nonshared
to LDFLAGS on i386. This is not needed on amd64. However, several hundred
ports do not currently respect LDFLAGS, so this support is disabled currently
as it causes build failures if a dependency is looking for the stack_chk
symbols.

Many thanks to jlh@ for this as he had many years of patience in getting
all of the necessary pieces [1][2] in.

[1] http://svnweb.freebsd.org/base/head/lib/libc/libc.ldscript?revision=251668&view=markup

PR:		ports/138228 [2]
Submitted by:	jlh (bsd.ssp.mk based on)
Reviewed by:	bapt
With hat:	portmgr
exp-runs done:	37 over a month on 91i386,91amd64,10i386,10amd64
2013-09-20 12:54:54 +00:00

91 lines
2.5 KiB
Makefile

# Created by: MANTANI Nobutaka <nobutaka@nobutaka.com>
# $FreeBSD$
PORTNAME= emacs
PORTVERSION= 21.3
PORTREVISION= 16
CATEGORIES= editors ipv6
MASTER_SITES= ${MASTER_SITE_GNU:C/\/gnu\//\/old-gnu\//g}
MASTER_SITE_SUBDIR= ${PORTNAME}
.if defined(WITH_MENUBAR_FONTSET)
PATCH_SITES= http://nijino.homelinux.net/emacs/
PATCHFILES= emacs-21.1-fontset.patch emacs-21.2-menu-encode.patch
PATCH_DIST_STRIP= -p1
.endif
MAINTAINER= ashish@FreeBSD.org
COMMENT= GNU editing macros
CONFLICTS= emacs-19.* emacs-22.* emacs-23.* emacs-24.* \
xemacs-[0-9]* xemacs-devel-[0-9]* \
xemacs-mule-[0-9]* xemacs-devel-mule-[0-9]*
SSP_UNSAFE= yes
.if !defined(WITHOUT_X11)
LIB_DEPENDS= Xaw3d:${PORTSDIR}/x11-toolkits/Xaw3d \
jpeg.11:${PORTSDIR}/graphics/jpeg \
tiff.4:${PORTSDIR}/graphics/tiff \
gif.5:${PORTSDIR}/graphics/giflib \
png15:${PORTSDIR}/graphics/png
USE_XORG= xpm
.endif
USE_AUTOTOOLS= autoconf213
USE_GMAKE= yes
CONFIGURE_TARGET= ${MACHINE_ARCH}--freebsd
.if defined(WITHOUT_X11)
CONFIGURE_ARGS= --with-x=no
.endif
.if defined(WITHOUT_XIM)
CONFIGURE_ARGS+= --without-xim
.endif
MAN1= ctags.1 emacs.1 etags.1 gfdl.1
PLIST_SUB= EMACS_VER=${PORTVERSION} EMACS_ARCH=${CONFIGURE_TARGET}
TEXIFILES= ada-mode autotype cc-mode cl dired-x ebrowse ediff \
faq emacs emacs-mime eshell eudc forms gnus idlwave \
info message mh-e pcl-cvs reftex sc speedbar vip \
viper widget woman
INFO= ada-mode autotype ccmode cl dired-x ebrowse ediff \
efaq emacs emacs-mime eshell eudc forms gnus idlwave \
info message mh-e pcl-cvs reftex sc speedbar vip \
viper widget woman
LATEST_LINK= emacs21
.include <bsd.port.pre.mk>
.if ${ARCH} == "ia64"
CFLAGS:= ${CFLAGS:C/-O.?/-O0/g}
.endif
pre-everything::
.if !defined(WITH_MENUBAR_FONTSET)
@${ECHO_MSG} "====>"
@${ECHO_MSG} "====> To enable menubar fontset support, define WITH_MENUBAR_FONTSET"
@${ECHO_MSG} "====>"
.endif
post-patch:
@${RM} -f ${WRKSRC}/info/*
@(cd ${WRKSRC}/man ; \
for f in ${TEXIFILES} ; do \
${CP} $${f}.texi $${f}.texi.orig ; \
${SED} -e "s/@dircategory Emacs/@dircategory The Emacs editor and associated tools/" < $${f}.texi.orig > $${f}.texi ; \
${RM} $${f}.texi.orig ; \
done)
post-build:
(cd ${WRKSRC}/lisp ; \
${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} recompile ; \
${RM} ${WRKSRC}/src/emacs ${WRKSRC}/src/emacs-${PORTVERSION}.1 ; \
cd ${WRKSRC}/src ; \
${SETENV} ${MAKE_ENV} ${GMAKE} ${MAKE_FLAGS} ${MAKEFILE} ${MAKE_ARGS} ${ALL_TARGET})
post-install:
@${CAT} ${PKGMESSAGE}
.include <bsd.port.post.mk>