2012-05-21 02:33:13 +00:00
|
|
|
#! /bin/sh
|
|
|
|
# Merge gnulib sources into Emacs sources.
|
|
|
|
# Typical usage:
|
|
|
|
#
|
|
|
|
# admin/merge-gnulib
|
|
|
|
|
2020-01-01 00:19:43 +00:00
|
|
|
# Copyright 2012-2020 Free Software Foundation, Inc.
|
2012-05-21 02:33:13 +00:00
|
|
|
|
|
|
|
# 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
|
2017-09-13 22:52:52 +00:00
|
|
|
# along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
|
2012-05-21 02:33:13 +00:00
|
|
|
|
|
|
|
# written by Paul Eggert
|
|
|
|
|
|
|
|
GNULIB_URL=git://git.savannah.gnu.org/gnulib.git
|
|
|
|
|
|
|
|
GNULIB_MODULES='
|
Use binary-io module, O_BINARY, and "b" flag.
* admin/merge-gnulib (GNULIB_MODULES): Add binary-io. It was already
present implicitly; this just makes the dependence explicit.
* lib-src/etags.c, lib-src/hexl.c, lib-src/make-docfile.c:
Include binary-io.h instead of fcntl.h and/or io.h.
(main): Use set_binary_mode or SET_BINARY
in place of handcrafted code.
* lib-src/etags.c (main) [DOS_NT]:
* lib-src/movemail.c (main) [WINDOWSNT]:
Don't mess with _fmode.
* lib-src/etags.c (main, process_file_name, analyse_regex):
Use fopen/popen's "b" flag instead.
* lib-src/movemail.c (main, popmail): Use open/lk_open/mkostemp's O_BINARY
instead.
* src/callproc.c (create_temp_file): Use mkostemp's O_BINARY flag.
* src/emacs.c [MSDOS]:
* src/emacs.c (main) [DOS_NT]: Don't mess with _fmode.
(main) [MSDOS]: Use SET_BINARY instead of setmode.
* src/minibuf.c: Include binary-io.h instead of fcntl.h.
(read_minibuf_noninteractive):
Use set_binary_mode instead of handcrafted code.
Don't call emacs_set_tty if emacs_get_tty failed.
* src/sysdep.c, src/systty.h (emacs_get_tty): Return int, not void.
* src/sysdep.c (emacs_open, emacs_pipe): Use O_BINARY.
* src/w32.c (pipe2): Adjust eassert to include O_BINARY.
Fixes: debbugs:18006
2014-07-14 19:23:18 +00:00
|
|
|
alloca-opt binary-io byteswap c-ctype c-strcase
|
2019-06-25 22:54:37 +00:00
|
|
|
canonicalize-lgpl
|
2019-06-07 04:18:11 +00:00
|
|
|
careadlinkat close-stream copy-file-range
|
2017-03-03 17:17:51 +00:00
|
|
|
count-leading-zeros count-one-bits count-trailing-zeros
|
Update from Gnulib
This incorporates:
2018-05-21 crypto: omit stream ops Emacs doesn’t need
2018-05-13 truncate: Fix compilation error on Android
2018-05-13 imaxdiv: Fix compilation error on Android
2018-05-13 Support selective inclusion of recent mingw.org headers
2018-05-13 Add cross-compilation guesses for Linux systems sans glibc
2018-05-13 stdioext: Fix compilation errors with newer Android headers
2018-05-07 af_alg: Pacify --enable-gcc-warnings
2018-05-06 af_alg: Fix bug with streams that are not at position 0
2018-05-06 Followup to 'af_alg: New module'
2018-05-05 crypto/{md5,sha1,sha256,sha512}: simplify
2018-05-05 af_alg: New module
2018-05-05 af_alg: Improve function signature
2018-04-28 md5sum: Use AF_ALG when available
2018-04-28 sha512sum: Use AF_ALG when available
2018-04-28 sha256sum: Use AF_ALG when available
2018-04-28 sha1sum: Use AF_ALG when available
2018-05-05 all: Replace more http URLs by https URLs
2018-05-03 maint: port more modules to GCC 8
2018-05-03 Simplify code; drop support for Borland C++ on Windows
* admin/merge-gnulib (GNULIB_MODULES): Use crypto/md5-buffer
rather than crypto/md5, since Emacs doesn’t use the stream
operations that in recent Gnulib pull in other stuff Emacs doesn’t
need. Similarly for crypto/sha1-buffer, crypto/sha256-buffer,
crypto/sha512-buffer.
* build-aux/config.guess, build-aux/config.sub, lib/dosname.h:
* lib/dup2.c, lib/errno.in.h, lib/euidaccess.c, lib/fcntl.c:
* lib/fcntl.in.h, lib/fpending.c, lib/fsync.c, lib/getdtablesize.c:
* lib/getopt.c, lib/gettimeofday.c, lib/inttypes.in.h, lib/md5.c:
* lib/md5.h, lib/open.c, lib/pipe2.c, lib/putenv.c, lib/sha1.c:
* lib/sha1.h, lib/sha256.c, lib/sha256.h, lib/sha512.c:
* lib/sha512.h, lib/stat-time.h, lib/stdio-impl.h, lib/stdio.in.h:
* lib/stdlib.in.h, lib/sys_stat.in.h, lib/sys_types.in.h:
* lib/timespec.h, lib/unistd.in.h, lib/utimens.c, m4/c-strtod.m4:
* m4/gnulib-common.m4, m4/inttypes.m4, m4/lstat.m4, m4/nocrash.m4:
* m4/pselect.m4, m4/readlink.m4, m4/stdio_h.m4, m4/symlink.m4:
* m4/unistd_h.m4, m4/utimens.m4:
Copy from Gnulib.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
2018-05-21 18:42:18 +00:00
|
|
|
crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
|
2020-03-28 20:58:44 +00:00
|
|
|
d-type diffseq double-slash-root dtoastr dtotimespec dup2
|
2019-04-25 00:41:05 +00:00
|
|
|
environ execinfo explicit_bzero faccessat
|
Add 'nofollow' flag to set-file-modes etc.
This avoids some race conditions (Bug#39683). E.g., if some other
program changes a file to a symlink between the time Emacs creates
the file and the time it changes the file’s permissions, using the
new flag prevents Emacs from inadvertently changing the
permissions of a victim in some completely unrelated directory.
* admin/merge-gnulib (GNULIB_MODULES): Add fchmodat.
* doc/lispref/files.texi (Testing Accessibility, Changing Files):
* doc/lispref/os.texi (File Notifications):
* etc/NEWS:
Adjust documentation accordingly.
* lib/chmodat.c, lib/fchmodat.c, lib/lchmod.c, m4/fchmodat.m4:
* m4/lchmod.m4: New files, copied from Gnulib.
* lib/gnulib.mk.in: Regenerate.
* lisp/dired-aux.el (dired-do-chmod):
* lisp/doc-view.el (doc-view-make-safe-dir):
* lisp/emacs-lisp/autoload.el (autoload--save-buffer):
* lisp/emacs-lisp/bytecomp.el (byte-compile-file):
* lisp/eshell/em-pred.el (eshell-pred-file-mode):
* lisp/files.el (backup-buffer-copy, copy-directory):
* lisp/gnus/mail-source.el (mail-source-movemail):
* lisp/gnus/mm-decode.el (mm-display-external):
* lisp/gnus/nnmail.el (nnmail-write-region):
* lisp/net/tramp-adb.el (tramp-adb-handle-file-local-copy)
(tramp-adb-handle-write-region):
* lisp/net/tramp-sh.el (tramp-do-copy-or-rename-file-directly):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-write-region):
* lisp/net/tramp.el (tramp-handle-write-region)
(tramp-make-tramp-temp-file):
* lisp/server.el (server-ensure-safe-dir):
* lisp/url/url-util.el (url-make-private-file):
When getting or setting file modes, avoid following symbolic links
when the file is not supposed to be a symbolic link.
* lisp/doc-view.el (doc-view-make-safe-dir):
Omit no-longer-needed separate symlink test.
* lisp/gnus/gnus-util.el (gnus-set-file-modes):
* lisp/net/tramp.el (tramp-handle-file-modes):
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-modes):
* src/fileio.c (symlink_nofollow_flag): New function.
(Ffile_modes, Fset_file_modes):
Support an optional FLAG arg. All C callers changed.
* lisp/net/ange-ftp.el (ange-ftp-set-file-modes):
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-modes):
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-modes):
* lisp/net/tramp-smb.el (tramp-smb-handle-set-file-modes):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-modes):
Accept an optional FLAG arg that is currently ignored,
and add a FIXME comment for it.
* m4/gnulib-comp.m4: Regenerate.
2020-02-24 00:19:42 +00:00
|
|
|
fchmodat fcntl fcntl-h fdopendir
|
2020-03-28 20:58:44 +00:00
|
|
|
filemode filename filevercmp flexmember fpieee fstatat fsusage fsync futimens
|
2020-06-27 20:02:24 +00:00
|
|
|
getloadavg getopt-gnu getrandom gettime gettimeofday gitlog-to-changelog
|
2020-08-12 18:40:12 +00:00
|
|
|
ieee754-h ignore-value intprops largefile libgmp lstat
|
etags: remove some arbitrary limits
etags had undefined behavior if input files, lines, tags, etc.,
had more than INT_MAX bytes. Clean up the usage of integer types
to fix the overflow errors I found.
* admin/merge-gnulib (GNULIB_MODULES): Add mempcpy.
* lib-src/etags.c: Include inttypes.h, intprops.h.
(memcpyz): New function. Use it to simplify several occurrences
of memcpy followed by storing a trailing '\0'.
(xnew): Use xnmalloc, to catch overflow on integer multiplication.
(xrnew): Change last arg to multiplier. The type is not needed.
All callers changed.
(node, lineno, charno, linecharno, invalidcharno, make_tag):
(pfnote, add_node, number_len, C_symtype, lbz, Makefile_targets)
(readline):
Use intmax_t for line numbers and character positions, instead of
int or long.
(linebuffer, make_tag, pfnote, total_size_of_entries, put_entry)
(in_word_set, C_symtype, token, cstack, pushclass_above):
(popclass_above, write_classname, consider_token, C_entries)
(Ruby_functions, Makefile_targets, Lua_functions, TeX_commands)
(TeX_decode_env, erlang_func, erlang_attribute, erlang_atom)
(substitute, regex_tag_multiline, nocase_tail, readline_interval)
(readline, savenstr, concat, etags_getcwd, relative_filename)
(linebuffer_setlen):
Use ptrdiff_t for object sizes, instead of int or long or unsigned
or size_t.
(write_classname, C_entries):
Avoid sprintf, as the result could exceed INT_MAX bytes
and then behavior goes haywire.
(main): Use int, instead of unsigned, for argv counts.
(get_language_from_filename): Use bool for boolean.
(Ruby_functions): Prefer strcpy to memcpy when copying "=".
(linebuffer_setlen): Use ‘if’ instead of ‘while’.
(memory_full, xnmalloc, xnrealloc): New functions.
(xmalloc): Use memory_full, and take a ptrdiff_t instead of a size_t.
(xrealloc): Remove; no longer needed.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/mempcpy.c, m4/mempcpy.m4: New files, copied from Gnulib.
2019-11-26 21:53:41 +00:00
|
|
|
manywarnings memmem-simple mempcpy memrchr minmax mkostemp mktime nstrftime
|
2020-01-19 04:54:29 +00:00
|
|
|
pathmax pipe2 pselect pthread_sigmask
|
2019-06-25 22:54:37 +00:00
|
|
|
qcopy-acl readlink readlinkat regex
|
2020-08-23 21:59:15 +00:00
|
|
|
sig2str sigdescr_np socklen stat-time std-gnu11 stdalign stddef stdio
|
Avoid some strlen work, primarily via strnlen
* admin/merge-gnulib (GNULIB_MODULES): Add strnlen.
* lib-src/etags.c (find_entries):
* src/emacs.c (main):
* src/nsmenu.m (parseKeyEquiv:):
* src/nsterm.m (ns_xlfd_to_fontname):
* src/term.c (vfatal):
Prefer !*X to !strlen (X).
* lib-src/etags.c (pfnote, add_regex):
* lib-src/pop.c (pop_open):
* lib-src/update-game-score.c (main):
* lwlib/lwlib.c (lw_separator_p):
* src/doprnt.c (doprnt):
* src/emacs.c (main):
* src/inotify.c (inotifyevent_to_event):
* src/keyboard.c (menu_separator_name_p, parse_tool_bar_item):
* src/sysdep.c (get_current_dir_name_or_unreachable):
* src/xdisp.c (store_mode_line_string):
Use strnlen to avoid unnecessary work with strlen.
* lib-src/etags.c (Prolog_functions, prolog_pr)
(Erlang_functions, erlang_func):
Prefer ptrdiff_t to size_t when either will do.
(prolog_pr, erlang_func): New arg LASTLEN, to avoid
unnecessary strlen call. All callers changed.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/strnlen.c, m4/strnlen.m4: New files, copied from Gnulib.
* lwlib/lwlib.c (lw_separator_p):
* src/json.c (json_has_prefix):
Use strncmp to avoid unecessary work with strlen + memcmp.
* src/process.c (set_socket_option): Use SBYTES instead of strlen.
2019-06-25 21:53:39 +00:00
|
|
|
stpcpy strnlen strtoimax symlink sys_stat sys_time
|
Improve make-temp-file performance on local files
For the motivation behind this patch, please see Bug#28023 and:
http://emacshorrors.com/posts/make-temp-name.html
Although, given the recent changes to Tramp, the related security
problem in make-temp-file is already fixed, make-temp-file still has
several unnecessary system calls. In the typical case on GNU/Linux,
this patch replaces 8 syscalls (symlink, open, close, readlinkat, uname,
getpid, unlink, umask) by 2 (open, close).
* admin/merge-gnulib (GNULIB_MODULES): Add tempname, now
that Emacs is using it directly.
* configure.ac (AUTO_DEPEND): Remove AC_SYS_LONG_FILE_NAMES;
no longer needed.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lisp/files.el (files--make-magic-temp-file): Rename from
make-temp-file.
(make-temp-file): Use make-temp-file-internal for
non-magic file names.
* src/fileio.c: Include tempname.h.
(make_temp_name_tbl, make_temp_name_count)
(make_temp_name_count_initialized_p, make_temp_name): Remove.
(Fmake_temp_file_internal): New function.
(Fmake_temp_name): Use it.
* src/filelock.c (get_boot_time): Use Fmake_temp_file_internal
instead of make_temp_name.
2017-08-12 21:00:17 +00:00
|
|
|
tempname time time_r time_rz timegm timer-time timespec-add timespec-sub
|
Add ‘nofollow’ flag to set-file-times
This is a companion to the recent set-file-modes patch.
It adds support for a ‘nofollow’ flag to set-file-times (Bug#39773).
Like the set-file-modes patch, it needs work in the w32 port.
* admin/merge-gnulib (GNULIB_MODULES): Add futimens, utimensat.
Remove utimens.
* doc/lispref/files.texi (Changing Files):
* etc/NEWS: Mention the change.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lisp/files.el (copy-directory):
* lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file):
* lisp/net/tramp-adb.el (tramp-adb-handle-copy-file):
* lisp/net/tramp-smb.el (tramp-smb-handle-copy-file):
* lisp/tar-mode.el (tar-copy):
* test/lisp/filenotify-tests.el (file-notify-test03-events):
* test/lisp/files-tests.el:
(files-tests-file-name-non-special-set-file-times):
* test/lisp/net/tramp-tests.el (tramp-test22-file-times):
When setting file times, avoid following symbolic links
when the file is not supposed to be a symbolic link.
* lib/futimens.c, lib/utimensat.c, m4/futimens.m4, m4/utimensat.m4:
New files, copied from Gnulib.
* lisp/gnus/gnus-cloud.el (gnus-cloud-replace-file):
When creating a file that is not supposed to exist already,
use the excl flag to check this.
* lisp/net/tramp-adb.el (tramp-adb-handle-set-file-times):
* lisp/net/tramp-sh.el (tramp-sh-handle-set-file-times):
* lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-set-file-times):
Accept an optional FLAG arg that is currently ignored,
and add a FIXME comment for it.
* lisp/net/tramp-gvfs.el (tramp-gvfs-handle-set-file-times):
* src/fileio.c (Fset_file_times):
Support an optional FLAG arg.
* src/fileio.c (Fcopy_file): Use futimens instead of set_file_times,
as it’s simpler and is a POSIX API.
* src/sysdep.c (set_file_times): Move from here ...
* src/w32.c (set_file_times): ... to here, and make it static,
since it is now used only in w32.c. Presumably w32.c should also
add support for futimens and utimensat (the POSIX APIs, which
Emacs now uses) and it can remove fdutimens (the Gnulib API,
which Emacs no longer uses).
2020-03-07 20:04:05 +00:00
|
|
|
update-copyright unlocked-io utimensat
|
Vector-sorting fixes.
It's not safe to call qsort or qsort_r, since they have undefined
behavior if the user-specified predicate is not a total order.
Also, watch out for garbage-collection while sorting vectors.
* admin/merge-gnulib (GNULIB_MODULES): Add vla.
* configure.ac (qsort_r): Remove, as we no longer use qsort-like
functions.
* lib/gnulib.mk, m4/gnulib-comp.m4: Regenerate.
* lib/vla.h, m4/vararrays.m4: New files, copied from gnulib.
* lib/stdlib.in.h, m4/stdlib_h.m4: Sync from gnulib, incorporating:
2014-08-29 qsort_r: new module, for GNU-style qsort_r
The previous two files' changes are boilerplate generated by
admin/merge-gnulib, and should not affect Emacs.
* src/fns.c: Include <vla.h>.
(sort_vector_predicate) [!HAVE_QSORT_R]: Remove.
(sort_vector_compare): Remove, replacing with ....
(inorder, merge_vectors, sort_vector_inplace, sort_vector_copy):
... these new functions.
(sort_vector): Rewrite to use the new functions.
GCPRO locals, since the predicate can invoke the GC.
Since it's in-place return void; caller changed.
(merge): Use 'inorder', for clarity.
Fixes: debbugs:18361
2014-08-30 22:59:39 +00:00
|
|
|
vla warnings
|
2012-05-21 02:33:13 +00:00
|
|
|
'
|
|
|
|
|
Switch from Automake to GNU Make
Emacs assumes GNU Make, and GNU Make has much of the functionality of
Automake built-in. The Emacs build process uses Automake primarily
because Emacs uses some Gnulib code and Gnulib formerly required
Automake. Now that Gnulib no longer requires Automake, Emacs can
stop using Automake and this should simplify Emacs maintenance
in the future (Bug#26100). Although this patch may look long, most of
it is generated automatically: the changes to build-aux/config.guess,
build-aux/config.sub, build-aux/install-sh, and lib/gnulib.mk.in are
all done by admin/merge-gnulib.
* .gitignore: Remove build-aux/ar-lib, build-aux/compile,
build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
build-aux/install-sh, build-aux/missing, and lib/Makefile.in,
as they are no longer built by autogen.sh.
Add lib/gnulib.mk, as it is now built by 'configure'.
Remove nt/gnulib.mk, as it is no longer built by 'make'.
* INSTALL.REPO, README, admin/make-tarball.txt:
Remove mention of Automake.
* Makefile.in (AUTOCONF, AUTOMAKE, AUTOHEADER, ACLOCAL, lib)
(AUTOCONF_INPUTS, ACLOCAL_PATH, ACLOCAL_INPUTS)
($(srcdir)/aclocal.m4, AUTOMAKE_INPUTS)
($(srcdir)/lib/Makefile.in, $(srcdir)/nt/gnulib.mk, am--refresh):
Remove.
($(MAKEFILE_NAME)): Depend on lib/gnulib.mk.in.
($(srcdir)/configure, $(srcdir)/src/stamp-h.in)
($(srcdir)/src/config.in):
Use autogen.sh instead of doing it by hand.
* admin/merge-gnulib (AVOIDED_MODULES, avoided_flags)):
New vars, to simplify processing of avoided modules.
(GNULIB_TOOL_FLAGS): Move --avoid flags into AVOIDED_MODULES.
Add --gnu-make, and change makefile name to gnulib.mk.in.
Copy config.guess, config.sub, and install-sh too, since
Automake no longer does that for us.
* admin/notes/copyright:
* admin/update_autogen (genfiles):
Update list of files.
Remove hack for nt/gnulib.mk, a file that is no longer needed.
* autogen.sh (progs): Remove Automake.
(automake_min): Remove.
Build aclocal.m4 so that autoreconf need not use aclocal.
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh:
New files, copied from Gnulib. These are now updated by
admin/merge-gnulib instead by autogen.sh.
* configure.ac (AC_PROG_MAKE_SET, ACLOCAL_PATH, AM_CONDITIONAL):
Remove.
(AM_INIT_AUTOMAKE, AM_SILENT_RULES): Remove call.
(AC_PROG_CC_C_O): Call this instead of AM_PROG_CC_C_O.
(BUILDING_FOR_WINDOWSNT, HYBRID_MALLOC_LIB): Remove; no longer needed.
(--disable-silent-rules): New option, since Automake no longer
does this for us.
(AM_V, AM_DEFAULT_V): Set unconditionally, and do not bother
with AM_SUBST_NOTMAKE.
(AC_PROG_INSTALL): Add call.
(MAKEINFO): Do not bother with the 'missing' program.
(MAKEINFO, SYSTEM_TYPE): AC_SUBST.
(AC_CONFIG_FILES): Add Makefile, lib/gnulib.mk.
(SUBDIR_MAKEFILES): Remove duplication.
* lib/Makefile.am: Remove, replacing with:
* lib/Makefile.in: New file, with the old Makefile.am contents
and with the following changes:
(AUTOMAKE_OPTIONS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST)
(MOSTLYCLEANDIRS, MOSTLYCLEANFILES, noinst_LIBRARIES, SUFFIXES)
(AM_CFLAGS, DEFAULT_INCLUDES, libegnu_a_SOURCES, libegnu_a_LIBADD)
(EXTRA_libegnu_a_SOURCES, libegnu_a_SHORTNAME, libegnu_a_CPPFLAGS):
Remove.
(VPATH, abs_top_builddir, top_builddir, top_srcdir, all, AM_V_AR)
(AM_V_CC, AM_V_GEN, AM_V_at, DEPDIR, DEPFLAGS, MKDEPDIR, SYSTEM_TYPE)
(libgnu.a, libegnu.a, ETAGS, $(ETAGS), tags, TAGS, clean)
(mostlyclean, distclean, bootstrap-clean, maintainer-clean):
New macros and rules, since Automake no longer does them.
Include ../nt/gnulib-cfg.mk if SYSTEM_TYPE is windows-nt,
instead of including ../nt/gnulib.mk if BUILDING_FOR_WINDOWS_NT.
Include dependency files if AUTO_DEPEND.
(ALL_CFLAGS, AUTOCONF_INPUTS, libgnu_a_OBJECTS, libegnu_a_OBJECTS):
New macros.
(bootstrap-clean): Depend on distclean, not maintainer-clean,
and remove gnulib.mk.
(AUTOCONF_INPUTS, $(top_srcdir)/configure, ../config.status, Makefile):
New macros and rules, copied from ../Makefile.in.
($(libegnu_a_OBJECTS), $(libgnu_a_OBJECTS)): Depend on BUILT_SOURCES.
(.c.o, e-%.o): New generic rules.
* lib/gnulib.mk: Remove.
* lib/gnulib.mk.in: New file, which is built by autogen.sh
and contains much of what used to be in lib/gnulib.mk.
* m4/gnulib-common.m4: Copy from gnulib.
* make-dist: Do not distribute build-aux/compile, build-aux/depcomp,
build-aux/missing, build-aux/ar-lib, lib/Makefile.am, nt/gnulib.mk,
nt/gnulib-modules-to-delete.cfg. Distribute lib/Makefile.in,
lib/gnulib.mk.in, and nt/gnulib-cfg.mk instead.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1, ${srcdir}/gnulib.mk): Remove.
* nt/gnulib-cfg.mk: New file, which supersedes ...
* nt/gnulib-modules-to-delete.cfg: ... this file, which is removed.
* src/Makefile.in (ACLOCAL_INPUTS): Remove.
(AUTOCONF_INPUTS): Merge ACLOCAL_INPUTS into it.
($(top_srcdir)/configure, ../config.status, config.in Makefile):
Defer to parent Makefile.
2017-03-17 18:33:47 +00:00
|
|
|
AVOIDED_MODULES='
|
Use Gnulib regex for lib-src
Emacs regular expressions forked from everyone else long ago.
This makes it official and should allow simplification later.
etags.c now uses the glibc regex API, falling back on a
Gnulib-supplied substitute lib/regex.c if necessary.
Emacs proper now uses its own regular expression module.
Although this patch may look dauntingly large, most of it
was generated automatically by admin/merge-gnulib
and contains an exact copy of the glibc regex source,
and the by-hand changes do not grow the Emacs source code.
* admin/merge-gnulib (GNULIB_MODULES): Add regex.
(AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
nl_langinfo, wchar, wcrtomb, wctype-h.
* lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
(etags_deps, etags_libs): Remove regex-emacs.o.
* lib-src/etags.c: Go back to including regex.h.
(add_regex): Use unsigned char translation array,
since glibc regex requires that.
* lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
(libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
* lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
* m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
New files, copied from Gnulib.
* src/regex-emacs.h, src/conf_post.h:
(RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
Move from src/conf_post.h to src/regex-emacs.h,
so that they don’t interfere with compiling lib/regex.c.
2018-08-06 01:41:20 +00:00
|
|
|
btowc close dup fchdir fstat langinfo lock
|
Replace executable’s fingerprint in place
* admin/merge-gnulib (GNULIB_MODULES): Add memmem-simple.
(AVOIDED_MODULES): Add memchr.
* configure.ac (HAVE_PDUMPER): AC_SUBST it, too, for use in makefiles.
* lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o.
* lib/fingerprint.c: New file.
* lib/memmem.c, lib/str-two-way.h, m4/memmem.m4: New files,
copied from Gnulib.
* lib/fingerprint.h: Rename from src/fingerprint.h.
* lib-src/make-fingerprint.c: Include limits.h, sys/stat.h,
fingerprint.h, intprops.h, min-max.h.
(SSIZE_MAX): New macro, if not already defined.
(main): Without -r, Replace the fingerprint in the input file
instead of generating a fingerprint.c.
* lib/Makefile.in (libgnu_a_OBJECTS): Add fingerprint.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* src/Makefile.in (HAVE_PDUMPER, MAKE_PDUMPER_FINGERPRINT):
New macros.
(temacs$(EXEEXT)): Use them to replace the fingerprint instead
of precalculating it.
(mostlyclean, ctagsfiles1): Do not worry about fingerprint.c.
2019-04-14 23:31:24 +00:00
|
|
|
malloc-posix mbrtowc mbsinit memchr mkdir msvc-inval msvc-nothrow nl_langinfo
|
2019-12-06 23:16:15 +00:00
|
|
|
openat-die opendir pthread-h raise
|
2017-04-30 07:38:28 +00:00
|
|
|
save-cwd select setenv sigprocmask stat stdarg stdbool
|
2017-05-01 22:33:06 +00:00
|
|
|
threadlib tzset unsetenv utime utime-h
|
Use Gnulib regex for lib-src
Emacs regular expressions forked from everyone else long ago.
This makes it official and should allow simplification later.
etags.c now uses the glibc regex API, falling back on a
Gnulib-supplied substitute lib/regex.c if necessary.
Emacs proper now uses its own regular expression module.
Although this patch may look dauntingly large, most of it
was generated automatically by admin/merge-gnulib
and contains an exact copy of the glibc regex source,
and the by-hand changes do not grow the Emacs source code.
* admin/merge-gnulib (GNULIB_MODULES): Add regex.
(AVOIDED_MODULES): Add btowc, langinfo, lock, mbrtowc, mbsinit,
nl_langinfo, wchar, wcrtomb, wctype-h.
* lib-src/Makefile.in (regex-emacs.o): Remove; Gnulib does it now.
(etags_deps, etags_libs): Remove regex-emacs.o.
* lib-src/etags.c: Go back to including regex.h.
(add_regex): Use unsigned char translation array,
since glibc regex requires that.
* lib/Makefile.in (not_emacs_OBJECTS, for_emacs_OBJECTS): New macros.
(libegnu_a_OBJECTS): Use them, to avoid building e-regex.o.
* lib/gnulib.mk.in, m4/gnulib-comp.m4: Regenerate.
* lib/regcomp.c, lib/regex.c, lib/regex.h, lib/regex_internal.c:
* lib/regex_internal.h, lib/regexec.c, m4/builtin-expect.m4:
* m4/eealloc.m4, m4/glibc21.m4, m4/mbstate_t.m4, m4/regex.m4:
New files, copied from Gnulib.
* src/regex-emacs.h, src/conf_post.h:
(RE_TRANSLATE_TYPE, RE_TRANSLATE, RE_TRANSLATE_P):
Move from src/conf_post.h to src/regex-emacs.h,
so that they don’t interfere with compiling lib/regex.c.
2018-08-06 01:41:20 +00:00
|
|
|
wchar wcrtomb wctype-h
|
Switch from Automake to GNU Make
Emacs assumes GNU Make, and GNU Make has much of the functionality of
Automake built-in. The Emacs build process uses Automake primarily
because Emacs uses some Gnulib code and Gnulib formerly required
Automake. Now that Gnulib no longer requires Automake, Emacs can
stop using Automake and this should simplify Emacs maintenance
in the future (Bug#26100). Although this patch may look long, most of
it is generated automatically: the changes to build-aux/config.guess,
build-aux/config.sub, build-aux/install-sh, and lib/gnulib.mk.in are
all done by admin/merge-gnulib.
* .gitignore: Remove build-aux/ar-lib, build-aux/compile,
build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
build-aux/install-sh, build-aux/missing, and lib/Makefile.in,
as they are no longer built by autogen.sh.
Add lib/gnulib.mk, as it is now built by 'configure'.
Remove nt/gnulib.mk, as it is no longer built by 'make'.
* INSTALL.REPO, README, admin/make-tarball.txt:
Remove mention of Automake.
* Makefile.in (AUTOCONF, AUTOMAKE, AUTOHEADER, ACLOCAL, lib)
(AUTOCONF_INPUTS, ACLOCAL_PATH, ACLOCAL_INPUTS)
($(srcdir)/aclocal.m4, AUTOMAKE_INPUTS)
($(srcdir)/lib/Makefile.in, $(srcdir)/nt/gnulib.mk, am--refresh):
Remove.
($(MAKEFILE_NAME)): Depend on lib/gnulib.mk.in.
($(srcdir)/configure, $(srcdir)/src/stamp-h.in)
($(srcdir)/src/config.in):
Use autogen.sh instead of doing it by hand.
* admin/merge-gnulib (AVOIDED_MODULES, avoided_flags)):
New vars, to simplify processing of avoided modules.
(GNULIB_TOOL_FLAGS): Move --avoid flags into AVOIDED_MODULES.
Add --gnu-make, and change makefile name to gnulib.mk.in.
Copy config.guess, config.sub, and install-sh too, since
Automake no longer does that for us.
* admin/notes/copyright:
* admin/update_autogen (genfiles):
Update list of files.
Remove hack for nt/gnulib.mk, a file that is no longer needed.
* autogen.sh (progs): Remove Automake.
(automake_min): Remove.
Build aclocal.m4 so that autoreconf need not use aclocal.
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh:
New files, copied from Gnulib. These are now updated by
admin/merge-gnulib instead by autogen.sh.
* configure.ac (AC_PROG_MAKE_SET, ACLOCAL_PATH, AM_CONDITIONAL):
Remove.
(AM_INIT_AUTOMAKE, AM_SILENT_RULES): Remove call.
(AC_PROG_CC_C_O): Call this instead of AM_PROG_CC_C_O.
(BUILDING_FOR_WINDOWSNT, HYBRID_MALLOC_LIB): Remove; no longer needed.
(--disable-silent-rules): New option, since Automake no longer
does this for us.
(AM_V, AM_DEFAULT_V): Set unconditionally, and do not bother
with AM_SUBST_NOTMAKE.
(AC_PROG_INSTALL): Add call.
(MAKEINFO): Do not bother with the 'missing' program.
(MAKEINFO, SYSTEM_TYPE): AC_SUBST.
(AC_CONFIG_FILES): Add Makefile, lib/gnulib.mk.
(SUBDIR_MAKEFILES): Remove duplication.
* lib/Makefile.am: Remove, replacing with:
* lib/Makefile.in: New file, with the old Makefile.am contents
and with the following changes:
(AUTOMAKE_OPTIONS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST)
(MOSTLYCLEANDIRS, MOSTLYCLEANFILES, noinst_LIBRARIES, SUFFIXES)
(AM_CFLAGS, DEFAULT_INCLUDES, libegnu_a_SOURCES, libegnu_a_LIBADD)
(EXTRA_libegnu_a_SOURCES, libegnu_a_SHORTNAME, libegnu_a_CPPFLAGS):
Remove.
(VPATH, abs_top_builddir, top_builddir, top_srcdir, all, AM_V_AR)
(AM_V_CC, AM_V_GEN, AM_V_at, DEPDIR, DEPFLAGS, MKDEPDIR, SYSTEM_TYPE)
(libgnu.a, libegnu.a, ETAGS, $(ETAGS), tags, TAGS, clean)
(mostlyclean, distclean, bootstrap-clean, maintainer-clean):
New macros and rules, since Automake no longer does them.
Include ../nt/gnulib-cfg.mk if SYSTEM_TYPE is windows-nt,
instead of including ../nt/gnulib.mk if BUILDING_FOR_WINDOWS_NT.
Include dependency files if AUTO_DEPEND.
(ALL_CFLAGS, AUTOCONF_INPUTS, libgnu_a_OBJECTS, libegnu_a_OBJECTS):
New macros.
(bootstrap-clean): Depend on distclean, not maintainer-clean,
and remove gnulib.mk.
(AUTOCONF_INPUTS, $(top_srcdir)/configure, ../config.status, Makefile):
New macros and rules, copied from ../Makefile.in.
($(libegnu_a_OBJECTS), $(libgnu_a_OBJECTS)): Depend on BUILT_SOURCES.
(.c.o, e-%.o): New generic rules.
* lib/gnulib.mk: Remove.
* lib/gnulib.mk.in: New file, which is built by autogen.sh
and contains much of what used to be in lib/gnulib.mk.
* m4/gnulib-common.m4: Copy from gnulib.
* make-dist: Do not distribute build-aux/compile, build-aux/depcomp,
build-aux/missing, build-aux/ar-lib, lib/Makefile.am, nt/gnulib.mk,
nt/gnulib-modules-to-delete.cfg. Distribute lib/Makefile.in,
lib/gnulib.mk.in, and nt/gnulib-cfg.mk instead.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1, ${srcdir}/gnulib.mk): Remove.
* nt/gnulib-cfg.mk: New file, which supersedes ...
* nt/gnulib-modules-to-delete.cfg: ... this file, which is removed.
* src/Makefile.in (ACLOCAL_INPUTS): Remove.
(AUTOCONF_INPUTS): Merge ACLOCAL_INPUTS into it.
($(top_srcdir)/configure, ../config.status, config.in Makefile):
Defer to parent Makefile.
2017-03-17 18:33:47 +00:00
|
|
|
'
|
|
|
|
|
2012-05-21 02:33:13 +00:00
|
|
|
GNULIB_TOOL_FLAGS='
|
|
|
|
--conditional-dependencies --import --no-changelog --no-vc-files
|
Switch from Automake to GNU Make
Emacs assumes GNU Make, and GNU Make has much of the functionality of
Automake built-in. The Emacs build process uses Automake primarily
because Emacs uses some Gnulib code and Gnulib formerly required
Automake. Now that Gnulib no longer requires Automake, Emacs can
stop using Automake and this should simplify Emacs maintenance
in the future (Bug#26100). Although this patch may look long, most of
it is generated automatically: the changes to build-aux/config.guess,
build-aux/config.sub, build-aux/install-sh, and lib/gnulib.mk.in are
all done by admin/merge-gnulib.
* .gitignore: Remove build-aux/ar-lib, build-aux/compile,
build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
build-aux/install-sh, build-aux/missing, and lib/Makefile.in,
as they are no longer built by autogen.sh.
Add lib/gnulib.mk, as it is now built by 'configure'.
Remove nt/gnulib.mk, as it is no longer built by 'make'.
* INSTALL.REPO, README, admin/make-tarball.txt:
Remove mention of Automake.
* Makefile.in (AUTOCONF, AUTOMAKE, AUTOHEADER, ACLOCAL, lib)
(AUTOCONF_INPUTS, ACLOCAL_PATH, ACLOCAL_INPUTS)
($(srcdir)/aclocal.m4, AUTOMAKE_INPUTS)
($(srcdir)/lib/Makefile.in, $(srcdir)/nt/gnulib.mk, am--refresh):
Remove.
($(MAKEFILE_NAME)): Depend on lib/gnulib.mk.in.
($(srcdir)/configure, $(srcdir)/src/stamp-h.in)
($(srcdir)/src/config.in):
Use autogen.sh instead of doing it by hand.
* admin/merge-gnulib (AVOIDED_MODULES, avoided_flags)):
New vars, to simplify processing of avoided modules.
(GNULIB_TOOL_FLAGS): Move --avoid flags into AVOIDED_MODULES.
Add --gnu-make, and change makefile name to gnulib.mk.in.
Copy config.guess, config.sub, and install-sh too, since
Automake no longer does that for us.
* admin/notes/copyright:
* admin/update_autogen (genfiles):
Update list of files.
Remove hack for nt/gnulib.mk, a file that is no longer needed.
* autogen.sh (progs): Remove Automake.
(automake_min): Remove.
Build aclocal.m4 so that autoreconf need not use aclocal.
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh:
New files, copied from Gnulib. These are now updated by
admin/merge-gnulib instead by autogen.sh.
* configure.ac (AC_PROG_MAKE_SET, ACLOCAL_PATH, AM_CONDITIONAL):
Remove.
(AM_INIT_AUTOMAKE, AM_SILENT_RULES): Remove call.
(AC_PROG_CC_C_O): Call this instead of AM_PROG_CC_C_O.
(BUILDING_FOR_WINDOWSNT, HYBRID_MALLOC_LIB): Remove; no longer needed.
(--disable-silent-rules): New option, since Automake no longer
does this for us.
(AM_V, AM_DEFAULT_V): Set unconditionally, and do not bother
with AM_SUBST_NOTMAKE.
(AC_PROG_INSTALL): Add call.
(MAKEINFO): Do not bother with the 'missing' program.
(MAKEINFO, SYSTEM_TYPE): AC_SUBST.
(AC_CONFIG_FILES): Add Makefile, lib/gnulib.mk.
(SUBDIR_MAKEFILES): Remove duplication.
* lib/Makefile.am: Remove, replacing with:
* lib/Makefile.in: New file, with the old Makefile.am contents
and with the following changes:
(AUTOMAKE_OPTIONS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST)
(MOSTLYCLEANDIRS, MOSTLYCLEANFILES, noinst_LIBRARIES, SUFFIXES)
(AM_CFLAGS, DEFAULT_INCLUDES, libegnu_a_SOURCES, libegnu_a_LIBADD)
(EXTRA_libegnu_a_SOURCES, libegnu_a_SHORTNAME, libegnu_a_CPPFLAGS):
Remove.
(VPATH, abs_top_builddir, top_builddir, top_srcdir, all, AM_V_AR)
(AM_V_CC, AM_V_GEN, AM_V_at, DEPDIR, DEPFLAGS, MKDEPDIR, SYSTEM_TYPE)
(libgnu.a, libegnu.a, ETAGS, $(ETAGS), tags, TAGS, clean)
(mostlyclean, distclean, bootstrap-clean, maintainer-clean):
New macros and rules, since Automake no longer does them.
Include ../nt/gnulib-cfg.mk if SYSTEM_TYPE is windows-nt,
instead of including ../nt/gnulib.mk if BUILDING_FOR_WINDOWS_NT.
Include dependency files if AUTO_DEPEND.
(ALL_CFLAGS, AUTOCONF_INPUTS, libgnu_a_OBJECTS, libegnu_a_OBJECTS):
New macros.
(bootstrap-clean): Depend on distclean, not maintainer-clean,
and remove gnulib.mk.
(AUTOCONF_INPUTS, $(top_srcdir)/configure, ../config.status, Makefile):
New macros and rules, copied from ../Makefile.in.
($(libegnu_a_OBJECTS), $(libgnu_a_OBJECTS)): Depend on BUILT_SOURCES.
(.c.o, e-%.o): New generic rules.
* lib/gnulib.mk: Remove.
* lib/gnulib.mk.in: New file, which is built by autogen.sh
and contains much of what used to be in lib/gnulib.mk.
* m4/gnulib-common.m4: Copy from gnulib.
* make-dist: Do not distribute build-aux/compile, build-aux/depcomp,
build-aux/missing, build-aux/ar-lib, lib/Makefile.am, nt/gnulib.mk,
nt/gnulib-modules-to-delete.cfg. Distribute lib/Makefile.in,
lib/gnulib.mk.in, and nt/gnulib-cfg.mk instead.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1, ${srcdir}/gnulib.mk): Remove.
* nt/gnulib-cfg.mk: New file, which supersedes ...
* nt/gnulib-modules-to-delete.cfg: ... this file, which is removed.
* src/Makefile.in (ACLOCAL_INPUTS): Remove.
(AUTOCONF_INPUTS): Merge ACLOCAL_INPUTS into it.
($(top_srcdir)/configure, ../config.status, config.in Makefile):
Defer to parent Makefile.
2017-03-17 18:33:47 +00:00
|
|
|
--gnu-make
|
|
|
|
--makefile-name=gnulib.mk.in
|
2012-05-21 02:33:13 +00:00
|
|
|
'
|
|
|
|
|
|
|
|
# The source directory, with a trailing '/'.
|
|
|
|
# If empty, the source directory is the working directory.
|
|
|
|
src=$2
|
|
|
|
case $src in
|
|
|
|
*/ | '') ;;
|
|
|
|
*) src=$src/ ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
# Gnulib's source directory.
|
|
|
|
gnulib_srcdir=${1-$src../gnulib}
|
|
|
|
|
|
|
|
case $gnulib_srcdir in
|
|
|
|
-*) src=- ;;
|
|
|
|
esac
|
|
|
|
case $src in
|
|
|
|
-*)
|
Use ‘echo’ safely with ‘\’ or leading ‘-’
POSIX says that ‘echo FOO’ produces implementation-defined output
if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
behavior in that case.
* Makefile.in (removenullpaths): Remove.
(epaths-force): Rewrite to avoid the need for ‘echo’.
(install-etc): Be clearer about escaping the shell metacharacters
‘\’ and ‘$’.
* Makefile.in (install-arch-indep, install-etcdoc):
* admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
* admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
* configure.ac, lib-src/rcs2log, make-dist:
* src/Makefile.in (lisp.mk):
Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
if $foo can contain arbitrary characters.
* lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
* doc/lispref/two-volume.make (vol1.pdf):
* test/etags/make-src/Makefile (web ftp publish):
Use ‘printf’ rather than ‘echo -e’.
2015-10-11 01:03:49 +00:00
|
|
|
printf '%s\n' >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]]
|
2012-05-21 02:33:13 +00:00
|
|
|
|
|
|
|
SRCDIR is the Emacs source directory (default: working directory).
|
|
|
|
GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)."
|
|
|
|
exit 1 ;;
|
|
|
|
esac
|
|
|
|
|
|
|
|
test -x "$src"autogen.sh || {
|
Use ‘echo’ safely with ‘\’ or leading ‘-’
POSIX says that ‘echo FOO’ produces implementation-defined output
if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
behavior in that case.
* Makefile.in (removenullpaths): Remove.
(epaths-force): Rewrite to avoid the need for ‘echo’.
(install-etc): Be clearer about escaping the shell metacharacters
‘\’ and ‘$’.
* Makefile.in (install-arch-indep, install-etcdoc):
* admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
* admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
* configure.ac, lib-src/rcs2log, make-dist:
* src/Makefile.in (lisp.mk):
Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
if $foo can contain arbitrary characters.
* lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
* doc/lispref/two-volume.make (vol1.pdf):
* test/etags/make-src/Makefile (web ftp publish):
Use ‘printf’ rather than ‘echo -e’.
2015-10-11 01:03:49 +00:00
|
|
|
printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory."
|
2012-05-21 02:33:13 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
|
|
|
test -d "$gnulib_srcdir" ||
|
|
|
|
git clone -- "$GNULIB_URL" "$gnulib_srcdir" ||
|
|
|
|
exit
|
|
|
|
|
|
|
|
test -x "$gnulib_srcdir"/gnulib-tool || {
|
Use ‘echo’ safely with ‘\’ or leading ‘-’
POSIX says that ‘echo FOO’ produces implementation-defined output
if FOO contains leading ‘-’, or ‘\’ anywhere, so don’t assume GNU
behavior in that case.
* Makefile.in (removenullpaths): Remove.
(epaths-force): Rewrite to avoid the need for ‘echo’.
(install-etc): Be clearer about escaping the shell metacharacters
‘\’ and ‘$’.
* Makefile.in (install-arch-indep, install-etcdoc):
* admin/charsets/mapconv, admin/merge-gnulib, admin/merge-pkg-config:
* admin/quick-install-emacs, build-aux/gitlog-to-emacslog:
* configure.ac, lib-src/rcs2log, make-dist:
* src/Makefile.in (lisp.mk):
Don’t assume ‘echo’ outputs ‘\’ and leading ‘-’ unscathed.
For example, use ‘printf '%s\n' "$foo"’ rather than ‘echo "$foo"’
if $foo can contain arbitrary characters.
* lisp/Makefile.in (TAGS): Use ‘ls’, not ‘echo’, to avoid ‘\’ issues.
* doc/lispref/two-volume.make (vol1.pdf):
* test/etags/make-src/Makefile (web ftp publish):
Use ‘printf’ rather than ‘echo -e’.
2015-10-11 01:03:49 +00:00
|
|
|
printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory."
|
2012-05-21 02:33:13 +00:00
|
|
|
exit 1
|
|
|
|
}
|
|
|
|
|
Switch from Automake to GNU Make
Emacs assumes GNU Make, and GNU Make has much of the functionality of
Automake built-in. The Emacs build process uses Automake primarily
because Emacs uses some Gnulib code and Gnulib formerly required
Automake. Now that Gnulib no longer requires Automake, Emacs can
stop using Automake and this should simplify Emacs maintenance
in the future (Bug#26100). Although this patch may look long, most of
it is generated automatically: the changes to build-aux/config.guess,
build-aux/config.sub, build-aux/install-sh, and lib/gnulib.mk.in are
all done by admin/merge-gnulib.
* .gitignore: Remove build-aux/ar-lib, build-aux/compile,
build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
build-aux/install-sh, build-aux/missing, and lib/Makefile.in,
as they are no longer built by autogen.sh.
Add lib/gnulib.mk, as it is now built by 'configure'.
Remove nt/gnulib.mk, as it is no longer built by 'make'.
* INSTALL.REPO, README, admin/make-tarball.txt:
Remove mention of Automake.
* Makefile.in (AUTOCONF, AUTOMAKE, AUTOHEADER, ACLOCAL, lib)
(AUTOCONF_INPUTS, ACLOCAL_PATH, ACLOCAL_INPUTS)
($(srcdir)/aclocal.m4, AUTOMAKE_INPUTS)
($(srcdir)/lib/Makefile.in, $(srcdir)/nt/gnulib.mk, am--refresh):
Remove.
($(MAKEFILE_NAME)): Depend on lib/gnulib.mk.in.
($(srcdir)/configure, $(srcdir)/src/stamp-h.in)
($(srcdir)/src/config.in):
Use autogen.sh instead of doing it by hand.
* admin/merge-gnulib (AVOIDED_MODULES, avoided_flags)):
New vars, to simplify processing of avoided modules.
(GNULIB_TOOL_FLAGS): Move --avoid flags into AVOIDED_MODULES.
Add --gnu-make, and change makefile name to gnulib.mk.in.
Copy config.guess, config.sub, and install-sh too, since
Automake no longer does that for us.
* admin/notes/copyright:
* admin/update_autogen (genfiles):
Update list of files.
Remove hack for nt/gnulib.mk, a file that is no longer needed.
* autogen.sh (progs): Remove Automake.
(automake_min): Remove.
Build aclocal.m4 so that autoreconf need not use aclocal.
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh:
New files, copied from Gnulib. These are now updated by
admin/merge-gnulib instead by autogen.sh.
* configure.ac (AC_PROG_MAKE_SET, ACLOCAL_PATH, AM_CONDITIONAL):
Remove.
(AM_INIT_AUTOMAKE, AM_SILENT_RULES): Remove call.
(AC_PROG_CC_C_O): Call this instead of AM_PROG_CC_C_O.
(BUILDING_FOR_WINDOWSNT, HYBRID_MALLOC_LIB): Remove; no longer needed.
(--disable-silent-rules): New option, since Automake no longer
does this for us.
(AM_V, AM_DEFAULT_V): Set unconditionally, and do not bother
with AM_SUBST_NOTMAKE.
(AC_PROG_INSTALL): Add call.
(MAKEINFO): Do not bother with the 'missing' program.
(MAKEINFO, SYSTEM_TYPE): AC_SUBST.
(AC_CONFIG_FILES): Add Makefile, lib/gnulib.mk.
(SUBDIR_MAKEFILES): Remove duplication.
* lib/Makefile.am: Remove, replacing with:
* lib/Makefile.in: New file, with the old Makefile.am contents
and with the following changes:
(AUTOMAKE_OPTIONS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST)
(MOSTLYCLEANDIRS, MOSTLYCLEANFILES, noinst_LIBRARIES, SUFFIXES)
(AM_CFLAGS, DEFAULT_INCLUDES, libegnu_a_SOURCES, libegnu_a_LIBADD)
(EXTRA_libegnu_a_SOURCES, libegnu_a_SHORTNAME, libegnu_a_CPPFLAGS):
Remove.
(VPATH, abs_top_builddir, top_builddir, top_srcdir, all, AM_V_AR)
(AM_V_CC, AM_V_GEN, AM_V_at, DEPDIR, DEPFLAGS, MKDEPDIR, SYSTEM_TYPE)
(libgnu.a, libegnu.a, ETAGS, $(ETAGS), tags, TAGS, clean)
(mostlyclean, distclean, bootstrap-clean, maintainer-clean):
New macros and rules, since Automake no longer does them.
Include ../nt/gnulib-cfg.mk if SYSTEM_TYPE is windows-nt,
instead of including ../nt/gnulib.mk if BUILDING_FOR_WINDOWS_NT.
Include dependency files if AUTO_DEPEND.
(ALL_CFLAGS, AUTOCONF_INPUTS, libgnu_a_OBJECTS, libegnu_a_OBJECTS):
New macros.
(bootstrap-clean): Depend on distclean, not maintainer-clean,
and remove gnulib.mk.
(AUTOCONF_INPUTS, $(top_srcdir)/configure, ../config.status, Makefile):
New macros and rules, copied from ../Makefile.in.
($(libegnu_a_OBJECTS), $(libgnu_a_OBJECTS)): Depend on BUILT_SOURCES.
(.c.o, e-%.o): New generic rules.
* lib/gnulib.mk: Remove.
* lib/gnulib.mk.in: New file, which is built by autogen.sh
and contains much of what used to be in lib/gnulib.mk.
* m4/gnulib-common.m4: Copy from gnulib.
* make-dist: Do not distribute build-aux/compile, build-aux/depcomp,
build-aux/missing, build-aux/ar-lib, lib/Makefile.am, nt/gnulib.mk,
nt/gnulib-modules-to-delete.cfg. Distribute lib/Makefile.in,
lib/gnulib.mk.in, and nt/gnulib-cfg.mk instead.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1, ${srcdir}/gnulib.mk): Remove.
* nt/gnulib-cfg.mk: New file, which supersedes ...
* nt/gnulib-modules-to-delete.cfg: ... this file, which is removed.
* src/Makefile.in (ACLOCAL_INPUTS): Remove.
(AUTOCONF_INPUTS): Merge ACLOCAL_INPUTS into it.
($(top_srcdir)/configure, ../config.status, config.in Makefile):
Defer to parent Makefile.
2017-03-17 18:33:47 +00:00
|
|
|
avoided_flags=
|
|
|
|
for module in $AVOIDED_MODULES; do
|
|
|
|
avoided_flags="$avoided_flags --avoid=$module"
|
|
|
|
done
|
|
|
|
|
|
|
|
"$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS \
|
|
|
|
$avoided_flags $GNULIB_MODULES &&
|
2016-09-20 15:30:17 +00:00
|
|
|
rm -- "$src"lib/gl_openssl.h "$src"m4/fcntl-o.m4 \
|
2016-09-08 00:04:49 +00:00
|
|
|
"$src"m4/gl-openssl.m4 \
|
2017-03-12 08:02:52 +00:00
|
|
|
"$src"m4/gnulib-cache.m4 "$src"m4/gnulib-tool.m4 \
|
2017-08-09 18:38:04 +00:00
|
|
|
"$src"m4/manywarnings-c++.m4 \
|
2017-03-12 08:02:52 +00:00
|
|
|
"$src"m4/warn-on-use.m4 "$src"m4/wint_t.m4 &&
|
2012-05-21 02:33:13 +00:00
|
|
|
cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc &&
|
Switch from Automake to GNU Make
Emacs assumes GNU Make, and GNU Make has much of the functionality of
Automake built-in. The Emacs build process uses Automake primarily
because Emacs uses some Gnulib code and Gnulib formerly required
Automake. Now that Gnulib no longer requires Automake, Emacs can
stop using Automake and this should simplify Emacs maintenance
in the future (Bug#26100). Although this patch may look long, most of
it is generated automatically: the changes to build-aux/config.guess,
build-aux/config.sub, build-aux/install-sh, and lib/gnulib.mk.in are
all done by admin/merge-gnulib.
* .gitignore: Remove build-aux/ar-lib, build-aux/compile,
build-aux/config.guess, build-aux/config.sub, build-aux/depcomp,
build-aux/install-sh, build-aux/missing, and lib/Makefile.in,
as they are no longer built by autogen.sh.
Add lib/gnulib.mk, as it is now built by 'configure'.
Remove nt/gnulib.mk, as it is no longer built by 'make'.
* INSTALL.REPO, README, admin/make-tarball.txt:
Remove mention of Automake.
* Makefile.in (AUTOCONF, AUTOMAKE, AUTOHEADER, ACLOCAL, lib)
(AUTOCONF_INPUTS, ACLOCAL_PATH, ACLOCAL_INPUTS)
($(srcdir)/aclocal.m4, AUTOMAKE_INPUTS)
($(srcdir)/lib/Makefile.in, $(srcdir)/nt/gnulib.mk, am--refresh):
Remove.
($(MAKEFILE_NAME)): Depend on lib/gnulib.mk.in.
($(srcdir)/configure, $(srcdir)/src/stamp-h.in)
($(srcdir)/src/config.in):
Use autogen.sh instead of doing it by hand.
* admin/merge-gnulib (AVOIDED_MODULES, avoided_flags)):
New vars, to simplify processing of avoided modules.
(GNULIB_TOOL_FLAGS): Move --avoid flags into AVOIDED_MODULES.
Add --gnu-make, and change makefile name to gnulib.mk.in.
Copy config.guess, config.sub, and install-sh too, since
Automake no longer does that for us.
* admin/notes/copyright:
* admin/update_autogen (genfiles):
Update list of files.
Remove hack for nt/gnulib.mk, a file that is no longer needed.
* autogen.sh (progs): Remove Automake.
(automake_min): Remove.
Build aclocal.m4 so that autoreconf need not use aclocal.
* build-aux/config.guess, build-aux/config.sub:
* build-aux/install-sh:
New files, copied from Gnulib. These are now updated by
admin/merge-gnulib instead by autogen.sh.
* configure.ac (AC_PROG_MAKE_SET, ACLOCAL_PATH, AM_CONDITIONAL):
Remove.
(AM_INIT_AUTOMAKE, AM_SILENT_RULES): Remove call.
(AC_PROG_CC_C_O): Call this instead of AM_PROG_CC_C_O.
(BUILDING_FOR_WINDOWSNT, HYBRID_MALLOC_LIB): Remove; no longer needed.
(--disable-silent-rules): New option, since Automake no longer
does this for us.
(AM_V, AM_DEFAULT_V): Set unconditionally, and do not bother
with AM_SUBST_NOTMAKE.
(AC_PROG_INSTALL): Add call.
(MAKEINFO): Do not bother with the 'missing' program.
(MAKEINFO, SYSTEM_TYPE): AC_SUBST.
(AC_CONFIG_FILES): Add Makefile, lib/gnulib.mk.
(SUBDIR_MAKEFILES): Remove duplication.
* lib/Makefile.am: Remove, replacing with:
* lib/Makefile.in: New file, with the old Makefile.am contents
and with the following changes:
(AUTOMAKE_OPTIONS, BUILT_SOURCES, CLEANFILES, EXTRA_DIST)
(MOSTLYCLEANDIRS, MOSTLYCLEANFILES, noinst_LIBRARIES, SUFFIXES)
(AM_CFLAGS, DEFAULT_INCLUDES, libegnu_a_SOURCES, libegnu_a_LIBADD)
(EXTRA_libegnu_a_SOURCES, libegnu_a_SHORTNAME, libegnu_a_CPPFLAGS):
Remove.
(VPATH, abs_top_builddir, top_builddir, top_srcdir, all, AM_V_AR)
(AM_V_CC, AM_V_GEN, AM_V_at, DEPDIR, DEPFLAGS, MKDEPDIR, SYSTEM_TYPE)
(libgnu.a, libegnu.a, ETAGS, $(ETAGS), tags, TAGS, clean)
(mostlyclean, distclean, bootstrap-clean, maintainer-clean):
New macros and rules, since Automake no longer does them.
Include ../nt/gnulib-cfg.mk if SYSTEM_TYPE is windows-nt,
instead of including ../nt/gnulib.mk if BUILDING_FOR_WINDOWS_NT.
Include dependency files if AUTO_DEPEND.
(ALL_CFLAGS, AUTOCONF_INPUTS, libgnu_a_OBJECTS, libegnu_a_OBJECTS):
New macros.
(bootstrap-clean): Depend on distclean, not maintainer-clean,
and remove gnulib.mk.
(AUTOCONF_INPUTS, $(top_srcdir)/configure, ../config.status, Makefile):
New macros and rules, copied from ../Makefile.in.
($(libegnu_a_OBJECTS), $(libgnu_a_OBJECTS)): Depend on BUILT_SOURCES.
(.c.o, e-%.o): New generic rules.
* lib/gnulib.mk: Remove.
* lib/gnulib.mk.in: New file, which is built by autogen.sh
and contains much of what used to be in lib/gnulib.mk.
* m4/gnulib-common.m4: Copy from gnulib.
* make-dist: Do not distribute build-aux/compile, build-aux/depcomp,
build-aux/missing, build-aux/ar-lib, lib/Makefile.am, nt/gnulib.mk,
nt/gnulib-modules-to-delete.cfg. Distribute lib/Makefile.in,
lib/gnulib.mk.in, and nt/gnulib-cfg.mk instead.
* nt/Makefile.in (AM_V_GEN, am__v_GEN_, am__v_GEN_0)
(am__v_GEN_1, ${srcdir}/gnulib.mk): Remove.
* nt/gnulib-cfg.mk: New file, which supersedes ...
* nt/gnulib-modules-to-delete.cfg: ... this file, which is removed.
* src/Makefile.in (ACLOCAL_INPUTS): Remove.
(AUTOCONF_INPUTS): Merge ACLOCAL_INPUTS into it.
($(top_srcdir)/configure, ../config.status, config.in Makefile):
Defer to parent Makefile.
2017-03-17 18:33:47 +00:00
|
|
|
cp -- "$gnulib_srcdir"/build-aux/config.guess \
|
|
|
|
"$gnulib_srcdir"/build-aux/config.sub \
|
|
|
|
"$gnulib_srcdir"/build-aux/install-sh \
|
|
|
|
"$gnulib_srcdir"/build-aux/move-if-change \
|
|
|
|
"$src"build-aux &&
|
2014-05-13 23:15:01 +00:00
|
|
|
{ test -z "$src" || cd "$src"; } &&
|
|
|
|
./autogen.sh
|