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 ]
|