Bump to version 0.9.4
[platform/upstream/libunistring.git] / autogen.sh
1 #!/bin/sh
2 # Convenience script for regenerating all autogeneratable files that are
3 # omitted from the version control repository. In particular, this script
4 # also regenerates all aclocal.m4, config.h.in, Makefile.in, configure files
5 # with new versions of autoconf or automake.
6 #
7 # This script requires autoconf-2.63..2.69 and automake-1.11..1.12 in the PATH.
8 # It also requires either
9 #   - the GNULIB_TOOL environment variable pointing to the gnulib-tool script
10 #     in a gnulib checkout, or
11 #   - the git program in the PATH and an internet connection.
12 # It also requires
13 #   - the gperf program.
14
15 # Copyright (C) 2003-2012 Free Software Foundation, Inc.
16 #
17 # This program is free software: you can redistribute it and/or modify
18 # it under the terms of the GNU General Public License as published by
19 # the Free Software Foundation; either version 3 of the License, or
20 # (at your option) any later version.
21 #
22 # This program is distributed in the hope that it will be useful,
23 # but WITHOUT ANY WARRANTY; without even the implied warranty of
24 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25 # GNU General Public License for more details.
26 #
27 # You should have received a copy of the GNU General Public License
28 # along with this program.  If not, see <http://www.gnu.org/licenses/>.
29
30 # Usage: ./autogen.sh [--skip-gnulib]
31 #
32 # Usage from a git checkout:                 ./autogen.sh
33 # This uses an up-to-date gnulib checkout.
34 #
35 # Usage from a released tarball:             ./autogen.sh --skip-gnulib
36 # This does not use a gnulib checkout.
37
38 skip_gnulib=false
39 while :; do
40   case "$1" in
41     --skip-gnulib) skip_gnulib=true; shift;;
42     *) break ;;
43   esac
44 done
45
46 if test $skip_gnulib = false; then
47   # texinfo.tex
48   # The most recent snapshot of it is available in the gnulib repository.
49   # But this is a snapshot, with all possible dangers.
50   # A stable release of it is available through "automake --add-missing --copy",
51   # but that is too old (does not support @arrow{}). So take the version which
52   # matches the latest stable texinfo release.
53   if test ! -f build-aux/texinfo.tex; then
54     { wget -q --timeout=5 -O build-aux/texinfo.tex.tmp 'http://cvs.savannah.gnu.org/viewvc/*checkout*/texinfo/doc/texinfo.tex?root=texinfo&pathrev=texinfo_4_13' \
55         && mv build-aux/texinfo.tex.tmp build-aux/texinfo.tex; \
56     } || rm -f build-aux/texinfo.tex.tmp
57   fi
58   if test -z "$GNULIB_TOOL"; then
59     # Check out gnulib in a subdirectory 'gnulib'.
60     if test -d gnulib; then
61       (cd gnulib && git pull)
62     else
63       git clone git://git.savannah.gnu.org/gnulib.git
64     fi
65     # Now it should contain a gnulib-tool.
66     if test -f gnulib/gnulib-tool; then
67       GNULIB_TOOL=`pwd`/gnulib/gnulib-tool
68     else
69       echo "** warning: gnulib-tool not found" 1>&2
70     fi
71   fi
72   # Skip the gnulib-tool step if gnulib-tool was not found.
73   if test -n "$GNULIB_TOOL"; then
74     GNULIB_MODULES='
75       unitypes
76       unistr/base
77       unistr/u8-check
78       unistr/u8-chr
79       unistr/u8-cmp
80       unistr/u8-cmp2
81       unistr/u8-cpy
82       unistr/u8-cpy-alloc
83       unistr/u8-endswith
84       unistr/u8-mblen
85       unistr/u8-mbsnlen
86       unistr/u8-mbtouc
87       unistr/u8-mbtoucr
88       unistr/u8-mbtouc-unsafe
89       unistr/u8-move
90       unistr/u8-next
91       unistr/u8-prev
92       unistr/u8-set
93       unistr/u8-startswith
94       unistr/u8-stpcpy
95       unistr/u8-stpncpy
96       unistr/u8-strcat
97       unistr/u8-strchr
98       unistr/u8-strcmp
99       unistr/u8-strcoll
100       unistr/u8-strcpy
101       unistr/u8-strcspn
102       unistr/u8-strdup
103       unistr/u8-strlen
104       unistr/u8-strmblen
105       unistr/u8-strmbtouc
106       unistr/u8-strncat
107       unistr/u8-strncmp
108       unistr/u8-strncpy
109       unistr/u8-strnlen
110       unistr/u8-strpbrk
111       unistr/u8-strrchr
112       unistr/u8-strspn
113       unistr/u8-strstr
114       unistr/u8-strtok
115       unistr/u8-to-u16
116       unistr/u8-to-u32
117       unistr/u8-uctomb
118       unistr/u16-check
119       unistr/u16-chr
120       unistr/u16-cmp
121       unistr/u16-cmp2
122       unistr/u16-cpy
123       unistr/u16-cpy-alloc
124       unistr/u16-endswith
125       unistr/u16-mblen
126       unistr/u16-mbsnlen
127       unistr/u16-mbtouc
128       unistr/u16-mbtoucr
129       unistr/u16-mbtouc-unsafe
130       unistr/u16-move
131       unistr/u16-next
132       unistr/u16-prev
133       unistr/u16-set
134       unistr/u16-startswith
135       unistr/u16-stpcpy
136       unistr/u16-stpncpy
137       unistr/u16-strcat
138       unistr/u16-strchr
139       unistr/u16-strcmp
140       unistr/u16-strcoll
141       unistr/u16-strcpy
142       unistr/u16-strcspn
143       unistr/u16-strdup
144       unistr/u16-strlen
145       unistr/u16-strmblen
146       unistr/u16-strmbtouc
147       unistr/u16-strncat
148       unistr/u16-strncmp
149       unistr/u16-strncpy
150       unistr/u16-strnlen
151       unistr/u16-strpbrk
152       unistr/u16-strrchr
153       unistr/u16-strspn
154       unistr/u16-strstr
155       unistr/u16-strtok
156       unistr/u16-to-u32
157       unistr/u16-to-u8
158       unistr/u16-uctomb
159       unistr/u32-check
160       unistr/u32-chr
161       unistr/u32-cmp
162       unistr/u32-cmp2
163       unistr/u32-cpy
164       unistr/u32-cpy-alloc
165       unistr/u32-endswith
166       unistr/u32-mblen
167       unistr/u32-mbsnlen
168       unistr/u32-mbtouc
169       unistr/u32-mbtoucr
170       unistr/u32-mbtouc-unsafe
171       unistr/u32-move
172       unistr/u32-next
173       unistr/u32-prev
174       unistr/u32-set
175       unistr/u32-startswith
176       unistr/u32-stpcpy
177       unistr/u32-stpncpy
178       unistr/u32-strcat
179       unistr/u32-strchr
180       unistr/u32-strcmp
181       unistr/u32-strcoll
182       unistr/u32-strcpy
183       unistr/u32-strcspn
184       unistr/u32-strdup
185       unistr/u32-strlen
186       unistr/u32-strmblen
187       unistr/u32-strmbtouc
188       unistr/u32-strncat
189       unistr/u32-strncmp
190       unistr/u32-strncpy
191       unistr/u32-strnlen
192       unistr/u32-strpbrk
193       unistr/u32-strrchr
194       unistr/u32-strspn
195       unistr/u32-strstr
196       unistr/u32-strtok
197       unistr/u32-to-u16
198       unistr/u32-to-u8
199       unistr/u32-uctomb
200       uniconv/base
201       uniconv/u8-conv-from-enc
202       uniconv/u8-conv-to-enc
203       uniconv/u8-strconv-from-enc
204       uniconv/u8-strconv-from-locale
205       uniconv/u8-strconv-to-enc
206       uniconv/u8-strconv-to-locale
207       uniconv/u16-conv-from-enc
208       uniconv/u16-conv-to-enc
209       uniconv/u16-strconv-from-enc
210       uniconv/u16-strconv-from-locale
211       uniconv/u16-strconv-to-enc
212       uniconv/u16-strconv-to-locale
213       uniconv/u32-conv-from-enc
214       uniconv/u32-conv-to-enc
215       uniconv/u32-strconv-from-enc
216       uniconv/u32-strconv-from-locale
217       uniconv/u32-strconv-to-enc
218       uniconv/u32-strconv-to-locale
219       unistdio/base
220       unistdio/u8-asnprintf
221       unistdio/u8-asprintf
222       unistdio/u8-snprintf
223       unistdio/u8-sprintf
224       unistdio/u8-u8-asnprintf
225       unistdio/u8-u8-asprintf
226       unistdio/u8-u8-snprintf
227       unistdio/u8-u8-sprintf
228       unistdio/u8-u8-vasnprintf
229       unistdio/u8-u8-vasprintf
230       unistdio/u8-u8-vsnprintf
231       unistdio/u8-u8-vsprintf
232       unistdio/u8-vasnprintf
233       unistdio/u8-vasprintf
234       unistdio/u8-vsnprintf
235       unistdio/u8-vsprintf
236       unistdio/u16-asnprintf
237       unistdio/u16-asprintf
238       unistdio/u16-snprintf
239       unistdio/u16-sprintf
240       unistdio/u16-u16-asnprintf
241       unistdio/u16-u16-asprintf
242       unistdio/u16-u16-snprintf
243       unistdio/u16-u16-sprintf
244       unistdio/u16-u16-vasnprintf
245       unistdio/u16-u16-vasprintf
246       unistdio/u16-u16-vsnprintf
247       unistdio/u16-u16-vsprintf
248       unistdio/u16-vasnprintf
249       unistdio/u16-vasprintf
250       unistdio/u16-vsnprintf
251       unistdio/u16-vsprintf
252       unistdio/u32-asnprintf
253       unistdio/u32-asprintf
254       unistdio/u32-snprintf
255       unistdio/u32-sprintf
256       unistdio/u32-u32-asnprintf
257       unistdio/u32-u32-asprintf
258       unistdio/u32-u32-snprintf
259       unistdio/u32-u32-sprintf
260       unistdio/u32-u32-vasnprintf
261       unistdio/u32-u32-vasprintf
262       unistdio/u32-u32-vsnprintf
263       unistdio/u32-u32-vsprintf
264       unistdio/u32-vasnprintf
265       unistdio/u32-vasprintf
266       unistdio/u32-vsnprintf
267       unistdio/u32-vsprintf
268       unistdio/ulc-asnprintf
269       unistdio/ulc-asprintf
270       unistdio/ulc-fprintf
271       unistdio/ulc-snprintf
272       unistdio/ulc-sprintf
273       unistdio/ulc-vasnprintf
274       unistdio/ulc-vasprintf
275       unistdio/ulc-vfprintf
276       unistdio/ulc-vsnprintf
277       unistdio/ulc-vsprintf
278       uniname/base
279       uniname/uniname
280       unictype/base
281       unictype/bidiclass-all
282       unictype/block-all
283       unictype/category-all
284       unictype/combining-class-all
285       unictype/ctype-alnum
286       unictype/ctype-alpha
287       unictype/ctype-blank
288       unictype/ctype-cntrl
289       unictype/ctype-digit
290       unictype/ctype-graph
291       unictype/ctype-lower
292       unictype/ctype-print
293       unictype/ctype-punct
294       unictype/ctype-space
295       unictype/ctype-upper
296       unictype/ctype-xdigit
297       unictype/decimal-digit
298       unictype/digit
299       unictype/joininggroup-all
300       unictype/joiningtype-all
301       unictype/mirror
302       unictype/numeric
303       unictype/property-all
304       unictype/scripts-all
305       unictype/syntax-c-ident
306       unictype/syntax-c-whitespace
307       unictype/syntax-java-ident
308       unictype/syntax-java-whitespace
309       uniwidth/base
310       uniwidth/u8-strwidth
311       uniwidth/u8-width
312       uniwidth/u16-strwidth
313       uniwidth/u16-width
314       uniwidth/u32-strwidth
315       uniwidth/u32-width
316       uniwidth/width
317       unigbrk/base
318       unigbrk/u8-grapheme-breaks
319       unigbrk/u8-grapheme-next
320       unigbrk/u8-grapheme-prev
321       unigbrk/u16-grapheme-breaks
322       unigbrk/u16-grapheme-next
323       unigbrk/u16-grapheme-prev
324       unigbrk/u32-grapheme-breaks
325       unigbrk/u32-grapheme-next
326       unigbrk/u32-grapheme-prev
327       unigbrk/uc-gbrk-prop
328       unigbrk/uc-is-grapheme-break
329       unigbrk/ulc-grapheme-breaks
330       uniwbrk/base
331       uniwbrk/u8-wordbreaks
332       uniwbrk/u16-wordbreaks
333       uniwbrk/u32-wordbreaks
334       uniwbrk/ulc-wordbreaks
335       uniwbrk/wordbreak-property
336       unilbrk/base
337       unilbrk/u8-possible-linebreaks
338       unilbrk/u8-width-linebreaks
339       unilbrk/u16-possible-linebreaks
340       unilbrk/u16-width-linebreaks
341       unilbrk/u32-possible-linebreaks
342       unilbrk/u32-width-linebreaks
343       unilbrk/ulc-possible-linebreaks
344       unilbrk/ulc-width-linebreaks
345       uninorm/base
346       uninorm/canonical-decomposition
347       uninorm/composition
348       uninorm/decomposition
349       uninorm/filter
350       uninorm/nfc
351       uninorm/nfd
352       uninorm/nfkc
353       uninorm/nfkd
354       uninorm/u8-normalize
355       uninorm/u8-normcmp
356       uninorm/u8-normcoll
357       uninorm/u8-normxfrm
358       uninorm/u16-normalize
359       uninorm/u16-normcmp
360       uninorm/u16-normcoll
361       uninorm/u16-normxfrm
362       uninorm/u32-normalize
363       uninorm/u32-normcmp
364       uninorm/u32-normcoll
365       uninorm/u32-normxfrm
366       unicase/base
367       unicase/empty-prefix-context
368       unicase/empty-suffix-context
369       unicase/locale-language
370       unicase/tolower
371       unicase/totitle
372       unicase/toupper
373       unicase/u8-casecmp
374       unicase/u8-casecoll
375       unicase/u8-casefold
376       unicase/u8-casexfrm
377       unicase/u8-ct-casefold
378       unicase/u8-ct-tolower
379       unicase/u8-ct-totitle
380       unicase/u8-ct-toupper
381       unicase/u8-is-cased
382       unicase/u8-is-casefolded
383       unicase/u8-is-lowercase
384       unicase/u8-is-titlecase
385       unicase/u8-is-uppercase
386       unicase/u8-tolower
387       unicase/u8-totitle
388       unicase/u8-toupper
389       unicase/u16-casecmp
390       unicase/u16-casecoll
391       unicase/u16-casefold
392       unicase/u16-casexfrm
393       unicase/u16-ct-casefold
394       unicase/u16-ct-tolower
395       unicase/u16-ct-totitle
396       unicase/u16-ct-toupper
397       unicase/u16-is-cased
398       unicase/u16-is-casefolded
399       unicase/u16-is-lowercase
400       unicase/u16-is-titlecase
401       unicase/u16-is-uppercase
402       unicase/u16-tolower
403       unicase/u16-totitle
404       unicase/u16-toupper
405       unicase/u32-casecmp
406       unicase/u32-casecoll
407       unicase/u32-casefold
408       unicase/u32-casexfrm
409       unicase/u32-ct-casefold
410       unicase/u32-ct-tolower
411       unicase/u32-ct-totitle
412       unicase/u32-ct-toupper
413       unicase/u32-is-cased
414       unicase/u32-is-casefolded
415       unicase/u32-is-lowercase
416       unicase/u32-is-titlecase
417       unicase/u32-is-uppercase
418       unicase/u32-tolower
419       unicase/u32-totitle
420       unicase/u32-toupper
421       unicase/ulc-casecmp
422       unicase/ulc-casecoll
423       unicase/ulc-casexfrm
424       relocatable-lib-lgpl
425     '
426     $GNULIB_TOOL --lib=libunistring --source-base=lib --m4-base=gnulib-m4 --tests-base=tests \
427       --with-tests --lgpl --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local \
428       --import $GNULIB_MODULES
429     # Change lib/unistr.h to be usable standalone.
430     sed -e 's/if GNULIB_[A-Za-z0-9_]* || .*/if 1/g' \
431         -e 's/if GNULIB_[A-Za-z0-9_]*/if 1/g' \
432         -e 's/HAVE_INLINE/UNISTRING_HAVE_INLINE/g' \
433         < lib/unistr.in.h \
434         > lib/unistr.in.h.tmp \
435     && mv lib/unistr.in.h.tmp lib/unistr.in.h
436     # Change lib/unictype.h and lib/uninorm.h for shared libraries on Woe32 systems.
437     sed -e 's/extern const uc_general_category_t UC_/extern LIBUNISTRING_DLL_VARIABLE const uc_general_category_t UC_/' \
438         -e 's/extern const uc_property_t UC_/extern LIBUNISTRING_DLL_VARIABLE const uc_property_t UC_/' \
439         < lib/unictype.in.h \
440         > lib/unictype.in.h.tmp \
441     && mv lib/unictype.in.h.tmp lib/unictype.in.h
442     sed -e 's/extern const struct unicode_normalization_form /extern LIBUNISTRING_DLL_VARIABLE const struct unicode_normalization_form /' \
443         < lib/uninorm.in.h \
444         > lib/uninorm.in.h.tmp \
445     && mv lib/uninorm.in.h.tmp lib/uninorm.in.h
446     sed -e 's/extern const casing_/extern LIBUNISTRING_DLL_VARIABLE const casing_/' \
447         < lib/unicase.in.h \
448         > lib/unicase.in.h.tmp \
449     && mv lib/unicase.in.h.tmp lib/unicase.in.h
450     $GNULIB_TOOL --copy-file build-aux/config.guess; chmod a+x build-aux/config.guess
451     $GNULIB_TOOL --copy-file build-aux/config.sub;   chmod a+x build-aux/config.sub
452     # If we got no texinfo.tex so far, take the snapshot from gnulib.
453     if test ! -f build-aux/texinfo.tex; then
454       $GNULIB_TOOL --copy-file build-aux/texinfo.tex build-aux/texinfo.tex
455     fi
456   fi
457 fi
458
459 build-aux/fixaclocal aclocal -I m4 -I gnulib-m4
460 autoconf
461 autoheader && touch config.h.in
462 automake --add-missing --copy