"$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
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
# $(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)
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)
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