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/process.o src/syslog.o \
src/bit.o src/binary.o src/fs.o src/user.o \
- src/tls-crypto.o src/tls-context.o src/tls-socket.o
+ $(if $(NIXIO_TLS),src/tls-crypto.o src/tls-context.o src/tls-socket.o,)
ifeq ($(NIXIO_TLS),axtls)
TLS_CFLAGS = -IaxTLS/ssl -IaxTLS/crypto -IaxTLS/config -include src/axtls-compat.h
NIXIO_OBJ += src/cyassl-compat.o
endif
+ifeq ($(NIXIO_TLS),)
+ NIXIO_CFLAGS += -DNO_TLS
+endif
+
ifeq ($(OS),SunOS)
NIXIO_LDFLAGS += -lsocket -lnsl -lsendfile
%.o: %.c
$(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) -c -o $@ $<
+ifneq ($(NIXIO_TLS),)
src/tls-crypto.o: $(TLS_DEPENDS) src/tls-crypto.c
$(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/tls-crypto.c
$(COMPILE) $(NIXIO_CFLAGS) $(LUA_CFLAGS) $(FPIC) $(TLS_CFLAGS) -c -o $@ src/axtls-compat.c
mkdir -p dist
cp -pR axtls-root/* dist/
-
+endif
compile: $(NIXIO_OBJ)
$(LINK) $(SHLIB_FLAGS) $(NIXIO_LDFLAGS) -o src/$(NIXIO_SO) $(NIXIO_OBJ) $(NIXIO_LDFLAGS_POST)
return self:copy(fd, size)
end
-function tls_socket.close(self)
- return self.socket:close()
-end
+if tls_socket then
+ function tls_socket.close(self)
+ return self.socket:close()
+ end
-function tls_socket.getsockname(self)
- return self.socket:getsockname()
-end
+ function tls_socket.getsockname(self)
+ return self.socket:getsockname()
+ end
-function tls_socket.getpeername(self)
- return self.socket:getpeername()
-end
+ function tls_socket.getpeername(self)
+ return self.socket:getpeername()
+ end
-function tls_socket.getsockopt(self, ...)
- return self.socket:getsockopt(...)
-end
-tls_socket.getopt = tls_socket.getsockopt
+ function tls_socket.getsockopt(self, ...)
+ return self.socket:getsockopt(...)
+ end
+ tls_socket.getopt = tls_socket.getsockopt
-function tls_socket.setsockopt(self, ...)
- return self.socket:setsockopt(...)
+ function tls_socket.setsockopt(self, ...)
+ return self.socket:setsockopt(...)
+ end
+ tls_socket.setopt = tls_socket.setsockopt
end
-tls_socket.setopt = tls_socket.setsockopt
for k, v in pairs(meta) do
file[k] = v
socket[k] = v
- tls_socket[k] = v
+ if tls_socket then
+ tls_socket[k] = v
+ end
end
void nixio_open_bin(lua_State *L);
void nixio_open_fs(lua_State *L);
void nixio_open_user(lua_State *L);
+
+#ifndef NO_TLS
void nixio_open_tls_crypto(lua_State *L);
void nixio_open_tls_context(lua_State *L);
void nixio_open_tls_socket(lua_State *L);
+#endif
/* Method functions */