Fixed setting of LUA_INCLUDES when having extraneous lua heder directory.
authorstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 3 Jun 2009 15:28:30 +0000 (15:28 +0000)
committerstig <stig@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 3 Jun 2009 15:28:30 +0000 (15:28 +0000)
Fixed resetting flags after negative check for Lua.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@28624 f5534014-38df-0310-8fa8-9805f1628bb7

acinclude.m4

index 83cccbdb60712fea30c1675c9340eb52b51d48b4..cfea175a5c8d009a1c05eba6584237612293636d 100644 (file)
@@ -873,10 +873,10 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                                do
                                        if test -d $lua_dir
                                        then
-                                               LUA_INCLUDES="-I$prefix/include/lua5.1"
+                                               LUA_INCLUDES="-I$lua_dir"
+                                               found_lua_dir="$lua_dir"
+                                               break
                                        fi
-                                       found_lua_dir="$lua_dir"
-                                       break
                                done
 
                                if test "x$found_lua_dir" != "x"
@@ -884,6 +884,17 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                                        AC_MSG_RESULT(found -- $found_lua_dir)
                                else
                                        AC_MSG_RESULT(not found)
+                                       #
+                                       # Restore the versions of CFLAGS, CPPFLAGS,
+                                       # LDFLAGS, and LIBS before we added the
+                                       # "--with-lua=" directory, as we didn't
+                                       # actually find lua there.
+                                       #
+                                       CFLAGS="$wireshark_save_CFLAGS"
+                                       CPPFLAGS="$wireshark_save_CPPFLAGS"
+                                       LDFLAGS="$wireshark_save_LDFLAGS"
+                                       LIBS="$wireshark_save_LIBS"
+                                       LUA_LIBS=""
                                        if test "x$want_lua" = "xyes"
                                        then
                                                # we found lua5.1/lua.h, but we don't know which include dir contains it
@@ -899,6 +910,17 @@ AC_DEFUN([AC_WIRESHARK_LIBLUA_CHECK],[
                        fi
                ],
                [
+                       #
+                       # Restore the versions of CFLAGS, CPPFLAGS,
+                       # LDFLAGS, and LIBS before we added the
+                       # "--with-lua=" directory, as we didn't
+                       # actually find lua there.
+                       #
+                       CFLAGS="$wireshark_save_CFLAGS"
+                       CPPFLAGS="$wireshark_save_CPPFLAGS"
+                       LDFLAGS="$wireshark_save_LDFLAGS"
+                       LIBS="$wireshark_save_LIBS"
+                       LUA_LIBS=""
                        if test "x$lua_dir" != "x"
                        then
                                #