2 # Merge gnulib sources into Emacs sources.
7 # Copyright 2012-2017 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 <http://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 crypto/sha1 crypto/sha256 crypto/sha512
33 diffseq dtoastr dtotimespec dup2 environ execinfo explicit_bzero faccessat
34 fcntl fcntl-h fdatasync fdopendir
35 filemode filevercmp flexmember fstatat fsync
36 getloadavg getopt-gnu gettime gettimeofday gitlog-to-changelog
37 ignore-value intprops largefile lstat
38 manywarnings memrchr minmax mkostemp mktime nstrftime
39 pipe2 pselect pthread_sigmask putenv qcopy-acl readlink readlinkat
40 sig2str socklen stat-time std-gnu11 stdalign stddef stdio
41 stpcpy strtoimax symlink sys_stat
42 sys_time time time_r time_rz timegm timer-time timespec-add timespec-sub
43 update-copyright unlocked-io utimens
48 close dup fchdir fstat
49 malloc-posix msvc-inval msvc-nothrow
50 open openat-die opendir raise
51 save-cwd select setenv sigprocmask stat stdarg stdbool
52 threadlib tzset unsetenv utime utime-h
56 --conditional-dependencies --import --no-changelog --no-vc-files
58 --makefile-name=gnulib.mk.in
61 # The source directory, with a trailing '/'.
62 # If empty, the source directory is the working directory.
69 # Gnulib's source directory.
70 gnulib_srcdir
=${1-$src../gnulib}
72 case $gnulib_srcdir in
77 printf '%s\n' >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]]
79 SRCDIR is the Emacs source directory (default: working directory).
80 GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)."
84 test -x "$src"autogen.sh ||
{
85 printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory."
89 test -d "$gnulib_srcdir" ||
90 git clone
-- "$GNULIB_URL" "$gnulib_srcdir" ||
93 test -x "$gnulib_srcdir"/gnulib-tool ||
{
94 printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory."
99 for module
in $AVOIDED_MODULES; do
100 avoided_flags
="$avoided_flags --avoid=$module"
103 "$gnulib_srcdir"/gnulib-tool
--dir="$src" $GNULIB_TOOL_FLAGS \
104 $avoided_flags $GNULIB_MODULES &&
105 rm -- "$src"lib
/gl_openssl.h
"$src"m
4/fcntl-o.
m4 \
106 "$src"m
4/gl-openssl.
m4 \
107 "$src"m
4/gnulib-cache.
m4 "$src"m
4/gnulib-tool.
m4 \
108 "$src"m
4/warn-on-use.
m4 "$src"m
4/wint_t.
m4 &&
109 cp -- "$gnulib_srcdir"/build-aux
/texinfo.tex
"$src"doc
/misc
&&
110 cp -- "$gnulib_srcdir"/build-aux
/config.guess \
111 "$gnulib_srcdir"/build-aux
/config.sub \
112 "$gnulib_srcdir"/build-aux
/install-sh \
113 "$gnulib_srcdir"/build-aux
/move-if-change \
115 { test -z "$src" ||
cd "$src"; } &&