2010-12-30 Bruce Korb <bkorb@gnu.org>
* libposix/bootstrap (posix_list): remove unnecessary temp file
+ (modules): install all modules to tmp/modules that reference
+ the 'error' module.
+ * libposix/configure.ac (GNULIB_LIBPOSIX): define this in
+ config.h so that openat-die.c can omit calls to error().
+ * lib/openat-die.c: remove error module stuff when GNULIB_LIBPOSIX
+ is defined.
2010-12-29 Eric Blake <eblake@redhat.com>
#include <stdlib.h>
+#ifndef GNULIB_LIBPOSIX
#include "error.h"
+#endif GNULIB_LIBPOSIX
#include "exitfail.h"
#include "gettext.h"
void
openat_save_fail (int errnum)
{
+#ifndef GNULIB_LIBPOSIX
error (exit_failure, errnum,
_("unable to record current working directory"));
-
+#endif GNULIB_LIBPOSIX
/* The `noreturn' attribute cannot be applied to error, since it returns
when its first argument is 0. To help compilers understand that this
function does not return, call abort. Also, the abort is a
void
openat_restore_fail (int errnum)
{
+#ifndef GNULIB_LIBPOSIX
error (exit_failure, errnum,
_("failed to return to initial working directory"));
+#endif GNULIB_LIBPOSIX
/* As above. */
abort ();
posix_list=`
{ echo alloca
- posix-modules
+ posix-modules | sed '/^error$/d'
} | tr -d ' \t' | sed '/^$/d' | sort -u`
cat > tmp/modules/libposix <<- _EOF_
Gary V. Vaughan
_EOF_
+# We cannot tell which modules will get pulled in via dependencies
+# when gnulib-tool gets run. Therefore, strip out "error" from all
+# modules that mention it. Either we won't use the module, or the
+# module will have to be tweaked to remove the dependency for libposix.
+# "GNULIB_LIBPOSIX" is a CPP symbol for libposix.
+#
+set -- `egrep -l '^error$' ../modules/[a-z]*`
+
+for mod
+do
+ test "X$mod" = Xerror && continue
+ echo 'NOTE: removing "error" dependency from' ${mod}
+ d=`basename $mod`
+ sed '/^error$/d' ${mod} > tmp/modules/$d
+done >&2
opts='--local-dir=tmp
--import
--with-longrunning-tests'
# Bootstrap for autotools.
+#
gnulib-tool ${opts} git-version-gen libposix
# No need to maintain a Makefile.am just to include gnulib.mk.
+#
mv tests/gnulib.mk tests/Makefile.am
# Run autotools.
+#
autoreconf --force --install --verbose --symlink
AC_SUBST([LTV_CURRENT], 0)
AC_SUBST([LTV_REVISION], 0)
AC_SUBST([LTV_AGE], 0)
+AC_DEFINE_UNQUOTED(GNULIB_LIBPOSIX,1,[we are libposix])
AC_PROG_CC
LIBPOSIX_EARLY