Statically link curl on OSX #1560

pull/1657/head
René Cannaò 8 years ago
parent 8c4ba5ba42
commit 58ca2d3920

@ -35,6 +35,15 @@ yum install automake bzip2 cmake make gcc-c++ gcc git openssl openssl-devel patc
apt-get install automake bzip2 cmake make g++ gcc git openssl libssl-dev patch
```
On Mac OSX, Proxysql's dependencies are not fully satisfied by the tools included with the XCode/clang toolkit. The Proxysql build system needs to be told where to find non-system `curl` (and possibly `openssl`) libraries. 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 openssl curl
export OPENSSL_ROOT_DIR="$(brew --prefix openssl)"
export CXXFLAGS="${CXXFLAGS:-} -I$(brew --prefix openssl)/include -I$(brew --prefix curl)/include"
export LDFLAGS="${LDFLAGS:-} -L$(brew --prefix openssl)/lib"
```
Go to the directory where you cloned the repo (or unpacked the tarball) and run:
```bash

@ -88,6 +88,10 @@ endif
ifeq ($(UNAME_S),Darwin)
MYLIBS=-lssl -lre2 -lmariadbclient -lpthread -lm -lz -liconv -lcrypto -lcurl
else
CURL_DIR=$(DEPS_PATH)/curl/curl
IDIRS+= -L$(CURL_DIR)/include
LDIRS+= -L$(CURL_DIR)/lib/.libs
endif
ifeq ($(UNAME_S),Linux)
MYLIBS+= -ldl
@ -98,7 +102,7 @@ endif
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/sqlite3/sqlite3/sqlite3.o
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
endif
LIBPROXYSQLAR+= $(SSL_LDIR)/libssl.a $(SSL_LDIR)/libcrypto.a

Loading…
Cancel
Save