On OS X 10.8, libmatheval fails to build if only the system flex
(2.5.35) is installed. /usr/lib has libl.a, but not libfl.a
This is the error:
libtool: link: gcc -dynamiclib -Wl,-undefined -Wl,dynamic_lookup -o
.libs/libmatheval.1.dylib .libs/parser.o .libs/scanner.o .libs/error.o
.libs/matheval.o .libs/g77_interface.o .libs/node.o .libs/symbol_table.o
.libs/xmalloc.o .libs/xmath.o -L/sw/lib -lfl -lm -O2 -install_name
/sw/lib/libmatheval.1.dylib -compatibility_version 2 -current_version
2.0 -Wl,-single_module
ld: library not found for -lfl
./configure correctly detects -ll and saves LEXLIB='-ll'
However, lib/Makefile.am hardcodes '-lfl' and applies that to the linker
command. The following simple patch uses an automake substitution token
to avoid hardcoding the lex library name.
------- 8< ------- 8< ------- 8< ------- 8< ------- 8< -------
--- lib/Makefile.am.orig 2012-11-29 06:46:16.000000000 -0500
+++ lib/Makefile.am 2013-08-13 16:42:43.000000000 -0400
@@ -29,7 +29,7 @@
g77_interface.c node.c symbol_table.c xmalloc.c xmath.c
libmatheval_la_LDFLAGS = -version-info 1:0:0
-libmatheval_la_LIBADD = -lfl -lm
+libmatheval_la_LIBADD = @LEXLIB@ -lm
include_HEADERS = matheval.h
noinst_HEADERS = common.h error.h node.h symbol_table.h xmalloc.h \
------- 8< ------- 8< ------- 8< ------- 8< ------- 8< -------
Hanspeter