[svn-r26136] Updated autogen.sh to run flex and bison, replacing the (incomplete)

bin/genltanalyze script, which has been deleted. Also removed the
generated hl/src/H5LTparse.c/h and H5LTanalyze.c files.

Part of: HDFFV-9120

Tested on: Local Ubuntu VM
This commit is contained in:
Dana Robinson 2015-02-05 21:39:36 -05:00
parent eea4f45172
commit d63cdb36cf
5 changed files with 105 additions and 5193 deletions

View File

@ -30,7 +30,7 @@
# Note that aclocal will attempt to include libtool's share/aclocal
# directory.
#
# This script takes one potential option:
# This script takes two potential options:
#
# -p, --production
#
@ -41,6 +41,10 @@
# NOTE: This is probably temporary. Once we update our dev machines
# to have recent versions of the autotools this option will probably
# be removed.
#
# -v, --verbose
#
# This emits some extra information, mainly tool versions.
echo
echo "**************************"
@ -51,7 +55,10 @@ echo
# Default is not production
production=false
optspec=":hp-"
# Default is not verbose output
verbose=false
optspec=":hpv-"
while getopts "$optspec" optchar; do
case "${optchar}" in
-)
@ -61,6 +68,11 @@ while getopts "$optspec" optchar; do
echo
production=true
;;
verbose)
echo "Setting verbosity: high"
echo
verbose=true
;;
*)
if [ "$OPTERR" = 1 ] && [ "${optspec:0:1}" != ":" ]; then
echo "Unknown option --${OPTARG}" >&2
@ -84,6 +96,10 @@ while getopts "$optspec" optchar; do
echo "Setting production mode..."
production=true
;;
v)
echo "Setting verbosity: high"
verbose=true
;;
*)
if [ "$OPTERR" != 1 ] || [ "${optspec:0:1}" = ":" ]; then
echo "Non-option argument: '-${OPTARG}'" >&2
@ -96,18 +112,20 @@ if [ "$production" = true ] ; then
# Production mode
#
# Hard-code canonical HDF Group autotools locations and ensure
# Hard-code canonical HDF Group tool locations and ensure
# version numbers are correct.
# Production versions of the autotools
# 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"
# If paths to autotools are not specified, assume tools are
# If paths to tools are not specified, assume they are
# located in /mnt/hdf/packages and set paths accordingly.
if test -z ${HDF5_AUTOCONF}; then
HDF5_AUTOCONF=/mnt/hdf/packages/autoconf/autoconf-2.69/bin/autoconf
@ -127,13 +145,19 @@ if [ "$production" = true ] ; then
if test -z ${HDF5_M4}; then
HDF5_M4=/mnt/hdf/packages/m4/m4-1.4.17/bin/m4
fi
if test -z ${HDF5_BISON}; then
HDF5_BISON=/usr/hdf/bin/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
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
@ -143,26 +167,36 @@ if [ "$production" = true ] ; then
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
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
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
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
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
fi
@ -191,6 +225,12 @@ else
if test -z ${HDF5_M4}; then
HDF5_M4=m4
fi
if test -z ${HDF5_BISON}; then
HDF5_BISON=bison
fi
if test -z ${HDF5_FLEX}; then
HDF5_FLEX=flex
fi
fi # production
@ -199,7 +239,9 @@ fi # production
AUTOCONF_DIR=`dirname ${HDF5_AUTOCONF}`
LIBTOOL_DIR=`dirname ${HDF5_LIBTOOL}`
M4_DIR=`dirname ${HDF5_M4}`
PATH=${AUTOCONF_DIR}:${M4_DIR}:$PATH
BISON_DIR=`dirname ${HDF5_BISON}`
FLEX_DIR=`dirname ${HDF5_FLEX}`
PATH=${AUTOCONF_DIR}:${M4_DIR}:${FLEX_DIR}:${BISON_DIR}:$PATH
# Make libtoolize match the specified libtool
HDF5_LIBTOOLIZE="${LIBTOOL_DIR}/libtoolize"
@ -216,7 +258,9 @@ fi
# in Makefile.am. You can ignore this suggestion.
echo ${HDF5_LIBTOOLIZE}
${HDF5_LIBTOOLIZE} --version
if [ "$verbose" = true ] ; then
${HDF5_LIBTOOLIZE} --version
fi
${HDF5_LIBTOOLIZE} || exit 1
echo
echo "NOTE: You can ignore the warning about adding -I m4."
@ -227,22 +271,30 @@ if test -e "${LIBTOOL_DIR}/../share/aclocal" ; then
aclocal_include="-I ${LIBTOOL_DIR}/../share/aclocal"
fi
echo ${HDF5_ACLOCAL} ${aclocal_include}
${HDF5_ACLOCAL} --version
if [ "$verbose" = true ] ; then
${HDF5_ACLOCAL} --version
fi
${HDF5_ACLOCAL} ${aclocal_include} || exit 1
echo
echo ${HDF5_AUTOHEADER}
${HDF5_AUTOHEADER} --version
if [ "$verbose" = true ] ; then
${HDF5_AUTOHEADER} --version
fi
${HDF5_AUTOHEADER} || exit 1
echo
echo ${HDF5_AUTOMAKE} --add-missing
${HDF5_AUTOMAKE} --version
if [ "$verbose" = true ] ; then
${HDF5_AUTOMAKE} --version
fi
${HDF5_AUTOMAKE} --add-missing || exit 1
echo
echo ${HDF5_AUTOCONF}
${HDF5_AUTOCONF} --version
if [ "$verbose" = true ] ; then
${HDF5_AUTOCONF} --version
fi
${HDF5_AUTOCONF} || exit 1
echo
@ -270,11 +322,35 @@ echo
echo "Running API version generation script:"
bin/make_vers src/H5vers.txt || exit 1
# Run flex
# automatically generates the lexical file for hl/src/H5LTanalyze.c
# Run flex and bison
# automatically generates hl/src/H5LTanalyze.c and hl/src/H5LTparse.c
echo
echo "Running flex generation script:"
bin/genltanalyze || exit 1
echo "Running flex/bison:"
cd hl/src
echo "Generate hl/src/H5LTparse.c from hl/src/H5LTparse.y"
if [ "$verbose" = true ] ; then
${HDF5_BISON} --version
fi
${HDF5_BISON} -pH5LTyy -o H5LTparse.c -d H5LTparse.y
echo "Generate hl/src/H5LTanalyze.c from hl/src/H5LTanalyze.l"
if [ "$verbose" = true ] ; then
${HDF5_FLEX} --version
fi
${HDF5_FLEX} --nounistd -PH5LTyy -o H5LTanalyze.c H5LTanalyze.l
# fix H5LTparse.c to declare H5LTyyparse return type as an hid_t
# instead of int. Currently the generated function H5LTyyparse is
# generated with a return value of type int, which is a mapping to the
# flex yyparse function. The return value in the HL library should be
# an hid_t.
# 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\nyyparse/hid_t\nyyparse/igs' H5LTparse.c
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' H5LTparse.c
cd ../..
echo
exit 0

View File

@ -1,65 +0,0 @@
#!/bin/sh
##
## Copyright by the Board of Trustees of the University of Illinois.
## All rights reserved.
##
## This file is part of HDF5. The full HDF5 copyright notice, including
## terms governing use, modification, and redistribution, is contained in
## the files COPYING and Copyright.html. COPYING can be found at the root
## of the source code distribution tree; Copyright.html can be found at the
## root level of an installed copy of the electronic HDF5 document set and
## is linked from the top-level documents page. It can also be found at
## http://hdf.ncsa.uiuc.edu/HDF5/doc/Copyright.html. If you do not have
## access to either file, you may request a copy from hdfhelp@ncsa.uiuc.edu.
##
# regenerate hl/src/H5LTanalyze.c
# HDF5 currently uses the following versions of the bison flex:
BISON_VERSION="bison (GNU Bison) 2.7"
FLEX_VERSION="flex 2.5.37"
# If paths to bison flex are not specified by the user, assume tools are
# running on jam in /mnt/hdf/packages and set paths accordingly.
if test -z ${BISON}; then
BISON=/usr/hdf/bin/bison
fi
if test -z ${FLEX}; then
FLEX=/usr/hdf/bin/flex
fi
# Check version numbers of all bison flex against the "correct" versions
BI_VERS=`${BISON} --version 2>&1 | grep "^${BISON_VERSION}"`
if test -z "${BI_VERS}"; then
echo "${BISON} version is not ${BISON_VERSION}"
exit 1
fi
FL_VERS=`${FLEX} --version 2>&1 | grep "^${FLEX_VERSION}"`
if test -z "${FL_VERS}"; then
echo "${FLEX} version is not ${FLEX_VERSION}"
exit 1
fi
# Make sure that the tools are in the path.
BISON_DIR=`dirname ${BISON}`
FLEX_DIR=`dirname ${FLEX}`
# Main body
cd hl/src
echo "Generate hl/src/H5LTparse.c from hl/src/H5LTparse.y"
bison -pH5LTyy -o H5LTparse.c -d H5LTparse.y
echo "Generate hl/src/H5LTanalyze.c from hl/src/H5LTanalyze.l"
flex --nounistd -PH5LTyy -oH5LTanalyze.c H5LTanalyze.l
# fix H5LTparse.c to declare H5LTyyparse return type as an hid_t
# instead of int. Currently the generated function H5LTyyparse is
# generated with a return value of type int, which is a mapping to the
# flex yyparse function. The return value in the HL library should be
# an hid_t.
# 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\nyyparse/hid_t\nyyparse/igs' H5LTparse.c
perl -0777 -pi -e 's/int H5LTyyparse/hid_t H5LTyyparse/igs' H5LTparse.c
cd ../..
exit 0

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -1,144 +0,0 @@
/* A Bison parser, made by GNU Bison 2.7. */
/* Bison interface for Yacc-like parsers in C
Copyright (C) 1984, 1989-1990, 2000-2012 Free Software Foundation, Inc.
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>. */
/* As a special exception, you may create a larger work that contains
part or all of the Bison parser skeleton and distribute that work
under terms of your choice, so long as that work isn't itself a
parser generator using the skeleton or a modified version thereof
as a parser skeleton. Alternatively, if you modify or redistribute
the parser skeleton itself, you may (at your option) remove this
special exception, which will cause the skeleton and the resulting
Bison output files to be licensed under the GNU General Public
License without this special exception.
This special exception was added by the Free Software Foundation in
version 2.2 of Bison. */
#ifndef YY_H5LTYY_H5LTPARSE_H_INCLUDED
# define YY_H5LTYY_H5LTPARSE_H_INCLUDED
/* Enabling traces. */
#ifndef YYDEBUG
# define YYDEBUG 0
#endif
#if YYDEBUG
extern int H5LTyydebug;
#endif
/* Tokens. */
#ifndef YYTOKENTYPE
# define YYTOKENTYPE
/* Put the tokens into the symbol table, so that GDB and other debuggers
know about them. */
enum yytokentype {
H5T_STD_I8BE_TOKEN = 258,
H5T_STD_I8LE_TOKEN = 259,
H5T_STD_I16BE_TOKEN = 260,
H5T_STD_I16LE_TOKEN = 261,
H5T_STD_I32BE_TOKEN = 262,
H5T_STD_I32LE_TOKEN = 263,
H5T_STD_I64BE_TOKEN = 264,
H5T_STD_I64LE_TOKEN = 265,
H5T_STD_U8BE_TOKEN = 266,
H5T_STD_U8LE_TOKEN = 267,
H5T_STD_U16BE_TOKEN = 268,
H5T_STD_U16LE_TOKEN = 269,
H5T_STD_U32BE_TOKEN = 270,
H5T_STD_U32LE_TOKEN = 271,
H5T_STD_U64BE_TOKEN = 272,
H5T_STD_U64LE_TOKEN = 273,
H5T_NATIVE_CHAR_TOKEN = 274,
H5T_NATIVE_SCHAR_TOKEN = 275,
H5T_NATIVE_UCHAR_TOKEN = 276,
H5T_NATIVE_SHORT_TOKEN = 277,
H5T_NATIVE_USHORT_TOKEN = 278,
H5T_NATIVE_INT_TOKEN = 279,
H5T_NATIVE_UINT_TOKEN = 280,
H5T_NATIVE_LONG_TOKEN = 281,
H5T_NATIVE_ULONG_TOKEN = 282,
H5T_NATIVE_LLONG_TOKEN = 283,
H5T_NATIVE_ULLONG_TOKEN = 284,
H5T_IEEE_F32BE_TOKEN = 285,
H5T_IEEE_F32LE_TOKEN = 286,
H5T_IEEE_F64BE_TOKEN = 287,
H5T_IEEE_F64LE_TOKEN = 288,
H5T_NATIVE_FLOAT_TOKEN = 289,
H5T_NATIVE_DOUBLE_TOKEN = 290,
H5T_NATIVE_LDOUBLE_TOKEN = 291,
H5T_STRING_TOKEN = 292,
STRSIZE_TOKEN = 293,
STRPAD_TOKEN = 294,
CSET_TOKEN = 295,
CTYPE_TOKEN = 296,
H5T_VARIABLE_TOKEN = 297,
H5T_STR_NULLTERM_TOKEN = 298,
H5T_STR_NULLPAD_TOKEN = 299,
H5T_STR_SPACEPAD_TOKEN = 300,
H5T_CSET_ASCII_TOKEN = 301,
H5T_CSET_UTF8_TOKEN = 302,
H5T_C_S1_TOKEN = 303,
H5T_FORTRAN_S1_TOKEN = 304,
H5T_OPAQUE_TOKEN = 305,
OPQ_SIZE_TOKEN = 306,
OPQ_TAG_TOKEN = 307,
H5T_COMPOUND_TOKEN = 308,
H5T_ENUM_TOKEN = 309,
H5T_ARRAY_TOKEN = 310,
H5T_VLEN_TOKEN = 311,
STRING = 312,
NUMBER = 313
};
#endif
#if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
typedef union YYSTYPE
{
/* Line 2065 of yacc.c */
#line 68 "H5LTparse.y"
int ival; /*for integer token*/
char *sval; /*for name string*/
hid_t hid; /*for hid_t token*/
/* Line 2065 of yacc.c */
#line 122 "H5LTparse.h"
} YYSTYPE;
# define YYSTYPE_IS_TRIVIAL 1
# define yystype YYSTYPE /* obsolescent; will be withdrawn */
# define YYSTYPE_IS_DECLARED 1
#endif
extern YYSTYPE H5LTyylval;
#ifdef YYPARSE_PARAM
#if defined __STDC__ || defined __cplusplus
int H5LTyyparse (void *YYPARSE_PARAM);
#else
int H5LTyyparse ();
#endif
#else /* ! YYPARSE_PARAM */
#if defined __STDC__ || defined __cplusplus
int H5LTyyparse (void);
#else
int H5LTyyparse ();
#endif
#endif /* ! YYPARSE_PARAM */
#endif /* !YY_H5LTYY_H5LTPARSE_H_INCLUDED */