2 # Merge gnulib sources into Emacs sources.
7 # Copyright 2012-2024 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
=https
://git.savannah.gnu.org
/git
/gnulib.git
29 alignasof alloca-opt binary-io boot-time byteswap c-ctype c-strcase
31 careadlinkat close-stream copy-file-range
32 count-leading-zeros count-one-bits count-trailing-zeros
33 crypto/md5 crypto/md5-buffer
34 crypto/sha1-buffer crypto/sha256-buffer crypto/sha512-buffer
35 d-type diffseq double-slash-root dtoastr dtotimespec dup2
36 environ execinfo faccessat
37 fchmodat fcntl fcntl-h fdopendir file-has-acl
38 filemode filename filevercmp flexmember fpieee
39 free-posix fstatat fsusage fsync futimens
40 getline getloadavg getopt-gnu getrandom gettime gettimeofday gitlog-to-changelog
41 ieee754-h ignore-value intprops largefile libgmp lstat
42 manywarnings memmem-simple mempcpy memrchr memset_explicit
43 minmax mkostemp mktime
44 nanosleep nproc nstrftime
45 pathmax pipe2 pselect pthread_sigmask
46 qcopy-acl readlink readlinkat regex
47 sig2str sigdescr_np socklen stat-time std-gnu11 stdbool stdckdint stddef stdio
48 stpcpy strnlen strnlen strtoimax symlink sys_stat sys_time
49 tempname time-h time_r time_rz timegm timer-time timespec-add timespec-sub
50 update-copyright unlocked-io utimensat
55 access btowc chmod close crypto/af_alg dup fchdir fstat
56 iswblank iswctype iswdigit iswxdigit langinfo localename-unsafe-limited lock
57 mbrtowc mbsinit memchr mkdir msvc-inval msvc-nothrow nl_langinfo
58 openat-die opendir pthread-h raise
59 save-cwd select setenv sigprocmask stat stdarg
60 threadlib tzset unsetenv utime utime-h
61 wchar wcrtomb wctype wctype-h
65 --conditional-dependencies --import --no-changelog --no-vc-files
67 --makefile-name=gnulib.mk.in
70 # The source directory, with a trailing '/'.
71 # If empty, the source directory is the working directory.
78 # Gnulib's source directory.
79 gnulib_srcdir
=${1-$src../gnulib}
81 case $gnulib_srcdir in
86 printf '%s\n' >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]]
88 SRCDIR is the Emacs source directory (default: working directory).
89 GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)."
93 test -x "$src"autogen.sh ||
{
94 printf '%s\n' >&2 "$0: '${src:-.}' is not an Emacs source directory."
98 test -d "$gnulib_srcdir" ||
99 git clone
-- "$GNULIB_URL" "$gnulib_srcdir" ||
102 test -x "$gnulib_srcdir"/gnulib-tool ||
{
103 printf '%s\n' >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory."
107 # gnulib-tool has problems with a bare checkout (Bug#32452#65).
108 test -f configure || .
/autogen.sh ||
exit
111 for module
in $AVOIDED_MODULES; do
112 avoided_flags
="$avoided_flags --avoid=$module"
115 # Clean the lib directory as well.
116 if [ -e "$src"/lib
/Makefile
]; then
117 make -C "$src"/lib maintainer-clean
120 "$gnulib_srcdir"/gnulib-tool
--dir="$src" $GNULIB_TOOL_FLAGS \
121 $avoided_flags $GNULIB_MODULES &&
122 rm -- "$src"lib
/gl_openssl.h \
123 "$src"lib
/stdio-read.c
"$src"lib
/stdio-write.c \
124 "$src"m
4/fcntl-o.
m4 \
125 "$src"m
4/gl-openssl.
m4 \
126 "$src"m
4/gnulib-cache.
m4 "$src"m
4/gnulib-tool.
m4 \
127 "$src"m
4/locale-fr.
m4 \
128 "$src"m
4/manywarnings-c
++.
m4 \
129 "$src"m
4/warn-on-use.
m4 "$src"m
4/wint_t.
m4 &&
130 cp -- "$gnulib_srcdir"/build-aux
/texinfo.tex
"$src"doc
/misc
&&
131 cp -- "$gnulib_srcdir"/build-aux
/config.guess \
132 "$gnulib_srcdir"/build-aux
/config.sub \
133 "$gnulib_srcdir"/build-aux
/install-sh \
134 "$gnulib_srcdir"/build-aux
/move-if-change \
136 cp -- "$gnulib_srcdir"/lib
/af_alg.h \
137 "$gnulib_srcdir"/lib
/save-cwd.h \
139 cp -- "$gnulib_srcdir"/m
4/codeset.
m4 \
141 { test -z "$src" ||
cd "$src"; } &&