summaryrefslogtreecommitdiff
path: root/editors
diff options
context:
space:
mode:
authortron <tron>2011-07-20 23:24:05 +0000
committertron <tron>2011-07-20 23:24:05 +0000
commita8a756f00c5db829f5fbe9346f4dc57587691100 (patch)
tree0b41a070b89c827c3dce8d4a27b3c69d5d88f632 /editors
parent9c1962aef88fbc0bf47fcd731a66f24ed38d1bbb (diff)
downloadpkgsrc-a8a756f00c5db829f5fbe9346f4dc57587691100.tar.gz
Fix build with GCC 4.5's C preprocessor.
Diffstat (limited to 'editors')
-rw-r--r--editors/emacs22/Makefile14
-rw-r--r--editors/emacs22/hacks.mk33
2 files changed, 33 insertions, 14 deletions
diff --git a/editors/emacs22/Makefile b/editors/emacs22/Makefile
index 846208e9230..513369b73f5 100644
--- a/editors/emacs22/Makefile
+++ b/editors/emacs22/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.13 2011/04/22 14:40:42 obache Exp $
+# $NetBSD: Makefile,v 1.14 2011/07/20 23:24:05 tron Exp $
PKGNAME?= ${DISTNAME}
COMMENT?= GNU editing macros (editor)
@@ -21,7 +21,7 @@ PKG_DESTDIR_SUPPORT= user-destdir
USE_TOOLS+= gmake gzip mktemp:run perl:run pkg-config
GNU_CONFIGURE= yes
-INFO_FILES= # PLIST
+INFO_FILES= yes
SETGIDGAME= yes
@@ -59,6 +59,16 @@ SPECIAL_PERMS+= libexec/emacs/${PKGVERSION_NOREV}/${MACHINE_GNU_PLATFORM}/updat
CPPFLAGS+= -DDFLY_CRT_USRLIB
.endif
+.include "../../mk/compiler.mk"
+
+# "emacs" uses the C pre-processor to generate makefiles. The C pre-processor
+# of newer GCC version is designed to break this by purpose. We work around
+# that using the traditional mode to generate makefiles.
+.if !emtpy(CC_VERSION:Mgcc-[4-9].*)
+CPP+= -traditional
+CONFIGURE_ENV+= CPP=${CPP:Q}
+.endif
+
post-extract:
cp ${FILESDIR}/site-init.el ${WRKSRC}/lisp
cp ${FILESDIR}/dragonfly.h ${WRKSRC}/src/s
diff --git a/editors/emacs22/hacks.mk b/editors/emacs22/hacks.mk
index f2a5f08e575..2421feee417 100644
--- a/editors/emacs22/hacks.mk
+++ b/editors/emacs22/hacks.mk
@@ -1,16 +1,25 @@
-# $NetBSD: hacks.mk,v 1.1.1.1 2009/08/05 10:30:29 minskim Exp $
-
-.if !defined(EMACS_HACKS_MK)
-EMACS_HACKS_MK= # defined
-
+# $NetBSD: hacks.mk,v 1.2 2011/07/20 23:24:05 tron Exp $
+### [Sun Mar 14 19:32:40 UTC 2004 : jlam]
+### GCC 3.3.x and older versions have an optimization bug on powerpc that's
+### tickled by the db4 source code, so remove optimization flags in that
+### case. This fixes PR pkg/30647 by Ian Spray.
###
-### Workaround for PR pkg/39778
-###
-. include "../../mk/bsd.fast.prefs.mk"
-. if !empty(MACHINE_PLATFORM:MNetBSD-[4-9].*-x86_64)
-pre-build:
- ${TOUCH} ${WRKSRC}/leim/quail/tsang-b5.el
+.if ${MACHINE_ARCH} == "powerpc"
+. include "../../mk/compiler.mk"
+. if !empty(CC_VERSION:Mgcc*)
+. if !defined(_GCC_IS_TOO_OLD)
+_GCC_IS_TOO_OLD!= \
+ if ${PKG_ADMIN} pmatch 'gcc<3.4' ${CC_VERSION}; then \
+ ${ECHO} "yes"; \
+ else \
+ ${ECHO} "no"; \
+ fi
+MAKEFLAGS+= _GCC_IS_TOO_OLD=${_GCC_IS_TOO_OLD:Q}
+. endif
+. if !empty(_GCC_IS_TOO_OLD:M[yY][eE][sS])
+PKG_HACKS+= powerpc-codegen
+BUILDLINK_TRANSFORM+= rm:-O[0-9]*
+. endif
. endif
-
.endif