Browse Source

Merge pull request #106 from kytvi2p/fix_makefiles

Makefile updates
pull/108/head 0.2.0
orignal 10 years ago
parent
commit
51c908ab55
  1. 4
      Makefile
  2. 5
      Makefile.bsd
  3. 19
      Makefile.linux
  4. 6
      Makefile.osx
  5. 8
      debian/patches/rename-binary.patch
  6. 1
      debian/rules

4
Makefile

@ -11,13 +11,13 @@ endif
all: obj i2p all: obj i2p
i2p: $(OBJECTS:obj/%=obj/%) i2p: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES: .SUFFIXES:
.SUFFIXES: .c .cc .C .cpp .o .SUFFIXES: .c .cc .C .cpp .o
obj/%.o : %.cpp obj/%.o : %.cpp
$(CC) -o $@ $< -c $(CFLAGS) $(INCFLAGS) $(CPU_FLAGS) $(CXX) -o $@ $< -c $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS)
obj: obj:
mkdir -p obj mkdir -p obj

5
Makefile.bsd

@ -1,5 +1,6 @@
CC = g++ CXX = g++
CFLAGS = -std=c++11 -O2 CXXFLAGS = -O2
NEEDED_CXXFLAGS = -std=c++11
include filelist.mk include filelist.mk
INCFLAGS = -I/usr/include/ -I/usr/local/include/ 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 -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread

19
Makefile.linux

@ -1,13 +1,17 @@
CC = g++ CXXFLAGS = -g -Wall
CFLAGS = -g -Wall CXXVER := $(shell $(CXX) -dumpversion)
CXXVER := $(shell ${CC} -dumpversion)
FGREP = fgrep
IS_64 := $(shell $(CXX) -dumpmachine 2>&1 | $(FGREP) -c "64")
ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10 ifeq ($(shell expr match ${CXXVER} "4\.[0-9][0-9]"),4) # >= 4.10
CFLAGS += -std=c++11 NEEDED_CXXFLAGS += -std=c++11
else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7 else ifeq ($(shell expr match ${CXXVER} "4\.[7-9]"),3) # >= 4.7
CFLAGS += -std=c++11 NEEDED_CXXFLAGS += -std=c++11
else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6 else ifeq ($(shell expr match ${CXXVER} "4\.6"),3) # = 4.6
CFLAGS += -std=c++0x NEEDED_CXXFLAGS += -std=c++0x
else ifeq ($(shell expr match $(CXX) 'clang'),5)
NEEDED_CXXFLAGS += -std=c++11
else # not supported else # not supported
$(error Compiler too old) $(error Compiler too old)
endif endif
@ -18,8 +22,11 @@ INCFLAGS =
LDFLAGS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread LDFLAGS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
LIBS = LIBS =
ifeq ($(IS_64),1)
#check if AES-NI is supported by CPU #check if AES-NI is supported by CPU
ifneq ($(shell grep -c aes /proc/cpuinfo),0) ifneq ($(shell grep -c aes /proc/cpuinfo),0)
CPU_FLAGS = -maes -DAESNI CPU_FLAGS = -maes -DAESNI
endif endif
endif

6
Makefile.osx vendored

@ -1,5 +1,5 @@
CC = clang++ CXX = clang++
CFLAGS = -g -Wall -std=c++11 -lstdc++ -I/usr/local/include CXXFLAGS = -g -Wall -std=c++11 -lstdc++ -I/usr/local/include
include filelist.mk include filelist.mk
INCFLAGS = -DCRYPTOPP_DISABLE_ASM 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 -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
@ -9,7 +9,7 @@ LIBS =
# http://www.hutsby.net/2011/08/macs-with-aes-ni.html # http://www.hutsby.net/2011/08/macs-with-aes-ni.html
# Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2 # Seems like all recent Mac's have AES-NI, after firmware upgrade 2.2
# Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic # Found no good way to detect it from command line. TODO: Might be some osx sysinfo magic
CFLAGS += -maes -DAESNI CXXFLAGS += -maes -DAESNI
# Apple Mac OSX # Apple Mac OSX
UNAME_S := $(shell uname -s) UNAME_S := $(shell uname -s)

8
debian/patches/rename-binary.patch vendored

@ -1,8 +1,6 @@
diff --git a/Makefile b/Makefile
index 9b9425b..84de72f 100644
--- a/Makefile --- a/Makefile
+++ b/Makefile +++ b/Makefile
@@ -8,9 +8,9 @@ else @@ -10,9 +10,9 @@
include Makefile.linux include Makefile.linux
endif endif
@ -11,10 +9,10 @@ index 9b9425b..84de72f 100644
-i2p: $(OBJECTS:obj/%=obj/%) -i2p: $(OBJECTS:obj/%=obj/%)
+i2pd: $(OBJECTS:obj/%=obj/%) +i2pd: $(OBJECTS:obj/%=obj/%)
$(CC) -o $@ $^ $(LDFLAGS) $(LIBS) $(CXX) -o $@ $^ $(LDFLAGS) $(LIBS)
.SUFFIXES: .SUFFIXES:
@@ -23,7 +23,7 @@ obj: @@ -25,7 +25,7 @@
mkdir -p obj mkdir -p obj
clean: clean:

1
debian/rules vendored

@ -6,7 +6,6 @@
DPKG_EXPORT_BUILDFLAGS = 1 DPKG_EXPORT_BUILDFLAGS = 1
include /usr/share/dpkg/buildflags.mk include /usr/share/dpkg/buildflags.mk
CFLAGS+=$(CPPFLAGS)
CXXFLAGS+=$(CPPFLAGS) CXXFLAGS+=$(CPPFLAGS)
PREFIX=/usr PREFIX=/usr

Loading…
Cancel
Save