+2010-11-17 Bruce Korb <bkorb@gnu.org>
+
+ * libposix/lib/Makefile.am (lpx-config.h): generate the new header
+ and install it.
+ * libposix/lib/mk-lpx-config-h.sh: script for creating the header
+ by massaging the config.h header.
+
2010-11-17 Bruce Korb <bkorb@gnu.org>
* libposix/mk-tarball: script to make a libposix distribution
-BUILT_SOURCES =
+BUILT_SOURCES = lpx-config.h
SUFFIXES =
-EXTRA_DIST =
+EXTRA_DIST = mk-lpx-config-h.sh
EXTRA_HEADERS =
-nodist_pkginclude_HEADERS =
+nodist_pkginclude_HEADERS = lpx-config.h
nobase_nodist_pkginclude_HEADERS =
pkginclude_HEADERS = version.h
CLEANFILES =
MOSTLYCLEANDIRS =
-MOSTLYCLEANFILES =
+MOSTLYCLEANFILES = lpx-config.h
MAINTAINERCLEANFILES =
include gnulib.mk
libposix_la_LDFLAGS += -version-info $(LTV_CURRENT):$(LTV_REVISION):$(LTV_AGE)
libposix_la_SOURCES += version.c
+
+version.o : lpx-config.h
+lpx-config.h : $(top_builddir)/config.h
+ $(SHELL) $(srcdir)/mk-lpx-config-h.sh $(top_builddir)/config.h $@
--- /dev/null
+#! /bin/sh
+# -*- Mode: Shell-script -*-
+
+# Copyright (C) 2002-2010 Free Software Foundation, Inc.
+#
+# This program is free software: you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 3 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+infile=$1
+outfile=$2
+
+{
+ echo '/*'
+ sed '1,/^$/d;s/^#/ */;/http:\/\/www\.gnu\.org/q' $0
+
+ g='_LPX_CONFIG_H_GUARD'
+ cat <<EOF
+ */
+#ifndef $g
+#define $g 1
+/* derived from the libposix config.h by $0 */
+EOF
+
+ # 1. strip comments for eyeball verification of name changes
+ # 2. Change the #define names
+ # 3. Change the #ifdef names
+ # 4. Change the "defined XXX" names in "#if" directives
+ # 5. Clean up whatever we figure out we've missed.
+ #
+ sedcmd='
+ /^\/\*.*\*\/$/d
+ /^\/\*/,/\*\/$/d
+ /^$/d
+ s/^\(# *define *\)\([A-Za-z]\)/\1LPX_\2/
+ /^#if/s/\(defined *\)\([A-Za-z]\)/\1LPX_\2/g
+ s/^\(# *ifn*def *\)\([A-Za-z]\)/\1LPX_\2/
+ s/>DIR_FD_MEMBER_NAME/>LPX_DIR_FD_MEMBER_NAME/
+ s/_GL_UNUSED/_LPX_UNUSED/
+ '
+
+ sed "${sedcmd}" $infile
+
+ echo "#endif /* $g */"
+} > $outfile
git --version >/dev/null 2>&1 \
|| func_die "git is not operational"
+ test -d _b && rm -rf _b
+
case "$*" in
- *'--clean'* )
+ *'--clean'* | *'--clob'* )
git clean -f -x -d .
;;
esac
func_mkdistro()
{
- mkdir _b || die mkdir _b
+ mkdir _b || func_die mkdir _b
cd _b
- ../configure || die configure
- make || die make
- make distcheck || die make distcheck
- mv libposix*.tar.gz .. || die cannot move tarball
+ ../configure || func_die configure
+ make || func_die make
+ make distcheck || func_die make distcheck
+ mv libposix*.tar.gz .. || func_die cannot move tarball
}
func_init ${1+"$@"}