]> code.delx.au - gnu-emacs/commitdiff
Link temacs with gnulib compiled with -Demacs
authorWolfgang Jenkner <wjenkner@inode.at>
Sat, 30 Jan 2016 22:20:56 +0000 (14:20 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 30 Jan 2016 23:26:06 +0000 (15:26 -0800)
This is done to support HYBRID_MALLOC, since some static variables
(e.g., last_environ in putenv.c) hold pointers to memory malloced
before dumping (Bug#22086).
* lib/Makefile.am: Add incantation to install libegnu.a.
* src/Makefile.in ($(lib)/libgnu.a): Replace with libegnu.a
(temacs$(EXEEXT)): Use it.

lib/Makefile.am
src/Makefile.in

index cda96811ebc587f95c10ab9fa7e388785a51dcfd..a1dd6a4ca9050ce276808ba3d5c4fee796844afa 100644 (file)
@@ -17,6 +17,15 @@ include gnulib.mk
 libgnu_a_SOURCES += openat-die.c save-cwd.c
 endif
 
+noinst_LIBRARIES += libegnu.a
+
+libegnu_a_SOURCES = $(libgnu_a_SOURCES)
+libegnu_a_LIBADD = $(patsubst %.o,e-%.o,$(libgnu_a_LIBADD))
+EXTRA_libegnu_a_SOURCES = $(EXTRA_libgnu_a_SOURCES)
+libegnu_a_SHORTNAME = e
+
+libegnu_a_CPPFLAGS = $(AM_CPPFLAGS) -Demacs
+
 .PHONY: bootstrap-clean
 
 bootstrap-clean: maintainer-clean
index b38e7d558b880cd85eaeb526ff85330107fcfb7c..6a315427b6f3e219e8774d9c552b4c9fcfa9c057 100644 (file)
@@ -576,7 +576,7 @@ globals.h: gl-stamp; @true
 
 $(ALLOBJS): globals.h
 
-$(lib)/libgnu.a: $(config_h)
+$(lib)/libegnu.a: $(config_h)
        $(MAKE) -C $(lib) all
 
 ## We have to create $(etc) here because init_cmdargs tests its
@@ -584,9 +584,9 @@ $(lib)/libgnu.a: $(config_h)
 ## This goes on to affect various things, and the emacs binary fails
 ## to start if Vinstallation_directory has the wrong value.
 temacs$(EXEEXT): $(LIBXMENU) $(ALLOBJS) \
-                $(lib)/libgnu.a $(EMACSRES) ${charsets} ${charscript}
+                $(lib)/libegnu.a $(EMACSRES) ${charsets} ${charscript}
        $(AM_V_CCLD)$(CC) $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \
-         -o temacs $(ALLOBJS) $(lib)/libgnu.a $(W32_RES_LINK) $(LIBES)
+         -o temacs $(ALLOBJS) $(lib)/libegnu.a $(W32_RES_LINK) $(LIBES)
        $(MKDIR_P) $(etc)
 ifneq ($(CANNOT_DUMP),yes)
        $(PAXCTL_if_present) -r $@