Browse Source

Merge pull request #120 from torbjo/master

Fixed building on OS X. - Tested and accepted :)
pull/122/head
Meeh 10 years ago
parent
commit
e8c544c774
  1. 9
      Makefile
  2. 11
      Makefile.osx
  3. 2
      README.md
  4. 10
      filelist.mk

9
Makefile

@ -22,7 +22,10 @@ else # win32 @@ -22,7 +22,10 @@ else # win32
DAEMON_SRC += DaemonWin32.cpp
endif
all: $(SHLIB) $(I2PD)
all: mk_build_dir $(SHLIB) $(I2PD)
mk_build_dir:
test -d obj || mkdir obj
api: $(SHLIB)
@ -34,12 +37,10 @@ api: $(SHLIB) @@ -34,12 +37,10 @@ api: $(SHLIB)
## custom FLAGS to work at build-time.
deps:
@test -d obj || mkdir obj
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) -MM *.cpp > $(DEPS)
@sed -i -e '/\.o:/ s/^/obj\//' $(DEPS)
obj/%.o : %.cpp
@test -d obj || mkdir obj
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -c -o $@ $<
# '-' is 'ignore if missing' on first run
@ -50,7 +51,7 @@ $(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC)) @@ -50,7 +51,7 @@ $(I2PD): $(patsubst %.cpp,obj/%.o,$(DAEMON_SRC))
$(SHLIB): $(patsubst %.cpp,obj/%.o,$(LIB_SRC))
ifneq ($(USE_STATIC),yes)
$(CXX) $(CXXFLAGS) $(NEEDED_CXXFLAGS) $(INCFLAGS) $(CPU_FLAGS) -shared -o $@ $^
$(CXX) $(LDFLAGS) $(LDLIBS) -shared -o $@ $^
endif
clean:

11
Makefile.osx vendored

@ -1,5 +1,6 @@ @@ -1,5 +1,6 @@
CXX = clang++
CXXFLAGS = -g -Wall -std=c++11 -lstdc++ -DCRYPTOPP_DISABLE_ASM
CXXFLAGS = -g -Wall -std=c++11 -DCRYPTOPP_DISABLE_ASM
#CXXFLAGS = -g -O2 -Wall -std=c++11 -DCRYPTOPP_DISABLE_ASM
INCFLAGS = -I/usr/local/include
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
@ -12,6 +13,8 @@ ifeq ($(USE_AESNI),yes) @@ -12,6 +13,8 @@ ifeq ($(USE_AESNI),yes)
CXXFLAGS += -maes -DAESNI
endif
install: all
mkdir -p ${PREFIX}/
cp -r i2p ${PREFIX}/
# Disabled, since it will be the default make rule. I think its better
# to define the default rule in Makefile and not Makefile.<ostype> - torkel
#install: all
# test -d ${PREFIX} || mkdir -p ${PREFIX}/
# cp -r i2p ${PREFIX}/

2
README.md

@ -21,7 +21,7 @@ Build Statuses @@ -21,7 +21,7 @@ Build Statuses
- Linux x64 - [![Build Status](https://jenkins.nordcloud.no/buildStatus/icon?job=i2pd-linux)](https://jenkins.nordcloud.no/job/i2pd-linux/)
- Linux ARM - To be added
- Mac OS X - To be added
- Mac OS X - Got it working, but not well tested. (Only works with clang, not GCC.)
- Microsoft VC13 - To be added

10
filelist.mk

@ -5,6 +5,16 @@ COMMON_SRC = \ @@ -5,6 +5,16 @@ COMMON_SRC = \
TransitTunnel.cpp Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \
TunnelGateway.cpp Destination.cpp util.cpp aes.cpp base64.cpp
ifeq ($(UNAME),Darwin)
# This is needed on OS X for some reason I don't understand (yet).
# Else will get linker error about unknown symbols. - torkel
COMMON_SRC += \
BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp SOCKS.cpp \
UPnP.cpp HTTPServer.cpp HTTPProxy.cpp i2p.cpp DaemonLinux.cpp
endif
# also: Daemon{Linux,Win32}.cpp will be added later
DAEMON_SRC = $(COMMON_SRC) \
BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp SOCKS.cpp UPnP.cpp \

Loading…
Cancel
Save