Skip to content

Commit

Permalink
Add more detailed autogen.sh - softlink bootstrap
Browse files Browse the repository at this point in the history
  • Loading branch information
Peter Haag authored and Peter Haag committed Dec 28, 2017
1 parent 0a86642 commit be29ad7
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 8 deletions.
2 changes: 2 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
- Add ipfix delta timestamp elements 158/159.
- Update sflow code to commit 7322984 of https://github.com/sflow/sflowtool
- Cleanup sflow code - uncomment unnecessary code
- Fix header includes"
- Fix 64bit fts compat issue in fts_compat.c

2017-12-22
- Fix potential memory leaks in nfpcapd
Expand Down
74 changes: 74 additions & 0 deletions autogen.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
#!/bin/sh

set -e

case "$(uname)" in
Darwin)
LIBTOOLIZE=${LIBTOOLIZE:-glibtoolize}
;;
*)
LIBTOOLIZE=${LIBTOOLIZE:-libtoolize}
;;
esac
AUTORECONF=${AUTORECONF:-autoreconf}
ACLOCAL=${ACLOCAL:-aclocal}
AUTOCONF=${AUTOCONF:-autoconf}
AUTOHEADER=${AUTOHEADER:-autoheader}
AUTOMAKE=${AUTOMAKE:-automake}

# Check we have all tools installed
check_command() {
command -v "${1}" > /dev/null 2>&1 || {
>&2 echo "autogen.sh: could not find \`$1'. \`$1' is required to run autogen.sh."
exit 1
}
}
check_command "$LIBTOOLIZE"
check_command "$AUTORECONF"
check_command "$ACLOCAL"
check_command "$AUTOCONF"
check_command "$AUTOHEADER"
check_command "$AUTOMAKE"

# Absence of pkg-config or misconfiguration can make some odd error
# messages, we check if it is installed correctly. See:
# https://blogs.oracle.com/mandy/entry/autoconf_weirdness
#
# We cannot just check for pkg-config command, we need to check for
# PKG_* macros. The pkg-config command can be defined in ./configure,
# we cannot tell anything when not present.
check_pkg_config() {
grep -q '^AC_DEFUN.*PKG_CHECK_MODULES' aclocal.m4 || {
cat <<EOF >&2
autogen.sh: could not find PKG_CHECK_MODULES macro.
Either pkg-config is not installed on your system or
\`pkg.m4' is missing or not found by aclocal.
If \`pkg.m4' is installed at an unusual location, re-run
\`autogen.sh' by setting \`ACLOCAL_FLAGS':
ACLOCAL_FLAGS="-I <prefix>/share/aclocal" ./autogen.sh
EOF
exit 1
}
}

echo "autogen.sh: reconfigure with autoreconf"
${AUTORECONF} -vif -I m4 || {
echo "autogen.sh: autoreconf has failed ($?), let's do it manually"
[ -f ./configure.ac ] || [ -f ./configure.in ] || continue
echo "autogen.sh: configure `basename $PWD`"
${ACLOCAL} -I m4 ${ACLOCAL_FLAGS}
check_pkg_config
${LIBTOOLIZE} --automake --copy --force
${ACLOCAL} -I m4 ${ACLOCAL_FLAGS}
${AUTOCONF} --force
${AUTOHEADER}
${AUTOMAKE} --add-missing --copy --force-missing
}

echo "autogen.sh: for the next step, run './configure' [or './configure --help' to check available options]"

exit 0
8 changes: 0 additions & 8 deletions bootstrap

This file was deleted.

1 change: 1 addition & 0 deletions bootstrap

0 comments on commit be29ad7

Please sign in to comment.