diff --git a/.github/workflows/CI-darwin.yml b/.github/workflows/CI-darwin.yml new file mode 100644 index 0000000000..67d2daaf73 --- /dev/null +++ b/.github/workflows/CI-darwin.yml @@ -0,0 +1,19 @@ +name: Darwin + +on: + push: + +jobs: + build: + runs-on: macos-latest + steps: + - uses: actions/checkout@v4 + + - name: Install dependencies + run: brew install automake bzip2 cmake git gpatch gnutls ossp-uuid libtool + + - name: Build + run: make + + - name: Show version + run: ./src/proxysql --version diff --git a/INSTALL.md b/INSTALL.md index e7d5cfed02..677c65088e 100644 --- a/INSTALL.md +++ b/INSTALL.md @@ -26,7 +26,7 @@ The list of currently supported operating systems for native packaging is: - Fedora 33,24 - OpenSUSE 15 - AlmaLinux 8,9 - + Download a __deb__ or __rpm__ installer file for your OS and architecture from: https://github.com/sysown/proxysql/releases @@ -111,7 +111,7 @@ https://github.com/ProxySQL/docker-images/tree/main/build-clang-images On modern Mac OSX, ProxySQL's dependencies are not fully satisfied by the tools included with the XCode/clang toolkit. Using the [Homebrew](https://brew.sh/) OSX package manager, dependencies can be installed and located on OSX like this: ```bash -brew install automake bzip2 cmake make git gpatch gnutls ossp-uuid +brew install automake bzip2 cmake make git gpatch gnutls ossp-uuid libtool ``` Go to the directory where you cloned the repo (or unpacked the tarball) and run: diff --git a/Makefile b/Makefile index a067414c08..4607fc6f8f 100644 --- a/Makefile +++ b/Makefile @@ -42,9 +42,9 @@ export MAKE export CURVER ### detect compiler support for c++11/17 -CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') +CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201703L) - CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') + CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3) LEGACY_BUILD := 1 ifneq ($(CPLUSPLUS),201103L) $(error Compiler must support at least c++11) @@ -235,7 +235,7 @@ build_tap_test_debug: build_tap_tests_debug build_tap_tests_debug: build_src_debug cd test/tap && OPTZ="${O0} -ggdb -DDEBUG" CC=${CC} CXX=${CXX} ${MAKE} debug -# ClickHouse build targets are now default build targets. +# ClickHouse build targets are now default build targets. # To maintain backward compatibility, ClickHouse targets are still available. .PHONY: build_deps_clickhouse build_deps_clickhouse: build_deps_default @@ -289,7 +289,7 @@ SYS_ARCH := $(shell uname -m) REL_ARCH := $(subst x86_64,amd64,$(subst aarch64,arm64,$(SYS_ARCH))) RPM_ARCH := .$(SYS_ARCH) DEB_ARCH := _$(REL_ARCH) -REL_VERS := $(shell echo ${GIT_VERSION} | grep -Po '(?<=^v|^)[\d\.]+') +REL_VERS := $(shell echo ${GIT_VERSION} | awk -F'[.-]' '{print $1"."$2"."$3}') RPM_VERS := -$(REL_VERS)-1 DEB_VERS := _$(REL_VERS) diff --git a/deps/Makefile b/deps/Makefile index 24501d5331..2d61b2ebfc 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -28,9 +28,9 @@ endif ### detect compiler support for c++11/17 -CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') +CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201703L) - CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') + CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201103L) $(error Compiler must support at least c++11) endif @@ -74,7 +74,7 @@ libssl/openssl/libssl.a: # cd libssl/openssl && patch crypto/asn1/a_time.c < ../a_time.c-multiplication-overflow.patch cd libssl/openssl && ./config no-ssl3 no-tests cd libssl/openssl && CC=${CC} CXX=${CXX} ${MAKE} - cd libssl/openssl && ln -fsT . lib # curl wants this path + cd libssl/openssl && ln -fs . lib # curl wants this path libssl: libssl/openssl/libssl.a @@ -92,7 +92,9 @@ ifeq ($(UNAME_S),FreeBSD) sed -i -e 's/\/bin\/bash/\/usr\/local\/bin\/bash/' libhttpserver/libhttpserver/bootstrap endif ifeq ($(SYS_KERN),Darwin) - sed -i -e 's/glibtoolize/libtoolize/' libhttpserver/libhttpserver/bootstrap +ifeq (, $(shell which glibtoolize)) + sed -i -e 's/glibtoolize/libtoolize/' libhttpserver/libhttpserver/bootstrap +endif endif cd libhttpserver/libhttpserver && ./bootstrap && mkdir build cd libhttpserver/libhttpserver/build && LDFLAGS=-L$(shell pwd)/libmicrohttpd/libmicrohttpd/src/microhttpd/.libs/ CPPFLAGS=-I$(shell pwd)/libmicrohttpd/libmicrohttpd/src/include ../configure --disable-doxygen-doc --disable-doxygen-dot --disable-doxygen-man --disable-doxygen-html --enable-fastopen=false --disable-examples @@ -159,7 +161,7 @@ lz4: lz4/lz4/lib/liblz4.a clickhouse-cpp/clickhouse-cpp/clickhouse/libclickhouse-cpp-lib-static.a: cd clickhouse-cpp && rm -rf clickhouse-cpp-*/ || true - cd clickhouse-cpp && ln -fsT clickhouse-cpp-2.3.0 clickhouse-cpp + cd clickhouse-cpp && ln -fs clickhouse-cpp-2.3.0 clickhouse-cpp cd clickhouse-cpp && tar -zxf v2.3.0.tar.gz && sync cd clickhouse-cpp/clickhouse-cpp && patch clickhouse/base/wire_format.h < ../wire_format.patch cd clickhouse-cpp/clickhouse-cpp && cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo . diff --git a/lib/Makefile b/lib/Makefile index 58b17c29eb..798968c6fb 100644 --- a/lib/Makefile +++ b/lib/Makefile @@ -95,9 +95,9 @@ endif ### detect compiler support for c++11/17 -CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') +CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201703L) - CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') + CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201103L) $(error Compiler must support at least c++11) endif diff --git a/src/Makefile b/src/Makefile index 01a10c739c..ad0380f592 100644 --- a/src/Makefile +++ b/src/Makefile @@ -105,9 +105,9 @@ endif ### detect compiler support for c++11/17 -CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') +CPLUSPLUS := $(shell ${CC} -std=c++17 -dM -E -x c++ /dev/null 2>/dev/null | grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201703L) - CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | grep -Po '\d\d\d\d\d\dL') + CPLUSPLUS := $(shell ${CC} -std=c++11 -dM -E -x c++ /dev/null 2>/dev/null| grep -F __cplusplus | cut -d' ' -f3) ifneq ($(CPLUSPLUS),201103L) $(error Compiler must support at least c++11) endif