summaryrefslogtreecommitdiff
path: root/examples/hello-c-gnulib-nonrecursive/autogen.sh
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2021-12-15 19:59:01 +0100
committerBruno Haible <bruno@clisp.org>2021-12-15 19:59:01 +0100
commita3c4f3ffbed121b02ed44a6ddf6cfdd16e5b05e9 (patch)
treeeb6e2f749d3232984971773f18fd01043f35f38c /examples/hello-c-gnulib-nonrecursive/autogen.sh
parentb2bd0a9041ed7401fb69f59f7450abb8b3249ecb (diff)
downloadgnulib-a3c4f3ffbed121b02ed44a6ddf6cfdd16e5b05e9.tar.gz
Add simple examples.
* examples: New directory.
Diffstat (limited to 'examples/hello-c-gnulib-nonrecursive/autogen.sh')
-rwxr-xr-xexamples/hello-c-gnulib-nonrecursive/autogen.sh48
1 files changed, 48 insertions, 0 deletions
diff --git a/examples/hello-c-gnulib-nonrecursive/autogen.sh b/examples/hello-c-gnulib-nonrecursive/autogen.sh
new file mode 100755
index 0000000000..eb97f95975
--- /dev/null
+++ b/examples/hello-c-gnulib-nonrecursive/autogen.sh
@@ -0,0 +1,48 @@
+#!/bin/sh
+# This file is in the public domain.
+#
+# Script for regenerating all autogenerated files.
+
+# Usage: ./autogen.sh [--skip-gnulib]
+
+skip_gnulib=false
+while :; do
+ case "$1" in
+ --skip-gnulib) skip_gnulib=true; shift;;
+ *) break ;;
+ esac
+done
+
+if test $skip_gnulib = false; then
+ if test -n "$GNULIB_SRCDIR"; then
+ test -d "$GNULIB_SRCDIR" || {
+ echo "*** GNULIB_SRCDIR is set but does not point to an existing directory." 1>&2
+ exit 1
+ }
+ fi
+ # Now it should contain a gnulib-tool.
+ GNULIB_TOOL="$GNULIB_SRCDIR/gnulib-tool"
+ test -f "$GNULIB_TOOL" || {
+ echo "*** gnulib-tool not found." 1>&2
+ exit 1
+ }
+ GNULIB_MODULES='
+ alloca
+ unistd
+ get_ppid_of
+ non-recursive-gnulib-prefix-hack
+ '
+ $GNULIB_TOOL --lib=libgnu --source-base=lib --m4-base=gnulib-m4 \
+ --makefile-name=gnulib.mk \
+ --import $GNULIB_MODULES
+ build-aux/prefix-gnulib-mk --lib-name=libgnu lib/gnulib.mk
+ $GNULIB_TOOL --copy-file build-aux/ar-lib; chmod a+x build-aux/ar-lib
+ $GNULIB_TOOL --copy-file build-aux/config.guess; chmod a+x build-aux/config.guess
+ $GNULIB_TOOL --copy-file build-aux/config.sub; chmod a+x build-aux/config.sub
+fi
+
+aclocal -I m4 -I gnulib-m4
+autoconf
+autoheader && touch config.h.in
+automake -a -c
+rm -rf autom4te.cache