Commit 2098b6ff authored by Martti Mela's avatar Martti Mela

mingw mods

darcs-hash:20060302124401-1b897-03593dc64500c96033ca17457b08052616267d53.gz
parent 439b5371
...@@ -73,7 +73,8 @@ if test x$enable_stun = xno ; then ...@@ -73,7 +73,8 @@ if test x$enable_stun = xno ; then
AC_MSG_WARN([** STUN support disabled **]) AC_MSG_WARN([** STUN support disabled **])
elif test x${HAVE_OPENSSL} != x1 ; then elif test x${HAVE_OPENSSL} != x1 ; then
dnl compile STUN only if OPENSSL is available dnl compile STUN only if OPENSSL is available
AC_MSG_WARN([** STUN support disabled as OpenSSL headers and/or libraries were not found **]) AC_MSG_WARN([** TLS support for STUN disabled as OpenSSL headers and/or libraries were not found **])
AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define as 1 if we use STUN library])
else else
AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define as 1 if we use STUN library]) AC_DEFINE([HAVE_SOFIA_STUN], 1, [Define as 1 if we use STUN library])
fi fi
......
...@@ -15,7 +15,7 @@ INCLUDES = -I$(srcdir)/../su -I../su ...@@ -15,7 +15,7 @@ INCLUDES = -I$(srcdir)/../su -I../su
# ---------------------------------------------------------------------- # ----------------------------------------------------------------------
# Build targets # Build targets
if HAVE_TLS # if HAVE_TLS
stun_lib_sources = stun.c stun_common.c stun_lib_sources = stun.c stun_common.c
stun_prog_targets = stunc torture_stun stun_prog_targets = stunc torture_stun
else else
......
...@@ -52,7 +52,9 @@ ...@@ -52,7 +52,9 @@
#include <sofia-sip/su.h> #include <sofia-sip/su.h>
#include <sofia-sip/su_localinfo.h> #include <sofia-sip/su_localinfo.h>
#if defined(HAVE_OPENSSL)
#include <openssl/opensslv.h> #include <openssl/opensslv.h>
#endif
/* Missing socket symbols */ /* Missing socket symbols */
#ifndef SOL_TCP #ifndef SOL_TCP
...@@ -182,8 +184,14 @@ struct stun_handle_s ...@@ -182,8 +184,14 @@ struct stun_handle_s
su_localinfo_t sh_localinfo; /**< local addrinfo */ su_localinfo_t sh_localinfo; /**< local addrinfo */
su_sockaddr_t sh_local_addr[1]; /**< local address */ su_sockaddr_t sh_local_addr[1]; /**< local address */
#if defined(HAVE_OPENSSL)
SSL_CTX *sh_ctx; /**< SSL context for TLS */ SSL_CTX *sh_ctx; /**< SSL context for TLS */
SSL *sh_ssl; /**< SSL handle for TLS */ SSL *sh_ssl; /**< SSL handle for TLS */
#else
void *sh_ctx; /**< SSL context for TLS */
void *sh_ssl; /**< SSL handle for TLS */
#endif
stun_msg_t sh_tls_request; stun_msg_t sh_tls_request;
stun_msg_t sh_tls_response; stun_msg_t sh_tls_response;
int sh_nattype; /**< NAT-type, see stun_common.h */ int sh_nattype; /**< NAT-type, see stun_common.h */
...@@ -258,8 +266,13 @@ int stun_lifetime(stun_discovery_t *sd) ...@@ -258,8 +266,13 @@ int stun_lifetime(stun_discovery_t *sd)
} }
#if defined(HAVE_OPENSSL)
char const stun_version[] = char const stun_version[] =
"sofia-sip-stun using " OPENSSL_VERSION_TEXT; "sofia-sip-stun using " OPENSSL_VERSION_TEXT;
#else
char const stun_version[] =
"sofia-sip-stun";
#endif
int do_action(stun_handle_t *sh, stun_msg_t *binding_response); int do_action(stun_handle_t *sh, stun_msg_t *binding_response);
int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg); int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg);
...@@ -417,7 +430,7 @@ stun_handle_t *stun_handle_create(stun_magic_t *context, ...@@ -417,7 +430,7 @@ stun_handle_t *stun_handle_create(stun_magic_t *context,
return stun; return stun;
} }
#if defined(HAVE_OPENSSL)
/** Shared secret request/response processing */ /** Shared secret request/response processing */
int stun_handle_request_shared_secret(stun_handle_t *sh) int stun_handle_request_shared_secret(stun_handle_t *sh)
{ {
...@@ -509,6 +522,12 @@ int stun_handle_request_shared_secret(stun_handle_t *sh) ...@@ -509,6 +522,12 @@ int stun_handle_request_shared_secret(stun_handle_t *sh)
return 0; return 0;
} }
#else
int stun_handle_request_shared_secret(stun_handle_t *sh)
{
return 0;
}
#endif /* HAVE_OPENSSL */
stun_request_t *stun_request_create(stun_discovery_t *sd) stun_request_t *stun_request_create(stun_discovery_t *sd)
...@@ -762,7 +781,6 @@ static int get_localinfo(su_localinfo_t *clientinfo) ...@@ -762,7 +781,6 @@ static int get_localinfo(su_localinfo_t *clientinfo)
return 0; return 0;
} }
#endif
/** Bind a socket using STUN client. /** Bind a socket using STUN client.
...@@ -995,6 +1013,7 @@ int stun_handle_get_nattype(stun_handle_t *sh, ...@@ -995,6 +1013,7 @@ int stun_handle_get_nattype(stun_handle_t *sh,
* Internal functions * Internal functions
*******************************************************************/ *******************************************************************/
#if defined(HAVE_OPENSSL)
int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg) int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg)
{ {
stun_discovery_t *sd = arg; stun_discovery_t *sd = arg;
...@@ -1242,8 +1261,15 @@ int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg) ...@@ -1242,8 +1261,15 @@ int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg)
return 0; return 0;
} }
#else
int stun_tls_callback(su_root_magic_t *m, su_wait_t *w, su_wakeup_arg_t *arg)
{
return 0;
}
#endif /* HAVE_OPENSSL */
#if defined(HAVE_OPENSSL)
void stun_tls_connect_timer_cb(su_root_magic_t *magic, void stun_tls_connect_timer_cb(su_root_magic_t *magic,
su_timer_t *t, su_timer_t *t,
su_timer_arg_t *arg) su_timer_arg_t *arg)
...@@ -1269,7 +1295,12 @@ void stun_tls_connect_timer_cb(su_root_magic_t *magic, ...@@ -1269,7 +1295,12 @@ void stun_tls_connect_timer_cb(su_root_magic_t *magic,
return; return;
} }
#else
void stun_tls_connect_timer_cb(su_root_magic_t *magic,
su_timer_t *t,
su_timer_arg_t *arg)
{
#endif /* HAVE_OPENSSL */
/** Compose a STUN message of the format defined by stun_msg_t /** Compose a STUN message of the format defined by stun_msg_t
* result encoded in enc_buf ready for sending as well. * result encoded in enc_buf ready for sending as well.
......
...@@ -404,6 +404,7 @@ int stun_encode_buffer(stun_attr_t *attr) { ...@@ -404,6 +404,7 @@ int stun_encode_buffer(stun_attr_t *attr) {
return attr->enc_buf.size; return attr->enc_buf.size;
} }
#if defined(HAVE_OPENSSL)
int stun_encode_message_integrity(stun_attr_t *attr, int stun_encode_message_integrity(stun_attr_t *attr,
unsigned char *buf, unsigned char *buf,
int len, int len,
...@@ -427,6 +428,15 @@ int stun_encode_message_integrity(stun_attr_t *attr, ...@@ -427,6 +428,15 @@ int stun_encode_message_integrity(stun_attr_t *attr,
free(padded_text); free(padded_text);
return attr->enc_buf.size; return attr->enc_buf.size;
} }
#else
int stun_encode_message_integrity(stun_attr_t *attr,
unsigned char *buf,
int len,
stun_buffer_t *pwd) {
return 0;
}
#endif /* HAVE_OPENSSL */
/** this function allocates the enc_buf, fills in type, length */ /** this function allocates the enc_buf, fills in type, length */
int stun_encode_type_len(stun_attr_t *attr, uint16_t len) { int stun_encode_type_len(stun_attr_t *attr, uint16_t len) {
......
...@@ -119,7 +119,7 @@ static struct gai_afd { ...@@ -119,7 +119,7 @@ static struct gai_afd {
#if !SU_HAVE_IN6 #if !SU_HAVE_IN6
extern extern
#if defined(_WIN32) || defined(__CYGWIN__) #if defined(_WIN32) || defined(__CYGWIN__) || defined(__MINGW32__)
__declspec(dllimport) __declspec(dllimport)
#endif #endif
int h_errno; int h_errno;
...@@ -617,10 +617,6 @@ get_addr(hostname, af, res, pai, port0) ...@@ -617,10 +617,6 @@ get_addr(hostname, af, res, pai, port0)
return error; return error;
} }
#endif /* !HAVE_GETADDRINFO */
#if !HAVE_GETNAMEINFO
/* /*
* Issues to be discussed: * Issues to be discussed:
* - Thread safe-ness must be checked * - Thread safe-ness must be checked
...@@ -883,7 +879,7 @@ int su_getaddrinfo(char const *node, char const *service, ...@@ -883,7 +879,7 @@ int su_getaddrinfo(char const *node, char const *service,
su_addrinfo_t const *hints, su_addrinfo_t const *hints,
su_addrinfo_t **res) su_addrinfo_t **res)
{ {
#if HAVE_SCTP #if HAVE_SCTP && SU_HAVE_GETADDRINFO
if (res && hints && hints->ai_protocol == IPPROTO_SCTP) { if (res && hints && hints->ai_protocol == IPPROTO_SCTP) {
su_addrinfo_t *ai, system_hints[1]; su_addrinfo_t *ai, system_hints[1];
int retval, socktype; int retval, socktype;
......
...@@ -345,10 +345,12 @@ gboolean su_source_check(GSource *gs) ...@@ -345,10 +345,12 @@ gboolean su_source_check(GSource *gs)
I = self->sup_n_waits; I = self->sup_n_waits;
#if SU_HAVE_POLL
for (i = 0; i < I; i++) { for (i = 0; i < I; i++) {
if (self->sup_waits[i].revents) if (self->sup_waits[i].revents)
return TRUE; return TRUE;
} }
#endif
return su_source_prepare(gs, &tout); return su_source_prepare(gs, &tout);
} }
...@@ -382,6 +384,7 @@ gboolean su_source_dispatch(GSource *gs, ...@@ -382,6 +384,7 @@ gboolean su_source_dispatch(GSource *gs,
timers = su_timer_expire(&self->sup_timers, &tout, now); timers = su_timer_expire(&self->sup_timers, &tout, now);
} }
#if SU_HAVE_POLL
{ {
su_root_t *root; su_root_t *root;
su_wait_t *waits = self->sup_waits; su_wait_t *waits = self->sup_waits;
...@@ -400,6 +403,7 @@ gboolean su_source_dispatch(GSource *gs, ...@@ -400,6 +403,7 @@ gboolean su_source_dispatch(GSource *gs,
} }
} }
} }
#endif
if (!callback) if (!callback)
return TRUE; return TRUE;
...@@ -996,7 +1000,7 @@ su_duration_t su_source_step(su_port_t *self, su_duration_t tout) ...@@ -996,7 +1000,7 @@ su_duration_t su_source_step(su_port_t *self, su_duration_t tout)
if (tout < timeout) if (tout < timeout)
timeout = tout; timeout = tout;
i = poll((struct pollfd *)fds, n, timeout); i = su_wait((su_wait_t *)fds, n, timeout);
if (g_main_context_check(gmc, priority, fds, n)) if (g_main_context_check(gmc, priority, fds, n))
g_main_context_dispatch(gmc); g_main_context_dispatch(gmc);
......
...@@ -48,7 +48,13 @@ ...@@ -48,7 +48,13 @@
#include <sys/time.h> /* Get struct timeval */ #include <sys/time.h> /* Get struct timeval */
#endif #endif
#if HAVE_FILETIME #if defined(__MINGW32__)
#define HAVE_FILETIME 1
#include <windows.h>
#endif
#if HAVE_FILETIME
#define HAVE_FILETIME 1
#include <windows.h> #include <windows.h>
#endif #endif
......
...@@ -78,8 +78,13 @@ typedef struct tport_nat_s tport_nat_t; ...@@ -78,8 +78,13 @@ typedef struct tport_nat_s tport_nat_t;
#include <sofia-sip/su_wait.h> #include <sofia-sip/su_wait.h>
#include <sofia-sip/msg.h> #include <msg.h>
#include <sofia-sip/msg_addr.h> #include <msg_addr.h>
#if !HAVE_RANDOM
#define random() rand()
#define srandom(x) srand(x)
#endif
#if HAVE_IP_RECVERR || HAVE_IPV6_RECVERR #if HAVE_IP_RECVERR || HAVE_IPV6_RECVERR
#include <linux/types.h> #include <linux/types.h>
...@@ -258,7 +263,6 @@ struct tport_s { ...@@ -258,7 +263,6 @@ struct tport_s {
stun_socket_t *tp_stun_socket; stun_socket_t *tp_stun_socket;
#endif #endif
su_socket_t tp_stun_socket; su_socket_t tp_stun_socket;
int tp_has_keepalive;
#endif #endif
/* ==== Receive queue ================================================== */ /* ==== Receive queue ================================================== */
...@@ -7022,7 +7026,7 @@ tport_nat_initialize_nat_traversal(tport_master_t *mr, ...@@ -7022,7 +7026,7 @@ tport_nat_initialize_nat_traversal(tport_master_t *mr,
for (i = 0; stun_transports[i]; i++) { for (i = 0; stun_transports[i]; i++) {
if ((strcmp(tpn->tpn_proto, "*") == 0 || if ((strcmp(tpn->tpn_proto, "*") == 0 ||
strcasecmp(tpn->tpn_proto, stun_transports[i]) == 0)) { strcasecmp(tpn->tpn_proto, stun_transports[i]) == 0)) {
SU_DEBUG_5(("%s(%p) creating STUN handle\n", __func__, mr)); SU_DEBUG_5(("%s(%p) starting STUN engine\n", __func__, mr));
nat->stun = stun_handle_create(mr, nat->stun = stun_handle_create(mr,
mr->mr_root, mr->mr_root,
......
...@@ -432,6 +432,36 @@ fi ...@@ -432,6 +432,36 @@ fi
AM_CONDITIONAL(EXPENSIVE_CHECKS, test x$enable_expensive_checks != no) AM_CONDITIONAL(EXPENSIVE_CHECKS, test x$enable_expensive_checks != no)
]) ])
dnl ======================================================================
dnl Check if we are using Windows with MinGW compiler
dnl ======================================================================
AC_DEFUN([AC_CHECK_COMPILATION_ENVIRONMENT], [
AC_REQUIRE([AC_PROG_CC])
AC_CACHE_CHECK([for compilation environment],
ac_cc_environment, [
machine=`$CC -dumpmachine`
if test $machine == "mingw32" ; then
ac_cc_environment=$machine
fi
])
if test X$ac_cc_environment == "Xmingw32" ; then
CFLAGS="$CFLAGS -I\$(top_srcdir)/win32/pthread -DWINVER=0x0501 \
-D_WIN32_WINNT=0x0501 -DIN_LIBSOFIA_SIP_UA -mms-bitfields \
-pipe -mno-cygwin -mwindows -mconsole -Wall -g -O0"
LDFLAGS="$LDFLAGS -Wl,--enable-auto-image-base"
LIBS="-L\$(top_srcdir)/win32/pthread -lpthread -lws2_32 \
-lwsock32"
AC_SUBST(MINGW_ENVIRONMENT)
AC_DEFINE([HAVE_MINGW], [1], [Define this as 1 if you are compiling in MinGW environment])
AC_DEFINE([HAVE_WIN32], [1], [Define this as 1 if you have WIN32])
fi
AM_CONDITIONAL([HAVE_MINGW32], [test "x$ac_cc_environment" != x])
])dnl
dnl ====================================================================== dnl ======================================================================
dnl Find long long (at least 64 bits) dnl Find long long (at least 64 bits)
dnl ====================================================================== dnl ======================================================================
......
...@@ -17,7 +17,7 @@ AC_REQUIRE([SAC_WITH_RT]) ...@@ -17,7 +17,7 @@ AC_REQUIRE([SAC_WITH_RT])
# Check for features used by su # Check for features used by su
dnl Define compilation options for su_configure.h dnl Define compilation options for su_configure.h
SAC_SU_DEFINE([SU_HAVE_BSDSOCK], 1, [Define as 1 if you have BSD socket interface]) dnl SAC_SU_DEFINE([SU_HAVE_BSDSOCK], 1, [Define as 1 if you have BSD socket interface])
case "$target" in case "$target" in
*-*-solaris?.* ) *-*-solaris?.* )
...@@ -59,9 +59,15 @@ if $ax_inttypes; then : ; else ...@@ -59,9 +59,15 @@ if $ax_inttypes; then : ; else
AC_MSG_ERROR("No <stdint.h> or <inttypes.h> found.") AC_MSG_ERROR("No <stdint.h> or <inttypes.h> found.")
fi fi
if test "x$MINGW_ENVIRONMENT" != x1 ; then
AC_CHECK_HEADER(pthread.h, AC_CHECK_HEADER(pthread.h,
HAVE_PTHREADS=1; HAVE_PTHREADS=1;
SAC_SU_DEFINE([SU_HAVE_PTHREADS], 1, [Sofia SU uses pthreads])) SAC_SU_DEFINE([SU_HAVE_PTHREADS], 1, [Sofia SU uses pthreads]))
else
AC_DEFINE([HAVE_PTHREAD_H], 1, [Define to 1 if you have the <pthread.h> header file.])
AC_DEFINE([HAVE_PTHREADS], 1, [Define as 1 you have PTHREADS])
SAC_SU_DEFINE([SU_HAVE_PTHREADS], 1, [Sofia SU uses pthreads])
fi
dnl =========================================================================== dnl ===========================================================================
dnl Checks for typedefs, headers, structures, and compiler characteristics. dnl Checks for typedefs, headers, structures, and compiler characteristics.
...@@ -111,25 +117,29 @@ yes) SAC_SU_DEFINE(SU_HAVE_IN6, 1, [ ...@@ -111,25 +117,29 @@ yes) SAC_SU_DEFINE(SU_HAVE_IN6, 1, [
esac esac
AC_CHECK_HEADERS([unistd.h sys/time.h]) AC_CHECK_HEADERS([unistd.h sys/time.h])
AC_CHECK_HEADERS([sys/socket.h sys/ioctl.h sys/filio.h sys/sockio.h])
AC_CHECK_HEADERS([netinet/in.h arpa/inet.h netdb.h \
net/if.h net/if_types.h ifaddr.h],,,
[sys/types.h sys/socket.h])
AC_CACHE_CHECK([for struct addrinfo],
[ac_cv_struct_addrinfo],[
ac_cv_struct_addrinfo=no
if test "$ac_cv_header_sys_socket_h" = yes; then
AC_EGREP_HEADER([struct.+addrinfo], [netdb.h], [
ac_cv_struct_addrinfo=yes])
else
ac_cv_struct_addrinfo='sys/socket.h missing'
fi])
if test "$ac_cv_struct_addrinfo" = yes; then AC_CHECK_HEADERS([winsock2.h ws2tcpip.h], [
SAC_SU_DEFINE(SU_HAVE_ADDRINFO, 1, SAC_SU_DEFINE([SU_HAVE_WINSOCK], 1, [Define as 1 you have WinSock])
[Define as 1 if you have struct addrinfo.]) SAC_SU_DEFINE([SU_HAVE_WINSOCK2], 1, [Define as 1 you have WinSock2])
fi SAC_SU_DEFINE(SU_HAVE_SOCKADDR_STORAGE, 1,
[Define this as 1 if you have struct sockaddr_storage])
SAC_SU_DEFINE([SU_HAVE_GETADDRINFO], 1,
[Define this as 1 if you have getaddrinfo() function.])
AC_CHECK_HEADERS([windef.h])
AC_CHECK_HEADERS([iphlpapi.h], [
AC_DEFINE([HAVE_INTERFACE_INFO_EX], 1, [
Define this as 1 if you have WIN32 INTERFACE_INFO_EX type.])
AC_DEFINE([HAVE_SIO_ADDRESS_LIST_QUERY], 1, [
Define this as 1 if you have WIN32 WSAIoctl SIO_ADDRESS_LIST_QUERY.])
], [], [#if HAVE_WINDEF_H
#include <windef.h>
#include <winbase.h>
#endif
])
], [
AC_CHECK_HEADERS([sys/socket.h sys/ioctl.h sys/filio.h sys/sockio.h])
AC_CHECK_HEADERS([netinet/in.h arpa/inet.h netdb.h net/if.h net/if_types.h], [], [
SAC_SU_DEFINE([SU_HAVE_BSDSOCK], 1, [Define as 1 if you have BSD socket interface])
AC_CACHE_CHECK([for struct sockaddr_storage], AC_CACHE_CHECK([for struct sockaddr_storage],
[ac_cv_struct_sockaddr_storage],[ [ac_cv_struct_sockaddr_storage],[
...@@ -145,6 +155,14 @@ if test "$ac_cv_struct_sockaddr_storage" = yes; then ...@@ -145,6 +155,14 @@ if test "$ac_cv_struct_sockaddr_storage" = yes; then
[Define this as 1 if you have struct sockaddr_storage]) [Define this as 1 if you have struct sockaddr_storage])
fi fi
# Test for getaddrinfo(), getnameinfo(), freeaddrinfo() and gai_strerror()
AC_CHECK_FUNC([getaddrinfo],[
SAC_SU_DEFINE([SU_HAVE_GETADDRINFO], 1, [
Define this as 1 if you have getaddrinfo() function.
])])
])
])
AC_CACHE_CHECK([for field ifr_index in struct ifreq], AC_CACHE_CHECK([for field ifr_index in struct ifreq],
[ac_cv_struct_ifreq_ifr_index],[ [ac_cv_struct_ifreq_ifr_index],[
ac_cv_struct_ifreq_ifr_index=no ac_cv_struct_ifreq_ifr_index=no
...@@ -219,23 +237,44 @@ else ...@@ -219,23 +237,44 @@ else
HAVE_IFNUM=0 HAVE_IFNUM=0
fi fi
if false; then
# Define Win32 macros
AC_DEFINE([HAVE_IPHLPAPI_H], 1, [Define as 1 you have WIN32 <iphlpapi.h>])
AC_DEFINE([HAVE_INTERFACE_INFO_EX], 1, [
Define this as 1 if you have WIN32 INTERFACE_INFO_EX type.])
AC_DEFINE([HAVE_SIO_ADDRESS_LIST_QUERY], 1, [
Define this as 1 if you have WIN32 WSAIoctl SIO_ADDRESS_LIST_QUERY.])
fi
# =========================================================================== # ===========================================================================
# Checks for libraries # Checks for libraries
# =========================================================================== # ===========================================================================
SAC_CHECK_SU_LIBS SAC_CHECK_SU_LIBS
AC_ARG_WITH(glib-dir,
[ --with-glib-dir=PREFIX explicitly define GLib path],
glib_dir="$withval", glib_dir="no")
#check if GLib path is explicitly defined
if test X$glib_dir != Xno ; then
gprefix=$glib_dir
exec_gprefix=${gprefix}
glibdir=${exec_gprefix}/lib
gincludedir=${gprefix}/include
# glib_genmarshal=glib-genmarshal
# gobject_query=gobject-query
# glib_mkenums=glib-mkenums
# GLIB_LIBS="-L${glibdir} -lglib-2.0 -lintl -liconv"
GLIB_LIBS="-L${glibdir} ${glibdir}/libglib-2.0.dll.a ${glibdir}/libintl.a ${glibdir}/libiconv.a"
GLIB_CFLAGS="-I${gincludedir}/glib-2.0 -I${glibdir}/glib-2.0/include"
# how the hell should I know?
GLIB_VERSION="2.0"
SAC_SU_DEFINE([SU_HAVE_GLIB], 1, [Define as 1 if you have >= glib-2.0])
HAVE_GLIB=yes
AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_CFLAGS)
else
# No GLib path explicitly defined, use pkg-config
AC_ARG_WITH(glib, AC_ARG_WITH(glib,
[ --with-glib=version use GLib (default=2.0)], [ [ --with-glib=version use GLib (default=2.0)], [
case "$with_glib" in case "$with_glib" in
...@@ -250,6 +289,7 @@ SAC_SU_DEFINE([SU_HAVE_GLIB], 1, [Define as 1 if you have >= glib-2.0]) ...@@ -250,6 +289,7 @@ SAC_SU_DEFINE([SU_HAVE_GLIB], 1, [Define as 1 if you have >= glib-2.0])
HAVE_GLIB=yes HAVE_GLIB=yes
]) ])
fi
fi fi
AM_CONDITIONAL([HAVE_GLIB], [test "x$HAVE_GLIB" != x]) AM_CONDITIONAL([HAVE_GLIB], [test "x$HAVE_GLIB" != x])
...@@ -257,6 +297,7 @@ AC_SUBST(GLIB_LIBS) ...@@ -257,6 +297,7 @@ AC_SUBST(GLIB_LIBS)
AC_SUBST(GLIB_CFLAGS) AC_SUBST(GLIB_CFLAGS)
AC_SUBST(GLIB_VERSION) AC_SUBST(GLIB_VERSION)
# =========================================================================== # ===========================================================================
# Checks for library functions. # Checks for library functions.
# =========================================================================== # ===========================================================================
...@@ -274,7 +315,7 @@ if test "${with_rt}" != no; then ...@@ -274,7 +315,7 @@ if test "${with_rt}" != no; then
AC_CHECK_FUNCS([clock_gettime clock_getcpuclockid]) AC_CHECK_FUNCS([clock_gettime clock_getcpuclockid])
fi fi
SAC_REPLACE_FUNCS(memmem memccpy memspn memcspn strcasestr strtoull) SAC_REPLACE_FUNCS(memmem memccpy memspn memcspn strcasestr strtoull inet_ntop inet_pton)
AC_CHECK_FUNC([poll], AC_CHECK_FUNC([poll],
SAC_SU_DEFINE([SU_HAVE_POLL], 1, [ SAC_SU_DEFINE([SU_HAVE_POLL], 1, [
......
# #
# Template for Sofia SIP UA library RPM spec file # Template for Sofia SIP UA RPM spec file
# #
# Options: # Options:
# --with doxygen - Generate documents using doxygen and dot # --with doxygen - Generate documents using doxygen and dot
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment