]> git.eshelyaron.com Git - emacs.git/commitdiff
Remove redundant second copy of gnulib
authorPo Lu <luangruo@yahoo.com>
Sun, 5 Mar 2023 02:18:28 +0000 (10:18 +0800)
committerPo Lu <luangruo@yahoo.com>
Sun, 5 Mar 2023 02:18:28 +0000 (10:18 +0800)
* .gitignore: Simplify cross/lib rule.
* admin/merge-gnulib (avoided_flags): Stop copying to cross/lib.
* configure.ac: Link gnulib source and header files to
cross/lib.
* cross/Makefile.in (LIB_SRCDIR): Make relative to builddir.
(maintainer-clean): Merge with distclean.  Remove links created
by configure.

.gitignore
admin/merge-gnulib
configure.ac
cross/Makefile.in

index 3950a46211b336096a1ccb44f7462c11d43dfcf0..8552d11855243cd00590ff5edff44236aac29ad1 100644 (file)
@@ -101,33 +101,7 @@ src/lisp.mk
 src/verbose.mk
 
 # Stuff built during cross compilation
-cross/lib/alloca.h
-cross/lib/assert.h
-cross/lib/byteswap.h
-cross/lib/dirent.h
-cross/lib/errno.h
-cross/lib/execinfo.h
-cross/lib/fcntl.h
-cross/lib/getopt.h
-cross/lib/getopt-cdefs.h
-cross/lib/gmp.h
-cross/lib/ieee754.h
-cross/lib/inttypes.h
-cross/lib/libgnu.a
-cross/lib/limits.h
-cross/lib/malloc/*.gl.h
-cross/lib/signal.h
-cross/lib/std*.h
-!cross/lib/std*.in.h
-!cross/lib/stdio-impl.h
-!cross/lib/_Noreturn.h
-cross/lib/math.h
-cross/lib/string.h
-cross/lib/sys/
-cross/lib/time.h
-cross/lib/unistd.h
-cross/lib/config.h
-cross/lib/gnulib.mk
+cross/lib/*
 cross/src/*
 cross/lib-src/*
 cross/sys/*
index 60963669f1b03368988a1ab9ffcb7456cca96083..4e84e1a2c8d0267e1324fc504e877418317b28c5 100755 (executable)
@@ -139,11 +139,3 @@ cp -- "$gnulib_srcdir"/lib/af_alg.h \
    "$src"lib &&
 { test -z "$src" || cd "$src"; } &&
 ./autogen.sh
-
-# Finally, copy gnulib stuff in lib/ to xcompile/lib.
-rm -rf "$src"cross/lib
-cp -r "$src"lib "$src"cross
-
-# Remove unnecessary files.
-rm -f "$src"cross/lib/*.mk.in "$src"cross/lib/Makefile.in \
-   "$src"cross/lib/Makefile
index 3a9d2614c00d7655023072951cb9bd881f6de525..e66551805ec0c0f4c7567091e7bb1276804a42c0 100644 (file)
@@ -7755,7 +7755,23 @@ if test "$XCONFIGURE" != "android"; then
   dnl Make cross/lib, which various Makefiles in cross expect to
   dnl always exist.
   AS_MKDIR_P([cross/lib])
+  AS_MKDIR_P([cross/lib/malloc])
+  AS_MKDIR_P([cross/lib/sys])
   AS_MKDIR_P([cross/lib-src])
+
+  dnl Link gnulib files to cross/lib as well.
+  dnl af_alg.h and lib/save-cwd.h are copied manually from
+  dnl gnulib, and as such aren't specified in gl_FILE_LIST.
+  emacs_files='gl_FILE_LIST lib/af_alg.h lib/save-cwd.h'
+  dnl These files are specific to Emacs.
+  emacs_files="$emacs_files lib/fingerprint.c lib/fingerprint.h \
+                 lib/save-cwd.c lib/openat-die.c lib/save-cwd.c \
+                lib/min-max.h"
+  for file in $emacs_files; do
+    AS_IF([expr "X${file}J" : "Xlib/.*[[ch]]J" >/dev/null],
+      [AS_IF([test -f $file],
+        [AC_CONFIG_LINKS([cross/$file:$file])])])
+  done
 fi
 
 # Make java/Makefile
index b30aade759f3f39e1fb7a9d829a216f374d16ba6..b8955a70ebd7354266e2a745d16a4213e0236002 100644 (file)
@@ -33,9 +33,10 @@ top_builddir = @top_builddir@
 # $(top_builddir)/lib-src/Makefile.android are copied to their usual
 # locations in this directory.
 
-# This is possibly the ugliest Makefile ever written!
+# N.B. that LIB_SRCDIR is actually relative to builddir, because that
+# is where the gnulib files get linked.
 
-LIB_SRCDIR = $(realpath $(srcdir)/lib)
+LIB_SRCDIR = $(realpath $(builddir)/lib)
 LIB_TOP_SRCDIR = $(realpath $(top_srcdir))
 
 SRC_SRCDIR = $(realpath $(top_srcdir)/src)
@@ -49,7 +50,7 @@ LIB_SRC_TOP_SRCDIR = $(realpath $(top_src))
 LIBSRC_BINARIES = lib-src/etags lib-src/ctags lib-src/emacsclient \
                  lib-src/ebrowse lib-src/hexl lib-src/movemail
 
-CLEAN_SUBDIRS=src lib-src
+CLEAN_SUBDIRS=src lib-src lib
 
 .PHONY: all
 all: lib/libgnu.a src/libemacs.so src/android-emacs $(LIBSRC_BINARIES)
@@ -185,23 +186,15 @@ $(LIBSRC_BINARIES) &: src/verbose.mk $(top_builddir)/$@ lib/libgnu.a \
 clean:
        for dir in $(CLEAN_SUBDIRS); do \
          find $$dir -type f -delete;   \
-       done;                           \
-       if [ -e lib/Makefile ]; then    \
-         make -C lib clean;            \
-       fi
+       done
        rm -rf lib/config.h lib-src/config.h
 # ndk-build won't have been generated in a non-Android build.
        -make -C ndk-build clean
 
-distclean bootstrap-clean: clean
-       if [ -e lib/Makefile ]; then            \
-         make -C lib distclean;                \
-       fi
-# Just in case.
+maintainer-clean distclean bootstrap-clean: clean
+# Remove links created by configure.
+       for dir in $(CLEAN_SUBDIRS); do \
+         find $$dir -type l -delete;   \
+       done
        rm -rf lib/Makefile lib/gnulib.mk ndk-build/Makefile
        rm -rf ndk-build/ndk-build.mk Makefile
-
-maintainer-clean: distclean bootstrap-clean
-       if [ -e lib/Makefile ]; then            \
-         make -C lib maintainer-clean;         \
-       fi