3 # gnulib-version.sh -- creates gnulib-version.c (from ../import-gnulib.config)
4 # Copyright (C) 2007 Free Software Foundation, Inc.
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2, or (at your option)
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License
17 # along with this program; if not, write to the Free Software
18 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301,
26 outfile
="${srcdir}"/gnulib-version.c
30 if [ -z "$gnulib_version" ]
32 echo "Error: There should be a gnulib_version setting in $configfile, but there is not." >&2
37 cat > "${outfile}".new
<<EOF
38 /* This file is automatically generated by $0 and simply records which version of gnulib we used. */
39 const char * const gnulib_version = "$gnulib_version";
42 if test -f "$outfile" ; then
43 if diff "${outfile}".new
"${outfile}" > /dev
/null
50 mv "${outfile}".new
"${outfile}"