i2pd/Makefile.osx
xanoni 24b10bbc34
Makefile.osx: detect openssl@1.1 from Homebrew
The current Makefile does not work on Darwin if openssl was installed
via Homebrew ... this change ensures the openssl headers and libs are
included if they were installed via Homebrew, even when i2pd is compiled
without Homebrew (e.g., by just cloning the repo and running `make`).
2021-10-18 04:12:57 -04:00

35 lines
1 KiB
Text

CXX = clang++
CXXFLAGS := ${CXX_DEBUG} -Wall -std=c++11 -DMAC_OSX
INCFLAGS := -I/usr/local/include
LDFLAGS := -Wl,-rpath,/usr/local/lib -L/usr/local/lib
LDFLAGS += -Wl,-dead_strip
LDFLAGS += -Wl,-dead_strip_dylibs
LDFLAGS += -Wl,-bind_at_load
$(shell brew ls openssl@1.1 > /dev/null 2>&1)
ifeq ($(.SHELLSTATUS),0)
INCFLAGS := -I/usr/local/opt/openssl@1.1/include $(INCFLAGS)
LDFLAGS += -L/usr/local/opt/openssl@1.1/lib
endif
ifeq ($(USE_STATIC),yes)
LDLIBS = -lz /usr/local/lib/libcrypto.a /usr/local/lib/libssl.a /usr/local/lib/libboost_system.a /usr/local/lib/libboost_date_time.a /usr/local/lib/libboost_filesystem.a /usr/local/lib/libboost_program_options.a -lpthread
else
LDLIBS = -lz -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread
endif
ifeq ($(USE_UPNP),yes)
LDFLAGS += -ldl
CXXFLAGS += -DUSE_UPNP
ifeq ($(USE_STATIC),yes)
LDLIBS += /usr/local/lib/libminiupnpc.a
else
LDLIBS += -lminiupnpc
endif
endif
ifeq ($(USE_AESNI),yes)
CXXFLAGS += -D__AES__ -maes
else
CXXFLAGS += -msse
endif