added key for build under win32

v0.5.xx
unknown 10 years ago
parent ecc8275674
commit e6dd64a9ea

@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
AC_INIT(libsntl, 0.1) AC_INIT(libsntl, 0.1)
LDFLAGS="$LDFLAGS -L/mingw/lib -L/local/lib" #LDFLAGS="$LDFLAGS -L/mingw/lib -L/local/lib"
AC_CONFIG_MACRO_DIR(['/share/aclocal/']) AC_CONFIG_MACRO_DIR(['/share/aclocal/'])
AC_CONFIG_HEADERS([config.h]) AC_CONFIG_HEADERS([config.h])
@ -15,11 +15,6 @@ AC_PROG_CC
LT_INIT LT_INIT
PKG_CHECK_MODULES(OPENSSL, [openssl])
dnl PKG_CHECK_MODULES(LIBUUID, [uuid])
PKG_CHECK_MODULES(LIBTDATA, [libtdata])
PKG_CHECK_MODULES(LIBSEXPR, [libsexpr])
dnl ***************** dnl *****************
dnl ***** options ***** dnl ***** options *****
dnl ***************** dnl *****************
@ -33,6 +28,29 @@ AS_IF([test "x$enable_build_examples" = "xyes"], [
AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_build_examples" = "xyes") AM_CONDITIONAL(BUILD_EXAMPLES, test "x$enable_build_examples" = "xyes")
dnl ************win32*********
AC_ARG_ENABLE([win32],
AS_HELP_STRING([--enable-win32-build], [Enable win32 build mode]))
AS_IF([test "x$enable_win32_build" = "xyes"], [
AC_DEFINE([BUILD_WIN32], 1, [build for win32]),
LDFLAGS="$LDFLAGS -L/mingw/lib -L/local/lib"
],
[
PKG_CHECK_MODULES(LIBUUID, [uuid])
]
)
PKG_CHECK_MODULES(OPENSSL, [openssl])
dnl PKG_CHECK_MODULES(LIBUUID, [uuid])
PKG_CHECK_MODULES(LIBTDATA, [libtdata])
PKG_CHECK_MODULES(LIBSEXPR, [libsexpr])
AM_CONDITIONAL(BUILD_WIN32, test "x$enable_win32_build" = "xyes")
AC_OUTPUT([ AC_OUTPUT([
Makefile Makefile
lib/libsntl.pc lib/libsntl.pc

@ -10,21 +10,34 @@ AM_CPPFLAGS = \
AM_CFLAGS = -Wall -g AM_CFLAGS = -Wall -g
#LIBS += $(ZOFFICE_LIBS) if !BUILD_WIN32
LIBS += $(ZOFFICE_LIBS)
endif !BUILD_WIN32
libsntl = ../lib/.libs/libsntl.la libsntl = ../lib/.libs/libsntl.la
bin_PROGRAMS = sntlc bin_PROGRAMS = sntlc
#sntld_SOURCES = sntld.c
#sntld_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ if !BUILD_WIN32
# $(LIBUUID_LIBS) $(libsntl) -lws2_32 sntld_SOURCES = sntld.c
sntld_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
$(LIBUUID_LIBS) $(libsntl)
sntlc_SOURCES = sntlc.c
sntlc_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
$(LIBUUID_LIBS) $(libsntl)
gentest_SOURCES = gentest.c
gentest_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
$(LIBUUID_LIBS) $(libsntl)
else BUILD_WIN32
sntlc_SOURCES = sntlc.c sntlc_SOURCES = sntlc.c
sntlc_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ sntlc_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
$(LIBUUID_LIBS) $(libsntl) -lws2_32 $(LIBUUID_LIBS) $(libsntl) -lws2_32
#gentest_SOURCES = gentest.c
#gentest_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
# $(LIBUUID_LIBS) $(libsntl)
endif BUILD_WIN32
#zsyncd_LDFLAGS = \ #zsyncd_LDFLAGS = \
# -Wl,--export-dynamic # -Wl,--export-dynamic

@ -18,8 +18,11 @@ libsntl_la_SOURCES = \
libsntl_la_LDFLAGS = -Wl,--export-dynamic libsntl_la_LDFLAGS = -Wl,--export-dynamic
libsntl_la_LIBADD = -lpthread -lcrypto $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \ libsntl_la_LIBADD = -lpthread -lcrypto $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS)
-luuid
if BUILD_WIN32
libsntl_la_LIBADD += -luuid
endif BUILD_WIN32
pkgconfigdir = $(libdir)/pkgconfig pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = libsntl.pc pkgconfig_DATA = libsntl.pc

@ -93,10 +93,12 @@ static int __conn_read(conn_t *co, void *buf, size_t buf_len)
int ofcmode, read_blocked = 0, read_blocked_on_write = 0; int ofcmode, read_blocked = 0, read_blocked_on_write = 0;
/* First we make the socket nonblocking */ /* First we make the socket nonblocking */
#ifndef WIN32
ofcmode = fcntl(rfd, F_GETFL,0); ofcmode = fcntl(rfd, F_GETFL,0);
ofcmode |= O_NDELAY; ofcmode |= O_NDELAY;
if(fcntl(rfd, F_SETFL, ofcmode)) if(fcntl(rfd, F_SETFL, ofcmode))
fprintf(stderr, "Couldn't make socket nonblocking"); fprintf(stderr, "Couldn't make socket nonblocking");
#endif
__retry: __retry:

Loading…
Cancel
Save