2007-05-15 21:02:54 +00:00
AC_INIT(pjproject,0.7)
2006-09-17 22:58:51 +00:00
host_orig="$host"
2006-08-20 20:47:34 +00:00
AC_CANONICAL_BUILD
AC_CANONICAL_HOST
2006-07-24 02:07:11 +00:00
AC_CANONICAL_TARGET
2006-08-20 20:47:34 +00:00
AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h
pjlib/include/pj/compat/m_auto.h
2007-01-27 17:44:13 +00:00
pjmedia/include/pjmedia/config_auto.h
pjmedia/include/pjmedia-codec/config_auto.h
2006-12-25 20:34:14 +00:00
pjsip/include/pjsip/sip_autoconf.h
2006-08-20 20:47:34 +00:00
])
AC_CONFIG_FILES([build.mak
build/os-auto.mak
pjlib/build/os-auto.mak
pjlib-util/build/os-auto.mak
pjmedia/build/os-auto.mak
pjsip/build/os-auto.mak
2007-04-18 09:24:31 +00:00
third_party/build/portaudio/os-auto.mak
third_party/build/os-auto.mak
2006-08-20 20:47:34 +00:00
])
2006-09-13 09:38:06 +00:00
2007-03-12 10:44:38 +00:00
2006-09-13 09:38:06 +00:00
dnl
dnl Setup default CFLAGS
dnl
if test "$CFLAGS" = ""; then
2006-10-04 20:56:39 +00:00
CFLAGS="-O2"
2006-09-13 09:38:06 +00:00
else
CFLAGS="$CFLAGS"
fi
CXXFLAGS="$CFLAGS $CXXFLAGS"
2006-07-24 02:07:11 +00:00
AC_PROG_CC
2006-08-20 20:47:34 +00:00
AC_PROG_CXX
2006-07-24 02:07:11 +00:00
AC_LANG_C
2007-03-12 10:44:38 +00:00
AC_SUBST(ac_pjdir)
2007-09-24 16:10:13 +00:00
case $target in
*mingw* | *cygw* | *win32* | *w32* )
ac_pjdir=`pwd -W`
;;
*)
ac_pjdir=`pwd`
;;
esac
2007-03-12 10:44:38 +00:00
2006-08-20 20:47:34 +00:00
AC_CHECK_LIB(pthread,pthread_create)
2006-09-10 16:33:48 +00:00
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)
2007-05-16 13:41:00 +00:00
AC_CHECK_LIB(uuid,uuid_generate)
AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1])
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])
AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"])
2006-09-10 22:27:40 +00:00
dnl
dnl Memory alignment detection
dnl
AC_MSG_CHECKING([memory alignment])
case $target in
ia64-* | x86_64-* )
AC_DEFINE(PJ_POOL_ALIGNMENT, 8)
AC_MSG_RESULT([8 bytes])
;;
* )
AC_DEFINE(PJ_POOL_ALIGNMENT, 4)
AC_MSG_RESULT([4 bytes (default)])
;;
esac
2006-09-10 16:33:48 +00:00
dnl
dnl Endianness detection
dnl
2006-09-10 08:53:59 +00:00
AC_C_BIGENDIAN
2006-09-10 16:33:48 +00:00
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
2006-09-10 08:53:59 +00:00
dnl # --disable-floating-point option
2006-08-20 20:47:34 +00:00
AC_ARG_ENABLE(floating-point,
AC_HELP_STRING([--disable-floating-point],
[Disable floating point where possible]),
[if test "$enable_floating_point" = "no"; then
AC_DEFINE(PJ_HAS_FLOATING_POINT,0)
AC_MSG_RESULT([Checking if floating point is disabled... yes])
fi],
[
AC_DEFINE(PJ_HAS_FLOATING_POINT,1)
AC_MSG_RESULT([Checking if floating point is disabled... no])
AC_CHECK_LIB(m,fmod)
])
2006-07-24 02:07:11 +00:00
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)])
2006-09-10 16:33:48 +00:00
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
2006-07-24 02:07:11 +00:00
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)])
AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
2007-02-01 00:33:12 +00:00
AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)])
2007-11-17 10:27:34 +00:00
AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)])
2007-12-03 04:03:17 +00:00
AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)])
2006-07-24 02:07:11 +00:00
AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)])
AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)])
AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)])
AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)])
2008-01-23 14:34:46 +00:00
AC_CHECK_HEADER(stdint.h,[AC_DEFINE(PJ_HAS_STDINT_H,1)])
2006-07-24 02:07:11 +00:00
AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)])
AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)])
AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)])
AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)])
AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)])
AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)])
AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)])
2007-05-16 13:41:00 +00:00
AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1])
2006-07-24 02:07:11 +00:00
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1])
AC_DEFINE(PJ_HAS_ERRNO_VAR,1)
AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1])
AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1)
AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1])
AC_DEFINE(PJ_HAS_MALLOC,1)
AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0])
AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0)
AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long])
AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long)
2006-07-24 02:07:11 +00:00
2006-09-10 08:53:59 +00:00
dnl # Determine if inet_aton() is available
2007-11-18 14:53:47 +00:00
AC_MSG_CHECKING([if inet_aton() is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>]],
2006-07-24 02:07:11 +00:00
[inet_aton(0, 0);])],
[AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
2007-11-18 14:53:47 +00:00
dnl # Determine if inet_pton() is available
AC_MSG_CHECKING([if inet_pton() is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>]],
[inet_pton(0, 0, 0);])],
[AC_DEFINE(PJ_SOCK_HAS_INET_PTON,1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
dnl # Determine if inet_ntop() is available
AC_MSG_CHECKING([if inet_ntop() is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>]],
[inet_ntop(0, 0, 0, 0);])],
[AC_DEFINE(PJ_SOCK_HAS_INET_NTOP,1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
dnl # Determine if getaddrinfo() is available
AC_MSG_CHECKING([if getaddrinfo() is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>]],
[getaddrinfo(0, 0, 0, 0);])],
[AC_DEFINE(PJ_SOCK_HAS_GETADDRINFO,1)
AC_MSG_RESULT(yes)],
[AC_MSG_RESULT(no)])
2006-09-10 08:53:59 +00:00
dnl # Determine if sockaddr_in has sin_len member
2006-07-24 02:07:11 +00:00
AC_MSG_CHECKING([if sockaddr_in has sin_len member])
2006-09-10 08:53:59 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <arpa/inet.h>]],
2006-07-24 02:07:11 +00:00
[struct sockaddr_in a; a.sin_len=0;])],
[AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1)
AC_MSG_RESULT(yes)],
2006-09-09 20:05:33 +00:00
AC_MSG_RESULT(no))
2006-09-10 08:53:59 +00:00
dnl # Determine if socklen_t is available
2006-09-09 20:05:33 +00:00
AC_MSG_CHECKING([if socklen_t is available])
2006-09-10 22:27:40 +00:00
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
2006-09-09 20:05:33 +00:00
[socklen_t xxx = 0;])],
[AC_DEFINE(PJ_HAS_SOCKLEN_T,1)
AC_MSG_RESULT(yes)],
2006-07-24 02:07:11 +00:00
AC_MSG_RESULT(no))
2006-09-10 08:53:59 +00:00
dnl # Determine if SO_ERROR is available
2006-07-24 02:07:11 +00:00
AC_MSG_CHECKING([if SO_ERROR is available])
2006-09-10 16:33:48 +00:00
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
2006-07-24 02:07:11 +00:00
2006-09-10 08:53:59 +00:00
dnl # Determine if RW-mutex is available
2006-07-24 02:07:11 +00:00
AC_MSG_CHECKING([if pthread_rwlock_t is available])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
[pthread_rwlock_t *x;])],
[AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
AC_MSG_RESULT(yes)],
2006-08-20 20:47:34 +00:00
[AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
AC_MSG_RESULT(no)])
2006-09-10 16:33:48 +00:00
AC_SUBST(ac_os_objs)
case $target in
*mingw* | *cygw* | *win32* | *w32* )
2007-02-16 10:58:18 +00:00
ac_os_objs="file_access_win32.o file_io_win32.o os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o ioqueue_select.o"
2006-09-10 16:33:48 +00:00
;;
*)
2007-05-16 13:41:00 +00:00
ac_os_objs="file_access_unistd.o file_io_ansi.o os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o ioqueue_select.o"
# UUID
if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then
ac_os_objs="$ac_os_objs guid_uuid.o"
else
ac_os_objs="$ac_os_objs guid_simple.o"
fi
2006-09-10 16:33:48 +00:00
;;
esac
2006-08-20 20:47:34 +00:00
2007-05-16 13:41:00 +00:00
2006-09-10 08:53:59 +00:00
dnl ##########################################
dnl #
dnl # PJMEDIA
dnl #
2006-08-20 20:47:34 +00:00
2006-09-10 08:53:59 +00:00
dnl # Sound device backend selection
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_pjmedia_snd)
2006-09-10 22:27:40 +00:00
AC_ARG_ENABLE(sound,
AC_HELP_STRING([--disable-sound],
[Exclude sound (i.e. use null sound)]),
[if test "$enable_sound" = "no"; then
[ac_pjmedia_snd=null]
AC_MSG_RESULT([Checking if sound is disabled... yes])
fi]
)
2006-10-13 17:57:42 +00:00
AC_SUBST(ac_pa_cflags)
2007-04-09 21:28:15 +00:00
AC_CHECK_HEADER(sys/soundcard.h,
[ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"])
AC_CHECK_HEADER(linux/soundcard.h,
[ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H"])
AC_CHECK_HEADER(machine/soundcard.h,
[ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H"])
2008-01-09 15:43:02 +00:00
if test "x$ac_cv_c_bigendian" = "xyes"; then
ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN"
else
ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN"
fi
2006-09-10 22:27:40 +00:00
if test "$enable_sound" = "no"; then
true;
else
case $target in
2006-09-10 08:53:59 +00:00
*darwin*)
2006-10-13 17:57:42 +00:00
LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"
if test "`uname -r`" = "6.8"; then
2007-04-09 21:28:15 +00:00
#ac_pa_cflags="$ac_pa_cflags -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS"
2006-10-13 17:57:42 +00:00
#AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS])
ac_pjmedia_snd=pa_old_darwinos
AC_MSG_RESULT([Checking sound device backend... old coreaudio])
else
ac_pjmedia_snd=pa_darwinos
AC_MSG_RESULT([Checking sound device backend... coreaudio])
fi
2006-09-10 08:53:59 +00:00
;;
*cygwin* | *mingw*)
2006-08-20 20:47:34 +00:00
ac_pjmedia_snd=pa_win32
AC_MSG_RESULT([Checking sound device backend... win32 sound])
;;
*rtems*)
ac_pjmedia_snd=null
AC_MSG_RESULT([Checking sound device backend... null sound])
;;
*)
ac_pjmedia_snd=pa_unix
AC_CHECK_HEADER(alsa/version.h,
[AC_SUBST(ac_pa_use_alsa,1)
LIBS="$LIBS -lasound"
],
[AC_SUBST(ac_pa_use_alsa,0)])
AC_MSG_RESULT([Checking sound device backend... unix])
;;
2006-09-10 22:27:40 +00:00
esac
fi
2006-08-20 20:47:34 +00:00
2006-09-10 08:53:59 +00:00
dnl # Include resampling small filter
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_small_filter)
AC_ARG_ENABLE(small-filter,
AC_HELP_STRING([--disable-small-filter],
[Exclude small filter in resampling]),
[if test "$enable_small_filter" = "no"; then
[ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0']
AC_MSG_RESULT([Checking if small filter is disabled... yes])
fi],
AC_MSG_RESULT([Checking if small filter is disabled... no]))
2006-09-10 08:53:59 +00:00
dnl # Include resampling large filter
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_large_filter)
AC_ARG_ENABLE(large-filter,
AC_HELP_STRING([--disable-large-filter],
[Exclude large filter in resampling]),
[if test "$enable_large_filter" = "no"; then
[ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0']
AC_MSG_RESULT([Checking if large filter is disabled... yes])
fi],
AC_MSG_RESULT([Checking if large filter is disabled... no]))
2006-09-10 08:53:59 +00:00
dnl # Include Speex AEC
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_speex_aec)
AC_ARG_ENABLE(speex-aec,
AC_HELP_STRING([--disable-speex-aec],
[Exclude Speex Acoustic Echo Canceller/AEC]),
[if test "$enable_speex_aec" = "no"; then
[ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0']
AC_MSG_RESULT([Checking if Speex AEC is disabled...yes])
fi],
AC_MSG_RESULT([Checking if Speex AEC is disabled...no]))
2006-09-10 08:53:59 +00:00
dnl # Include G711 codec
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_g711_codec)
AC_ARG_ENABLE(g711-codec,
AC_HELP_STRING([--disable-g711-codec],
[Exclude G.711 codecs from the build]),
[if test "$enable_g711_codec" = "no"; then
[ac_no_g711_codec=1]
2007-01-27 17:44:13 +00:00
AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0)
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Checking if G.711 codec is disabled...yes])
fi],
AC_MSG_RESULT([Checking if G.711 codec is disabled...no]))
2006-09-10 08:53:59 +00:00
dnl # Include L16 codec
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_l16_codec)
AC_ARG_ENABLE(l16-codec,
AC_HELP_STRING([--disable-l16-codec],
[Exclude Linear/L16 codec family from the build]),
[if test "$enable_l16_codec" = "no"; then
[ac_no_l16_codec=1]
2007-01-27 17:44:13 +00:00
AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0)
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Checking if L16 codecs are disabled...yes])
fi],
2006-09-13 09:38:06 +00:00
AC_MSG_RESULT([Checking if L16 codec is disabled...no]))
2006-08-20 20:47:34 +00:00
2006-09-10 08:53:59 +00:00
dnl # Include GSM codec
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_gsm_codec)
AC_ARG_ENABLE(gsm-codec,
AC_HELP_STRING([--disable-gsm-codec],
[Exclude GSM codec in the build]),
[if test "$enable_gsm_codec" = "no"; then
[ac_no_gsm_codec=1]
2007-01-27 17:44:13 +00:00
AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0)
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Checking if GSM codec is disabled...yes])
fi],
AC_MSG_RESULT([Checking if GSM codec is disabled...no]))
2006-09-10 08:53:59 +00:00
dnl # Include Speex codec
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_speex_codec)
AC_ARG_ENABLE(speex-codec,
AC_HELP_STRING([--disable-speex-codec],
[Exclude Speex codecs in the build]),
[if test "$enable_speex_codec" = "no"; then
[ac_no_speex_codec=1]
2007-01-27 17:44:13 +00:00
AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0)
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Checking if Speex codec is disabled...yes])
fi],
AC_MSG_RESULT([Checking if Speex codec is disabled...no]))
2006-09-10 08:53:59 +00:00
dnl # Include iLBC codec
2006-08-20 20:47:34 +00:00
AC_SUBST(ac_no_ilbc_codec)
AC_ARG_ENABLE(ilbc-codec,
AC_HELP_STRING([--disable-ilbc-codec],
[Exclude iLBC codec in the build]),
[if test "$enable_ilbc_codec" = "no"; then
[ac_no_ilbc_codec=1]
2007-01-27 17:44:13 +00:00
AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0)
2006-08-20 20:47:34 +00:00
AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])
fi],
AC_MSG_RESULT([Checking if iLBC codec is disabled...no]))
2007-10-16 08:54:00 +00:00
dnl # Include libsamplerate
AC_ARG_ENABLE(libsamplerate,
AC_HELP_STRING([--enable-libsamplerate],
[Link with libsamplerate when available. Note that PJMEDIA_RESAMPLE_IMP must also be configured]),
[ AC_CHECK_LIB(samplerate,src_new) ],
AC_MSG_RESULT([Skipping libsamplerate detection])
)
2006-08-20 20:47:34 +00:00
2006-12-25 20:34:14 +00:00
dnl ##########################################
dnl #
dnl # PJSIP CONFIG
dnl #
dnl # Include SSL support
AC_SUBST(ac_no_ssl)
AC_ARG_ENABLE(ssl,
2007-02-14 02:21:08 +00:00
AC_HELP_STRING([--disable-ssl],
[Exclude SSL support the build (default: autodetect)])
,
2006-12-25 20:34:14 +00:00
[
if test "$enable_ssl" = "no"; then
[ac_no_ssl=1]
AC_MSG_RESULT([Checking if SSL support is disabled... yes])
fi
],
[
AC_MSG_RESULT([checking for OpenSSL installations..])
AC_SUBST(openssl_h_present)
AC_SUBST(libssl_present)
AC_SUBST(libcrypto_present)
AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"])
AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"])
if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1)
else
AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **])
fi
])
2006-09-10 08:53:59 +00:00
dnl ##########################################
dnl #
dnl # MANUAL CONFIG
dnl #
2006-08-20 20:47:34 +00:00
2006-07-24 02:07:11 +00:00
2006-09-10 08:53:59 +00:00
dnl # Determine if select() requires nfds to be filled up with
dnl # correct value (max_fd+1). If zero, nfds will be filled up with
dnl # PJ_FD_SETSIZE
2006-08-20 20:47:34 +00:00
AC_MSG_CHECKING([if select() needs correct nfds])
2006-07-24 02:07:11 +00:00
case $target in
*rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1)
AC_MSG_RESULT(yes)
;;
*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0)
AC_MSG_RESULT([no (default)])
AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)])
;;
esac
2006-09-10 08:53:59 +00:00
dnl # Determine if pj_thread_create() should enforce thread stack size when
dnl # creating thread. Default is zero, to allow OS to allocate appropriate
dnl # thread's stack size.
2006-07-24 02:07:11 +00:00
AC_MSG_CHECKING([if pj_thread_create() should enforce stack size])
case $target in
*rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1)
AC_MSG_RESULT(yes)
;;
*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0)
AC_MSG_RESULT([no (default)])
;;
esac
2006-09-10 08:53:59 +00:00
dnl # Determine if pj_thread_create() should allocate thread's stack from
dnl # the pool. Default is zero, to let OS allocate thread's stack.
2006-07-24 02:07:11 +00:00
AC_MSG_CHECKING([if pj_thread_create() should allocate stack])
case $target in
*rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1)
AC_MSG_RESULT(yes)
;;
*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0)
AC_MSG_RESULT([no (default)])
;;
esac
2006-09-10 08:53:59 +00:00
dnl # This value specifies the value set in errno by the OS when a non-blocking
dnl # socket recv() can not return immediate data.
2006-07-24 02:07:11 +00:00
case $target in
2006-09-10 16:33:48 +00:00
*mingw* | *cygw* | *win32* | *w32* )
AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK)
;;
2006-07-24 02:07:11 +00:00
*) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
;;
esac
2006-09-10 08:53:59 +00:00
dnl # This value specifies the value set in errno by the OS when a non-blocking
dnl # socket connect() can not get connected immediately.
2006-07-24 02:07:11 +00:00
case $target in
2006-09-10 16:33:48 +00:00
*mingw* | *cygw* | *win32* | *w32* )
AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK)
;;
2006-07-24 02:07:11 +00:00
*) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
;;
esac
2006-08-20 20:47:34 +00:00
AC_SUBST(target)
AC_SUBST(ac_cross_compile)
if test "$build" = "$host"; then
ac_cross_compile=
else
2006-09-17 22:58:51 +00:00
ac_cross_compile=${host_orig}-
2006-08-20 20:47:34 +00:00
fi
AC_SUBST(ac_linux_poll,select)
AC_SUBST(ac_host,unix)
AC_SUBST(ac_main_obj)
case $target in
*rtems*)
ac_main_obj=main_rtems.o
;;
*)
ac_main_obj=main.o
;;
esac
AC_SUBST(CC)
2006-07-24 02:07:11 +00:00
AC_OUTPUT()
2007-04-18 09:24:31 +00:00
AC_MSG_RESULT([
2007-11-18 14:53:47 +00:00
Configurations for current target have been written to 'build.mak', and 'os-auto.mak' in various build directories, and pjlib/include/pj/compat/os_auto.h.
2007-04-18 09:24:31 +00:00
2007-11-18 14:53:47 +00:00
Further customizations can be put in:
2007-04-18 09:24:31 +00:00
- 'user.mak'
- 'pjlib/include/pj/config_site.h'
The next step now is to run 'make dep' and 'make'.
])