Fixed autoconf in mingw
git-svn-id: https://svn.pjsip.org/repos/pjproject/trunk@699 74dad513-b988-da41-8d7b-12977e46ad98
This commit is contained in:
parent
b466e23e8f
commit
c5b6dbf81f
6894
aconfigure
6894
aconfigure
File diff suppressed because it is too large
Load Diff
|
@ -17,13 +17,50 @@ AC_PROG_CXX
|
|||
AC_LANG_C
|
||||
|
||||
AC_CHECK_LIB(pthread,pthread_create)
|
||||
AC_CHECK_LIB(wsock32,puts)
|
||||
AC_CHECK_LIB(ws2_32,puts)
|
||||
AC_CHECK_LIB(ole32,puts)
|
||||
AC_CHECK_LIB(winmm,puts)
|
||||
AC_CHECK_LIB(socket,puts)
|
||||
AC_CHECK_LIB(rt,puts)
|
||||
AC_CHECK_LIB(nsl,puts)
|
||||
|
||||
AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])
|
||||
AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"])
|
||||
|
||||
dnl # Endianness detection
|
||||
dnl
|
||||
dnl Endianness detection
|
||||
dnl
|
||||
AC_C_BIGENDIAN
|
||||
|
||||
dnl
|
||||
dnl Legacy macros
|
||||
dnl
|
||||
case $target in
|
||||
*mingw* | *cygw* | *win32* | *w32* )
|
||||
AC_DEFINE(PJ_WIN32,1)
|
||||
AC_DEFINE(PJ_WIN32_WINNT,0x0400)
|
||||
AC_DEFINE(WIN32_LEAN_AND_MEAN)
|
||||
;;
|
||||
*darwin*)
|
||||
AC_DEFINE(PJ_DARWINOS,1)
|
||||
;;
|
||||
*linux*)
|
||||
AC_DEFINE(PJ_LINUX,1)
|
||||
;;
|
||||
*rtems*)
|
||||
AC_DEFINE(PJ_RTEMS,1)
|
||||
;;
|
||||
*sunos* | *solaris* )
|
||||
AC_DEFINE(PJ_SUNOS,1)
|
||||
;;
|
||||
*)
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
|
||||
|
||||
dnl # --disable-floating-point option
|
||||
AC_ARG_ENABLE(floating-point,
|
||||
AC_HELP_STRING([--disable-floating-point],
|
||||
|
@ -42,7 +79,16 @@ AC_ARG_ENABLE(floating-point,
|
|||
AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)])
|
||||
AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)])
|
||||
AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)])
|
||||
AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
|
||||
|
||||
case $target in
|
||||
*mingw* | *cygw* | *win32* | *w32* )
|
||||
AC_DEFINE(PJ_HAS_ERRNO_H,0)
|
||||
;;
|
||||
*)
|
||||
AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
|
||||
;;
|
||||
esac
|
||||
|
||||
AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)])
|
||||
AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)])
|
||||
AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
|
||||
|
@ -112,14 +158,23 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <unistd.h>]],
|
|||
|
||||
dnl # Determine if SO_ERROR is available
|
||||
AC_MSG_CHECKING([if SO_ERROR is available])
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>]],
|
||||
[int i=SO_ERROR;])],
|
||||
[AC_DEFINE(PJ_HAS_SO_ERROR,1)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
case $target in
|
||||
*mingw* | *cygw* | *win32* | *w32* )
|
||||
AC_DEFINE(PJ_HAS_SO_ERROR,1)
|
||||
AC_MSG_RESULT(yes)
|
||||
;;
|
||||
*)
|
||||
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
#include <netinet/in.h>
|
||||
#include <arpa/inet.h>]],
|
||||
[int i=SO_ERROR;])],
|
||||
[AC_DEFINE(PJ_HAS_SO_ERROR,1)
|
||||
AC_MSG_RESULT(yes)],
|
||||
AC_MSG_RESULT(no))
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl # Determine if RW-mutex is available
|
||||
AC_MSG_CHECKING([if pthread_rwlock_t is available])
|
||||
|
@ -130,6 +185,16 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
|
|||
[AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
|
||||
AC_MSG_RESULT(no)])
|
||||
|
||||
AC_SUBST(ac_os_objs)
|
||||
case $target in
|
||||
*mingw* | *cygw* | *win32* | *w32* )
|
||||
ac_os_objs="os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o ioqueue_select.o"
|
||||
;;
|
||||
*)
|
||||
ac_os_objs="os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o ioqueue_select.o"
|
||||
;;
|
||||
esac
|
||||
|
||||
|
||||
dnl ##########################################
|
||||
dnl #
|
||||
|
@ -314,6 +379,9 @@ esac
|
|||
dnl # This value specifies the value set in errno by the OS when a non-blocking
|
||||
dnl # socket recv() can not return immediate data.
|
||||
case $target in
|
||||
*mingw* | *cygw* | *win32* | *w32* )
|
||||
AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK)
|
||||
;;
|
||||
*) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
|
||||
AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
|
||||
;;
|
||||
|
@ -322,6 +390,9 @@ esac
|
|||
dnl # This value specifies the value set in errno by the OS when a non-blocking
|
||||
dnl # socket connect() can not get connected immediately.
|
||||
case $target in
|
||||
*mingw* | *cygw* | *win32* | *w32* )
|
||||
AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK)
|
||||
;;
|
||||
*) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
|
||||
AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
|
||||
;;
|
||||
|
|
|
@ -1,17 +1,19 @@
|
|||
# @configure_input@
|
||||
|
||||
# Determine OS specific files
|
||||
AC_OS_OBJS=@ac_os_objs@
|
||||
|
||||
#
|
||||
# PJLIB_OBJS specified here are object files to be included in PJLIB
|
||||
# (the library) for this specific operating system. Object files common
|
||||
# to all operating systems should go in Makefile instead.
|
||||
#
|
||||
export PJLIB_OBJS += addr_resolv_sock.o guid_simple.o \
|
||||
log_writer_stdout.o os_core_unix.o \
|
||||
os_error_unix.o os_time_unix.o \
|
||||
os_timestamp_common.o os_timestamp_posix.o \
|
||||
export PJLIB_OBJS += $(AC_OS_OBJS) \
|
||||
addr_resolv_sock.o \
|
||||
log_writer_stdout.o \
|
||||
os_timestamp_common.o \
|
||||
pool_policy_malloc.o sock_bsd.o sock_select.o
|
||||
|
||||
export PJLIB_OBJS += ioqueue_select.o
|
||||
export PJLIB_OBJS += file_access_unistd.o file_io_ansi.o
|
||||
|
||||
#
|
||||
|
|
|
@ -28,6 +28,19 @@
|
|||
/* Canonical OS name */
|
||||
#undef PJ_OS_NAME
|
||||
|
||||
/* Legacy macros */
|
||||
#undef PJ_WIN32
|
||||
#undef PJ_WIN32_WINNT
|
||||
#undef WIN32_LEAN_AND_MEAN
|
||||
#undef PJ_DARWINOS
|
||||
#undef PJ_LINUX
|
||||
#undef PJ_RTEMS
|
||||
#undef PJ_SUNOS
|
||||
|
||||
#if defined(PJ_WIN32_WINNT) && !defined(_WIN32_WINNT)
|
||||
# define _WIN32_WINNT PJ_WIN32_WINNT
|
||||
#endif
|
||||
|
||||
/* Headers availability */
|
||||
#undef PJ_HAS_ARPA_INET_H
|
||||
#undef PJ_HAS_ASSERT_H
|
||||
|
@ -67,6 +80,7 @@
|
|||
#undef PJ_HAS_SOCKLEN_T
|
||||
|
||||
#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
|
||||
# define PJ_HAS_SOCKLEN_T 1
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -24,14 +24,14 @@
|
|||
* @brief Provides all socket related functions,data types, error codes, etc.
|
||||
*/
|
||||
|
||||
#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0
|
||||
# include <winsock.h>
|
||||
#endif
|
||||
|
||||
#if defined(PJ_HAS_WINSOCK2_H) && PJ_HAS_WINSOCK2_H != 0
|
||||
# include <winsock2.h>
|
||||
#endif
|
||||
|
||||
#if defined(PJ_HAS_WINSOCK_H) && PJ_HAS_WINSOCK_H != 0
|
||||
# include <winsock.h>
|
||||
#endif
|
||||
|
||||
#if defined(PJ_HAS_SYS_TYPES_H) && PJ_HAS_SYS_TYPES_H != 0
|
||||
# include <sys/types.h>
|
||||
#endif
|
||||
|
@ -124,9 +124,10 @@
|
|||
|
||||
|
||||
/*
|
||||
* Windows specific
|
||||
* This will finally be obsoleted, since it should be declared in
|
||||
* os_auto.h
|
||||
*/
|
||||
#if defined(PJ_WIN32) || defined(PJ_WIN32_WINCE)
|
||||
#if !defined(PJ_HAS_SOCKLEN_T) || PJ_HAS_SOCKLEN_T==0
|
||||
typedef int socklen_t;
|
||||
#endif
|
||||
|
||||
|
|
|
@ -79,7 +79,7 @@ static void on_read_complete(pj_ioqueue_key_t *key,
|
|||
}
|
||||
|
||||
if (bytes_read < 0) {
|
||||
if (-bytes_read != PJ_STATUS_FROM_OS(OSERR_EWOULDBLOCK))
|
||||
if (-bytes_read != PJ_STATUS_FROM_OS(PJ_BLOCKING_ERROR_VAL))
|
||||
app_perror("ioqueue reported recv error", -bytes_read);
|
||||
} else {
|
||||
sock_data.received += bytes_read;
|
||||
|
|
|
@ -92,7 +92,7 @@ endif
|
|||
ifeq ($(AC_PJMEDIA_SND),pa_win32)
|
||||
export PJMEDIA_OBJS += $(PA_DIR)/pa_win_hostapis.o $(PA_DIR)/pa_win_util.o \
|
||||
$(PA_DIR)/pa_win_wmme.o
|
||||
export CFLAGS += -DDPA_NO_ASIO -DPA_NO_DS \
|
||||
export CFLAGS += -DPA_NO_ASIO -DPA_NO_DS \
|
||||
-DPJMEDIA_SOUND_IMPLEMENTATION=PJMEDIA_SOUND_PORTAUDIO_SOUND
|
||||
endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue