summaryrefslogtreecommitdiffstats
path: root/autogen.sh
blob: b94b36979527ddc9d8d73e9cf01ae74803286178 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
#!/bin/sh
# Convenience script for regenerating all autogeneratable files that are
# omitted from the version control repository. In particular, this script
# also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
# with new versions of autoconf or automake.
#
# This script requires autoconf-2.60..2.63 and automake-1.10 in the PATH.
# It also requires either
#   - the GNULIB_TOOL environment variable pointing to the gnulib-tool script
#     in a gnulib checkout, or
#   - the cvs program in the PATH and an internet connection.

# Copyright (C) 2003-2008 Free Software Foundation, Inc.
#
# This program 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.
#
# This program 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
# along with this program.  If not, see <http://www.gnu.org/licenses/>.

# Usage: ./autogen.sh [--quick] [--skip-gnulib]
#
# Usage after a first-time CVS checkout:     ./autogen.sh
# Usage after a CVS update:                  ./autogen.sh --quick
# This uses an up-to-date gnulib checkout.
# (The gettext-0.17 release was prepared using gnulib commit
# bf5ebbca03613397b66521e98dd4ce28741c4689 from 2007-11-07.)
#
# Usage from a released tarball:             ./autogen.sh --quick --skip-gnulib
# This does not use a gnulib checkout.

quick=false
skip_gnulib=false
while :; do
  case "$1" in
    --quick) quick=true; shift;;
    --skip-gnulib) skip_gnulib=true; shift;;
    *) break ;;
  esac
done

# Fix execute permissions.
chmod a+x gettext-tools/tests/msgmerge-22
chmod a+x gettext-tools/tests/msgmerge-update-4

# The tests in gettext-tools/tests are not meant to be executable, because
# they have a TESTS_ENVIRONMENT that specifies the shell explicitly.

if ! $skip_gnulib; then
  if test -z "$GNULIB_TOOL"; then
    # Check out gnulib in a subdirectory 'gnulib'.
    GNULIB_CVS_ROOT=':pserver:anonymous@pserver.git.sv.gnu.org:/gnulib.git'
    GNULIB_CVS_REPOSITORY='gnulib'
    if test -d gnulib; then
      (cd gnulib && cvs update -d -P)
    else
      cvs -d "$GNULIB_CVS_ROOT" checkout -d $GNULIB_CVS_REPOSITORY HEAD
    fi
    # Now it should contain a gnulib-tool.
    if test -f gnulib/gnulib-tool; then
      GNULIB_TOOL=`pwd`/gnulib/gnulib-tool
    else
      echo "** warning: gnulib-tool not found" 1>&2
    fi
  fi
  # Skip the gnulib-tool step if gnulib-tool was not found.
  if test -n "$GNULIB_TOOL"; then
    # In gettext-runtime:
    if test -f gettext-runtime/gnulib-m4/gnulib-cache.m4; then
      mv -f gettext-runtime/gnulib-m4/gnulib-cache.m4 gettext-runtime/gnulib-m4/gnulib-cache.m4~
    fi
    GNULIB_MODULES_RUNTIME_FOR_SRC='
      atexit
      basename
      closeout
      error
      exit
      getopt
      gettext-h
      memmove
      progname
      propername
      relocatable-prog
      sigpipe
      stdbool
      stdio
      strtoul
      unlocked-io
      xalloc
    '
    GNULIB_MODULES_RUNTIME_OTHER='
      gettext-runtime-misc
      csharpcomp-script
      java
      javacomp-script
    '
    $GNULIB_TOOL --dir=gettext-runtime --lib=libgrt --source-base=gnulib-lib --m4-base=gnulib-m4 --no-libtool --local-dir=gnulib-local --local-symlink \
      --import $GNULIB_MODULES_RUNTIME_FOR_SRC $GNULIB_MODULES_RUNTIME_OTHER
    # In gettext-tools:
    if test -f gettext-tools/gnulib-m4/gnulib-cache.m4; then
      mv -f gettext-tools/gnulib-m4/gnulib-cache.m4 gettext-tools/gnulib-m4/gnulib-cache.m4~
    fi
    GNULIB_MODULES_TOOLS_FOR_SRC='
      alloca-opt
      atexit
      backupfile
      basename
      binary-io
      bison-i18n
      byteswap
      c-ctype
      c-strcase
      c-strcasestr
      c-strstr
      clean-temp
      closeout
      copy-file
      csharpcomp
      csharpexec
      error
      error-progname
      execute
      exit
      fd-ostream
      file-ostream
      filename
      findprog
      fnmatch-posix
      fopen
      fstrcmp
      full-write
      fwriteerror
      gcd
      getline
      getopt
      gettext-h
      hash
      html-styled-ostream
      iconv
      javacomp
      javaexec
      localcharset
      locale
      localename
      lock
      memmove
      memset
      minmax
      obstack
      open
      openmp
      ostream
      pipe
      progname
      propername
      relocatable-prog
      relocatable-script
      sh-quote
      sigpipe
      sigprocmask
      stdbool
      stdio
      stpcpy
      stpncpy
      strcspn
      strerror
      strpbrk
      strtol
      strtoul
      styled-ostream
      sys_select
      sys_stat
      sys_time
      term-styled-ostream
      ucs4-utf8
      unilbrk/ulc-width-linebreaks
      uniname/uniname
      unistd
      uniwidth/width
      unlocked-io
      utf8-ucs4
      utf16-ucs4
      vasprintf
      wait-process
      write
      xalloc
      xconcat-filename
      xmalloca
      xerror
      xsetenv
      xstriconv
      xvasprintf
    '
    # Not yet used. Add some files to gettext-tools-misc instead.
    GNULIB_MODULES_TOOLS_FOR_LIBGREP='
      error
      exitfail
      gettext-h
      hard-locale
      obstack
      regex
      stdbool
      xalloc
    '
    GNULIB_MODULES_TOOLS_OTHER='
      gettext-tools-misc
      gcj
      java
      stdint
    '
    $GNULIB_TOOL --dir=gettext-tools --lib=libgettextlib --source-base=gnulib-lib --m4-base=gnulib-m4 --tests-base=gnulib-tests --makefile-name=Makefile.gnulib --libtool --with-tests --local-dir=gnulib-local --local-symlink \
      --import $GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_OTHER
    # In gettext-tools/libgettextpo:
    if test -f gettext-tools/libgettextpo/gnulib-m4/gnulib-cache.m4; then
      mv -f gettext-tools/libgettextpo/gnulib-m4/gnulib-cache.m4 gettext-tools/libgettextpo/gnulib-m4/gnulib-cache.m4~
    fi
    # This is a subset of the GNULIB_MODULES_FOR_SRC.
    GNULIB_MODULES_LIBGETTEXTPO='
      basename
      c-ctype
      c-strcase
      c-strstr
      error
      error-progname
      exit
      file-ostream
      filename
      fopen
      fstrcmp
      fwriteerror
      gcd
      getline
      gettext-h
      hash
      iconv
      minmax
      open
      ostream
      progname
      relocatable-lib
      sigpipe
      stdbool
      stdio
      strerror
      ucs4-utf8
      unilbrk/ulc-width-linebreaks
      uniwidth/width
      unlocked-io
      utf8-ucs4
      utf16-ucs4
      vasprintf
      xalloc
      xconcat-filename
      xmalloca
      xerror
      xstriconv
      xvasprintf
    '
    GNULIB_MODULES_LIBGETTEXTPO_OTHER='
    '
    $GNULIB_TOOL --dir=gettext-tools --source-base=libgettextpo --m4-base=libgettextpo/gnulib-m4 --macro-prefix=gtpo --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local --local-symlink \
      --import $GNULIB_MODULES_LIBGETTEXTPO $GNULIB_MODULES_LIBGETTEXTPO_OTHER
  fi
fi

(cd autoconf-lib-link
 ../build-aux/fixaclocal aclocal -I m4 -I ../m4
 autoconf
 automake
)

(cd gettext-runtime
 ../build-aux/fixaclocal aclocal -I m4 -I ../autoconf-lib-link/m4 -I ../m4 -I gnulib-m4
 autoconf
 autoheader && touch config.h.in
 automake
)

(cd gettext-runtime/libasprintf
 ../../build-aux/fixaclocal aclocal -I ../../m4 -I ../m4
 autoconf
 autoheader && touch config.h.in
 automake
)

cp -p gettext-runtime/ABOUT-NLS gettext-tools/ABOUT-NLS

(cd gettext-tools
 ../build-aux/fixaclocal aclocal -I m4 -I ../gettext-runtime/m4 -I ../autoconf-lib-link/m4 -I ../m4 -I gnulib-m4 -I libgettextpo/gnulib-m4
 autoconf
 autoheader && touch config.h.in
 automake
)

(cd gettext-tools/examples
 ../../build-aux/fixaclocal aclocal -I ../../gettext-runtime/m4 -I ../../m4
 autoconf
 automake
 # Rebuilding the examples PO files is only rarely needed.
 if ! $quick; then
   ./configure && (cd po && make update-po) && make distclean
 fi
)

build-aux/fixaclocal aclocal
autoconf
automake

cp -p autoconf-lib-link/config.rpath build-aux/config.rpath