From 25b5068f5e5decf4616fc930354ce7b3a56b1d41 Mon Sep 17 00:00:00 2001 From: Kill Your TV Date: Thu, 30 Oct 2014 22:47:19 +0000 Subject: [PATCH] allow LDFLAGS to be set by user Move old LDFLAGS variable to LDLIBS. By doing ths, a user can set their own LDFLAGS without breaking the build. A case in which this can be useful is hardening with debian, e.g. $ dpkg-buildflags --get LDFLAGS -Wl,-z,relro --- Makefile | 2 +- Makefile.bsd | 3 ++- Makefile.linux | 2 +- Makefile.osx | 3 ++- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 4b5832e1..5e8c992e 100644 --- a/Makefile +++ b/Makefile @@ -11,7 +11,7 @@ endif all: obj i2p i2p: $(OBJECTS:obj/%=obj/%) - $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS) + $(CXX) -o $@ $^ $(LDLIBS) $(LDFLAGS) $(LIBS) .SUFFIXES: .SUFFIXES: .c .cc .C .cpp .o diff --git a/Makefile.bsd b/Makefile.bsd index d234d3f2..17f6ccd9 100644 --- a/Makefile.bsd +++ b/Makefile.bsd @@ -3,5 +3,6 @@ CXXFLAGS = -O2 NEEDED_CXXFLAGS = -std=c++11 include filelist.mk INCFLAGS = -I/usr/include/ -I/usr/local/include/ -LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread +LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib +LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LIBS = diff --git a/Makefile.linux b/Makefile.linux index 0be317d1..d87d7328 100644 --- a/Makefile.linux +++ b/Makefile.linux @@ -19,7 +19,7 @@ endif include filelist.mk INCFLAGS = -LDFLAGS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread +LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LIBS = diff --git a/Makefile.osx b/Makefile.osx index 180e48be..98aca703 100644 --- a/Makefile.osx +++ b/Makefile.osx @@ -2,7 +2,8 @@ CXX = clang++ CXXFLAGS = -g -Wall -std=c++11 -lstdc++ -I/usr/local/include include filelist.mk INCFLAGS = -DCRYPTOPP_DISABLE_ASM -LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread +LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib +LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LIBS = # OSX Notes