etc/TODO small updates
[emacs.git] / admin / merge-gnulib
bloba5bd622f4c0abab5b19aed97bf69eba8989b5608
1 #! /bin/sh
2 # Merge gnulib sources into Emacs sources.
3 # Typical usage:
5 # admin/merge-gnulib
7 # Copyright 2012-2013 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
28 GNULIB_MODULES='
29 alloca-opt byteswap c-ctype c-strcase
30 careadlinkat close-stream count-one-bits count-trailing-zeros
31 crypto/md5 crypto/sha1 crypto/sha256 crypto/sha512
32 dtoastr dtotimespec dup2 environ execinfo faccessat
33 fcntl fcntl-h fdatasync fdopendir filemode fstatat fsync
34 getloadavg getopt-gnu gettime gettimeofday
35 intprops largefile lstat
36 manywarnings memrchr mkostemp mktime
37 pipe2 pselect pthread_sigmask putenv qacl readlink readlinkat
38 sig2str socklen stat-time stdalign stdarg stdbool stdio
39 strftime strtoimax strtoumax symlink sys_stat
40 sys_time time timer-time timespec-add timespec-sub unsetenv utimens
41 warnings
44 GNULIB_TOOL_FLAGS='
45 --avoid=close --avoid=dup
46 --avoid=fchdir --avoid=fstat
47 --avoid=malloc-posix --avoid=msvc-inval --avoid=msvc-nothrow
48 --avoid=open --avoid=openat-die --avoid=opendir
49 --avoid=raise
50 --avoid=save-cwd --avoid=select --avoid=sigprocmask --avoid=sys_types
51 --avoid=threadlib
52 --conditional-dependencies --import --no-changelog --no-vc-files
53 --makefile-name=gnulib.mk
56 # The source directory, with a trailing '/'.
57 # If empty, the source directory is the working directory.
58 src=$2
59 case $src in
60 */ | '') ;;
61 *) src=$src/ ;;
62 esac
64 # Gnulib's source directory.
65 gnulib_srcdir=${1-$src../gnulib}
67 case $gnulib_srcdir in
68 -*) src=- ;;
69 esac
70 case $src in
71 -*)
72 echo >&2 "$0: usage: $0 [GNULIB_SRCDIR [SRCDIR]]
74 SRCDIR is the Emacs source directory (default: working directory).
75 GNULIB_SRCDIR is the Gnulib source directory (default: SRCDIR/../gnulib)."
76 exit 1 ;;
77 esac
79 test -x "$src"autogen.sh || {
80 echo >&2 "$0: '${src:-.}' is not an Emacs source directory."
81 exit 1
84 test -d "$gnulib_srcdir" ||
85 git clone -- "$GNULIB_URL" "$gnulib_srcdir" ||
86 exit
88 test -x "$gnulib_srcdir"/gnulib-tool || {
89 echo >&2 "$0: '$gnulib_srcdir' is not a Gnulib source directory."
90 exit 1
93 "$gnulib_srcdir"/gnulib-tool --dir="$src" $GNULIB_TOOL_FLAGS $GNULIB_MODULES &&
94 rm -- "$src"m4/fcntl-o.m4 "$src"m4/gnulib-cache.m4 "$src"m4/warn-on-use.m4 &&
95 cp -- "$gnulib_srcdir"/build-aux/texinfo.tex "$src"doc/misc &&
96 cp -- "$gnulib_srcdir"/build-aux/move-if-change "$src"build-aux &&
97 autoreconf -i -I m4 -- ${src:+"$src"}