From ea3cc7a32c492a715c9850fa7e9671d1548f80ca Mon Sep 17 00:00:00 2001 From: Rene Cannao Date: Sat, 2 May 2026 11:10:23 +0000 Subject: [PATCH] build: add ParserSQL build targets and flags --- deps/Makefile | 12 +++++++++++- include/makefiles_paths.mk | 4 ++++ lib/Makefile | 4 +++- src/Makefile | 7 +++++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/deps/Makefile b/deps/Makefile index f51640288..a89715ad1 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -39,7 +39,8 @@ targets := check_openssl_version \ prometheus-cpp \ postgresql \ libusual \ - libscram + libscram \ + parsersql ifeq ($(UNAME_S),Linux) targets += coredumper @@ -379,6 +380,14 @@ libscram/lib/libscram.a:postgresql/postgresql/src/interfaces/libpq/libpq.a libscram: libscram/lib/libscram.a +parsersql/parsersql-1.0.0/libsqlparser.a: + cd parsersql && rm -rf parsersql-1.0.0 || true + cd parsersql && tar -zxf parsersql-1.0.0.tar.gz + cd parsersql/parsersql-1.0.0 && CC=${CC} CXX=${CXX} ${MAKE} lib + +parsersql: parsersql/parsersql-1.0.0/libsqlparser.a + + ### clean targets cleanpart: @@ -414,5 +423,6 @@ cleanall: cd libscram && rm -rf lib/* obj/* || true cd json && rm -rf json-*/ || true cd zstd && rm -rf zstd-*/ || true + cd parsersql && rm -rf parsersql-*/ || true .PHONY: cleanall diff --git a/include/makefiles_paths.mk b/include/makefiles_paths.mk index 11ac00c1f..f6367c486 100644 --- a/include/makefiles_paths.mk +++ b/include/makefiles_paths.mk @@ -99,6 +99,10 @@ LIBSCRAM_PATH := $(DEPS_PATH)/libscram LIBSCRAM_IDIR := $(LIBSCRAM_PATH)/include LIBSCRAM_LDIR := $(LIBSCRAM_PATH)/lib +PARSERSQL_PATH := $(DEPS_PATH)/parsersql/parsersql-1.0.0 +PARSERSQL_IDIR := $(PARSERSQL_PATH)/include +PARSERSQL_LDIR := $(PARSERSQL_PATH) + TAP_PATH := $(PROXYSQL_PATH)/test/tap/tap TAP_IDIR := $(TAP_PATH) diff --git a/lib/Makefile b/lib/Makefile index 42b4fa828..c199ac611 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -27,6 +27,7 @@ IDIRS := -I$(PROXYSQL_IDIR) \ -I$(JSON_IDIR) \ -I$(SSL_IDIR) \ -I$(ZSTD_IDIR) \ + -I$(PARSERSQL_IDIR) \ ifeq ($(UNAME_S),Linux) IDIRS += -I$(COREDUMPER_IDIR) @@ -39,7 +40,8 @@ endif LDIRS := -L$(JEMALLOC_LDIR) \ -L$(RE2_LDIR) \ -L$(LIBINJECTION_LDIR) \ - -L$(PROMETHEUS_LDIR) + -L$(PROMETHEUS_LDIR) \ + -L$(PARSERSQL_LDIR) \ #LIBS := -rdynamic -Wl,-Bstatic -ljemalloc_pic -lre2 -Wl,-Bdynamic -ldl -lpthread -lm -lz -lrt $(EXTRALINK) #LIBS := -Wl,--export-dynamic -Wl,-Bstatic -ljemalloc_pic -lre2 -Wl,-Bdynamic -ldl -lpthread -lm -lz -lrt $(EXTRALINK) diff --git a/src/Makefile b/src/Makefile index e7e637975..aa7b75ac6 100644 --- a/src/Makefile +++ b/src/Makefile @@ -28,6 +28,7 @@ IDIRS := -I$(PROXYSQL_IDIR) \ -I$(JSON_IDIR) \ -I$(SSL_IDIR) \ -I$(ZSTD_IDIR) \ + -I$(PARSERSQL_IDIR) \ LDIRS := -L$(PROXYSQL_LDIR) \ -L$(JEMALLOC_LDIR) \ @@ -45,7 +46,8 @@ LDIRS := -L$(PROXYSQL_LDIR) \ -L$(POSTGRESQL_LDIR) \ -L$(LIBUSUAL_LDIR) \ -L$(LIBSCRAM_LDIR) \ - -L$(SSL_LDIR) + -L$(SSL_LDIR) \ + -L$(PARSERSQL_LDIR) \ ifeq ($(UNAME_S),Linux) LDIRS += -L$(COREDUMPER_LDIR) @@ -123,7 +125,8 @@ STATICMYLIBS := -Wl,-Bstatic \ -lusual \ -lpq \ -lpgcommon \ - -lpgport + -lpgport \ + -lsqlparser \ ifneq ($(NOJEMALLOC),1) STATICMYLIBS += -ljemalloc