]> git.draconx.ca Git - gob-dx.git/blob - bootstrap
Replace gnulib patch with new common helper macro.
[gob-dx.git] / bootstrap
1 #!/bin/sh
2 #
3 # Copyright © 2011-2012, 2021, 2023 Nick Bowler
4 #
5 # Simple script to get started from a fresh git checkout.
6 #
7 # License WTFPL2: Do What The Fuck You Want To Public License, version 2.
8 # This is free software: you are free to do what the fuck you want to.
9 # There is NO WARRANTY, to the extent permitted by law.
10
11 scriptname=$0
12
13 err () { printf '%s: %s\n' "$scriptname" "$*" 1>&2; }
14 die () { err "$@"; exit 1; }
15
16 : "${AUTORECONF=autoreconf}"
17 : "${GNULIB=gnulib}"
18 : "${PERL=perl}"
19 : "${GIT=git}"
20
21 $GIT submodule update --init || err "Failed to update submodules from git."
22
23 if test -x $GNULIB/gnulib-tool; then
24   $GNULIB/gnulib-tool --update -S || die "Failed to update gnulib."
25 else
26   err "Gnulib sources are not properly installed in $GNULIB/"
27   cat >&2 <<'EOF'
28
29 To bootstrap this package using an external Gnulib, you can set the GNULIB
30 environment variable to indicate the location of the Gnulib sources.
31 EOF
32   test ! -f configure || cat >&2 <<'EOF'
33
34 However, it seems this package is already bootstrapped.  It should not
35 normally be necessary to run this script from a release tarball.
36 EOF
37   exit 1
38 fi
39
40 $PERL common/scripts/fix-gnulib.pl -o lib/gnulib.mk -i lib/gnulib.mk.in ||
41   die "Failed to fixup Gnulib makefile fragment."
42
43 # Punt some automake-generated files so that Gentoo's wrapper script
44 # doesn't try to detect the automake version in use.
45 rm -f Makefile.in aclocal.m4
46 $AUTORECONF -fis