From 5669a149706727d2d0617000cc494e20ee0f09e5 Mon Sep 17 00:00:00 2001 From: Kalle Olavi Niemitalo Date: Tue, 10 Jul 2007 13:53:18 +0300 Subject: [PATCH] Don't treat spidermonkeydir="" and luadir="" as special. Previously, an empty string as spidermonkeydir or luadir meant that the LIBS and CFLAGS variables should be used unchanged. A few commits ago however, the configure script was changed to require test -f "$spidermonkeydir$spidermonkeyinclude/jsapi.h" and test -f "$luadir/include/lua$suffix/lua.h" to succeed. These commands interpret spidermonkeydir="" and luadir="" as the root directory. This behaviour was inconsistent with the part that decides whether to add the directory to *_LIBS and *_CFLAGS or not. The inconsistency could be solved in two ways. Either (a) add an exception so that the test -f is skipped if the variable is empty, or (b) treat an empty string as the root directory throughout. Because the Makefile of SpiderMonkey always installs to a subdirectory of the specified include directory, and ELinks uses #include without specifying that subdirectory in source code, it seems unlikely that the SpiderMonkey header files would ever be in the default include path. I am therefore implementing solution (b) here. I suppose similar considerations apply to Lua but did not check that carefully. --- configure.in | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/configure.in b/configure.in index 14664233..f22cb57c 100644 --- a/configure.in +++ b/configure.in @@ -630,12 +630,8 @@ if test -z "$disable_spidermonkey"; then for spidermonkeylib in js smjs mozjs; do if test "$cf_result" = no && test -f "$spidermonkeydir$spidermonkeyinclude/jsapi.h"; then - SPIDERMONKEY_LIBS="-l$spidermonkeylib" - - if test ! -z "$spidermonkeydir"; then - SPIDERMONKEY_LIBS="-L$spidermonkeydir/lib $SPIDERMONKEY_LIBS" - SPIDERMONKEY_CFLAGS="-I$spidermonkeydir$spidermonkeyinclude" - fi + SPIDERMONKEY_LIBS="-L$spidermonkeydir/lib -l$spidermonkeylib" + SPIDERMONKEY_CFLAGS="-I$spidermonkeydir$spidermonkeyinclude" LIBS="$SPIDERMONKEY_LIBS $LIBS_X" CFLAGS="$CFLAGS_X $SPIDERMONKEY_CFLAGS" @@ -886,12 +882,8 @@ if test -z "$disable_lua"; then for suffix in "" 50 51; do if test "$cf_result" = no && ( test -f "$luadir/include/lua.h" || \ test -f "$luadir/include/lua$suffix/lua.h" ) ; then - LUA_LIBS="-llua$suffix -llualib$suffix -lm" - - if test ! -z "$luadir"; then - LUA_LIBS="-L$luadir/lib $LUA_LIBS" - LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix" - fi + LUA_LIBS="-L$luadir/lib -llua$suffix -llualib$suffix -lm" + LUA_CFLAGS="-I$luadir/include -I$luadir/include/lua$suffix" LIBS="$LUA_LIBS $LIBS_X" CFLAGS="$CFLAGS_X $LUA_CFLAGS"