aboutsummaryrefslogtreecommitdiffstats
path: root/main/lua-posix/lua-version.patch
blob: bdd1ea0bc6948eb30ead55c44462ce5b07ea4b00 (plain)
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
--- ./m4/ax_lua.m4.orig
+++ ./m4/ax_lua.m4
@@ -257,9 +257,7 @@
   ],
   [ dnl Query Lua for its version number.
     AC_CACHE_CHECK([for $ax_display_LUA version], [ax_cv_lua_version],
-      [ ax_cv_lua_version=`$LUA -e "print(_VERSION)" | \
-          sed "s|^Lua \(.*\)|\1|" | \
-          grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"`
+      [ ax_cv_lua_version=`$LUA -e 'print(_VERSION:match("^Lua (%d+%.%d+)$"))'`
       ])
     AS_IF([test "x$ax_cv_lua_version" = 'x'],
       [AC_MSG_ERROR([invalid Lua version number])])
@@ -363,8 +361,7 @@
 dnl =========================================================================
 AC_DEFUN([_AX_LUA_CHK_VER],
 [
-  _ax_test_ver=`$1 -e "print(_VERSION)" 2>/dev/null | \
-    sed "s|^Lua \(.*\)|\1|" | grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"`
+  _ax_test_ver=`$1 -e 'print(_VERSION:match("^Lua (%d+%.%d+)$"))' 2>/dev/null`
   AS_IF([test "x$_ax_test_ver" = 'x'],
     [_ax_test_ver='0'])
   AX_COMPARE_VERSION([$_ax_test_ver], [ge], [$2])
@@ -487,7 +487,7 @@
             ],
             [ ax_cv_lua_header_version=`./conftest$EXEEXT p | \
                 sed "s|^Lua \(.*\)|\1|" | \
-                grep -o "^@<:@0-9@:>@\+\\.@<:@0-9@:>@\+"`
+                grep -E -o "^@<:@0-9@:>@+\.@<:@0-9@:>@+"`
             ],
             [ax_cv_lua_header_version='unknown'])
           CPPFLAGS=$_ax_lua_saved_cppflags