Imported Upstream version 2.5.2p1
[debian/amanda] / gnulib / regenerate / regenerate
1 #! /bin/bash
2
3 # Gnulib files in zmanda repo are from gnulib CVS updated with:
4 #   cvs update -D '2007-01-31 13:12:51 -0600'
5
6 # get to the project root
7 cd `dirname $0`/../..
8 if [ ! -f configure.in ]
9 then
10     echo "Cannot navigate to project root"
11     exit 1
12 fi
13
14 # check that gnulib-tool is available before we do anything drastic
15 [ -z "${GNULIB_TOOL}" ] && GNULIB_TOOL=gnulib-tool
16 "${GNULIB_TOOL}" --version >/dev/null 2>/dev/null
17 if [ "$?" != 0 ]
18 then
19     echo "gnulib-tool not found; try using"
20     echo "  GNULIB_TOOL=/path/to/gnulib-tool ${0} ${@}"
21     exit 1
22 fi
23
24 # remove the files in gnulib and config/gnulib, but not directories
25 # (and, in particular, not the gnulib/regenerate directory)
26 shopt -s nullglob
27 for filename in gnulib/* config/gnulib/*
28 do
29     [ -d "${filename}" ] && continue
30     echo "Removing ${filename}"
31     rm "${filename}" || exit 1
32 done
33 shopt -u nullglob
34
35 ########################## DEVELOPERS! ###############################
36 ## Add your modules here, then see below if you need to patch them. ##
37 ######################################################################
38
39 GNULIB_MODULES="getaddrinfo lock visibility"
40
41 ######################################################################
42 ## End modules                                                      ##
43 ######################################################################
44
45 # check out a brand new gnulib directory and gnulib.m4i
46
47 "${GNULIB_TOOL}" --import \
48         --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib \
49         --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl \
50         ${GNULIB_MODULES} || exit 1
51
52 for filename in config/gnulib/*.m4
53  do
54     echo "m4_include([$filename])"
55 done > config/gnulib.m4i || exit 1
56
57 ########################## DEVELOPERS! ###############################
58 ## Add your patch commands here, or use sed invoacations, etc.      ##
59 ## Please comment heavily!                                          ##
60 ######################################################################
61 PATCH_DIR="`pwd`/gnulib/regenerate"
62
63
64 # Patch Makefile.am to not error out on warnings
65 patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
66
67
68 # Add John's patches to getaddrinfo.c for use in cygwin
69 patch -p0 < "${PATCH_DIR}/getaddrinfo-cygwin.patch" || exit 1
70
71
72 # Add info to the makefile to ensure all this stuff gets put in
73 # the distribution tarball
74 (   echo ""
75     echo "# Make sure regenerate/* are in the distribution tarball"
76     echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print `
77 ) >> gnulib/Makefile.am
78
79 ######################################################################
80 ## End patches                                                      ##
81 ######################################################################