GNU Autoconf/automake not invoking bison

  • Follow


I'm using GNU bison and flex to generate the configuration file parser/lexer
for a project of mine.  In addition, I am using autoconf and automake to
manage the build process.  For reasons beyond my understanding (and any
information I've been able to find elsewhere), the auto-generated Makefile
is not invoking bison; therefore, flex fails as it cannot find the
requisite files output by bison.  The error I get:

then mv -f ".deps/configfile.Tpo" ".deps/configfile.Po"; else rm -f
".deps/configfile.Tpo"; exit 1; fi
if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include  
-DMODPATH="\"/usr/local/lib/kurt\"" -g -O2 -MT configure.o -MD -MP -MF
".deps/configure.Tpo" -c -o configure.o configure.c; \
then mv -f ".deps/configure.Tpo" ".deps/configure.Po"; else rm -f
".deps/configure.Tpo"; exit 1; fi
configure.l:4:19: y.tab.h: No such file or directory
configure.l: In function `yylex':
configure.l:11: error: `CmdServerName' undeclared (first use in this
function)
configure.l:11: error: (Each undeclared identifier is reported only once
configure.l:11: error: for each function it appears in.)
configure.l:12: error: `CmdServerPort' undeclared (first use in this
function)
configure.l:13: error: `yylval' undeclared (first use in this function)
configure.l:13: error: `MultiDigitNum' undeclared (first use in this
function)
configure.l:14: error: `ValidDomainName' undeclared (first use in this
function)

(the flex file is 'configure.l', and it is translated into 'configure.c'
when I run autoconf/automake, just like it should be).

Bison does not complain when I run it on configure.y manually, and when I do
that and THEN run 'make', everything works fine.

Here is configure.ac:
AC_INIT(kurt, 0.1, [kmw@armory.com])
AM_INIT_AUTOMAKE(kurt, 0.1)
AC_CONFIG_HEADERS(config.h)
AM_MAINTAINER_MODE

AC_ARG_WITH(user-config, AC_HELP_STRING([--with-user-config=CONFIGFILENAME],
[sets name for user configuration file (default is .kurtrc)]), [
        if [test -z $withval]; then
                AC_DEFINE(USERCONF, [".kurtrc"], [User configuration file name])
                else
                if [test $withval = "yes"]; then
                        AC_DEFINE(USERCONF, [".kurtrc"], \
                        [User configuration file name])
                        else
                        AC_DEFINE_UNQUOTED(USERCONF, ["$withval"], \
                        [User configuration file name])
                fi
        fi], AC_DEFINE(USERCONF, [".kurtrc"], [User configuration file name]))


AC_PROG_INSTALL
AC_PROG_CC
AC_LIBTOOL_DLOPEN
AC_PROG_LIBTOOL
AC_PROG_YACC
AC_DECL_YYTEXT
AM_PROG_LEX
AC_OUTPUT(Makefile src/Makefile include/Makefile src/kurt/Makefile
src/ui/Makefile src/ui/textui/Makefile)

And here is the relevant Makefile.am:
bin_PROGRAMS = kurt
kurt_SOURCES  = configfile.c \
                configure.l \
                configure.y \
                kurt.c
noinst_HEADERS = ../../include/
INCLUDES = -I../../include
kurt_LDFLAGS = -export-dynamic
kurt_LDADD = -ldl
AM_CFLAGS = -DMODPATH="\"$(pkglibdir)\""
AM_YFLAGS = -d
-- 
Kurt Weber
<kmw@armory.com>
Southwind Drum & Bugle Corps Baritone
0
Reply Kurt 4/19/2004 7:09:47 PM

Kurt> I'm using GNU bison and flex to generate the configuration file
Kurt> parser/lexer for a project of mine.  In addition, I am using
Kurt> autoconf and automake to manage the build process.  For reasons
Kurt> beyond my understanding (and any information I've been able to
Kurt> find elsewhere), the auto-generated Makefile is not invoking
Kurt> bison; therefore, flex fails as it cannot find the requisite files
Kurt> output by bison.  The error I get:

Kurt> then mv -f ".deps/configfile.Tpo" ".deps/configfile.Po"; else rm -f
Kurt> ".deps/configfile.Tpo"; exit 1; fi
Kurt> if gcc -DHAVE_CONFIG_H -I. -I. -I../.. -I../../include  
Kurt> -DMODPATH="\"/usr/local/lib/kurt\"" -g -O2 -MT configure.o -MD -MP -MF
Kurt> ".deps/configure.Tpo" -c -o configure.o configure.c; \
Kurt> then mv -f ".deps/configure.Tpo" ".deps/configure.Po"; else rm -f
Kurt> ".deps/configure.Tpo"; exit 1; fi
Kurt> configure.l:4:19: y.tab.h: No such file or directory
Kurt> configure.l: In function `yylex':
Kurt> configure.l:11: error: `CmdServerName' undeclared (first use in this
Kurt> function)
Kurt> configure.l:11: error: (Each undeclared identifier is reported only once
Kurt> configure.l:11: error: for each function it appears in.)
Kurt> configure.l:12: error: `CmdServerPort' undeclared (first use in this
Kurt> function)
Kurt> configure.l:13: error: `yylval' undeclared (first use in this function)
Kurt> configure.l:13: error: `MultiDigitNum' undeclared (first use in this
Kurt> function)
Kurt> configure.l:14: error: `ValidDomainName' undeclared (first use in this
Kurt> function)

You need

BUILT_SOURCES = configure.h


-- 
Nothing can be explained to a stone.
Or to a stoned person, either.
0
Reply Ian 4/30/2004 2:41:49 PM


1 Replies
256 Views

(page loaded in 0.059 seconds)

Similiar Articles:




7/17/2012 10:23:26 AM


Reply: