2 # Merge gnulib sources into Emacs sources.
7 # Copyright 2012-2018 Free Software Foundation, Inc.
9 # This file is part of GNU Emacs.
11 # GNU Emacs is free software: you can redistribute it and/or modify
12 # it under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # GNU Emacs is distributed in the hope that it will be useful,
17 # but WITHOUT ANY WARRANTY; without even the implied warranty of
18 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 # GNU General Public License for more details.
21 # You should have received a copy of the GNU General Public License
22 # along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>.
24 # written by Paul Eggert
26 GNULIB_URL
=git
://git.savannah.gnu.org
/gnulib.git
29 alloca-opt binary-io byteswap c-ctype c-strcase
30 careadlinkat close-stream
31 count-leading-zeros count-one-bits count-trailing-zeros
32 crypto/md5-buffer crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
33 d-type diffseq dtoastr dtotimespec dup2
34 environ execinfo explicit_bzero faccessat
35 fcntl fcntl-h fdatasync fdopendir
36 filemode filevercmp flexmember fpieee fstatat fsusage fsync
37 getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog
38 ignore-value intprops largefile lstat
39 manywarnings memrchr minmax mkostemp mktime nstrftime
40 pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat
41 sig2str socklen stat-time std-gnu11 stdalign stddef stdio
42 stpcpy strtoimax symlink sys_stat sys_time
43 tempname time time_r time_rz timegm timer-time timespec-add timespec-sub
44 update-copyright unlocked-io utimens
49 close dup fchdir fstat
50 malloc-posix msvc-inval msvc-nothrow
51 openat-die opendir raise
52 save-cwd select setenv sigprocmask stat stdarg stdbool
53 threadlib tzset unsetenv utime utime-h
57 --conditional-dependencies --import --no-changelog --no-vc-files
59 --makefile-name=gnulib.mk.in
62 # The source directory, with a trailing '/'.
63 # If empty, the source directory is the working directory.
70 # Gnulib's source directory.
71 gnulib_srcdir
=${1-$src../gnulib}
73 case $gnulib_srcdir in
78 printf '%s\n' >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]]
80 SRCDIR is the Emacs source directory (default: working directory).
81 GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)."
85 test -x "$src"autogen.sh ||
{
86 printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory."
90 test -d "$gnulib_srcdir" ||
91 git clone
-- "$GNULIB_URL" "$gnulib_srcdir" ||
94 test -x "$gnulib_srcdir"/gnulib-tool ||
{
95 printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory."
100 for module
in $AVOIDED_MODULES; do
101 avoided_flags
="$avoided_flags --avoid=$module"
104 "$gnulib_srcdir"/gnulib-tool
--dir="$src" $GNULIB_TOOL_FLAGS \
105 $avoided_flags $GNULIB_MODULES &&
106 rm -- "$src"lib
/gl_openssl.h
"$src"m
4/fcntl-o.
m4 \
107 "$src"m
4/gl-openssl.
m4 \
108 "$src"m
4/gnulib-cache.
m4 "$src"m
4/gnulib-tool.
m4 \
109 "$src"m
4/manywarnings-c
++.
m4 \
110 "$src"m
4/warn-on-use.
m4 "$src"m
4/wint_t.
m4 &&
111 cp -- "$gnulib_srcdir"/build-aux
/texinfo.tex
"$src"doc
/misc
&&
112 cp -- "$gnulib_srcdir"/build-aux
/config.guess \
113 "$gnulib_srcdir"/build-aux
/config.sub \
114 "$gnulib_srcdir"/build-aux
/install-sh \
115 "$gnulib_srcdir"/build-aux
/move-if-change \
117 { test -z "$src" ||
cd "$src"; } &&