diff -Naur -u luasocket-3.1.0.orig/src/makefile luasocket-3.1.0/src/makefile
--- luasocket-3.1.0.orig/src/makefile	2022-07-27 10:07:00.000000000 +0300
+++ luasocket-3.1.0/src/makefile	2024-05-01 00:51:04.521370820 +0300
@@ -18,7 +18,7 @@
 
 # LUAV: 5.1 5.2 5.3 5.4
 # lua version to build against
-LUAV?=5.1
+LUAV?=5.4
 
 # MYCFLAGS: to be set by user if needed
 MYCFLAGS?=
@@ -172,12 +172,14 @@
 # for Linux
 SO_linux=so
 O_linux=o
-CC_linux=gcc
-DEF_linux=-DLUASOCKET_$(DEBUG)
-CFLAGS_linux=$(LUAINC:%=-I%) $(DEF) -Wall -Wshadow -Wextra \
-	-Wimplicit -O2 -ggdb3 -fpic
-LDFLAGS_linux=-O -shared -fpic -o
-LD_linux=gcc
+CC_linux:=$(CC)
+DEF_linux=-DLUASOCKET_$(DEBUG) -DLUA_$(COMPAT)_MODULE \
+	-DLUASOCKET_API= \
+	-DUNIX_API= \
+	-DMIME_API=
+CFLAGS_linux=$(DEF) $(CPPFLAGS)
+LDFLAGS_linux=-o
+LD_linux=$(CC)
 SOCKET_linux=usocket.o
 
 #------
@@ -272,10 +274,10 @@
 #
 SO=$(SO_$(PLAT))
 O=$(O_$(PLAT))
-SOCKET_V=3.0.0
-MIME_V=1.0.3
-SOCKET_SO=socket-$(SOCKET_V).$(SO)
-MIME_SO=mime-$(MIME_V).$(SO)
+SOCKET_V=o
+MIME_V=o
+SOCKET_SO=socket.$(SO).$(SOCKET_V)
+MIME_SO=mime.$(SO).$(MIME_V)
 UNIX_SO=unix.$(SO)
 SERIAL_SO=serial.$(SO)
 SOCKET=$(SOCKET_$(PLAT))
