added key for build under win32
This commit is contained in:
parent
ecc8275674
commit
e6dd64a9ea
30
configure.ac
30
configure.ac
@ -2,7 +2,7 @@ dnl Process this file with autoconf to produce a configure script.
|
||||
|
||||
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_HEADERS([config.h])
|
||||
@ -15,11 +15,6 @@ AC_PROG_CC
|
||||
|
||||
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 ***** options *****
|
||||
dnl *****************
|
||||
@ -33,6 +28,29 @@ AS_IF([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([
|
||||
Makefile
|
||||
lib/libsntl.pc
|
||||
|
@ -10,21 +10,34 @@ AM_CPPFLAGS = \
|
||||
|
||||
AM_CFLAGS = -Wall -g
|
||||
|
||||
#LIBS += $(ZOFFICE_LIBS)
|
||||
if !BUILD_WIN32
|
||||
LIBS += $(ZOFFICE_LIBS)
|
||||
endif !BUILD_WIN32
|
||||
|
||||
libsntl = ../lib/.libs/libsntl.la
|
||||
|
||||
bin_PROGRAMS = sntlc
|
||||
#sntld_SOURCES = sntld.c
|
||||
#sntld_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
|
||||
# $(LIBUUID_LIBS) $(libsntl) -lws2_32
|
||||
|
||||
if !BUILD_WIN32
|
||||
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_LDADD = $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
|
||||
$(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 = \
|
||||
# -Wl,--export-dynamic
|
||||
|
@ -18,8 +18,11 @@ libsntl_la_SOURCES = \
|
||||
|
||||
libsntl_la_LDFLAGS = -Wl,--export-dynamic
|
||||
|
||||
libsntl_la_LIBADD = -lpthread -lcrypto $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS) \
|
||||
-luuid
|
||||
libsntl_la_LIBADD = -lpthread -lcrypto $(LIBTDATA_LIBS) $(LIBSEXPR_LIBS) $(OPENSSL_LIBS)
|
||||
|
||||
if BUILD_WIN32
|
||||
libsntl_la_LIBADD += -luuid
|
||||
endif BUILD_WIN32
|
||||
|
||||
pkgconfigdir = $(libdir)/pkgconfig
|
||||
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;
|
||||
|
||||
/* First we make the socket nonblocking */
|
||||
#ifndef WIN32
|
||||
ofcmode = fcntl(rfd, F_GETFL,0);
|
||||
ofcmode |= O_NDELAY;
|
||||
if(fcntl(rfd, F_SETFL, ofcmode))
|
||||
fprintf(stderr, "Couldn't make socket nonblocking");
|
||||
#endif
|
||||
|
||||
__retry:
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user