nexmon – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 #!/bin/sh
2 # Copyright (C) 2003-2016 Free Software Foundation, Inc.
3 #
4 # This program is free software: you can redistribute it and/or modify
5 # it under the terms of the GNU General Public License as published by
6 # the Free Software Foundation; either version 3 of the License, or
7 # (at your option) any later version.
8 #
9 # This program is distributed in the hope that it will be useful,
10 # but WITHOUT ANY WARRANTY; without even the implied warranty of
11 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 # GNU General Public License for more details.
13 #
14 # You should have received a copy of the GNU General Public License
15 # along with this program. If not, see <http://www.gnu.org/licenses/>.
16  
17 # This script populates the build infrastructure in the source tree
18 # checked-out from VCS.
19 #
20 # This script requires:
21 # - Autoconf
22 # - Automake
23 # - Wget
24 # - Git
25 # - XZ Utils
26 #
27 # By default, it fetches Gnulib as a git submodule. If you already
28 # have a local copy of Gnulib, you can avoid extra network traffic by
29 # setting the GNULIB_SRCDIR environment variable pointing to the path.
30 #
31 # In addition, it fetches the archive.dir.tar.gz file, which contains
32 # data files used by the autopoint program. If you already have the
33 # file, place it under gettext-tools/misc, before running this script.
34 #
35 # Usage: ./autogen.sh [--skip-gnulib] [--no-git]
36 #
37 # Usage after a git clone: ./autogen.sh
38 # Usage from a released tarball: ./autogen.sh --skip-gnulib
39 # This does not use a gnulib checkout.
40  
41 # Nuisances.
42 (unset CDPATH) >/dev/null 2>&1 && unset CDPATH
43  
44 skip_gnulib=false
45  
46 # Use git to update gnulib sources
47 use_git=true
48  
49 while :; do
50 case "$1" in
51 --skip-gnulib) skip_gnulib=true; shift;;
52 --no-git) use_git=false; shift;;
53 *) break ;;
54 esac
55 done
56  
57 $use_git || test -d "$GNULIB_SRCDIR" \
58 || die "Error: --no-git requires --gnulib-srcdir"
59  
60 cleanup_gnulib() {
61 status=$?
62 rm -fr "$gnulib_path"
63 exit $status
64 }
65  
66 git_modules_config () {
67 test -f .gitmodules && git config --file .gitmodules "$@"
68 }
69  
70 gnulib_path=$(git_modules_config submodule.gnulib.path)
71 test -z "$gnulib_path" && gnulib_path=gnulib
72  
73 # The tests in gettext-tools/tests are not meant to be executable, because
74 # they have a TESTS_ENVIRONMENT that specifies the shell explicitly.
75  
76 if ! $skip_gnulib; then
77 # Get gnulib files.
78 case ${GNULIB_SRCDIR--} in
79 -)
80 if git_modules_config submodule.gnulib.url >/dev/null; then
81 echo "$0: getting gnulib files..."
82 git submodule init || exit $?
83 git submodule update || exit $?
84  
85 elif [ ! -d "$gnulib_path" ]; then
86 echo "$0: getting gnulib files..."
87  
88 trap cleanup_gnulib 1 2 13 15
89  
90 shallow=
91 git clone -h 2>&1 | grep -- --depth > /dev/null && shallow='--depth 2'
92 git clone $shallow git://git.sv.gnu.org/gnulib "$gnulib_path" ||
93 cleanup_gnulib
94  
95 trap - 1 2 13 15
96 fi
97 GNULIB_SRCDIR=$gnulib_path
98 ;;
99 *)
100 # Use GNULIB_SRCDIR as a reference.
101 if $use_git && test -d "$GNULIB_SRCDIR"/.git && \
102 git_modules_config submodule.gnulib.url >/dev/null; then
103 echo "$0: getting gnulib files..."
104 if git submodule -h|grep -- --reference > /dev/null; then
105 # Prefer the one-liner available in git 1.6.4 or newer.
106 git submodule update --init --reference "$GNULIB_SRCDIR" \
107 "$gnulib_path" || exit $?
108 else
109 # This fallback allows at least git 1.5.5.
110 if test -f "$gnulib_path"/gnulib-tool; then
111 # Since file already exists, assume submodule init already complete.
112 git submodule update || exit $?
113 else
114 # Older git can't clone into an empty directory.
115 rmdir "$gnulib_path" 2>/dev/null
116 git clone --reference "$GNULIB_SRCDIR" \
117 "$(git_modules_config submodule.gnulib.url)" "$gnulib_path" \
118 && git submodule init && git submodule update \
119 || exit $?
120 fi
121 fi
122 GNULIB_SRCDIR=$gnulib_path
123 fi
124 ;;
125 esac
126 # Now it should contain a gnulib-tool.
127 if test -f "$GNULIB_SRCDIR"/gnulib-tool; then
128 GNULIB_TOOL="$GNULIB_SRCDIR"/gnulib-tool
129 else
130 echo "** warning: gnulib-tool not found" 1>&2
131 fi
132 # Skip the gnulib-tool step if gnulib-tool was not found.
133 if test -n "$GNULIB_TOOL"; then
134 # In gettext-runtime:
135 GNULIB_MODULES_RUNTIME_FOR_SRC='
136 atexit
137 basename
138 closeout
139 error
140 getopt-gnu
141 gettext-h
142 havelib
143 memmove
144 progname
145 propername
146 relocatable-prog
147 setlocale
148 sigpipe
149 stdbool
150 stdio
151 stdlib
152 strtoul
153 unlocked-io
154 xalloc
155 '
156 GNULIB_MODULES_RUNTIME_OTHER='
157 gettext-runtime-misc
158 ansi-c++-opt
159 csharpcomp-script
160 java
161 javacomp-script
162 '
163 $GNULIB_TOOL --dir=gettext-runtime --lib=libgrt --source-base=gnulib-lib --m4-base=gnulib-m4 --no-libtool --local-dir=gnulib-local --local-symlink \
164 --import $GNULIB_MODULES_RUNTIME_FOR_SRC $GNULIB_MODULES_RUNTIME_OTHER || exit $?
165 # In gettext-runtime/libasprintf:
166 GNULIB_MODULES_LIBASPRINTF='
167 alloca
168 errno
169 verify
170 xsize
171 '
172 GNULIB_MODULES_LIBASPRINTF_OTHER='
173 '
174 $GNULIB_TOOL --dir=gettext-runtime/libasprintf --source-base=. --m4-base=gnulib-m4 --lgpl=2 --makefile-name=Makefile.gnulib --libtool --local-dir=gnulib-local --local-symlink \
175 --import $GNULIB_MODULES_LIBASPRINTF $GNULIB_MODULES_LIBASPRINTF_OTHER || exit $?
176 $GNULIB_TOOL --copy-file m4/intmax_t.m4 gettext-runtime/libasprintf/gnulib-m4/intmax_t.m4 || exit $?
177 # In gettext-tools:
178 GNULIB_MODULES_TOOLS_FOR_SRC='
179 alloca-opt
180 atexit
181 backupfile
182 basename
183 binary-io
184 bison-i18n
185 byteswap
186 c-ctype
187 c-strcase
188 c-strcasestr
189 c-strstr
190 clean-temp
191 closedir
192 closeout
193 copy-file
194 csharpcomp
195 csharpexec
196 error
197 error-progname
198 execute
199 fd-ostream
200 file-ostream
201 filename
202 findprog
203 fnmatch
204 fopen
205 fstrcmp
206 full-write
207 fwriteerror
208 gcd
209 getline
210 getopt-gnu
211 gettext
212 gettext-h
213 hash
214 html-styled-ostream
215 iconv
216 javacomp
217 javaexec
218 libunistring-optional
219 localcharset
220 locale
221 localename
222 lock
223 memmove
224 memset
225 minmax
226 obstack
227 open
228 opendir
229 openmp
230 ostream
231 pipe-filter-ii
232 progname
233 propername
234 readdir
235 relocatable-prog
236 relocatable-script
237 setlocale
238 sh-quote
239 sigpipe
240 sigprocmask
241 spawn-pipe
242 stdbool
243 stdio
244 stdlib
245 stpcpy
246 stpncpy
247 strcspn
248 strerror
249 strpbrk
250 strtol
251 strtoul
252 styled-ostream
253 sys_select
254 sys_stat
255 sys_time
256 term-styled-ostream
257 trim
258 unictype/ctype-space
259 unilbrk/ulc-width-linebreaks
260 uniname/uniname
261 unistd
262 unistr/u8-mbtouc
263 unistr/u8-mbtoucr
264 unistr/u8-uctomb
265 unistr/u16-mbtouc
266 uniwidth/width
267 unlocked-io
268 vasprintf
269 wait-process
270 write
271 xalloc
272 xconcat-filename
273 xerror
274 xmalloca
275 xmemdup0
276 xsetenv
277 xstriconv
278 xstriconveh
279 xvasprintf
280 '
281 # Common dependencies of GNULIB_MODULES_TOOLS_FOR_SRC and GNULIB_MODULES_TOOLS_FOR_LIBGREP.
282 GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES='
283 alloca-opt
284 extensions
285 gettext-h
286 include_next
287 locale
288 localcharset
289 malloc-posix
290 mbrtowc
291 mbsinit
292 multiarch
293 snippet/arg-nonnull
294 snippet/c++defs
295 snippet/warn-on-use
296 ssize_t
297 stdbool
298 stddef
299 stdint
300 stdlib
301 streq
302 unistd
303 verify
304 wchar
305 wctype-h
306 '
307 GNULIB_MODULES_TOOLS_OTHER='
308 gettext-tools-misc
309 ansi-c++-opt
310 csharpcomp-script
311 csharpexec-script
312 gcj
313 java
314 javacomp-script
315 javaexec-script
316 stdint
317 '
318 GNULIB_MODULES_TOOLS_LIBUNISTRING_TESTS='
319 unilbrk/u8-possible-linebreaks-tests
320 unilbrk/ulc-width-linebreaks-tests
321 unistr/u8-mbtouc-tests
322 unistr/u8-mbtouc-unsafe-tests
323 uniwidth/width-tests
324 '
325 $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 \
326 --import --avoid=hash-tests `for m in $GNULIB_MODULES_TOOLS_LIBUNISTRING_TESTS; do echo --avoid=$m; done` $GNULIB_MODULES_TOOLS_FOR_SRC $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES $GNULIB_MODULES_TOOLS_OTHER || exit $?
327 # In gettext-tools/libgrep:
328 GNULIB_MODULES_TOOLS_FOR_LIBGREP='
329 mbrlen
330 regex
331 '
332 $GNULIB_TOOL --dir=gettext-tools --macro-prefix=grgl --lib=libgrep --source-base=libgrep --m4-base=libgrep/gnulib-m4 --witness-c-macro=IN_GETTEXT_TOOLS_LIBGREP --makefile-name=Makefile.gnulib --local-dir=gnulib-local --local-symlink \
333 --import `for m in $GNULIB_MODULES_TOOLS_FOR_SRC_COMMON_DEPENDENCIES; do if test \`$GNULIB_TOOL --extract-applicability $m\` != all; then echo --avoid=$m; fi; done` $GNULIB_MODULES_TOOLS_FOR_LIBGREP || exit $?
334 # In gettext-tools/libgettextpo:
335 # This is a subset of the GNULIB_MODULES_FOR_SRC.
336 GNULIB_MODULES_LIBGETTEXTPO='
337 basename
338 close
339 c-ctype
340 c-strcase
341 c-strstr
342 error
343 error-progname
344 file-ostream
345 filename
346 fopen
347 fstrcmp
348 fwriteerror
349 gcd
350 getline
351 gettext-h
352 hash
353 iconv
354 libunistring-optional
355 markup
356 minmax
357 open
358 ostream
359 progname
360 relocatable-lib
361 sigpipe
362 stdbool
363 stdio
364 stdlib
365 stpcpy
366 stpncpy
367 strchrnul
368 strerror
369 unictype/ctype-space
370 unilbrk/ulc-width-linebreaks
371 unistr/u8-mbtouc
372 unistr/u8-mbtoucr
373 unistr/u8-uctomb
374 unistr/u16-mbtouc
375 uniwidth/width
376 unlocked-io
377 vasprintf
378 xalloc
379 xconcat-filename
380 xmalloca
381 xerror
382 xstriconv
383 xvasprintf
384 '
385 GNULIB_MODULES_LIBGETTEXTPO_OTHER='
386 '
387 $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 \
388 --import $GNULIB_MODULES_LIBGETTEXTPO $GNULIB_MODULES_LIBGETTEXTPO_OTHER || exit $?
389 # Import build tools. We use --copy-file to avoid directory creation.
390 $GNULIB_TOOL --copy-file tests/init.sh gettext-tools || exit $?
391 $GNULIB_TOOL --copy-file build-aux/git-version-gen || exit $?
392 $GNULIB_TOOL --copy-file build-aux/gitlog-to-changelog || exit $?
393 $GNULIB_TOOL --copy-file build-aux/update-copyright || exit $?
394 $GNULIB_TOOL --copy-file build-aux/useless-if-before-free || exit $?
395 $GNULIB_TOOL --copy-file build-aux/vc-list-files || exit $?
396 $GNULIB_TOOL --copy-file top/GNUmakefile . || exit $?
397 $GNULIB_TOOL --copy-file top/maint.mk . || exit $?
398 fi
399 fi
400  
401 # Fetch config.guess, config.sub.
402 if test -n "$GNULIB_TOOL"; then
403 for file in config.guess config.sub; do
404 $GNULIB_TOOL --copy-file build-aux/$file; chmod a+x build-aux/$file || exit $?
405 done
406 else
407 for file in config.guess config.sub; do
408 echo "$0: getting $file..."
409 wget -q --timeout=5 -O build-aux/$file.tmp "http://git.savannah.gnu.org/gitweb/?p=gnulib.git;a=blob_plain;f=build-aux/${file};hb=HEAD" \
410 && mv build-aux/$file.tmp build-aux/$file \
411 && chmod a+x build-aux/$file
412 retval=$?
413 rm -f build-aux/$file.tmp
414 test $retval -eq 0 || exit $retval
415 done
416 fi
417  
418 # Fetch gettext-tools/misc/archive.dir.tar.
419 if ! test -f gettext-tools/misc/archive.dir.tar; then
420 if ! test -f gettext-tools/misc/archive.dir.tar.xz; then
421 echo "$0: getting gettext-tools/misc/archive.dir.tar..."
422 wget -q --timeout=5 -O gettext-tools/misc/archive.dir.tar.xz-t "ftp://alpha.gnu.org/gnu/gettext/archive.dir-latest.tar.xz" \
423 && mv gettext-tools/misc/archive.dir.tar.xz-t gettext-tools/misc/archive.dir.tar.xz
424 retval=$?
425 rm -f gettext-tools/misc/archive.dir.tar.xz-t
426 test $retval -eq 0 || exit $retval
427 fi
428 xz -d -c < gettext-tools/misc/archive.dir.tar.xz > gettext-tools/misc/archive.dir.tar-t \
429 && mv gettext-tools/misc/archive.dir.tar-t gettext-tools/misc/archive.dir.tar
430 retval=$?
431 rm -f gettext-tools/misc/archive.dir.tar-t
432 test $retval -eq 0 || exit $retval
433 fi
434  
435 # Generate configure script in each subdirectories.
436 dir0=`pwd`
437  
438 echo "$0: generating configure in gettext-runtime/libasprintf..."
439 cd gettext-runtime/libasprintf
440 aclocal -I ../../m4 -I ../m4 -I gnulib-m4 \
441 && autoconf \
442 && autoheader \
443 && touch ChangeLog config.h.in \
444 && automake --add-missing --copy \
445 || exit $?
446 cd "$dir0"
447  
448 echo "$0: generating configure in gettext-runtime..."
449 cd gettext-runtime
450 aclocal -I m4 -I ../m4 -I gnulib-m4 \
451 && autoconf \
452 && autoheader \
453 && touch ChangeLog intl/ChangeLog config.h.in \
454 && automake --add-missing --copy \
455 || exit $?
456 cd "$dir0"
457  
458 echo "$0: generating configure in gettext-tools/examples..."
459 cd gettext-tools/examples
460 aclocal -I ../../gettext-runtime/m4 -I ../../m4 \
461 && autoconf \
462 && touch ChangeLog \
463 && automake --add-missing --copy \
464 || exit $?
465 cd "$dir0"
466  
467 echo "$0: copying common files from gettext-runtime to gettext-tools..."
468 cp -p gettext-runtime/ABOUT-NLS gettext-tools/ABOUT-NLS
469 cp -p gettext-runtime/po/Makefile.in.in gettext-tools/po/Makefile.in.in
470 cp -p gettext-runtime/po/Rules-quot gettext-tools/po/Rules-quot
471 cp -p gettext-runtime/po/boldquot.sed gettext-tools/po/boldquot.sed
472 cp -p gettext-runtime/po/quot.sed gettext-tools/po/quot.sed
473 cp -p gettext-runtime/po/en@quot.header gettext-tools/po/en@quot.header
474 cp -p gettext-runtime/po/en@boldquot.header gettext-tools/po/en@boldquot.header
475 cp -p gettext-runtime/po/insert-header.sin gettext-tools/po/insert-header.sin
476 cp -p gettext-runtime/po/remove-potcdate.sin gettext-tools/po/remove-potcdate.sin
477 # Those two files might be newer than Gnulib's.
478 sed_extract_serial='s/^#.* serial \([^ ]*\).*/\1/p
479 1q'
480 for file in intl.m4 po.m4; do
481 existing_serial=`sed -n -e "$sed_extract_serial" < "gettext-tools/gnulib-m4/$file"`
482 gettext_serial=`sed -n -e "$sed_extract_serial" < "gettext-runtime/m4/$file"`
483 if test -n "$existing_serial" && test -n "$gettext_serial" \
484 && test "$existing_serial" -ge "$gettext_serial" 2> /dev/null; then
485 :
486 else
487 cp -p "gettext-runtime/m4/$file" "gettext-tools/gnulib-m4/$file"
488 fi
489 done
490  
491 echo "$0: generating configure in gettext-tools..."
492 cd gettext-tools
493 aclocal -I m4 -I ../gettext-runtime/m4 -I ../m4 -I gnulib-m4 -I libgrep/gnulib-m4 -I libgettextpo/gnulib-m4 \
494 && autoconf \
495 && autoheader && touch ChangeLog config.h.in \
496 && test -d intl || mkdir intl \
497 && automake --add-missing --copy \
498 || exit $?
499 cd "$dir0"
500  
501 aclocal -I m4 && autoconf && touch ChangeLog && automake || exit $?
502  
503 echo "$0: done. Now you can run './configure'."