summaryrefslogtreecommitdiffstats
path: root/autogen.sh
diff options
context:
space:
mode:
Diffstat (limited to 'autogen.sh')
-rwxr-xr-xautogen.sh147
1 files changed, 48 insertions, 99 deletions
diff --git a/autogen.sh b/autogen.sh
index 237e1b1..63be95a 100755
--- a/autogen.sh
+++ b/autogen.sh
@@ -1,4 +1,4 @@
-#! /bin/sh
+#! /bin/bash
#
# Copyright by The HDF Group.
# All rights reserved.
@@ -60,7 +60,7 @@
#
# This script takes two potential options:
#
-# -p, --production
+# -p
#
# When this is selected, the autotools versions are set to the paths
# and versions used by The HDF Group to produce the released versions
@@ -70,7 +70,7 @@
# to have recent versions of the autotools this option will probably
# be removed.
#
-# -v, --verbose
+# -v
#
# This emits some extra information, mainly tool versions.
@@ -89,39 +89,24 @@ verbose=false
optspec=":hpv-"
while getopts "$optspec" optchar; do
case "${optchar}" in
- -)
- case "${OPTARG}" in
- production)
- echo "Setting production mode..."
- echo
- production=true
- ;;
- verbose)
- echo "Setting verbosity: high"
- echo
- verbose=true
- ;;
- *)
- if [ "$OPTERR" = 1 ] && [ "${optspec:0:1}" != ":" ]; then
- echo "Unknown option --${OPTARG}" >&2
- fi
- ;;
- esac;;
h)
- echo "usage: $0 [-p|--production]"
+ echo "usage: $0 [OPTIONS]"
echo
- echo " -p Used by THG to ensure that particular versions"
- echo " of the autotools are used and hard-codes"
- echo " autotools paths to THG machines. Not for"
- echo " non-HDF-Group users!"
+ echo " -h Print this help message."
echo
- echo " NOTE: Each autotool can be set via an environment variable."
+ echo " -p Used by THG to use hard-codes autotools"
+ echo " paths on THG machines. Not for non-HDF-Group"
+ echo " users!"
+ echo
+ echo " -v Show more verbose output."
+ echo
+ echo " NOTE: Each tool can be set via an environment variable."
echo " These are documented inside this autogen.sh script."
echo
exit 0
;;
p)
- echo "Setting production mode..."
+ echo "Setting THG production mode..."
echo
production=true
;;
@@ -142,92 +127,33 @@ if [ "$production" = true ] ; then
# Production mode
#
- # Hard-code canonical HDF Group tool locations and ensure
- # version numbers are correct.
-
- # Production versions of the tools
- AUTOCONF_VERSION="autoconf (GNU Autoconf) 2.69"
- AUTOMAKE_VERSION="automake (GNU automake) 1.14.1"
- AUTOHEADER_VERSION="autoheader (GNU Autoconf) 2.69"
- ACLOCAL_VERSION="aclocal (GNU automake) 1.14.1"
- LIBTOOL_VERSION="(GNU libtool) 2.4.2"
- M4_VERSION="m4 (GNU M4) 1.4.17"
- BISON_VERSION="bison (GNU Bison) 2.7"
- FLEX_VERSION="flex 2.5.37"
+ # Hard-code canonical HDF Group tool locations.
# If paths to tools are not specified, assume they are
- # located in /mnt/hdf/packages and set paths accordingly.
+ # located in /usr/hdf/bin/AUTOTOOLS and set paths accordingly.
if test -z ${HDF5_AUTOCONF}; then
- HDF5_AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoconf
+ HDF5_AUTOCONF=/usr/hdf/bin/AUTOTOOLS/autoconf
fi
if test -z ${HDF5_AUTOMAKE}; then
- HDF5_AUTOMAKE=/mnt/hdf/packages/automake/automake-1.14.1/bin/automake-1.14
+ HDF5_AUTOMAKE=/usr/hdf/bin/AUTOTOOLS/automake
fi
if test -z ${HDF5_AUTOHEADER}; then
- HDF5_AUTOHEADER=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoheader
+ HDF5_AUTOHEADER=/usr/hdf/bin/AUTOTOOLS/autoheader
fi
if test -z ${HDF5_ACLOCAL}; then
- HDF5_ACLOCAL=/mnt/hdf/packages/automake/automake-1.14.1/bin/aclocal-1.14
+ HDF5_ACLOCAL=/usr/hdf/bin/AUTOTOOLS/aclocal
fi
if test -z ${HDF5_LIBTOOL}; then
- HDF5_LIBTOOL=/mnt/hdf/packages/libtool/libtool-2.4.2/bin/libtool
+ HDF5_LIBTOOL=/usr/hdf/bin/AUTOTOOLS/libtool
fi
if test -z ${HDF5_M4}; then
- HDF5_M4=/mnt/hdf/packages/m4/m4-1.4.17/bin/m4
+ HDF5_M4=/usr/hdf/bin/AUTOTOOLS/m4
fi
if test -z ${HDF5_BISON}; then
- HDF5_BISON=/usr/hdf/bin/bison
+ HDF5_BISON=/usr/hdf/bin/AUTOTOOLS/bison
fi
if test -z ${HDF5_FLEX}; then
- HDF5_FLEX=/usr/hdf/bin/flex
- fi
-
- # Check version numbers of all autotools against the "correct" versions
- AC_VERS=`${HDF5_AUTOCONF} --version 2>&1 | grep "^${AUTOCONF_VERSION}"`
- if test -z "${AC_VERS}"; then
- echo "${HDF5_AUTOCONF} version is not ${AUTOCONF_VERSION}"
- ${HDF5_AUTOCONF} --version
- exit 1
- fi
- AM_VERS=`${HDF5_AUTOMAKE} --version 2>&1 | grep "^${AUTOMAKE_VERSION}"`
- if test -z "${AM_VERS}"; then
- echo "${HDF5_AUTOMAKE} version is not ${AUTOMAKE_VERSION}"
- ${HDF5_AUTOMAKE} --version
- exit 1
- fi
- AH_VERS=`${HDF5_AUTOHEADER} --version 2>&1 | grep "^${AUTOHEADER_VERSION}"`
- if test -z "${AH_VERS}"; then
- echo "${HDF5_AUTOHEADER} version is not ${AUTOHEADER_VERSION}"
- ${HDF5_AUTOHEADER} --version
- exit 1
- fi
- AL_VERS=`${HDF5_ACLOCAL} --version 2>&1 | grep "^${ACLOCAL_VERSION}"`
- if test -z "${AL_VERS}"; then
- echo "${HDF5_ACLOCAL} version is not ${ACLOCAL_VERSION}"
- ${HDF5_ACLOCAL} --version
- exit 1
- fi
- LT_VERS=`${HDF5_LIBTOOL} --version 2>&1 | grep "${LIBTOOL_VERSION}"`
- if test -z "${LT_VERS}"; then
- echo "${HDF5_LIBTOOL} version is not ${LIBTOOL_VERSION}"
- ${HDF5_LIBTOOL} --version
- exit 1
- fi
- M4_VERS=`${HDF5_M4} --version 2>&1 | grep "${M4_VERSION}"`
- if test -z "${M4_VERS}"; then
- echo "${HDF5_M4} version is not ${M4_VERSION}"
- ${HDF5_M4} --version
- exit 1
- fi
- BI_VERS=`${HDF5_BISON} --version 2>&1 | grep "^${BISON_VERSION}"`
- if test -z "${BI_VERS}"; then
- echo "${HDF5_BISON} version is not ${BISON_VERSION}"
- exit 1
- fi
- FL_VERS=`${HDF5_FLEX} --version 2>&1 | grep "^${FLEX_VERSION}"`
- if test -z "${FL_VERS}"; then
- echo "${HDF5_FLEX} version is not ${FLEX_VERSION}"
- exit 1
+ HDF5_FLEX=/usr/hdf/bin/AUTOTOOLS/flex
fi
else
@@ -396,15 +322,37 @@ bin/make_overflow src/H5overflow.txt || exit 1
# to install a later version of bison. See the OS X note at the top
# of this script.
echo
-echo "Running flex/bison:"
-cd hl/src
+echo "Generating H5LT parser code (requires yacc/bison):"
echo "Generate hl/src/H5LTparse.c from hl/src/H5LTparse.y"
+# HDF5_BISON is set via the environment or 'which bison', above
+if test -z ${HDF5_BISON}; then
+ echo
+ echo "*************************"
+ echo " ERROR - bison not found"
+ echo "*************************"
+ echo "bison is required to generate parser code in H5LT"
+ echo
+ exit 127
+fi
+cd hl/src
if [ "$verbose" = true ] ; then
${HDF5_BISON} --version
fi
${HDF5_BISON} -pH5LTyy -o H5LTparse.c -d H5LTparse.y
+echo
+echo "Generating H5LT lexer code (requires lex/flex):"
echo "Generate hl/src/H5LTanalyze.c from hl/src/H5LTanalyze.l"
+# HDF5_FLEX is set via the environment or 'which flex', above
+if test -z ${HDF5_FLEX}; then
+ echo
+ echo "************************"
+ echo " ERROR - flex not found"
+ echo "************************"
+ echo "flex is required to generate lexer code in H5LT"
+ echo
+ exit 127
+fi
if [ "$verbose" = true ] ; then
${HDF5_FLEX} --version
fi
@@ -418,6 +366,7 @@ ${HDF5_FLEX} --nounistd -PH5LTyy -o H5LTanalyze.c H5LTanalyze.l
# I propose to not use flex to generate this function, but for now I am
# adding a perl command to find and replace this function declaration in
# H5LTparse.c.
+perl -0777 -pi -e 's/int yyparse/hid_t yyparse/igs' H5LTparse.c
perl -0777 -pi -e 's/int\nyyparse/hid_t\nyyparse/igs' H5LTparse.c
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' H5LTparse.c