Skip to content

Commit

Permalink
Merge pull request d5#5 from taf2/master
Browse files Browse the repository at this point in the history
make it easier to compile on OSX
  • Loading branch information
d5 committed Feb 15, 2012
2 parents bea7224 + 1ca19a6 commit 44eb301
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
15 changes: 11 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,22 @@
CXXFLAGS = -std=gnu++0x -g -O0 -I$(LIBUV_PATH)/include -I$(HTTP_PARSER_PATH) -I. -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64

OS=`uname`
ifneq ($(NULL),$(filter Darwin,$(OS)))
RTLIB=-lrt
else
RTLIB=
endif

all: webclient webserver file_test

webclient: webclient.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(wildcard native/*.h)
$(CXX) $(CXXFLAGS) -o webclient webclient.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o -lrt -lm -lpthread
$(CXX) $(CXXFLAGS) -o webclient webclient.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(RTLIB) -lm -lpthread

webserver: webserver.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(wildcard native/*.h)
$(CXX) $(CXXFLAGS) -o webserver webserver.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o -lrt -lm -lpthread
$(CXX) $(CXXFLAGS) -o webserver webserver.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(RTLIB) -lm -lpthread

file_test: file_test.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(wildcard native/*.h)
$(CXX) $(CXXFLAGS) -o file_test file_test.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o -lrt -lm -lpthread
$(CXX) $(CXXFLAGS) -o file_test file_test.cpp $(LIBUV_PATH)/uv.a $(HTTP_PARSER_PATH)/http_parser.o $(RTLIB) -lm -lpthread

$(LIBUV_PATH)/uv.a:
$(MAKE) -C $(LIBUV_PATH)
Expand All @@ -20,4 +27,4 @@ $(HTTP_PARSER_PATH)/http_parser.o:
clean:
rm -f $(LIBUV_PATH)/uv.a
rm -f $(HTTP_PARSER_PATH)/http_parser.o
rm -f webclient webserver file_test
rm -f webclient webserver file_test
4 changes: 4 additions & 0 deletions native/fs.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,12 @@ namespace native
static const int truncate = O_TRUNC;
static const int no_follow = O_NOFOLLOW;
static const int directory = O_DIRECTORY;
#ifdef O_NOATIME
static const int no_access_time = O_NOATIME;
#endif
#ifdef O_LARGEFILE
static const int large_large = O_LARGEFILE;
#endif

namespace internal
{
Expand Down

0 comments on commit 44eb301

Please sign in to comment.