From 886514894b8bef76f5ddb3931f48063a5063d3bb Mon Sep 17 00:00:00 2001 From: Houtan Bastani Date: Tue, 7 Jan 2014 11:56:39 +0100 Subject: [PATCH] build system: replace hard-coded flex include dir with that found by autoconf, #575 --- configure.ac | 5 ++++- preprocessor/Makefile.am | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/configure.ac b/configure.ac index c42debf8e..c8526e388 100755 --- a/configure.ac +++ b/configure.ac @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -dnl Copyright (C) 2009-2013 Dynare Team +dnl Copyright (C) 2009-2014 Dynare Team dnl dnl This file is part of Dynare. dnl @@ -62,6 +62,9 @@ AX_PROG_LN_S AC_PROG_MKDIR_P AM_PROG_LEX +# Hack to get lex include dir, ticket #575 +AC_PATH_PROG([LEXPATH], [$LEX]) +AC_SUBST([LEXINC], [`eval "echo $LEXPATH | sed 's|$LEX$|../include|'"`]) AC_CHECK_PROG([YACC], [bison], [bison]) if test "x$YACC" = "x"; then diff --git a/preprocessor/Makefile.am b/preprocessor/Makefile.am index 6556fd445..a9cecac8f 100644 --- a/preprocessor/Makefile.am +++ b/preprocessor/Makefile.am @@ -61,7 +61,7 @@ dynare_m_LDADD = macro/libmacro.a DynareFlex.cc FlexLexer.h: DynareFlex.ll $(LEX) -oDynareFlex.cc DynareFlex.ll - cp /usr/include/FlexLexer.h . + cp $(LEXINC)/FlexLexer.h . DynareBison.cc DynareBison.hh location.hh stack.hh position.hh: DynareBison.yy $(YACC) -o DynareBison.cc DynareBison.yy