Make for Freebsd

This commit is contained in:
云风
2013-05-08 17:26:43 +08:00
parent 79c92bbf10
commit fdb37bc110
7 changed files with 15 additions and 3 deletions

View File

@@ -1,16 +1,20 @@
.PHONY : all clean .PHONY : all clean
CFLAGS = -g -Wall CFLAGS = -g -Wall
LDFLAGS = -lpthread -llua -ldl -lm LDFLAGS = -lpthread -llua -lm
uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not') uname_S := $(shell sh -c 'uname -s 2>/dev/null || echo not')
ifeq ($(uname_S), Darwin) ifeq ($(uname_S), Darwin)
SHARED = -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup SHARED = -fPIC -dynamiclib -Wl,-undefined,dynamic_lookup
else else
LDFLAGS += -ldl -lrt -Wl,-E LDFLAGS += -lrt -Wl,-E
SHARED = -fPIC --shared SHARED = -fPIC --shared
endif endif
ifneq ($(uname_S), FreeBSD)
LDFLAGS += -ldl
endif
all : \ all : \
skynet \ skynet \
service/snlua.so \ service/snlua.so \

View File

@@ -1,4 +1,5 @@
#include <pthread.h> #include <pthread.h>
#include <netinet/in.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>

View File

@@ -7,6 +7,7 @@
#include <string.h> #include <string.h>
#include <assert.h> #include <assert.h>
#include <netinet/in.h>
#include <sys/uio.h> #include <sys/uio.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>

View File

@@ -1,6 +1,7 @@
#include "skynet.h" #include "skynet.h"
#include "mread.h" #include "mread.h"
#include <netinet/in.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <unistd.h> #include <unistd.h>
#include <stdlib.h> #include <stdlib.h>

View File

@@ -15,13 +15,16 @@
#endif #endif
/* ! Test for polling API */ /* ! Test for polling API */
#include <sys/types.h>
#ifdef HAVE_EPOLL #ifdef HAVE_EPOLL
#include <sys/epoll.h> #include <sys/epoll.h>
#elif HAVE_KQUEUE #elif HAVE_KQUEUE
#include <sys/event.h> #include <sys/event.h>
#endif #endif
#include <sys/types.h> #include <netinet/in.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <unistd.h> #include <unistd.h>

View File

@@ -1,6 +1,7 @@
#include "skynet.h" #include "skynet.h"
#include "skynet_harbor.h" #include "skynet_harbor.h"
#include <netinet/in.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>

View File

@@ -1,6 +1,7 @@
#include "skynet.h" #include "skynet.h"
#include "skynet_harbor.h" #include "skynet_harbor.h"
#include <netinet/in.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/socket.h> #include <sys/socket.h>
#include <arpa/inet.h> #include <arpa/inet.h>