GNU Autoconf/automake not invoking bison
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Unix and Linux reviews > Free Unix support > Unix Programming > GNU Autoconf/automake not invoking bison




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    GNU Autoconf/automake not invoking bison  
Kurt Weber


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-19-04 08:35 PM

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=CONFIGFILENA
ME],
[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





[ Post a follow-up to this message ]



    Re: GNU Autoconf/automake not invoking bison  
Ian Zimmerman


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
04-30-04 03:35 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 on
ce
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.





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 06:15 PM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register