summaryrefslogtreecommitdiffhomepage
path: root/libs/nixio/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'libs/nixio/Makefile')
-rw-r--r--libs/nixio/Makefile20
1 files changed, 13 insertions, 7 deletions
diff --git a/libs/nixio/Makefile b/libs/nixio/Makefile
index 57ff99a9e..d58162fcd 100644
--- a/libs/nixio/Makefile
+++ b/libs/nixio/Makefile
@@ -6,10 +6,12 @@ AXTLS_VERSION = 1.2.1
AXTLS_DIR = axTLS
AXTLS_FILE = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
NIXIO_TLS ?= axtls
+EXTRA_CFLAGS = -std=c99
+NIXIO_CFLAGS = -D_XOPEN_SOURCE=500
NIXIO_OBJ = src/nixio.o src/socket.o src/sockopt.o src/bind.o src/address.o \
- src/poll.o src/io.o src/file.o src/splice.o src/tls-context.o \
- src/tls-socket.o
+ src/poll.o src/io.o src/file.o src/splice.o src/process.o \
+ src/tls-context.o src/tls-socket.o
ifeq ($(NIXIO_TLS),axtls)
TLS_CFLAGS = -IaxTLS/{ssl,crypto,config} -include src/openssl-compat.h
@@ -22,17 +24,21 @@ ifeq ($(NIXIO_TLS),openssl)
TLS_LDFLAGS = -lssl
endif
+ifeq ($(OS),Linux)
+ NIXIO_CFLAGS = -D_GNU_SOURCE
+endif
+
%.o: %.c
- $(COMPILE) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<
+ $(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<
src/tls-context.o: $(TLS_DEPENDS) src/tls-context.c
- $(COMPILE) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/tls-context.c
+ $(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/tls-context.c
src/tls-socket.o: $(TLS_DEPENDS) src/tls-socket.c
- $(COMPILE) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/tls-socket.c
+ $(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/tls-socket.c
src/openssl-compat.o: src/libaxtls.a src/openssl-compat.c
- $(COMPILE) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/openssl-compat.c
+ $(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/openssl-compat.c
compile: $(NIXIO_OBJ)
@@ -47,7 +53,7 @@ $(AXTLS_DIR)/.prepared:
touch $@
src/libaxtls.a: $(AXTLS_DIR)/.prepared
- $(MAKE) -C $(AXTLS_DIR) CC=$(CC) CFLAGS="$(CFLAGS) $(EXTRA_CFLAGS) $(FPIC) -Wall -pedantic -I../config -I../ssl -I../crypto" LDFLAGS="$(LDFLAGS)" OS="$(OS)" clean all
+ $(MAKE) -C $(AXTLS_DIR) CC=$(CC) CFLAGS="$(CFLAGS) $(EXTRA_CFLAGS) $(FPIC) '-Dalloca(size)=__builtin_alloca(size)' -Wall -pedantic -I../config -I../ssl -I../crypto" LDFLAGS="$(LDFLAGS)" OS="$(OS)" clean all
cp -p $(AXTLS_DIR)/_stage/libaxtls.a src
clean: luaclean