]> git.sesse.net Git - vlc/blobdiff - configure.ac
Fix compilation.
[vlc] / configure.ac
index 4a9fbf0fce30857784a45243023ca2b0946f8d8e..487a2f405dbf9bc06d355b7a3c4c13b2e76282bd 100644 (file)
@@ -1560,10 +1560,21 @@ then
     PKG_CHECK_MODULES(LUA, lua >= 5.1,
       [ have_lua=yes ],
       [ 
-       AC_MSG_WARN([lua >= 5.1 not found!])
+        have_lua=yes
+        AC_CHECK_HEADERS([lua.h lauxlib.h lualib.h], 
+         [],  
+          [ have_lua=no ] )
+       AC_CHECK_LIB(  lua5.1 , luaL_newstate, 
+          [LUA_LIBS="-llua5.1"],
+         AC_CHECK_LIB(  lua , luaL_newstate, 
+            [LUA_LIBS="-llua"],
+           [ have_lua=no
+              AC_MSG_WARN([lua >= 5.1 not found!])
+           ])
+         )
       ])
     ])
-  if test "x${have_lua}" = "xyes"; then
+  if test "x${have_lua}" = "xyes" ;  then
      AC_DEFINE(HAVE_LUA, [], [Define if you have the lua library])
      VLC_ADD_PLUGINS([luaplaylist])
      VLC_ADD_LDFLAGS([luaplaylist],[$LUA_LIBS])
@@ -5311,7 +5322,14 @@ AS_IF([test "${enable_gnutls}" != "no"], [
   ])
 ])
 
-AM_PATH_LIBGCRYPT([1:1.1.94], [have_libgcrypt="yes"], [have_libgcrypt="no"])
+dnl Workaround for cross-compiling since AM_PATH_LIBGRYPT doesn't dectect
+dnl it and looks for libgcrypt headers in the wrong place.
+if test "${host_cpu}" = "${build_cpu}"
+then
+  AM_PATH_LIBGCRYPT([1:1.1.94], [have_libgcrypt="yes"], [have_libgcrypt="no"])
+else
+  AC_CHECK_HEADERS(gcrypt.h,have_libgcrypt="yes",have_libgcrypt="no")
+fi
 AM_CONDITIONAL([HAVE_LIBGCRYPT], [test "${have_libgcrypt}" = "yes"])