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

11
Makefile.osx vendored

@ -1,5 +1,6 @@
CXX = clang++ 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 INCFLAGS = -I/usr/local/include
LDFLAGS = -Wl,-rpath,/usr/local/lib -L/usr/local/lib 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 LDLIBS = -lcryptopp -lboost_system -lboost_date_time -lboost_filesystem -lboost_regex -lboost_program_options -lpthread
@ -12,6 +13,8 @@ ifeq ($(USE_AESNI),yes)
CXXFLAGS += -maes -DAESNI CXXFLAGS += -maes -DAESNI
endif endif
install: all # Disabled, since it will be the default make rule. I think its better
mkdir -p ${PREFIX}/ # to define the default rule in Makefile and not Makefile.<ostype> - torkel
cp -r i2p ${PREFIX}/ #install: all
# test -d ${PREFIX} || mkdir -p ${PREFIX}/
# cp -r i2p ${PREFIX}/

2
README.md

@ -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 x64 - [![Build Status](https://jenkins.nordcloud.no/buildStatus/icon?job=i2pd-linux)](https://jenkins.nordcloud.no/job/i2pd-linux/)
- Linux ARM - To be added - 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 - Microsoft VC13 - To be added

10
filelist.mk

@ -5,6 +5,16 @@ COMMON_SRC = \
TransitTunnel.cpp Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \ TransitTunnel.cpp Transports.cpp Tunnel.cpp TunnelEndpoint.cpp TunnelPool.cpp \
TunnelGateway.cpp Destination.cpp util.cpp aes.cpp base64.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 # also: Daemon{Linux,Win32}.cpp will be added later
DAEMON_SRC = $(COMMON_SRC) \ DAEMON_SRC = $(COMMON_SRC) \
BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp SOCKS.cpp UPnP.cpp \ BOB.cpp ClientContext.cpp Daemon.cpp I2PTunnel.cpp SAM.cpp SOCKS.cpp UPnP.cpp \

Loading…
Cancel
Save