changeset 2331:3840b7508835 vim73

Make it easier to build with Lua. Remove compiler warnings.
author Bram Moolenaar <bram@vim.org>
date Sun, 18 Jul 2010 12:35:47 +0200
parents ea4bf6df1a8a
children b13079093ae1
files src/Makefile src/auto/configure src/configure.in src/if_lua.c
diffstat 4 files changed, 24 insertions(+), 23 deletions(-) [+]
line wrap: on
line diff
--- a/src/Makefile
+++ b/src/Makefile
@@ -405,9 +405,8 @@ CClink = $(CC)
 # LUA
 # Uncomment this when you want to include the Lua interface.
 #CONF_OPT_LUA = --enable-luainterp
-# Lua installation dir (also in LUA_PREFIX environment variable)
+# Lua installation dir (when not set uses $LUA_PREFIX or defaults to /usr)
 #CONF_OPT_LUA_PREFIX = --with-lua-prefix=/usr/local
-#CONF_OPT_LUA_PREFIX = --with-lua-prefix=/usr
 
 # MZSCHEME
 # Uncomment this when you want to include the MzScheme interface.
--- a/src/auto/configure
+++ b/src/auto/configure
@@ -4605,8 +4605,8 @@ if test "${with_lua_prefix+set}" = set; 
   withval=$with_lua_prefix; with_lua_prefix="$withval"; { $as_echo "$as_me:${as_lineno-$LINENO}: result: $with_lua_prefix" >&5
 $as_echo "$with_lua_prefix" >&6; }
 else
-  with_lua_prefix="";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5
-$as_echo "\"no\"" >&6; }
+  with_lua_prefix="";{ $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
 fi
 
 
@@ -4620,8 +4620,9 @@ fi
 $as_echo "\"$LUA_PREFIX\"" >&6; }
 	vi_cv_path_lua_pfx="$LUA_PREFIX"
     else
-	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: \"not set\"" >&5
-$as_echo "\"not set\"" >&6; }
+	{ $as_echo "$as_me:${as_lineno-$LINENO}: result: not set, default to /usr" >&5
+$as_echo "not set, default to /usr" >&6; }
+	vi_cv_path_lua_pfx="/usr"
     fi
   fi
 
@@ -4630,11 +4631,11 @@ fi
     { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include" >&5
 $as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include... " >&6; }
     if test -f $vi_cv_path_lua_pfx/include/lua.h; then
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"yes\"" >&5
-$as_echo "\"yes\"" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
     else
-      { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5
-$as_echo "\"no\"" >&6; }
+      { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
             # Extract the first word of "lua", so it can be a program name with args.
 set dummy lua; ac_word=$2
 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
@@ -4688,12 +4689,12 @@ fi
         { $as_echo "$as_me:${as_lineno-$LINENO}: checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua" >&5
 $as_echo_n "checking if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua... " >&6; }
         if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"yes\"" >&5
-$as_echo "\"yes\"" >&6; }
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: yes" >&5
+$as_echo "yes" >&6; }
           LUA_INC=/lua$vi_cv_version_lua
         else
-          { $as_echo "$as_me:${as_lineno-$LINENO}: result: \"no\"" >&5
-$as_echo "\"no\"" >&6; }
+          { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
           vi_cv_path_lua_pfx=
         fi
       fi
--- a/src/configure.in
+++ b/src/configure.in
@@ -425,7 +425,7 @@ if test "$enable_luainterp" = "yes"; the
   AC_ARG_WITH(lua_prefix,
 	[  --with-lua-prefix=PFX   Prefix where Lua is installed.],
 	with_lua_prefix="$withval"; AC_MSG_RESULT($with_lua_prefix),
-	with_lua_prefix="";AC_MSG_RESULT("no"))
+	with_lua_prefix="";AC_MSG_RESULT(no))
 
   if test "X$with_lua_prefix" != "X"; then
        vi_cv_path_lua_pfx="$with_lua_prefix"
@@ -435,7 +435,8 @@ if test "$enable_luainterp" = "yes"; the
 	AC_MSG_RESULT("$LUA_PREFIX")
 	vi_cv_path_lua_pfx="$LUA_PREFIX"
     else
-	AC_MSG_RESULT("not set")
+	AC_MSG_RESULT([not set, default to /usr])
+	vi_cv_path_lua_pfx="/usr"
     fi
   fi
 
@@ -443,9 +444,9 @@ if test "$enable_luainterp" = "yes"; the
   if test "X$vi_cv_path_lua_pfx" != "X"; then
     AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include)
     if test -f $vi_cv_path_lua_pfx/include/lua.h; then
-      AC_MSG_RESULT("yes")
+      AC_MSG_RESULT(yes)
     else
-      AC_MSG_RESULT("no")
+      AC_MSG_RESULT(no)
       dnl -- try to find Lua executable
       AC_PATH_PROG(vi_cv_path_lua, lua)
       if test "X$vi_cv_path_lua" != "X"; then
@@ -454,10 +455,10 @@ if test "$enable_luainterp" = "yes"; the
         [ vi_cv_version_lua=`${vi_cv_path_lua} -e "print(_VERSION:sub(5,7))"` ])
         AC_MSG_CHECKING(if lua.h can be found in $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua)
         if test -f $vi_cv_path_lua_pfx/include/lua$vi_cv_version_lua/lua.h; then
-          AC_MSG_RESULT("yes")
+          AC_MSG_RESULT(yes)
           LUA_INC=/lua$vi_cv_version_lua
         else
-          AC_MSG_RESULT("no")
+          AC_MSG_RESULT(no)
           vi_cv_path_lua_pfx=
         fi
       fi
--- a/src/if_lua.c
+++ b/src/if_lua.c
@@ -921,7 +921,7 @@ luaV_eval(lua_State *L)
 }
 
     static int
-luaV_beep(lua_State *L)
+luaV_beep(lua_State *L UNUSED)
 {
     vim_beep();
     return 0;
@@ -955,8 +955,8 @@ luaV_buffer(lua_State *L)
 		{
 		    if (l == 0) break;
 		}
-		else if (strncmp(s, buf->b_ffname, l) == 0
-			|| strncmp(s, buf->b_sfname, l) == 0)
+		else if (strncmp(s, (char *)buf->b_ffname, l) == 0
+			|| strncmp(s, (char *)buf->b_sfname, l) == 0)
 		    break;
 	    }
 	}