$NetBSD: patch-af,v 1.5 2017/07/23 05:11:42 dholland Exp $

--- src/Makefile.in.orig	2016-11-26 06:25:26.875919180 +0000
+++ src/Makefile.in
@@ -329,7 +329,7 @@ LIBXMENU=
 #ifdef USE_X_TOOLKIT
 #define @X_TOOLKIT_TYPE@
 #if defined (LUCID) || defined (ATHENA)
-LIBW= -lXaw
+LIBW= -lXaw @LIBXPM@
 #endif
 #ifdef MOTIF
 #if defined (HAVE_MOTIF_2_1) && defined (HAVE_LIBXP)
@@ -402,7 +402,7 @@ LIBX= $(LIBXMENU) LD_SWITCH_X_SITE -lX10
    ask GCC explicitly where to find libgcc.a.  */
 
 #ifndef LINKER
-#define LINKER $(CC) -nostdlib
+#define LINKER $(CC) -nostartfiles
 #endif
 
 #ifndef LIB_GCC
@@ -804,14 +804,7 @@ LIBES = $(LOADLIBES) $(LDLIBS) $(LIBX) L
 #define OBJECTS_MACHINE
 #endif
 
-all: emacs bytecomp OTHER_FILES
-
-bytecomp: emacs
-	./emacs -batch -q -f batch-byte-compile \
-	${lispsource}ange-ftp.el ${lispsource}international/ccl.el \
-	${lispsource}international/mule-cmds.el \
-	${lispsource}international/mule.el \
-	${lispsource}international/titdic-cnv.el
+all: emacs OTHER_FILES
 
 emacs: temacs ${etc}DOC ${lisp}
 #ifdef CANNOT_DUMP
@@ -823,6 +816,7 @@ emacs: temacs ${etc}DOC ${lisp}
 #else /* ! defined (HAVE_SHM) */
 	./temacs -batch -l loadup dump
 #endif /* ! defined (HAVE_SHM) */
+	/usr/sbin/paxctl +a emacs || true
 #endif /* ! defined (CANNOT_DUMP) */
 	-./emacs -q -batch -f list-load-path-shadows
 
@@ -851,6 +845,7 @@ temacs: MAKE_PARALLEL $(LOCALCPP) $(STAR
 	$(LD) YMF_PASS_LDFLAGS (${STARTFLAGS} ${ALL_LDFLAGS}) \
     -o temacs ${STARTFILES} ${obj} ${otherobj}  \
     OBJECTS_SYSTEM OBJECTS_MACHINE ${LIBES}
+	/usr/sbin/paxctl +a temacs || true
 
 /* We don't use ALL_LDFLAGS because LD_SWITCH_SYSTEM and LD_SWITCH_MACHINE
    often contain options that have to do with using Emacs's crt0,
