3 # Gnulib files in zmanda repo are from gnulib GIT. To check out the
4 # same version as was used to generate the source in the repository,
5 # run the following in your git repository:
7 # git checkout 03400ebfaa064922caf3767d6641d7e1cdc8cd1b
9 # get to the project root
11 if [ ! -f configure.in ]
13 echo "Cannot navigate to project root"
17 # check that gnulib-tool is available before we do anything drastic
18 [ -z "${GNULIB_TOOL}" ] && GNULIB_TOOL=gnulib-tool
19 "${GNULIB_TOOL}" --version >/dev/null 2>/dev/null
22 echo "gnulib-tool not found; try using"
23 echo " GNULIB_TOOL=/path/to/gnulib-tool ${0} ${@}"
27 # remove the files in gnulib and config/gnulib, but not directories
28 # (and, in particular, not the gnulib/regenerate directory)
30 for filename in gnulib/* config/gnulib/*
32 [ -d "${filename}" ] && continue
33 echo "Removing ${filename}"
34 rm "${filename}" || exit 1
38 ########################## DEVELOPERS! ###############################
39 ## Add your modules here, then see below if you need to patch them. ##
40 ######################################################################
42 GNULIB_MODULES="getaddrinfo lock visibility base64 physmem fsusage"
43 GNULIB_MODULES="$GNULIB_MODULES mkdtemp getopt full-read full-write"
45 ######################################################################
47 ######################################################################
49 # create a brand new gnulib directory
51 "${GNULIB_TOOL}" --import \
52 --dir=. --lib=libgnu --source-base=gnulib --m4-base=config/gnulib \
53 --doc-base=doc --aux-dir=config --libtool --macro-prefix=gl \
54 ${GNULIB_MODULES} || exit 1
56 ########################## DEVELOPERS! ###############################
57 ## Add your patch commands here, or use sed invoacations, etc. ##
58 ## Please comment heavily! ##
59 ######################################################################
60 PATCH_DIR="`pwd`/gnulib/regenerate"
63 # Patch Makefile.am to not error out on warnings
64 patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
66 # Add John's patches to getaddrinfo.c for use in cygwin
67 patch -p0 < "${PATCH_DIR}/getaddrinfo-cygwin.patch" || exit 1
69 # Add John's patches to eliminate restrict attributes.
70 patch -p0 < "${PATCH_DIR}/no-restrict.patch" || exit 1
72 # Add info to the makefile to ensure all this stuff gets put in
73 # the distribution tarball
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 | sort`
77 ) >> gnulib/Makefile.am
79 ######################################################################
81 ######################################################################