1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45
|
Description: Allow cross build from source
fix ax_lua.m4 to allow cross build.
Author: Ying-Chun Liu (PaulLiu) <paulliu@debian.org>
Bug-Debian: http://bugs.debian.org/956713
Last-Update: 2021-11-06
Index: telegram-cli-1.3.1+git20160323.6547c0b21/ax_lua.m4
===================================================================
--- telegram-cli-1.3.1+git20160323.6547c0b21.orig/ax_lua.m4
+++ telegram-cli-1.3.1+git20160323.6547c0b21/ax_lua.m4
@@ -478,24 +478,18 @@ AC_DEFUN([AX_LUA_HEADERS],
[ax_cv_lua_header_version],
[ _ax_lua_saved_cppflags=$CPPFLAGS
CPPFLAGS="$CPPFLAGS $LUA_INCLUDE"
- AC_RUN_IFELSE(
- [ AC_LANG_SOURCE([[
+ AC_COMPUTE_INT(ax_cv_lua_header_version_major,[LUA_VERSION_NUM/100],[AC_INCLUDES_DEFAULT
#include <lua.h>
-#include <stdlib.h>
-#include <stdio.h>
-int main(int argc, char ** argv)
-{
- if(argc > 1) printf("%s", LUA_VERSION);
- exit(EXIT_SUCCESS);
-}
-]])
- ],
- [ ax_cv_lua_header_version=`./conftest$EXEEXT p | \
- sed "s|^Lua \(.*\)|\1|" | \
- grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
- ],
- [ax_cv_lua_header_version='unknown'])
- CPPFLAGS=$_ax_lua_saved_cppflags
+],[ax_cv_lua_header_version_major=unknown])
+ AC_COMPUTE_INT(ax_cv_lua_header_version_minor,[LUA_VERSION_NUM%100],[AC_INCLUDES_DEFAULT
+#include <lua.h>
+],[ax_cv_lua_header_version_minor=unknown])
+ AS_IF([test "x$ax_cv_lua_header_version_major" = xunknown || test "x$ax_cv_lua_header_version_minor" = xunknown],[
+ ax_cv_lua_header_version=unknown
+ ],[
+ ax_cv_lua_header_version="$ax_cv_lua_header_version_major.$ax_cv_lua_header_version_minor"
+ ])
+ CPPFLAGS=$_ax_lua_saved_cppflags
])
dnl Compare this to the previously found LUA_VERSION.
|