summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPaul Eggert <eggert@penguin.cs.ucla.edu>2016-04-27 15:52:53 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2016-04-27 16:03:50 -0700
commit734fb3ac6c3e5708ed05b6c5b1d8af92838ee3f5 (patch)
tree4cde4fb6d3a298f27cd9c673ca0eb62c2168e9ec /src
parent0255a70c8ae22e259e8938ac3840c7b6687edec8 (diff)
downloademacs-734fb3ac6c3e5708ed05b6c5b1d8af92838ee3f5.tar.gz
Port dumping to NetBSD with PaX
Problem reported by Thomas Klausner (Bug#23371). * configure.ac (PAXCTL_dumped, PAXCTL_notdumped): New vars. Set them to setfattr and/or paxctl commands appropriate for GNU/Linux and/or NetBSD; the latter prefers paxctl +a. Search for paxctl only if setfattr is not found. * src/Makefile.in (PAXCTL_dumped, PAXCTL_notdumped): New vars, replacing PAXCTL_if_present and SETFATTR_if_present. All uses changed.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.in18
1 files changed, 12 insertions, 6 deletions
diff --git a/src/Makefile.in b/src/Makefile.in
index 1f0df6f3ec8..d54670932d3 100644
--- a/src/Makefile.in
+++ b/src/Makefile.in
@@ -114,8 +114,9 @@ TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(LD_SWITCH_SYSTEM_TEMACS)
## around this, newer ones setfattr. See Bug#11398 and Bug#16343.
PAXCTL = @PAXCTL@
SETFATTR = @SETFATTR@
-PAXCTL_if_present = $(or $(PAXCTL),: paxctl)
-SETFATTR_if_present = $(or $(SETFATTR),: setfattr)
+## Commands to set PaX flags on dumped and not-dumped instances of Emacs.
+PAXCTL_dumped = @PAXCTL_dumped@
+PAXCTL_notdumped = @PAXCTL_notdumped@
## Some systems define this to request special libraries.
LIBS_SYSTEM=@LIBS_SYSTEM@
@@ -532,7 +533,9 @@ ifeq ($(CANNOT_DUMP),yes)
ln -f temacs$(EXEEXT) $@
else
LC_ALL=C $(RUN_TEMACS) -batch -l loadup dump
- $(PAXCTL_if_present) -zex $@
+ ifneq ($(PAXCTL_dumped),)
+ $(PAXCTL_dumped) $@
+ endif
ln -f $@ bootstrap-emacs$(EXEEXT)
endif
@@ -594,8 +597,9 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
-o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
$(MKDIR_P) $(etc)
ifneq ($(CANNOT_DUMP),yes)
- $(PAXCTL_if_present) -r $@
- $(SETFATTR_if_present) -n user.pax.flags -v er $@
+ ifneq ($(PAXCTL_notdumped),)
+ $(PAXCTL_notdumped) $@
+ endif
endif
## The following oldxmenu-related rules are only (possibly) used if
@@ -734,7 +738,9 @@ ifeq ($(CANNOT_DUMP),yes)
ln -f temacs$(EXEEXT) $@
else
$(RUN_TEMACS) --batch --load loadup bootstrap
- $(PAXCTL_if_present) -zex emacs$(EXEEXT)
+ ifneq ($(PAXCTL_dumped),)
+ $(PAXCTL_dumped) emacs$(EXEEXT)
+ endif
mv -f emacs$(EXEEXT) $@
endif
@: Compile some files earlier to speed up further compilation.