Blob Blame Raw
Patch provides debundling libraries:    pcre, curl, sqlite3, lz4, libssl
                                        libconfig, libdeamon, ev

diff -ur proxysql-2.0.9/deps/Makefile 209/deps/Makefile
--- proxysql-2.0.9/deps/Makefile	2019-11-07 06:48:56.000000000 +0100
+++ 209/deps/Makefile	2019-11-19 16:42:58.653140972 +0100
@@ -11,21 +11,12 @@
 
 PROXYSQLCLICKHOUSE := $(shell echo $(PROXYSQLCLICKHOUSE))
 ifeq ($(PROXYSQLCLICKHOUSE),1)
-default: libconfig libdaemon jemalloc mariadb_client re2 sqlite3 pcre clickhouse-cpp lz4 cityhash microhttpd curl ev coredumper libssl
+default: jemalloc mariadb_client re2 clickhouse-cpp cityhash coredumper microhttpd
 else
-default: libconfig libdaemon jemalloc mariadb_client re2 sqlite3 pcre microhttpd curl ev coredumper libssl
+default: jemalloc mariadb_client re2 coredumper microhttpd
 endif
 .PHONY: default
 
-libssl/openssl/libssl.a:
-#	cd libssl && rm -rf openssl-1.1.0h || true
-#	cd libssl && tar -zxf openssl-1.1.0h.tar.gz
-	cd libssl && rm -rf openssl-1.1.0h || true
-	cd libssl && tar -zxf openssl-1.1.0h.tar.gz
-	cd libssl/openssl  && ./config no-ssl3
-	cd libssl/openssl && CC=${CC} CXX=${CXX} ${MAKE}
-libssl: libssl/openssl/libssl.a
-
 libev/libev/.libs/libev.a:
 	cd libev && rm -rf libev-4.24 || true
 	cd libev && tar -zxf libev-4.24.tar.gz
@@ -40,17 +31,12 @@
 coredumper: google-coredumper/google-coredumper/.libs/libcoredumper.a
 
 
-curl/curl/lib/.libs/libcurl.a: #libssl/openssl/libssl.a
-	cd curl && rm -rf curl-7.57.0 || true
-	cd curl && tar -zxf curl-7.57.0.tar.gz
-	#cd curl/curl && ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --with-ssl=$(shell pwd)/../../libssl/openssl/ && CC=${CC} CXX=${CXX} ${MAKE}
-	cd curl/curl && ./configure --disable-debug --disable-ftp --disable-ldap --disable-ldaps --disable-rtsp --disable-proxy --disable-dict --disable-telnet --disable-tftp --disable-pop3 --disable-imap --disable-smb --disable-smtp --disable-gopher --disable-manual --disable-ipv6 --disable-sspi --disable-crypto-auth --disable-ntlm-wb --disable-tls-srp --without-nghttp2 --without-libidn2 --without-libssh2 --without-brotli --without-librtmp --without-libpsl --without-ssl && CC=${CC} CXX=${CXX} ${MAKE}
-curl: curl/curl/lib/.libs/libcurl.a
 
 libmicrohttpd/libmicrohttpd/src/microhttpd/.libs/libmicrohttpd.a:
 	cd libmicrohttpd && rm -rf libmicrohttpd-0.9.55 || true
 	cd libmicrohttpd && tar -zxf libmicrohttpd-0.9.55.tar.gz
 	cd libmicrohttpd/libmicrohttpd && ./configure --disable-https && CC=${CC} CXX=${CXX} ${MAKE}
+	cp libmicrohttpd/libmicrohttpd/MHD_config.h libmicrohttpd/libmicrohttpd/src/include/MHD_config.h
 microhttpd: libmicrohttpd/libmicrohttpd/src/microhttpd/.libs/libmicrohttpd.a
 
 cityhash/cityhash/src/.libs/libcityhash.a:
@@ -59,11 +45,6 @@
 	cd cityhash/cityhash && ./configure && CC=${CC} CXX=${CXX} ${MAKE}
 cityhash: cityhash/cityhash/src/.libs/libcityhash.a
 
-lz4/lz4/liblz4.a:
-	cd lz4 && rm -rf lz4-1.7.5 || true
-	cd lz4 && tar -zxf lz4-1.7.5.tar.gz
-	cd lz4/lz4 && CC=${CC} CXX=${CXX} ${MAKE}
-lz4: lz4/lz4/liblz4.a
 
 clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib.a:
 	cd clickhouse-cpp && rm -rf clickhouse-cpp || true
@@ -74,13 +55,6 @@
 clickhouse-cpp: clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib.a
 
 
-libdaemon/libdaemon/libdaemon/.libs/libdaemon.a: 
-	cd libdaemon && rm -rf libdaemon-0.14
-	cd libdaemon && tar -zxf libdaemon-0.14.tar.gz
-	cd libdaemon/libdaemon && ./configure --disable-examples
-	cd libdaemon/libdaemon && CC=${CC} CXX=${CXX} ${MAKE}
-
-libdaemon: libdaemon/libdaemon/libdaemon/.libs/libdaemon.a
 
 jemalloc/jemalloc/lib/libjemalloc.a:
 	cd jemalloc && rm -rf jemalloc-5.2.0
@@ -94,10 +68,10 @@
 jemalloc: jemalloc/jemalloc/lib/libjemalloc.a
 
 
-mariadb-client-library/mariadb_client/libmariadb/libmariadbclient.a: libssl/openssl/libssl.a
+mariadb-client-library/mariadb_client/libmariadb/libmariadbclient.a: # libssl/openssl/libssl.a
 	cd mariadb-client-library && rm -rf mariadb-connector-c-3.0.2-src
 	cd mariadb-client-library && tar -zxf mariadb-connector-c-3.0.2-src.tar.gz
-	cd mariadb-client-library/mariadb_client && cmake . -DOPENSSL_ROOT_DIR=$(shell pwd)/libssl/openssl/ -DOPENSSL_LIBRARIES=$(shell pwd)/libssl/openssl/ .
+	cd mariadb-client-library/mariadb_client && cmake . -DOPENSSL_ROOT_DIR=usr/include/openssl/ -DOPENSSL_LIBRARIES=/usr/bin .
 #	cd mariadb-client-library/mariadb_client && cmake . -DOPENSSL_ROOT_DIR=/usr/local/opt/openssl # this is needed on MacOSX
 	cd mariadb-client-library/mariadb_client && patch libmariadb/mariadb_stmt.c < ../mariadb_stmt.c.patch
 	cd mariadb-client-library/mariadb_client && patch libmariadb/mariadb_lib.c < ../mariadb_lib.c.patch
@@ -118,40 +92,18 @@
 mariadb_client: mariadb-client-library/mariadb_client/libmariadb/libmariadbclient.a
 
 
-sqlite3/sqlite3/sqlite3.o:
-	cd sqlite3 && rm -rf sqlite-amalgamation-3190200
-	cd sqlite3 && tar -zxf sqlite-amalgamation-3190200.tar.gz
-	cd sqlite3/sqlite3 && patch sqlite3.c < ../from_unixtime.patch
-	cd sqlite3/sqlite3 && ${CC} ${MYCFLAGS} -c -o sqlite3.o sqlite3.c -DSQLITE_ENABLE_MEMORY_MANAGEMENT -DSQLITE_ENABLE_JSON1
-
-sqlite3: sqlite3/sqlite3/sqlite3.o
-
-libconfig/libconfig/lib/.libs/libconfig++.a:
-	cd libconfig && rm -rf libconfig-1.7.2
-	cd libconfig && tar -zxf libconfig-1.7.2.tar.gz
-	cd libconfig/libconfig && ./configure --disable-examples
-	cd libconfig/libconfig && CC=${CC} CXX=${CXX} ${MAKE}
-
-libconfig: libconfig/libconfig/lib/.libs/libconfig++.a
-
 
 re2/re2/obj/libre2.a:
 	cd re2 && rm -rf re2-2018-07-01
 #	cd re2 && tar -zxf re2-20140304.tgz
 	cd re2 && tar -zxf re2.tar.gz
-#	cd re2/re2 && sed -i -e 's/-O3 -g /-O3 -fPIC /' Makefile
+	cd re2/re2 && sed -i -e 's/-O3 -g /-O3 -fPIC /' Makefile
 #	cd re2 && patch re2/util/mutex.h < mutex.h.patch
 	cd re2/re2 && sed -i -e 's/-O3 /-O3 -DMEMORY_SANITIZER -DRE2_ON_VALGRIND /' Makefile
 	cd re2/re2 && CC=${CC} CXX=${CXX} ${MAKE}
 
 re2: re2/re2/obj/libre2.a
 
-pcre/pcre/.libs/libpcre.a:
-	cd pcre && rm -rf pcre-8.39
-	cd pcre && tar -zxf pcre-8.39.tar.gz
-	cd pcre/pcre && ./configure
-	cd pcre/pcre && CC=${CC} CXX=${CXX} ${MAKE}
-pcre: pcre/pcre/.libs/libpcre.a
 
 cleanpart:
 	cd mariadb-client-library && rm -rf mariadb-connector-c-2.3.1
Only in 209/deps: Makefile.orig
diff -ur proxysql-2.0.9/lib/Makefile 209/lib/Makefile
--- proxysql-2.0.9/lib/Makefile	2019-11-07 06:48:56.000000000 +0100
+++ 209/lib/Makefile	2019-11-19 16:43:22.536324712 +0100
@@ -11,8 +11,6 @@
 JEMALLOC_PATH=$(DEPS_PATH)/jemalloc/jemalloc
 JEMALLOC_IDIR=$(JEMALLOC_PATH)/include/jemalloc
 
-LIBCONFIG_PATH=$(DEPS_PATH)/libconfig/libconfig
-LIBCONFIG_IDIR=-I$(LIBCONFIG_PATH)/lib
 
 #INJECTION_PATH=$(DEPS_PATH)/libinjection
 #INJECTION_IDIR=$(INJECTION_PATH)
@@ -20,9 +18,6 @@
 RE2_PATH=$(DEPS_PATH)/re2/re2
 RE2_IDIR=$(RE2_PATH)
 
-PCRE_PATH=$(DEPS_PATH)/pcre/pcre
-
-SQLITE3_DIR=$(DEPS_PATH)/sqlite3/sqlite3
 
 CLICKHOUSE_CPP_DIR=$(DEPS_PATH)/clickhouse-cpp/clickhouse-cpp
 
@@ -32,12 +27,6 @@
 COREDUMPER_DIR=$(DEPS_PATH)/google-coredumper/google-coredumper
 COREDUMPER_IDIR=$(COREDUMPER_DIR)/src
 
-CURL_DIR=$(DEPS_PATH)/curl/curl
-CURL_IDIR=-I$(CURL_DIR)/include
-
-SSL_DIR=$(DEPS_PATH)/libssl/openssl/
-SSL_IDIR=$(SSL_DIR)/include
-
 
 EV_DIR=$(DEPS_PATH)/libev/libev/
 EV_IDIR=$(EV_DIR)
@@ -45,7 +34,7 @@
 
 IDIR=../include
 
-IDIRS=-I$(IDIR) -I$(JEMALLOC_IDIR) -I$(MARIADB_IDIR) $(LIBCONFIG_IDIR) -I$(RE2_IDIR) -I$(SQLITE3_DIR) -I$(PCRE_PATH) -I/usr/local/include -I$(CLICKHOUSE_CPP_DIR) $(MICROHTTPD_IDIR) $(CURL_IDIR) -I$(EV_DIR) -I$(COREDUMPER_IDIR) -I$(SSL_IDIR)
+IDIRS=-I$(IDIR) -I$(JEMALLOC_IDIR) -I$(MARIADB_IDIR) -I$(RE2_IDIR) -I/usr/local/include -I$(CLICKHOUSE_CPP_DIR) -I$(MICROHTTPD_IDIR)  -I$(EV_DIR) -I$(COREDUMPER_IDIR)
 
 LDIRS=-L$(JEMALLOC_PATH)/lib -L$(RE2_PATH)/obj -L$(INJECTION_PATH)
 
@@ -105,8 +94,8 @@
 $(ODIR)/%.oo: %.cpp $(HEADERS)
 	$(CXX) -fPIC -c -o $@ $< $(MYCXXFLAGS) $(CXXFLAGS)
 
-libproxysql.a: $(ODIR) $(OBJ) $(OBJ_CXX) $(RE2_PATH)/obj/libre2.a $(SQLITE3_DIR)/sqlite3.o
-	ar rcs $@ $(OBJ) $(OBJ_CXX) $(RE2_PATH)/obj/libre2.a $(SQLITE3_DIR)/sqlite3.o
+libproxysql.a: $(ODIR) $(OBJ) $(OBJ_CXX) $(RE2_PATH)/obj/libre2.a
+	ar rcs $@ $(OBJ) $(OBJ_CXX) $(RE2_PATH)/obj/libre2.a
 
 $(ODIR):
 	mkdir $(ODIR)
Only in 209/lib: Makefile.orig
Only in 209/lib: Makefile.rej
diff -ur proxysql-2.0.9/src/Makefile 209/src/Makefile
--- proxysql-2.0.9/src/Makefile	2019-11-07 06:48:56.000000000 +0100
+++ 209/src/Makefile	2019-11-19 16:42:58.654140980 +0100
@@ -9,30 +9,18 @@
 MARIADB_LDIR=$(MARIADB_PATH)/libmariadb
 
 
-DAEMONPATH=$(DEPS_PATH)/libdaemon/libdaemon
-DAEMONPATH_IDIR=$(DAEMONPATH)
-DAEMONPATH_LDIR=$(DAEMONPATH)/libdaemon/.libs
 
 JEMALLOC_PATH=$(DEPS_PATH)/jemalloc/jemalloc
 JEMALLOC_IDIR=$(JEMALLOC_PATH)/include/jemalloc
 JEMALLOC_LDIR=$(JEMALLOC_PATH)/lib
 
-LIBCONFIG_PATH=$(DEPS_PATH)/libconfig/libconfig
-LIBCONFIG_IDIR=-I$(LIBCONFIG_PATH)/lib
-LIBCONFIG_LDIR=-L$(LIBCONFIG_PATH)/lib/.libs
 
 RE2_PATH=$(DEPS_PATH)/re2/re2
 RE2_IDIR=$(RE2_PATH)
 
-PCRE_PATH=$(DEPS_PATH)/pcre/pcre
-PCRE_LDIR=$(PCRE_PATH)/.libs
-
-SQLITE3_DIR=$(DEPS_PATH)/sqlite3/sqlite3
-
 
 CLICKHOUSE_CPP_DIR=$(DEPS_PATH)/clickhouse-cpp/clickhouse-cpp
 CITYHASH_DIR=$(DEPS_PATH)/cityhash/cityhash/src/.libs
-LZ4_DIR=$(DEPS_PATH)/lz4/lz4
 
 CLICKHOUSE_CPP_DIR=$(DEPS_PATH)/clickhouse-cpp/clickhouse-cpp
 
@@ -44,23 +32,12 @@
 COREDUMPER_IDIR=$(COREDUMPER_DIR)/src
 COREDUMPER_LDIR=$(COREDUMPER_DIR)/.libs
 
-CURL_DIR=$(DEPS_PATH)/curl/curl
-CURL_IDIR=$(CURL_DIR)/include
-CURL_LDIR=$(CURL_DIR)/lib/.libs
-
-SSL_DIR=$(DEPS_PATH)/libssl/openssl/
-SSL_IDIR=$(SSL_DIR)/include
-SSL_LDIR=$(SSL_DIR)
-
 
-EV_DIR=$(DEPS_PATH)/libev/libev/
-EV_IDIR=$(EV_DIR)
-EV_LDIR=$(EV_DIR)/.libs
 
 IDIR=../include
 LDIR=../lib
-IDIRS=-I$(IDIR) -I$(JEMALLOC_IDIR) -I$(MARIADB_IDIR) $(LIBCONFIG_IDIR) -I$(DAEMONPATH_IDIR) -I$(SQLITE3_DIR) -I$(CLICKHOUSE_CPP_DIR) -I$(MICROHTTPD_IDIR) -I$(CURL_IDIR) -I$(EV_IDIR) -I$(SSL_IDIR)
-LDIRS=-L$(LDIR) -L$(JEMALLOC_LDIR) $(LIBCONFIG_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(DAEMONPATH_LDIR) -L$(PCRE_LDIR) -L$(MICROHTTPD_LDIR) -L$(CURL_LDIR) -L$(EV_LDIR) -L$(COREDUMPER_LDIR) -L$(SSL_LDIR)
+IDIRS=-I$(IDIR) -I$(JEMALLOC_IDIR) -I$(MARIADB_IDIR) -I$(CLICKHOUSE_CPP_DIR) -I$(MICROHTTPD_IDIR)
+LDIRS=-L$(LDIR) -L$(JEMALLOC_LDIR) -L$(RE2_PATH)/obj -L$(MARIADB_LDIR) -L$(COREDUMPER_LDIR) -L$(MICROHTTPD_LDIR)
 
 UNAME_S := $(shell uname -s)
 
@@ -81,9 +58,9 @@
 LDFLAGS+=
 NOJEMALLOC := $(shell echo $(NOJEMALLOC))
 ifeq ($(NOJEMALLOC),1)
-MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lmicrohttpd -lcurl -lev -lcoredumper -Wl,-Bdynamic -lpthread -lm -lz -lrt $(EXTRALINK)
+MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lproxysql -lmicrohttpd -lre2 -lmariadbclient -lcoredumper -Wl,-Bdynamic -lssl -lcrypto -lsqlite3 -lev -ldaemon -lconfig -lconfig++ -lpcre -lpcrecpp -lcurl -lpthread -lm -lz -lrt $(EXTRALINK)
 else
-MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lconfig -lproxysql -ldaemon -ljemalloc -lconfig++ -lre2 -lpcrecpp -lpcre -lmariadbclient -lmicrohttpd -lcurl -lev -lcoredumper -Wl,-Bdynamic -lpthread -lm -lz -lrt $(EXTRALINK)
+MYLIBS=-Wl,--export-dynamic -Wl,-Bstatic -lproxysql -ljemalloc -lre2 -lmariadbclient -lcoredumper -lmicrohttpd -Wl,-Bdynamic -lev -lssl -lcrypto -lsqlite3 -ldaemon -lconfig -lconfig++ -lpthread -lm -lz -lrt -lpcre -lpcrecpp -lcurl  $(EXTRALINK)
 endif
 
 ifeq ($(UNAME_S),Darwin)
@@ -102,10 +79,9 @@
 
 LIBPROXYSQLAR=$(LDIR)/libproxysql.a
 ifeq ($(UNAME_S),Darwin)
-	LIBPROXYSQLAR=$(LDIR)/libproxysql.a ../deps/libmicrohttpd/libmicrohttpd/src/microhttpd/.libs/libmicrohttpd.a ../deps/pcre/pcre/.libs/libpcre.a ../deps/pcre/pcre/.libs/libpcrecpp.a  ../deps/libdaemon/libdaemon/libdaemon/.libs/libdaemon.a  ../deps/libconfig/libconfig/lib/.libs/libconfig++.a ../deps/libconfig/libconfig/lib/.libs/libconfig.a ../deps/curl/curl/lib/.libs/libcurl.a ../deps/sqlite3/sqlite3/sqlite3.o
+	LIBPROXYSQLAR=$(LDIR)/libproxysql.a ../deps/libmicrohttpd/libmicrohttpd/src/microhttpd/.libs/libmicrohttpd.a
 endif
 
-LIBPROXYSQLAR+= $(SSL_LDIR)/libssl.a $(SSL_LDIR)/libcrypto.a
 ODIR= obj
 
 EXECUTABLE=proxysql
@@ -118,7 +94,7 @@
 
 proxysql: $(ODIR) $(OBJ) $(LIBPROXYSQLAR)
 ifeq ($(PROXYSQLCLICKHOUSE),1)
-	$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CLICKHOUSE_CPP_DIR)/clickhouse/libclickhouse-cpp-lib.a $(CITYHASH_DIR)/libcityhash.a $(LZ4_DIR)/liblz4.a $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(LDFLAGS) $(MYLIBS)
+	$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(CLICKHOUSE_CPP_DIR)/clickhouse/libclickhouse-cpp-lib.a $(CITYHASH_DIR)/libcityhash.a $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(LDFLAGS) $(MYLIBS)
 else
 	$(CXX) -o $@ $(OBJ) $(LIBPROXYSQLAR) $(MYCXXFLAGS) $(CXXFLAGS) $(LDIRS) $(LIBS) $(LDFLAGS) $(MYLIBS)
 endif