From 4c03c46946d95a7e9079a087b5e0e835f5a5beac Mon Sep 17 00:00:00 2001 From: Andrea Corallo Date: Sun, 1 Sep 2019 11:06:27 +0200 Subject: [PATCH] Revert "Move native C code into shared library" This reverts commit 613f4156880bc6c3d56ebe0297e59f805d2a69ab. --- lib/Makefile.in | 4 +--- src/Makefile.in | 50 +++++++++++++++++++++---------------------------- src/emacs.c | 2 +- src/main.c | 26 ------------------------- 4 files changed, 23 insertions(+), 59 deletions(-) delete mode 100644 src/main.c diff --git a/lib/Makefile.in b/lib/Makefile.in index ed3123885d2..06d8e56421b 100644 --- a/lib/Makefile.in +++ b/lib/Makefile.in @@ -26,8 +26,6 @@ abs_top_srcdir = @abs_top_srcdir@ top_builddir = @top_builddir@ top_srcdir = @top_srcdir@ -CFLAGS = -fPIC @CFLAGS@ - all: .PHONY: all @@ -52,7 +50,7 @@ am__v_at_ = $(am__v_at_@AM_DEFAULT_V@) am__v_at_0 = @ am__v_at_1 = -ALL_CFLAGS= -fPIC \ +ALL_CFLAGS= \ $(C_SWITCH_SYSTEM) $(C_SWITCH_MACHINE) $(DEPFLAGS) \ $(GNULIB_WARN_CFLAGS) $(WERROR_CFLAGS) $(PROFILING_CFLAGS) $(CFLAGS) \ -I. -I../src -I$(srcdir) -I$(srcdir)/../src \ diff --git a/src/Makefile.in b/src/Makefile.in index 8e3712709e5..5e0e36d8b4d 100644 --- a/src/Makefile.in +++ b/src/Makefile.in @@ -33,7 +33,7 @@ top_srcdir = @top_srcdir@ abs_top_srcdir=@abs_top_srcdir@ VPATH = $(srcdir) CC = @CC@ -CFLAGS = @CFLAGS@ -fPIC +CFLAGS = @CFLAGS@ CPPFLAGS = @CPPFLAGS@ LDFLAGS = @LDFLAGS@ EXEEXT = @EXEEXT@ @@ -465,7 +465,7 @@ FIRSTFILE_OBJ=@FIRSTFILE_OBJ@ ALLOBJS = $(FIRSTFILE_OBJ) $(VMLIMIT_OBJ) $(obj) $(otherobj) # Must be first, before dep inclusion! -all: $(pdmp) $(OTHER_FILES) +all: emacs$(EXEEXT) $(pdmp) $(OTHER_FILES) .PHONY: all dmpstruct_headers=$(srcdir)/lisp.h $(srcdir)/buffer.h \ @@ -644,33 +644,25 @@ else MAKE_PDUMPER_FINGERPRINT = endif -## FIXME: dumper support totally missing here -libemacs.so: $(LIBXMENU) $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ - $(charsets) $(charscript) $(MAKE_PDUMPER_FINGERPRINT) main.o - $(CC) --shared -o $@ $(ALLOBJS) -Wl,-Bstatic $(LIBEGNU_ARCHIVE) -Wl,-Bdynamic $(LIBES) - -temacs$(EXEEXT): libemacs.so main.o - $(CC) -L. main.o -o $@ $(TEMACS_LDFLAGS) $(LDFLAGS) \ - $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) -lemacs -Wl,-rpath -Wl,$(shell pwd) - -# ## We have to create $(etc) here because init_cmdargs tests its -# ## existence when setting Vinstallation_directory (FIXME?). -# ## 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) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ -# $(charsets) $(charscript) $(MAKE_PDUMPER_FINGERPRINT) -# $(AM_V_CCLD)$(CC) -o $@.tmp \ -# $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ -# $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) -# ifeq ($(HAVE_PDUMPER),yes) -# $(AM_V_at)$(MAKE_PDUMPER_FINGERPRINT) $@.tmp -# endif -# $(AM_V_at)mv $@.tmp $@ -# $(MKDIR_P) $(etc) -# ifeq ($(DUMPING),unexec) -# ifneq ($(PAXCTL_notdumped),) -# $(PAXCTL_notdumped) $@ -# endif +## We have to create $(etc) here because init_cmdargs tests its +## existence when setting Vinstallation_directory (FIXME?). +## 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) $(LIBEGNU_ARCHIVE) $(EMACSRES) \ + $(charsets) $(charscript) $(MAKE_PDUMPER_FINGERPRINT) + $(AM_V_CCLD)$(CC) -o $@.tmp \ + $(ALL_CFLAGS) $(TEMACS_LDFLAGS) $(LDFLAGS) \ + $(ALLOBJS) $(LIBEGNU_ARCHIVE) $(W32_RES_LINK) $(LIBES) +ifeq ($(HAVE_PDUMPER),yes) + $(AM_V_at)$(MAKE_PDUMPER_FINGERPRINT) $@.tmp +endif + $(AM_V_at)mv $@.tmp $@ + $(MKDIR_P) $(etc) +ifeq ($(DUMPING),unexec) + ifneq ($(PAXCTL_notdumped),) + $(PAXCTL_notdumped) $@ + endif +endif ## The following oldxmenu-related rules are only (possibly) used if ## HAVE_X11 && !USE_GTK, but there is no harm in always defining them. diff --git a/src/emacs.c b/src/emacs.c index 1491ba5a479..c59a70988b7 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -924,7 +924,7 @@ load_pdump (int argc, char **argv) #endif /* HAVE_PDUMPER */ int -main1 (int argc, char **argv) +main (int argc, char **argv) { /* Variable near the bottom of the stack, and aligned appropriately for pointers. */ diff --git a/src/main.c b/src/main.c deleted file mode 100644 index 41e35534280..00000000000 --- a/src/main.c +++ /dev/null @@ -1,26 +0,0 @@ -/* Trampoline for GNU Emacs. - Copyright (C) 2019 Free Software - Foundation, Inc. - -This file is part of GNU Emacs. - -GNU Emacs is free software: you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation, either version 3 of the License, or (at -your option) any later version. - -GNU Emacs is distributed in the hope that it will be useful, -but WITHOUT ANY WARRANTY; without even the implied warranty of -MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -GNU General Public License for more details. - -You should have received a copy of the GNU General Public License -along with GNU Emacs. If not, see . */ - -extern int main1 (int argc, char **argv); - -int -main (int argc, char **argv) -{ - return main1(argc, argv); -} -- 2.39.5