There is one more phase: some autoconf macros for detecting presence and version of libposix. I'm done for a few days tho (I think).
diff --git a/.gitignore b/.gitignore index a9a9402..92cb9b5 100644 --- a/.gitignore +++ b/.gitignore @@ -7,3 +7,4 @@ allsnippets.tmp amsnippet.tmp testdir* *.diff +*.patch diff --git a/ChangeLog b/ChangeLog index ea219fb..5f1f5cc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2010-11-17 Bruce Korb <bk...@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 <bk...@gnu.org> + * libposix/mk-tarball: script to make a libposix distribution tarball. * libposix/bootstrap: cleanup and ensure the mkdir's are invoked diff --git a/libposix/lib/Makefile.am b/libposix/lib/Makefile.am index 3a7621b..d6d2716 100644 --- a/libposix/lib/Makefile.am +++ b/libposix/lib/Makefile.am @@ -1,18 +1,22 @@ -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 $@ diff --git a/libposix/lib/mk-lpx-config-h.sh b/libposix/lib/mk-lpx-config-h.sh new file mode 100755 index 0000000..ad3805f --- /dev/null +++ b/libposix/lib/mk-lpx-config-h.sh @@ -0,0 +1,54 @@ +#! /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 diff --git a/libposix/mk-tarball b/libposix/mk-tarball index ed724a4..d3bc4ee 100755 --- a/libposix/mk-tarball +++ b/libposix/mk-tarball @@ -47,8 +47,10 @@ func_init() 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 @@ -101,12 +103,12 @@ func_bootstrap() 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+"$@"}