public inbox for gwml@vger.gnuweeb.org
 help / color / mirror / Atom feed
From: Ahmad Gani <reyuki@gnuweeb.org>
To: ammarfaizi2@gnuweeb.org
Cc: gwml@vger.gnuweeb.org, reyuki@gnuweeb.org
Subject: [PATCH gwproxy v2 1/3] io_uring: Add liburing to the code base
Date: Tue, 29 Jul 2025 10:47:17 +0700	[thread overview]
Message-ID: <20250729034719.190563-2-reyuki@gnuweeb.org> (raw)
In-Reply-To: <20250729034719.190563-1-reyuki@gnuweeb.org>

Make the build process easier.
Some people may not have had liburing installed on their system.

Signed-off-by: Ahmad Gani <reyuki@gnuweeb.org>
---
 .gitmodules  |  4 ++++
 Makefile     | 10 ++++++++--
 src/liburing |  1 +
 3 files changed, 13 insertions(+), 2 deletions(-)
 create mode 100644 .gitmodules
 create mode 160000 src/liburing

diff --git a/.gitmodules b/.gitmodules
new file mode 100644
index 000000000000..d49ed8e6e06f
--- /dev/null
+++ b/.gitmodules
@@ -0,0 +1,4 @@
+[submodule "src/liburing"]
+	path = src/liburing
+	url = https://github.com/axboe/liburing
+	branch = master
diff --git a/Makefile b/Makefile
index 0fea43c9fce7..e5e0f756936a 100644
--- a/Makefile
+++ b/Makefile
@@ -9,6 +9,7 @@ LIBS = -lpthread
 DEPFLAGS = -MMD -MP -MF $@.d
 LDFLAGS_SHARED = $(LDFLAGS) -shared -fpic -fPIC
 GWPROXY_DIR = ./src/gwproxy
+LIBURING_DIR = ./src/liburing/src
 
 ifeq ($(SANITIZE),1)
 	CFLAGS += -fsanitize=address -fsanitize=undefined
@@ -30,6 +31,8 @@ ifeq ($(STATIC),1)
 	LDFLAGS += -static
 endif
 
+LIBURING_TARGET = $(LIBURING_DIR)/liburing.a
+
 GWPROXY_TARGET = gwproxy
 GWPROXY_CC_SOURCES = \
 	$(GWPROXY_DIR)/gwproxy.c \
@@ -39,7 +42,7 @@ GWPROXY_CC_SOURCES = \
 
 ifeq ($(CONFIG_IO_URING),1)
 	CFLAGS += -DCONFIG_IO_URING
-	LIBS += /usr/lib/liburing.a
+	LIBS += $(LIBURING_TARGET)
 	GWPROXY_CC_SOURCES += $(GWPROXY_DIR)/ev/io_uring.c
 endif
 
@@ -66,7 +69,10 @@ ALL_DEPFILES = $(ALL_OBJECTS:.o=.o.d)
 
 ALL_GWPROXY_OBJECTS = $(GWPROXY_OBJECTS) $(LIBGWPSOCKS5_OBJECTS) $(LIBGWDNS_OBJECTS)
 
-all: $(GWPROXY_TARGET) $(LIBGWPSOCKS5_TARGET) $(LIBGWDNS_TARGET)
+all: $(GWPROXY_TARGET) $(LIBGWPSOCKS5_TARGET) $(LIBGWDNS_TARGET) $(LIBURING_TARGET)
+
+$(LIBURING_TARGET): $(LIBURING_DIR)
+	@$(MAKE) -C $^
 
 $(GWPROXY_TARGET): $(ALL_GWPROXY_OBJECTS)
 	$(CC) $(LDFLAGS) -o $@ $^ $(LIBS)
diff --git a/src/liburing b/src/liburing
new file mode 160000
index 000000000000..f2b6fb85b79b
--- /dev/null
+++ b/src/liburing
@@ -0,0 +1 @@
+Subproject commit f2b6fb85b79baf17f2c0ea24a357c652caa2d7ba
-- 
Ahmad Gani


  reply	other threads:[~2025-07-29  3:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-29  2:48 [PATCH gwproxy v1 0/3] Minor changes and fixes Ahmad Gani
2025-07-29  2:48 ` [PATCH gwproxy v1 2/3] io_uring: Add macro guard Ahmad Gani
2025-07-29  2:48 ` [PATCH gwproxy v1 3/3] io_uring: Rename GWP_CONN_FLAG_IS_SHUTDOWN to GWP_CONN_FLAG_IS_CANCEL Ahmad Gani
2025-07-29  2:53 ` [PATCH gwproxy v1 0/3] Minor changes and fixes Ammar Faizi
2025-07-29  3:08   ` [PATCH gwproxy v2] io_uring: Reduce liburing code base Ahmad Gani
2025-07-29  3:47   ` [PATCH gwproxy v2 0/3] Minor changes and fixes Ahmad Gani
2025-07-29  3:47     ` Ahmad Gani [this message]
2025-07-29 15:06       ` [PATCH gwproxy v2 1/3] io_uring: Add liburing to the code base Ammar Faizi
2025-07-29  3:47     ` [PATCH gwproxy v2 2/3] io_uring: Add macro guard Ahmad Gani
2025-07-29  3:47     ` [PATCH gwproxy v2 3/3] io_uring: Rename GWP_CONN_FLAG_IS_SHUTDOWN to GWP_CONN_FLAG_IS_CANCEL Ahmad Gani
2025-07-29  3:50     ` [PATCH gwproxy v2 0/3] Minor changes and fixes Ammar Faizi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250729034719.190563-2-reyuki@gnuweeb.org \
    --to=reyuki@gnuweeb.org \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=gwml@vger.gnuweeb.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox