Remove redundant second copy of gnulib

* .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.
This commit is contained in:
Po Lu 2023-03-05 10:18:28 +08:00
parent 1f4818d3e3
commit 3be448f429
4 changed files with 27 additions and 52 deletions

28
.gitignore vendored
View 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/*

View file

@ -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

View 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

View 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