$NetBSD$ 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. --- src/Makefile.in.orig 2016-04-17 20:51:40.000000000 +0000 +++ src/Makefile.in @@ -114,8 +114,9 @@ TEMACS_LDFLAGS = $(LD_SWITCH_SYSTEM) $(L ## 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@ @@ -542,8 +543,10 @@ ifeq ($(CANNOT_DUMP),yes) ln -f temacs$(EXEEXT) $@ else LC_ALL=C $(RUN_TEMACS) -batch $(BUILD_DETAILS) -l loadup dump - $(PAXCTL_if_present) -zex $@ +ifneq ($(PAXCTL_dumped),) + $(PAXCTL_dumped) $@ +endif ln -f $@ bootstrap-emacs$(EXEEXT) endif ## We run make-docfile twice because the command line may get too long @@ -606,8 +612,9 @@ temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) -o temacs $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(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 @@ -748,8 +755,10 @@ ifeq ($(CANNOT_DUMP),yes) ln -f temacs$(EXEEXT) $@ else $(RUN_TEMACS) --batch $(BUILD_DETAILS) --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. $(MAKE) -C ../lisp compile-first EMACS="$(bootstrap_exe)"