diff options
author | noloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2015-06-27 23:36:47 +0000 |
---|---|---|
committer | noloader <noloader@57ff6487-cd31-0410-9ec3-f628ee90f5f0> | 2015-06-27 23:36:47 +0000 |
commit | 664b9ef808858768e0b9486be52aed2e77839edf (patch) | |
tree | aeac67e6a31a33756b1468bbb0d5aa20acf82c6d /GNUmakefile | |
parent | 08eb37a688e3a614902ab57e25624e4949380d34 (diff) | |
download | cryptopp-664b9ef808858768e0b9486be52aed2e77839edf.tar.gz |
Various makefile enhancements from GitHub
git-svn-id: svn://svn.code.sf.net/p/cryptopp/code/trunk/c5@544 57ff6487-cd31-0410-9ec3-f628ee90f5f0
Diffstat (limited to 'GNUmakefile')
-rw-r--r-- | GNUmakefile | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/GNUmakefile b/GNUmakefile index b1ab537..2695e65 100644 --- a/GNUmakefile +++ b/GNUmakefile @@ -1,6 +1,6 @@ CXXFLAGS = -DNDEBUG -g -O2 # -O3 fails to link on Cygwin GCC version 4.5.3 -# -fPIC is supported. Please report any breakage of -fPIC as a bug. +# -fPIC is supported, and enabled by default for x86_64. # CXXFLAGS += -fPIC # the following options reduce code size, but breaks link or makes link very slow on some systems # CXXFLAGS += -ffunction-sections -fdata-sections @@ -11,11 +11,12 @@ CP = cp MKDIR = mkdir EGREP = egrep UNAME = $(shell uname) -ISX86 = $(shell uname -m | $(EGREP) -c "i.86|x86|i86|amd64") +IS_X86 = $(shell uname -m | $(EGREP) -c "i.86|x86|i86|amd64") +IS_X86_64 = $(shell uname -m | $(EGREP) -c "_64|d64") IS_SUN_CC = $(shell $(CXX) -V 2>&1 | $(EGREP) -c "CC: Sun") IS_LINUX = $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -c "linux") IS_MINGW = $(shell $(CXX) -dumpmachine 2>&1 | $(EGREP) -c "mingw") -CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang version") +CLANG_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -i -c "clang") # Default prefix for make install ifeq ($(PREFIX),) @@ -26,7 +27,7 @@ ifeq ($(CXX),gcc) # for some reason CXX is gcc on cygwin 1.1.4 CXX = g++ endif -ifeq ($(ISX86),1) +ifeq ($(IS_X86),1) GCC42_OR_LATER = $(shell $(CXX) -v 2>&1 | $(EGREP) -c "^gcc version (4.[2-9]|[5-9])") INTEL_COMPILER = $(shell $(CXX) --version 2>&1 | $(EGREP) -c "\(ICC\)") @@ -35,6 +36,11 @@ GAS210_OR_LATER = $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EG GAS217_OR_LATER = $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.1[7-9]|2\.[2-9]|[3-9])") GAS219_OR_LATER = $(shell $(CXX) -xc -c /dev/null -Wa,-v -o/dev/null 2>&1 | $(EGREP) -c "GNU assembler version (2\.19|2\.[2-9]|[3-9])") +#Enable PIC for x86_64 targets +ifneq ($(IS_X86_64),0) +CXXFLAGS += -fPIC +endif + ifneq ($(GCC42_OR_LATER),0) ifeq ($(UNAME),Darwin) CXXFLAGS += -arch x86_64 -arch i386 @@ -67,7 +73,7 @@ CXXFLAGS += -Wa,--divide # allow use of "/" operator endif endif -endif # ISX86 +endif # IS_X86 ifeq ($(UNAME),) # for DJGPP, where uname doesn't exist CXXFLAGS += -mbnu210 @@ -81,7 +87,7 @@ endif ifeq ($(IS_LINUX),1) LDFLAGS += -pthread -ifneq ($(shell uname -i | $(EGREP) -c "(_64|d64)"),0) +ifneq ($(IS_X86_64),0) M32OR64 = -m64 endif endif @@ -146,6 +152,7 @@ test: cryptest.exe clean: -$(RM) cryptest.exe libcryptopp.a libcryptopp.so $(LIBOBJS) $(TESTOBJS) cryptopp.dll libcryptopp.dll.a libcryptopp.import.a cryptest.import.exe dlltest.exe $(DLLOBJS) $(LIBIMPORTOBJS) $(TESTI MPORTOBJS) $(DLLTESTOBJS) + -$(RM) -r cryptest.exe.dSYM install: $(MKDIR) -p $(PREFIX)/include/cryptopp $(PREFIX)/lib $(PREFIX)/bin |