autogen.sh 1011 Bytes
Newer Older
Sébastien Wilmet's avatar
Sébastien Wilmet committed
1
#!/bin/sh
2
# Run this to generate all the initial makefiles, etc.
3
test -n "$srcdir" || srcdir=$(dirname "$0")
4
test -n "$srcdir" || srcdir=.
Sébastien Wilmet's avatar
Sébastien Wilmet committed
5

6
olddir=$(pwd)
7

8
cd $srcdir
9

10
(test -f configure.ac) || {
11
	echo "*** ERROR: Directory '$srcdir' does not look like the top-level project directory ***"
12 13 14
	exit 1
}

15 16
# shellcheck disable=SC2016
PKG_NAME=$(autoconf --trace 'AC_INIT:$1' configure.ac)
17 18

if [ "$#" = 0 -a "x$NOCONFIGURE" = "x" ]; then
19
	echo "*** WARNING: I am going to run 'configure' with no arguments." >&2
20
	echo "*** If you wish to pass any to it, please specify them on the" >&2
21
	echo "*** '$0' command line." >&2
22
	echo "" >&2
23 24
fi

25 26 27
aclocal --install || exit 1
gtkdocize --copy || exit 1
intltoolize --force --copy --automake || exit 1
28
autoreconf --verbose --force --install || exit 1
29

30
cd "$olddir"
31 32 33 34
if [ "$NOCONFIGURE" = "" ]; then
	$srcdir/configure "$@" || exit 1

	if [ "$1" = "--help" ]; then exit 0 else
35
		echo "Now type 'make' to compile $PKG_NAME" || exit 1
36 37 38 39
	fi
else
	echo "Skipping configure process."
fi