1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
|
#!/bin/sh
# Run this to generate all the initial makefiles, etc.
srcdir=`dirname $0`
test -z "$srcdir" && srcdir=.
ORIGDIR=`pwd`
cd $srcdir
PROJECT=chafa
TEST_TYPE=-f
FILE=chafa/Makefile.am
DIE=0
MISSING_TOOLS=
MY_ECHO=$(which echo)
[ x$MY_ECHO = x ] && MY_ECHO=echo
SGR0=$(tput sgr0 2>/dev/null)
SETAF1=$(tput setaf 1 2>/dev/null)
SETAF3=$(tput setaf 3 2>/dev/null)
(autoconf --version) < /dev/null > /dev/null 2>&1 || {
MISSING_TOOLS="${MISSING_TOOLS}autoconf "
DIE=1
}
(automake --version) < /dev/null > /dev/null 2>&1 || {
MISSING_TOOLS="${MISSING_TOOLS}automake "
DIE=1
}
(libtoolize --version || glibtoolize --version) < /dev/null > /dev/null 2>&1 || {
MISSING_TOOLS="${MISSING_TOOLS}libtool "
DIE=1
}
(pkg-config --version) < /dev/null > /dev/null 2>&1 || {
MISSING_TOOLS="${MISSING_TOOLS}pkg-config "
DIE=1
}
if test "$DIE" -eq 1; then
${MY_ECHO}
${MY_ECHO} "Missing mandatory tools:${SETAF1} $MISSING_TOOLS"
${MY_ECHO} "${SGR0}"
${MY_ECHO} "These are required for building Chafa from its git repository."
${MY_ECHO} "You should be able to install them using your operating system's"
${MY_ECHO} "package manager (apt-get, yum, zypper or similar). Alternately"
${MY_ECHO} "they can be obtained directly from GNU: https://ftp.gnu.org/gnu/"
${MY_ECHO}
${MY_ECHO} "If you can't provide these tools, you may still be able to"
${MY_ECHO} "build Chafa from a tarball release: https://hpjansson.org/chafa/releases/"
${MY_ECHO}
fi
if test "$DIE" -eq 1; then
exit 1
fi
test $TEST_TYPE $FILE || {
${MY_ECHO}
${MY_ECHO} "You must run this script in the top-level $PROJECT directory."
${MY_ECHO}
exit 1
}
if test x$NOCONFIGURE = x && test -z "$*"; then
${MY_ECHO}
${MY_ECHO} "I am going to run ./configure with no arguments - if you wish "
${MY_ECHO} "to pass any to it, please specify them on the $0 command line."
${MY_ECHO}
fi
am_opt="--include-deps --add-missing"
${MY_ECHO} "Running libtoolize..."
LIBTOOLIZE=$(which libtoolize glibtoolize 2>/dev/null | head -n1)
${LIBTOOLIZE} --force --copy
GTKDOCIZE=$(which gtkdocize 2>/dev/null)
if test -z $GTKDOCIZE; then
${MY_ECHO} "Missing optional tool:${SETAF3} gtk-doc"
${MY_ECHO} "${SGR0}"
${MY_ECHO} "Without this, no developer documentation will be generated."
${MY_ECHO}
rm -f gtk-doc.make
cat > gtk-doc.make <<EOF
EXTRA_DIST =
CLEANFILES =
EOF
else
gtkdocize || exit $?
fi
${MY_ECHO} "Running aclocal..."
aclocal $ACLOCAL_FLAGS
# optionally feature autoheader
(autoheader --version) < /dev/null > /dev/null 2>&1 && autoheader
${MY_ECHO} "Running automake..."
automake -a $am_opt
${MY_ECHO} "Running autoconf..."
autoconf
cd $ORIGDIR
conf_flags="--enable-maintainer-mode"
if test x$NOCONFIGURE = x; then
${MY_ECHO} Running $srcdir/configure $conf_flags "$@" ...
$srcdir/configure $conf_flags "$@" || exit 1
else
${MY_ECHO} Skipping configure process.
fi
|