From 19fc59739f19801eedcb5ea18a9928aaf73cce02 Mon Sep 17 00:00:00 2001 From: R4SAS Date: Sat, 22 Apr 2017 04:17:01 +0300 Subject: [PATCH] update makefile-s --- Makefile | 2 +- Makefile.homebrew | 8 ++++---- Makefile.linux | 28 ++++++++++++++-------------- Makefile.mingw | 35 +++++++++++++++++------------------ 4 files changed, 36 insertions(+), 37 deletions(-) diff --git a/Makefile b/Makefile index 06c2f1a3..989f8586 100644 --- a/Makefile +++ b/Makefile @@ -78,7 +78,7 @@ obj/%.o: %.cpp DAEMON_OBJS += $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC)) $(I2PD): $(DAEMON_OBJS) $(ARLIB) $(ARLIB_CLIENT) - $(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS) + $(CXX) -o $@ $^ $(LDFLAGS) $(LDLIBS) $(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC)) ifneq ($(USE_STATIC),yes) diff --git a/Makefile.homebrew b/Makefile.homebrew index 05fd8dcf..1cce3232 100644 --- a/Makefile.homebrew +++ b/Makefile.homebrew @@ -9,9 +9,9 @@ LDFLAGS = -L${SSLROOT}/lib -L${BOOSTROOT}/lib LDLIBS = -lz -lcrypto -lssl -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread ifeq ($(USE_UPNP),yes) - LDFLAGS += -ldl - CXXFLAGS += -DUSE_UPNP - LDLIBS += -lminiupnpc + LDFLAGS += -ldl + CXXFLAGS += -DUSE_UPNP + LDLIBS += -lminiupnpc endif # OSX Notes @@ -20,7 +20,7 @@ endif # Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic # note from psi: 2009 macbook does not have aesni #ifeq ($(USE_AESNI),yes) -# CXXFLAGS += -maes -DAESNI +# CXXFLAGS += -maes -DAESNI #endif # Disabled, since it will be the default make rule. I think its better diff --git a/Makefile.linux b/Makefile.linux index 8173b4a5..782b0203 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -31,27 +31,27 @@ ifeq ($(USE_STATIC),yes) # NOTE: on glibc you will get this warning: # Using 'getaddrinfo' in statically linked applications requires at runtime # the shared libraries from the glibc version used for linking - LIBDIR := /usr/lib - LDLIBS = $(LIBDIR)/libboost_system.a - LDLIBS += $(LIBDIR)/libboost_date_time.a - LDLIBS += $(LIBDIR)/libboost_filesystem.a - LDLIBS += $(LIBDIR)/libboost_program_options.a - LDLIBS += $(LIBDIR)/libssl.a - LDLIBS += $(LIBDIR)/libcrypto.a - LDLIBS += $(LIBDIR)/libz.a - LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt -ldl - USE_AESNI := no + LIBDIR := /usr/lib + LDLIBS = $(LIBDIR)/libboost_system.a + LDLIBS += $(LIBDIR)/libboost_date_time.a + LDLIBS += $(LIBDIR)/libboost_filesystem.a + LDLIBS += $(LIBDIR)/libboost_program_options.a + LDLIBS += $(LIBDIR)/libssl.a + LDLIBS += $(LIBDIR)/libcrypto.a + LDLIBS += $(LIBDIR)/libz.a + LDLIBS += -lpthread -static-libstdc++ -static-libgcc -lrt -ldl + USE_AESNI := no else - LDLIBS = -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread + LDLIBS = -lcrypto -lssl -lz -lboost_system -lboost_date_time -lboost_filesystem -lboost_program_options -lpthread endif # UPNP Support (miniupnpc 1.5 and higher) ifeq ($(USE_UPNP),yes) - CXXFLAGS += -DUSE_UPNP + CXXFLAGS += -DUSE_UPNP ifeq ($(USE_STATIC),yes) - LDLIBS += $(LIBDIR)/libminiupnpc.a + LDLIBS += $(LIBDIR)/libminiupnpc.a else - LDLIBS += -lminiupnpc + LDLIBS += -lminiupnpc endif endif diff --git a/Makefile.mingw b/Makefile.mingw index 29176ab7..d6fedd7b 100644 --- a/Makefile.mingw +++ b/Makefile.mingw @@ -5,29 +5,28 @@ CXXFLAGS = -Os -D_MT -DWIN32 -D_WINDOWS -DWIN32_LEAN_AND_MEAN NEEDED_CXXFLAGS = -std=c++11 BOOST_SUFFIX = -mt INCFLAGS = -I/usr/include/ -I/usr/local/include/ -I. -Idaemon -LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib +LDFLAGS = -Wl,-rpath,/usr/local/lib -Wl,-Bstatic -static-libgcc -static-libstdc++ -L/usr/local/lib # UPNP Support ifeq ($(USE_UPNP),yes) - CXXFLAGS += -DUSE_UPNP -DMINIUPNP_STATICLIB - LDLIBS = -Wl,-Bstatic -lminiupnpc + CXXFLAGS += -DUSE_UPNP -DMINIUPNP_STATICLIB + LDLIBS = -lminiupnpc endif LDLIBS += \ - -Wl,-Bstatic -lboost_system$(BOOST_SUFFIX) \ - -Wl,-Bstatic -lboost_date_time$(BOOST_SUFFIX) \ - -Wl,-Bstatic -lboost_filesystem$(BOOST_SUFFIX) \ - -Wl,-Bstatic -lboost_program_options$(BOOST_SUFFIX) \ - -Wl,-Bstatic -lssl \ - -Wl,-Bstatic -lcrypto \ - -Wl,-Bstatic -lz \ - -Wl,-Bstatic -lwsock32 \ - -Wl,-Bstatic -lws2_32 \ - -Wl,-Bstatic -lgdi32 \ - -Wl,-Bstatic -liphlpapi \ - -static-libgcc -static-libstdc++ \ - -Wl,-Bstatic -lstdc++ \ - -Wl,-Bstatic -lpthread + -lboost_system$(BOOST_SUFFIX) \ + -lboost_date_time$(BOOST_SUFFIX) \ + -lboost_filesystem$(BOOST_SUFFIX) \ + -lboost_program_options$(BOOST_SUFFIX) \ + -lssl \ + -lcrypto \ + -lz \ + -lwsock32 \ + -lws2_32 \ + -lgdi32 \ + -liphlpapi \ + -lstdc++ \ + -lpthread ifeq ($(USE_WIN32_APP), yes) CXXFLAGS += -DWIN32_APP @@ -49,7 +48,7 @@ endif ifeq ($(USE_ASLR),yes) LDFLAGS += -Wl,--nxcompat -Wl,--high-entropy-va \ - -Wl,--dynamicbase,--export-all-symbols + -Wl,--dynamicbase,--export-all-symbols endif obj/%.o : %.rc