AXTLS_DIR = axTLS
AXTLS_FILE = $(AXTLS_DIR)-$(AXTLS_VERSION).tar.gz
NIXIO_TLS ?= openssl
+NIXIO_SHADOW ?= $(shell echo 'int main(void){ return !getspnam("root"); }' | $(CC) -include shadow.h -xc -o/dev/null - 2>/dev/null && echo yes)
NIXIO_SO = nixio.so
NIXIO_LDFLAGS =
NIXIO_CFLAGS += -DNO_TLS
endif
+ifneq ($(NIXIO_SHADOW),yes)
+ NIXIO_CFLAGS += -DNO_SHADOW
+endif
+
ifeq ($(OS),SunOS)
NIXIO_LDFLAGS += -lsocket -lnsl -lsendfile
#include <pwd.h>
#ifndef BSD
+#ifndef NO_SHADOW
#include <shadow.h>
+#endif
#include <crypt.h>
#endif
}
#ifndef BSD
+#ifndef NO_SHADOW
static int nixio__push_spwd(lua_State *L, struct spwd *sp) {
lua_createtable(L, 0, 9);
lua_pushstring(L, sp->sp_namp);
return nixio__push_spwd(L, sp);
}
}
+#endif /* !NO_SHADOW */
#endif /* !BSD */
static int nixio_crypt(lua_State *L) {
{"getgr", nixio_getgr},
{"getpw", nixio_getpw},
#ifndef BSD
+#ifndef NO_SHADOW
{"getsp", nixio_getsp},
+#endif
#endif
{NULL, NULL}
};