3 # Gnulib files in zmanda repo are from gnulib CVS updated with:
4 # cvs update -D '2007-10-25 17:00:00 -0600'
6 # get to the project root
8 if [ ! -f configure.in ]
10 echo "Cannot navigate to project root"
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
19 echo "gnulib-tool not found; try using"
20 echo " GNULIB_TOOL=/path/to/gnulib-tool ${0} ${@}"
24 # remove the files in gnulib and config/gnulib, but not directories
25 # (and, in particular, not the gnulib/regenerate directory)
27 for filename in gnulib/* config/gnulib/*
29 [ -d "${filename}" ] && continue
30 echo "Removing ${filename}"
31 rm "${filename}" || exit 1
35 ########################## DEVELOPERS! ###############################
36 ## Add your modules here, then see below if you need to patch them. ##
37 ######################################################################
39 GNULIB_MODULES="getaddrinfo lock visibility base64 physmem fsusage mkdtemp"
41 ######################################################################
43 ######################################################################
45 # create a brand new gnulib directory
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
52 ########################## DEVELOPERS! ###############################
53 ## Add your patch commands here, or use sed invoacations, etc. ##
54 ## Please comment heavily! ##
55 ######################################################################
56 PATCH_DIR="`pwd`/gnulib/regenerate"
59 # Patch Makefile.am to not error out on warnings
60 patch -p0 < "${PATCH_DIR}/no-error.patch" || exit 1
63 # Add John's patches to getaddrinfo.c for use in cygwin
64 patch -p0 < "${PATCH_DIR}/getaddrinfo-cygwin.patch" || exit 1
67 # Add info to the makefile to ensure all this stuff gets put in
68 # the distribution tarball
70 echo "# Make sure regenerate/* are in the distribution tarball"
71 echo "EXTRA_DIST += "`cd gnulib; find regenerate -name .svn -prune -o -type f -print `
72 ) >> gnulib/Makefile.am
74 ######################################################################
76 ######################################################################