1 AC_INIT(include/ptlib.h)
3 AC_CONFIG_SUBDIRS(plugins)
9 dnl ########################################################################
10 dnl set the PWLIB directory to the current directory
14 dnl set the pwlib installation dir for pwlib-config
17 dnl ########################################################################
18 dnl set the PREFIX accordingly
19 if test "x$prefix" = "xNONE"; then
20 INSTALLPREFIX="/usr/local"
22 INSTALLPREFIX="${prefix}"
25 AC_SUBST(INSTALLPREFIX)
28 dnl ########################################################################
29 dnl set LIBDIR accordingly
34 dnl ########################################################################
35 dnl extract the PWLIB version
36 dnl MSWIN_DISPLAY version,Version
37 dnl MSWIN_VERSION version,PWLIB_MAJOR=MAJOR_VERSION
38 dnl MSWIN_VERSION version,PWLIB_MINOR=MINOR_VERSION
39 dnl MSWIN_VERSION version,PWLIB_BUILD=BUILD_NUMBER
40 dnl MSWIN_VERSION version,PWLIB_VERSION=VERSION
42 MAJOR_VERSION=`cat ${PWLIBDIR}/version.h | grep MAJOR_VERSION | cut -f3 -d' '`
43 MINOR_VERSION=`cat ${PWLIBDIR}/version.h | grep MINOR_VERSION | cut -f3 -d' '`
44 BUILD_NUMBER=`cat ${PWLIBDIR}/version.h | grep BUILD_NUMBER | cut -f3 -d' '`
45 PWLIB_VERSION="${MAJOR_VERSION}.${MINOR_VERSION}.${BUILD_NUMBER}"
46 AC_SUBST(MAJOR_VERSION)
47 AC_SUBST(MINOR_VERSION)
48 AC_SUBST(BUILD_NUMBER)
49 AC_SUBST(PWLIB_VERSION)
50 AC_SUBST(MAJOR_VERSION, $MAJOR_VERSION)
51 AC_SUBST(MINOR_VERSION, $MINOR_VERSION)
52 AC_SUBST(BUILD_NUMBER, $BUILD_NUMBER)
54 AC_MSG_NOTICE(PTLib version is ${PWLIB_VERSION});
56 AC_DEFINE_UNQUOTED([PWLIB_MAJOR], [$MAJOR_VERSION], [Major version])
57 AC_DEFINE_UNQUOTED([PWLIB_MINOR], [$MINOR_VERSION], [Minor version])
58 AC_DEFINE_UNQUOTED([PWLIB_BUILD], [$BUILD_NUMBER], [Build number])
59 AC_DEFINE_UNQUOTED([PWLIB_VERSION], ["$PWLIB_VERSION"], [pwlib version])
61 dnl ########################################################################
62 dnl set the OSTYPE and MACHTYPE
71 linux*) OSTYPE=linux ;
72 OSRELEASE="\"`uname -r`\"";
77 freebsd* ) OSTYPE=FreeBSD ;
79 if test "x$OSRELEASE" = "x"; then
80 OSRELEASE="`sysctl -n kern.osreldate`" ;
85 openbsd* ) OSTYPE=OpenBSD ;
87 OSRELEASE="`sysctl -n kern.osrevision`" ;
88 ENDLDLIBS="-lossaudio" ;
92 netbsd* ) OSTYPE=NetBSD ;
94 OSRELEASE="`/sbin/sysctl -n kern.osrevision`" ;
95 ENDLDLIBS="-lossaudio" ;
99 solaris* | sunos* ) OSTYPE=solaris ;
101 OSRELEASE=`uname -r | sed "s/5\.//g"` ;
105 darwin* ) OSTYPE=Darwin ;
107 OSRELEASE="`uname -r | sed 's/\.//g'`" ;
108 SHAREDLIBEXT="dylib";
109 if test -e /Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6/include/expat.h ; then
110 EXPATDIR=/Developer/SDKs/MacOSX10.4u.sdk/usr/X11R6
116 OSRELEASE=`uname -r` ;
117 STDCCFLAGS="$STDCCFLAGS -D__BEOS__"
120 cygwin*) OSTYPE=cygwin ;
122 OSRELEASE="`uname -r`";
125 mingw*) OSTYPE=mingw ;
127 OSRELEASE=`uname -r` ;
130 STDCCFLAGS="$STDCCFLAGS -mms-bitfields" ;
131 ENDLDLIBS="-lwinmm -lwsock32 -lsnmpapi -lmpr -lcomdlg32 -lgdi32 -lavicap32" ;
135 * ) OSTYPE="$target_os" ;
136 OS_TAG="P_UNKNOWN_OS" ;
137 OSRELEASE="\"${OSTYPE}_`uname -r`\"" ;
138 AC_MSG_WARN("OS $target_os not recognized - proceed with caution!") ;
144 case "$target_cpu" in
145 x86 | i686 | i586 | i486 | i386 ) MACHTYPE=x86
148 x86_64) MACHTYPE=x86_64 ;
153 alpha | alphaev56 | alphaev6 | alphaev67 | alphaev7) MACHTYPE=alpha ;
157 sparc ) MACHTYPE=sparc ;
160 powerpc ) MACHTYPE=ppc ;
166 powerpc64 ) MACHTYPE=ppc64 ;
171 ppc64 ) MACHTYPE=ppc64 ;
176 ia64) MACHTYPE=ia64 ;
180 s390x) MACHTYPE=s390x ;
185 s390) MACHTYPE=s390 ;
188 * ) MACHTYPE=$target_cpu ;
189 AC_MSG_WARN("CPU $target_cpu not recognized - proceed with caution!") ;;
192 AC_MSG_NOTICE(OSTYPE set to $OSTYPE);
193 AC_MSG_NOTICE(OSRELEASE set to $OSRELEASE);
194 AC_MSG_NOTICE(MACHTYPE set to $MACHTYPE);
196 AC_SUBST(MACHTYPE, $MACHTYPE)
197 AC_SUBST(OSTYPE, $OSTYPE)
198 AC_SUBST(OSRELEASE, $OSRELEASE)
199 AC_SUBST(TARGETDIR, $TARGETDIR)
201 AC_DEFINE_UNQUOTED($OS_TAG, $OSRELEASE)
203 AC_DEFINE([PHAS_TEMPLATES], [1], [Templates found])
205 if test "x$P_64BIT" != "x" ; then
206 AC_DEFINE([P_64BIT], [1], [64bit architecture])
209 dnl BeOS has it;s own threading system
210 if test ${OSTYPE} != beos ; then
211 AC_DEFINE(P_PTHREADS, 1, "PThreads found")
214 dnl solaris has it's own ldap library
215 if test ${OSTYPE} != solaris ; then
216 LDAP_LIBRARIES="-llber -lldap_r"
219 dnl ########################################################################
220 dnl get the gcc version
225 if test x$GXX = xyes ; then
227 gcc_version=`$CXX -dumpversion`
228 AC_MSG_NOTICE(gcc version is $gcc_version);
229 GXX_MAJOR=`echo $gcc_version | sed 's/\..*$//'`
230 GXX_MINOR=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.//' -e 's/\..*$//'`]
231 GXX_PATCH=[`echo $gcc_version | sed -e 's/[0-9][0-9]*\.[0-9][0-9]*\.//' -e 's/\..*$//'`]
233 dnl only enable pragma for gcc 4.0 and later
234 AC_MSG_CHECKING(checking if pragma implementation should be used)
235 if test ${GXX_MAJOR} -lt 4 ; then
236 if test "${need_pragma}" = "yes" ; then
237 STDCCFLAGS="$STDCCFLAGS -DP_USE_PRAGMA"
246 dnl only enable PCH for gcc 4.0 and later
247 AC_MSG_CHECKING(checking if precompiled headers available)
248 if test ${GXX_MAJOR} -lt 4 ; then
253 [ --enable-pch disable precompiled headers],
254 enablepch=$enableval)
256 if test "${enablepch}" = "yes" ; then
269 dnl ########################################################################
270 dnl check if precompiled headers available, or disabled
272 dnl ########################################################################
273 dnl set the shared library extension, if not already set
275 if test "x${SHAREDLIBEXT}" = "x" ; then
278 AC_SUBST(SHAREDLIBEXT, $SHAREDLIBEXT)
279 AC_DEFINE([P_SHAREDLIBEXT], [$SHAREDLIBEXT], [shared library extension])
281 dnl ########################################################################
282 dnl check the endianness
284 dnl MSWIN_DISPLAY byteorder,Byte Order
285 dnl MSWIN_DEFINE byteorder,PBYTE_ORDER=PLITTLE_ENDIAN
287 if test ${OSTYPE} != "Darwin" ; then
289 if test ${ac_cv_c_bigendian} = yes ; then
290 PBYTE_ORDER=PBIG_ENDIAN
292 PBYTE_ORDER=PLITTLE_ENDIAN
295 AC_DEFINE_UNQUOTED(PBYTE_ORDER, $PBYTE_ORDER, "byte order")
298 dnl ########################################################################
299 dnl look for compile flags
302 AC_MSG_CHECKING(if linker accepts -felide-constructors)
303 AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
304 $CXX $CXXFLAGS -felide-constructors conftest.cc > /dev/null 2>&1
305 if test $? = 0 ; then
307 STDCXXFLAGS="$STDCXXFLAGS -felide-constructors"
312 AC_MSG_CHECKING(if linker accepts -Wreorder)
313 AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
314 $CXX $CXXFLAGS -Wreorder conftest.cc > /dev/null 2>&1
315 if test $? = 0 ; then
317 STDCXXFLAGS="$STDCXXFLAGS -Wreorder"
323 dnl add additional information for the debugger to ensure the user can indeed
324 dnl debug coredumps and macros.
326 AC_MSG_CHECKING(if debug build accepts -g3 -ggdb -O0)
327 AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
328 $CXX $CXXFLAGS -g3 -ggdb -O0 conftest.cc > /dev/null 2>&1
329 if test $? = 0 ; then
331 DEBUG_FLAG="-g3 -ggdb -O0"
338 # AC_MSG_CHECKING(if linker accepts -Woverloaded-virtual)
339 # AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
340 # $CXX $CFLAGS -Woverloaded-virtual conftest.cc > /dev/null 2>&1
341 # if test $? = 0 ; then
343 # STDCCFLAGS="$STDCCFLAGS -Woverloaded-virtual"
348 AC_MSG_CHECKING(if compiler uses RTTI by default)
351 int main(int ac,char **av)
356 virtual void fred() { }
364 A * p = dynamic_cast<A *>(&t);
367 ]],DEFAULT_RTTI=1, DEFAULT_RTTI=0)
368 if test "$DEFAULT_RTTI" = "1" ; then
372 STDCXXFLAGS="$STDCCFLAGS -rtti"
377 dnl Remove --gc-sections as the linker crashes when linking
378 dnl static executables with this option
379 dnl AC_MSG_CHECKING(if linker accepts --gc-sections)
380 dnl C_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
381 dnl CXX $CFLAGS -Wl,--gc-sections conftest.cc > /dev/null 2>&1
382 dnl if test $? = 0 ; then
386 dnl AC_MSG_RESULT(yes)
388 AC_MSG_CHECKING(if compiler accepts -ffunction-sections)
389 AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
390 $CXX $CFLAGS -ffunction-sections -c conftest.cc > /dev/null 2>&1
391 if test $? = 0 ; then
393 STDCCFLAGS="$STDCCFLAGS -ffunction-sections"
399 dnl remove data-sections as not only does is case the linker to
400 dnl crash on some platforms, but seems to be broken w.r.t
401 dnl closure of templates with static member functions
402 dnl see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=8249
404 dnl AC_MSG_CHECKING(if compiler accepts -fdata-sections)
405 dnl AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
406 dnl $CXX $CFLAGS -fdata-sections -c conftest.cc > /dev/null 2>&1
407 dnl if test $? = 0 ; then
408 dnl AC_MSG_RESULT(yes)
409 dnl STDCCFLAGS="$STDCCFLAGS -fdata-sections"
412 dnl AC_MSG_RESULT(no)
415 dnl as much as this flag would help, there is no known linker
416 dnl that can handle pwlib when it has been compiled with it
417 dnl AC_MSG_CHECKING(if compiler accepts -fvtable-gc)
418 dnl AC_LANG_CONFTEST([[int main(int ac,char **av) { return 0; }]])
419 dnl $CXX $CFLAGS -fvtable-gc -c conftest.cc > /dev/null 2>&1
420 dnl if test $? = 0 ; then
421 dnl AC_MSG_RESULT(yes)
422 dnl STDCCFLAGS="$STDCCFLAGS -fvtable-gc"
425 dnl AC_MSG_RESULT(no)
428 if test $GCSECTIONS = 1; then
429 if test "${OSTYPE}" != "Darwin" ; then
430 P_STATIC_LDFLAGS="$P_STATIC_LDFLAGS -Wl,--gc-sections"
438 dnl ########################################################################
439 dnl check for the size of int
442 dnl ########################################################################
443 dnl check for long double
446 if test $ac_cv_c_long_double != yes ; then
447 AC_DEFINE([PNO_LONG_DOUBLE], [], [No long double])
450 if test ${OSTYPE} = Darwin ; then
451 STDCCFLAGS="$STDCCFLAGS -Wno-long-double"
454 dnl ########################################################################
455 dnl we need flex, so we better make sure it's there
456 AC_PATH_PROG(FLEX, flex)
457 if test -z "$FLEX" ; then
458 AC_MSG_ERROR(pwlib needs the GNU Project fast lexical analyzer generator flex, 1)
461 dnl ########################################################################
462 dnl most systems have "ar", but some use "gar"
464 if test -z "$AR" ; then
465 AC_PATH_PROG(AR, gar)
468 dnl ########################################################################
469 dnl we need bison, so we better make sure it's there
470 AC_PATH_PROG(BISON, bison)
471 if test -z "$BISON" ; then
472 AC_MSG_ERROR(pwlib needs the GNU Project parser generator bison, 1)
475 dnl ########################################################################
476 dnl check for number of parms to readdir
477 AC_MSG_CHECKING(if readdir_r has 2 parms)
478 AC_TRY_COMPILE([#define _POSIX_PTHREAD_SEMANTICS
479 #include <dirent.h>],
480 [DIR *s; struct dirent * e; readdir_r(s, e);], P_HAS_POSIX_READDIR_R=2, P_HAS_POSIX_READDIR_R=0)
481 if test ${P_HAS_POSIX_READDIR_R} = 2 ; then
485 AC_MSG_CHECKING(if readdir_r has 3 parms)
486 AC_TRY_COMPILE([#include <dirent.h>],
487 [DIR *s; struct dirent * e; struct dirent * p; readdir_r(s, e, &p);], P_HAS_POSIX_READDIR_R=3, P_HAS_POSIX_READDIR_R=0)
488 if test ${P_HAS_POSIX_READDIR_R} = 3 ; then
494 AC_DEFINE_UNQUOTED(P_HAS_POSIX_READDIR_R, ${P_HAS_POSIX_READDIR_R})
496 dnl ########################################################################
497 dnl check for minimum sizing
499 AC_ARG_ENABLE(minsize,
500 [ --enable-minsize minimise the size of the lib by disabling least used options])
501 AC_ARG_ENABLE(openh323,
502 [ --enable-openh323 include only options needed with openh323])
504 [ --enable-opal include only options needed with opal])
506 dnl these are the default configure settings
534 default_configfile=yes
544 if test "${enable_openh323}x" = "yesx" -o "${enable_opal}x" = "yesx" ; then
572 default_configfile=yes
581 elif test "${enable_minsize}x" = "yesx" ; then
609 default_configfile=no
621 dnl ########################################################################
622 dnl check for recvmsg
625 AC_MSG_CHECKING(for recvmsg)
626 AC_TRY_COMPILE([#include <sys/types.h>
627 #include <sys/socket.h>
628 #include <netinet/in.h>],
629 [int t = SOL_IP; t = IP_PKTINFO; struct msghdr *msg; recvmsg(0, msg, 0);], P_HAS_RECVMSG=1)
630 if test "${P_HAS_RECVMSG}" = "1" ; then
632 AC_DEFINE(P_HAS_RECVMSG, 1)
637 dnl ########################################################################
638 dnl check for streams types
641 AC_MSG_CHECKING(if using STL streams)
642 AC_TRY_COMPILE([#include <iostream>],
643 [int v = (int)std::ios_base::seekdir();], P_HAS_STL_STREAMS=1)
644 if test "${P_HAS_STL_STREAMS}" = 1 ; then
649 AC_DEFINE_UNQUOTED(P_HAS_STL_STREAMS, ${P_HAS_STL_STREAMS})
651 dnl ########################################################################
652 dnl see if using GNU glibc++, because then we have atomic integer operations
655 P_NEEDS_GNU_CXX_NAMESPACE=0
656 AC_MSG_CHECKING(if atomic integer available)
657 AC_TRY_COMPILE([#include <bits/atomicity.h>],
658 [_Atomic_word val;], P_HAS_ATOMIC_INT=1,
659 AC_TRY_COMPILE([#include <ext/atomicity.h>],
660 [_Atomic_word val;], P_HAS_ATOMIC_INT=2)
662 if test ${P_HAS_ATOMIC_INT} != 0 ; then
664 AC_MSG_CHECKING(if __exchange_and_add is in __gnu_cxx namespace)
665 if test ${P_HAS_ATOMIC_INT} = 1 ; then
666 AC_TRY_COMPILE([#include <bits/atomicity.h>],
667 [_Atomic_word val; __gnu_cxx::__exchange_and_add(&val, 1)],
668 P_NEEDS_GNU_CXX_NAMESPACE=1)
671 AC_TRY_COMPILE([#include <ext/atomicity.h>],
672 [_Atomic_word val; __gnu_cxx::__exchange_and_add(&val, 1)],
673 P_NEEDS_GNU_CXX_NAMESPACE=1)
675 if test ${P_NEEDS_GNU_CXX_NAMESPACE} = 1 ; then
684 AC_DEFINE_UNQUOTED(P_HAS_ATOMIC_INT, ${P_HAS_ATOMIC_INT})
685 AC_DEFINE_UNQUOTED(P_NEEDS_GNU_CXX_NAMESPACE, ${P_NEEDS_GNU_CXX_NAMESPACE})
688 dnl ########################################################################
689 dnl check for select_large_fdset (Solaris)
691 if test "${OSTYPE:-unknown}" = "solaris"; then
692 AC_MSG_CHECKING(checking for FD_SETSIZE)
693 _FD_SYSTEM_FILE=/etc/system
694 _FD_SETSIZE=`cat $_FD_SYSTEM_FILE | grep rlim_fd_max | cut -c1`
695 if test "$_FD_SETSIZE" = "#"; then
698 _FD_SETSIZE=`cat $_FD_SYSTEM_FILE | grep rlim_fd_max | cut -f2 -d'='`
699 if test "x$_FD_SETSIZE" = "x"; then
702 STDCCFLAGS="$STDCCFLAGS -DFD_SETSIZE=$_FD_SETSIZE"
705 AC_MSG_RESULT($_FD_SETSIZE)
709 dnl ########################################################################
710 dnl check if upad128_t is defined (Solaris)
712 if test "${OSTYPE:-unknown}" = "solaris"; then
713 AC_MSG_CHECKING(for upad128_t)
714 AC_TRY_COMPILE([#include <sys/types.h>],
715 [upad128_t upad; upad._q = 0.0;], has_upad128_t=y)
716 if test ${has_upad128_t} == "y"; then
718 AC_DEFINE(P_HAS_UPAD128_T)
725 dnl ########################################################################
726 dnl check for Unix semaphores
728 dnl posix unnamed semaphore support in darwin/macosx is broken
729 if test ${OSTYPE} != Darwin ; then
730 AC_TRY_COMPILE([#include <semaphore.h>],
731 [sem_t *s; sem_init(s, 0, 0);], P_HAS_SEMAPHORES=1)
732 AC_MSG_CHECKING(if Unix semaphores are available)
733 if test "${P_HAS_SEMAPHORES}x" != "x" ; then
734 AC_DEFINE(P_HAS_SEMAPHORES)
741 if test "${P_HAS_SEMAPHORES}x" == "x" ; then
743 AC_TRY_COMPILE([#include <semaphore.h>],
744 [sem_t *s = sem_open("test", O_CREAT)],
745 P_HAS_NAMED_SEMAPHORES=1 )
746 AC_MSG_CHECKING(if named semaphores are available)
747 if test "${P_HAS_NAMED_SEMAPHORES}x" != "x"; then
748 AC_DEFINE(P_HAS_NAMED_SEMAPHORES)
752 AC_MSG_WARN(This host does not support semaphores which are essential)
753 AC_MSG_WARN(to implement 'critical sections'. This feature was added)
754 AC_MSG_WARN(in PWLib 1.7.0 and improves the stability of multithreaded)
755 AC_MSG_WARN(programs. This feature has been disabled for this host)
759 dnl ########################################################################
760 dnl check for pthreads library
762 dnl MSWIN_DISPLAY semaphore,Semaphore Support
763 dnl MSWIN_DEFINE semaphore,P_HAS_SEMAPHORES
765 dnl Linux, Mac OS X use libpthread and -lpthread
766 dnl FreeBSD uses the -pthread compiler option and uses libc_r
768 AC_CHECK_LIB(pthread, pthread_create, HAS_PTHREADS=yes, HAS_PTHREADS=no)
769 if test ${HAS_PTHREADS} = yes ; then
770 ENDLDLIBS="$ENDLDLIBS -lpthread"
771 STDCCFLAGS="$STDCCFLAGS -D_REENTRANT"
773 if test ${OSTYPE} = FreeBSD ; then
775 ENDLDLIBS="$ENDLDLIBS -pthread"
776 STDCCFLAGS="$STDCCFLAGS -D_REENTRANT -pthread"
777 elif test ${OSTYPE} = FreeBSD ; then
779 ENDLDLIBS="$ENDLDLIBS -pthread"
780 STDCCFLAGS="$STDCCFLAGS -D_REENTRANT -pthread"
785 if test ${HAS_PTHREADS} != yes -a ${NEEDS_PTHREADS} = yes; then
786 AC_MSG_ERROR(must have pthreads!)
789 dnl ########################################################################
790 dnl check for XPG6 compliant pthreads (timed spinlocks)
792 if test ${HAS_PTHREADS} = yes ; then
793 AC_MSG_CHECKING(if pthread_mutex_timedlock is available)
794 AC_TRY_COMPILE([#include <pthread.h>],
795 [pthread_mutex_timedlock(NULL, NULL);], HAS_PTHREADS_XPG6=yes, HAS_PTHREADS_XPG6=no)
796 if test ${HAS_PTHREADS_XPG6} = yes ; then
798 AC_DEFINE(P_PTHREADS_XPG6, 1, "XPG6 compliant pthreads found")
803 AC_CHECK_LIB(pthread, sem_timedwait, HAS_SEMAPHORES_XPG6=yes, HAS_SEMAPHORES_XPG6=no)
804 if test ${HAS_SEMAPHORES_XPG6} = yes ; then
805 AC_MSG_CHECKING(if sem_timedwait is compilable)
806 AC_TRY_COMPILE([#include <semaphore.h>],
807 [sem_t *s; const struct timespec * t; sem_timedwait(s, t);], HAS_SEMAPHORES_XPG6=yes, HAS_SEMAPHORES_XPG6=no)
808 if test ${HAS_SEMAPHORES_XPG6} = yes ; then
809 AC_DEFINE(P_HAS_SEMAPHORES_XPG6, 1, "Supports XPG6 Semaphores")
817 dnl ########################################################################
818 dnl check for recursive mutexes
819 P_HAS_RECURSIVE_MUTEX=0
820 AC_MSG_CHECKING(if recursive mutexes are available)
821 AC_TRY_COMPILE([#include <pthread.h>],
822 [pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE_NP);], P_HAS_RECURSIVE_MUTEX=1)
823 if test ${P_HAS_RECURSIVE_MUTEX} = 1 ; then
824 AC_MSG_RESULT(PTHREAD_MUTEX_RECURSIVE_NP)
826 AC_TRY_COMPILE([#include <pthread.h>],
827 [pthread_mutexattr_t attr; pthread_mutexattr_settype(&attr, PTHREAD_MUTEX_RECURSIVE);], P_HAS_RECURSIVE_MUTEX=2)
828 if test ${P_HAS_RECURSIVE_MUTEX} = 2 ; then
829 AC_MSG_RESULT(PTHREAD_MUTEX_RECURSIVE)
834 AC_DEFINE_UNQUOTED(P_HAS_RECURSIVE_MUTEX, ${P_HAS_RECURSIVE_MUTEX})
837 dnl ########################################################################
838 dnl check for regex library
840 dnl yes this test needs to be outside the if below
841 dnl because autoconf needs to initialise stuff. without this
842 dnl all sorts of strange things happen
843 AC_CHECK_HEADERS(regex.h, HAS_REGEX=yes)
845 AC_ARG_ENABLE(internalregex,
846 [ --enable-internalregex force internal regex library],
847 internalregex=$enableval)
848 if test "$internalregex" = "yes" ; then
849 AC_MSG_NOTICE(Forcing use of internal regex library)
851 if test "$HAS_REGEX" = "yes" ; then
852 AC_CHECK_FUNC(regcomp, HAS_REGEX=yes)
853 if test "$HAS_REGEX" = "yes" ; then
854 AC_SUBST(HAS_REGEX, 1)
855 AC_DEFINE(P_REGEX, 1, "Regex library found")
856 if test ${OSTYPE} = mingw ; then
857 ENDLDLIBS="$ENDLDLIBS -lregex"
864 dnl ########################################################################
865 dnl check for dynamic library code (dlopen and friends)
867 dnl MSWIN DLL Support,,P_DYNALINK
872 if test ${OSTYPE} = beos ; then
874 AC_DEFINE(P_DYNALINK, 1, "dlopen implemented inside pwlib in BeOS")
875 elif test ${OSTYPE} = Darwin ; then
877 AC_DEFINE(P_DYNALINK, 1, "dlopen implemented inside pwlib in Darwin")
879 AC_CHECK_HEADERS(dlfcn.h, HAS_DLFCN=yes, HAS_DLFCN=no)
880 if test "$HAS_DLFCN" = yes ; then
881 AC_MSG_CHECKING(if dlopen is available)
882 AC_TRY_COMPILE([#include <dlfcn.h>],
883 [void * p = dlopen("lib", 0);], HAS_DLOPEN=yes, HAS_DLOPEN=no)
884 if test "$HAS_DLOPEN" = no ; then
889 AC_DEFINE(P_DYNALINK, 1, "dlopen found")
890 AC_CHECK_LIB(dl,dlopen,HAS_LIBDL=yes, HAS_LIBDL=no)
895 dnl #########################################################################
896 dnl check to see if plugins enabled
898 dnl MSWIN_DISPLAY plugins,Plugin Support
899 dnl MSWIN_DEFINE plugins,P_HAS_PLUGINS
902 AC_MSG_CHECKING(if plugins support needs to be compiled)
903 AC_ARG_ENABLE(plugins,
904 [ --enable-plugins enable plugin support])
905 if test "${enable_plugins}z" = "z" ; then
906 enable_plugins=default_plugins
910 if test "${enable_plugins}" = "no" ; then
912 elif test "${P_DYNALINK:-unset}" = "unset" ; then
913 AC_MSG_RESULT(plugins disabled as dlopen not available)
915 AC_MSG_RESULT(plugins enabled)
917 AC_DEFINE(P_HAS_PLUGINS, 1, "plugins enabled")
920 AC_SUBST(HAS_PLUGINS)
922 if test "x$LIB64" != "x" ; then
923 AC_DEFINE_UNQUOTED([P_DEFAULT_PLUGIN_DIR], ["${INSTALLPREFIX}/lib64/pwlib"], [Default plugin directory])
925 AC_DEFINE_UNQUOTED([P_DEFAULT_PLUGIN_DIR], ["${INSTALLPREFIX}/lib/pwlib"], [Default plugin directory])
928 dnl ########################################################################
929 dnl look for DNS resolver code (must be done before OpenLDAP)
930 dnl on some systems, the resolver is in libc
931 dnl but needs resolv.h included which defines res_search as __res_search
933 dnl MSWIN_DISPLAY resolver,DNS Resolver
934 dnl MSWIN_CHECK_FILE resolver,include\windns.h,P_DNS=1
935 dnl MSWIN_DIR_SYMBOL resolver,DNS_DIR
936 dnl MSWIN_CHECK_DIR resolver,\program files\microsoft visual studio 8\vc\platformsdk\
937 dnl MSWIN_CHECK_DIR resolver,\Program Files\Microsoft SDK\
938 dnl MSWIN_CHECK_DIR resolver,\Program Files\Microsoft Platform SDK for Windows Server 2003 R2
940 AC_ARG_ENABLE(resolver,
941 [ --disable-resolver disable DNS resolver support])
943 if test "${enable_resolver}z" = "z" ; then
944 enable_resolver=$default_resolver
948 if test "$enable_resolver" = "no" ; then
949 AC_MSG_NOTICE(DNS resolver disabled)
952 AC_CHECK_FUNC(res_ninit, HAS_RES_NINIT)
953 if test "${HAS_RES_NINIT}z" != "z" ; then
954 AC_DEFINE(P_HAS_RES_NINIT)
959 if test "${HAS_RESOLVER}z" = "z" ; then
960 AC_MSG_CHECKING([for res_ninit in -lresolv])
963 #include <netinet/in.h>
965 int main(int argc,char **argv){
966 res_state p; res_ninit(p);
968 if test "${HAS_RES_NINIT}z" != "z" ; then
970 AC_DEFINE(P_HAS_RES_NINIT)
972 RESOLVER_LIBS="-lresolv"
979 if test "${HAS_RESOLVER}z" = "z" ; then
980 AC_CHECK_FUNC(res_search, HAS_RESOLVER=1)
981 if test "${HAS_RESOLVER}z" != "z" ; then
986 if test "${HAS_RESOLVER}z" = "z" ; then
987 AC_MSG_CHECKING([for res_search in -lresolv])
990 #include <netinet/in.h>
992 int main(int argc,char **argv){
993 res_search (NULL, 0, 0, NULL, 0);
995 if test "${HAS_RESOLVER:-unset}" != "unset" ; then
997 RESOLVER_LIBS="-lresolv"
1004 if test "${HAS_RESOLVER}z" = "z" ; then
1005 AC_SEARCH_LIBS(__res_search, resolv, HAS_RESOLVER=1)
1008 if test "${HAS_RESOLVER}z" != "z" ; then
1009 AC_DEFINE(P_DNS, 1, "resolver libraries found")
1013 AC_SUBST(HAS_RESOLVER)
1015 dnl ########################################################################
1018 dnl MSWIN_DISPLAY sasl,Cyrus SASL
1019 dnl MSWIN_CHECK_FILE sasl,include\sasl.h,P_SASL=1
1020 dnl MSWIN_DIR_SYMBOL sasl,SASL_DIR
1021 dnl MSWIN_CHECK_DIR sasl,..\sasl\
1022 dnl MSWIN_CHECK_DIR sasl,..\cyrus-sasl\
1023 dnl MSWIN_CHECK_DIR sasl,..\external\sasl\
1024 dnl MSWIN_CHECK_DIR sasl,..\external\cyrus-sasl\
1025 dnl MSWIN_CHECK_DIR sasl,\sasl\
1026 dnl MSWIN_CHECK_DIR sasl,\cyrus-sasl\
1027 dnl MSWIN_CHECK_DIR sasl,c:\sasl\
1028 dnl MSWIN_CHECK_DIR sasl,c:\cyrus-sasl\
1031 [ --disable-sasl disable SASL support])
1033 if test "${enable_sasl}z" = "z" ; then
1034 enable_sasl=$default_sasl
1040 if test "$enable_sasl" = "no" ; then
1041 AC_MSG_NOTICE(SASL disabled)
1044 AC_MSG_CHECKING([for sasl_version in -lsasl2])
1046 LIBS="$LIBS -lsasl2"
1047 AC_LINK_IFELSE([#ifdef __cplusplus
1050 char sasl_version ();
1057 }], HAS_SASL2=1, HAS_SASL2= )
1058 if test "${HAS_SASL2}x" = "x" ; then
1062 AC_MSG_CHECKING([for sasl_client_auth in sasl])
1063 AC_LINK_IFELSE([#ifdef __cplusplus
1066 char sasl_client_out ();
1073 }], HAS_SASL=1, HAS_SASL= )
1074 if test "${HAS_SASL}x" = "x" ; then
1084 dnl we need to track down the correct sasl.h
1085 AC_MSG_CHECKING([if <sasl.h> works])
1086 AC_COMPILE_IFELSE([[#include <sasl.h>
1087 int main(int argc,char **argv){ int v = SASL_LOG_PASS; }]],HAS_INCLUDE_SASL_H=1)
1088 if test "${HAS_INCLUDE_SASL_H}x" != "x" ; then
1093 AC_MSG_CHECKING([if <sasl/sasl.h> works])
1094 AC_COMPILE_IFELSE([[#include <sasl/sasl.h>
1095 int main(int argc,char **argv){ int v = SASL_LOG_PASS; }]],P_HAS_SASL_SASL_H=1)
1096 if test "${P_HAS_SASL_SASL_H}x" != "x" ; then
1099 AC_DEFINE(P_HAS_SASL_SASL_H)
1106 if test "${HAS_SASL2}x" != "x" ; then
1108 ENDLDLIBS="$ENDLDLIBS -lsasl2"
1110 elif test "${HAS_SASL}x" != "x" ; then
1112 ENDLDLIBS="$ENDLDLIBS -lsasl"
1123 dnl ########################################################################
1124 dnl check for mediaLib library
1127 AC_CHECK_LIB(mlib, mlib_VideoColorJFIFYCC2RGB420_Nearest, HAS_MEDIALIB=yes, HAS_MEDIALIB=no)
1128 if test $HAS_MEDIALIB = yes; then
1129 AC_DEFINE(P_MEDIALIB)
1130 ENDLDLIBS="-lmlib $ENDLDLIBS"
1133 dnl ########################################################################
1134 dnl look for OpenLDAP (requires SASL)
1136 dnl MSWIN_DISPLAY openldap,Open LDAP
1137 dnl MSWIN_IF_FEATURE openldap,sasl
1138 dnl MSWIN_CHECK_FILE openldap,include\ldap.h|OpenLDAP,P_LDAP=1
1139 dnl MSWIN_DIR_SYMBOL openldap,LDAP_DIR
1140 dnl MSWIN_CHECK_DIR openldap,..\openldap\
1141 dnl MSWIN_CHECK_DIR openldap,..\external\openldap\
1142 dnl MSWIN_CHECK_DIR openldap,\openldap\
1143 dnl MSWIN_CHECK_DIR openldap,c:\openldap\
1145 AC_ARG_ENABLE(openldap,
1146 [ --disable-openldap disable OpenLDAP support])
1148 if test "${enable_openldap}z" = "z" ; then
1149 enable_openldap=$default_openldap
1153 if test "$enable_openldap" = "no" ; then
1154 AC_MSG_NOTICE(OpenLDAP disabled)
1156 if test "${HAS_RESOLVER:-unset}" != "unset" -o "${OSTYPE}" = "mingw" ; then
1157 AC_CHECK_HEADERS(ldap.h, HAS_OPENLDAP=1)
1159 dnl posix4 is required by libldap_r on Solaris
1160 if test "${OSTYPE:-unknown}" = "solaris"; then
1161 OPENLDAPSYSLIBS=-lposix4
1164 dnl check also for lldap_r presence (required for thread safe OpenLDAP?)
1165 if test "${HAS_OPENLDAP:-unset}" != "unset" ; then
1166 AC_CHECK_LIB(ldap, ldap_open, HAS_OPENLDAP=1, HAS_OPENLDAP=,$LDAP_LIBRARIES $RESOLVER_LIBS $ENDLDLIBS $OPENLDAPSYSLIBS)
1168 AC_CHECK_FILE(/usr/local/include/ldap.h, HAS_OPENLDAP=1)
1169 if test "${HAS_OPENLDAP:-unset}" != "unset" ; then
1170 OPENLDAPINCLUDEDIR=/usr/local/include
1171 OPENLDAPLIBDIR=/usr/local/lib
1172 AC_CHECK_LIB(ldap, ldap_open, HAS_OPENLDAP=1, HAS_OPENLDAP=,-L/usr/local/lib $LDAP_LIBRARIES $RESOLVER_LIBS $ENDLDLIBS $OPENLDAPSYSLIBS)
1177 if test "${HAS_OPENLDAP:-unset}" != "unset" ; then
1179 AC_DEFINE(P_LDAP, 1, "OpenLDAP found")
1180 ENDLDLIBS="-lldap $LDAP_LIBRARIES $ENDLDLIBS"
1181 if test "${OPENLDAPINCLUDEDIR}unset" != "unset" ; then
1182 STDCCFLAGS="$STDCCFLAGS -I${OPENLDAPINCLUDEDIR}"
1184 if test "${OPENLDAPLIBDIR}unset" != "unset" ; then
1185 LDFLAGS="$LDFLAGS -L${OPENLDAPLIBDIR}"
1190 AC_SUBST(HAS_OPENLDAP)
1193 dnl ########################################################################
1194 dnl look for OpenSSL
1195 dnl check for environment variable, then assume standard system install
1196 dnl this process is made incredibly more complex by the fact that RedHad 9
1197 dnl is completely fscked. The default OpenSSL installation requires Kerberos,
1198 dnl even when Kerberos is not installed, requiring an explicit #define to
1200 dnl As if that is not enough, autoconf gets very confused if configure.in
1201 dnl contains a AC_CHECK_HEADER directive that never gets used. So we have
1202 dnl to ensure that it is always called
1204 dnl MSWIN_DISPLAY openssl,Open SSL
1205 dnl MSWIN_CHECK_FILE openssl,inc32\openssl\ssl.h,P_SSL=1
1206 dnl MSWIN_DIR_SYMBOL openssl,SSL_DIR
1207 dnl MSWIN_CHECK_DIR openssl,..\openssl\
1208 dnl MSWIN_CHECK_DIR openssl,..\external\openssl\
1209 dnl MSWIN_CHECK_DIR openssl,\openssl\
1210 dnl MSWIN_CHECK_DIR openssl,c:\openssl\
1211 dnl MSWIN_CHECK_DIR openssl,\libs\openssl\
1213 dnl MSWIN_DISPLAY osslAES,Open SSL AES
1214 dnl MSWIN_IF_FEATURE osslAES,openssl
1215 dnl MSWIN_CHECK_FILE osslAES,inc32\openssl\aes.h,P_SSL_AES=1
1216 dnl MSWIN_CHECK_DIR osslAES,..\openssl\
1217 dnl MSWIN_CHECK_DIR osslAES,..\external\openssl\
1218 dnl MSWIN_CHECK_DIR osslAES,\openssl\
1219 dnl MSWIN_CHECK_DIR osslAES,c:\openssl\
1220 dnl MSWIN_CHECK_DIR osslAES,\libs\openssl\
1222 dnl MSWIN_DISPLAY winssl,Windows Open SSL
1223 dnl MSWIN_IF_FEATURE winssl,!openssl
1224 dnl MSWIN_CHECK_FILE winssl,include\openssl\ssl.h,P_WINSSL=1
1225 dnl MSWIN_DIR_SYMBOL winssl,WINSSL_DIR
1226 dnl MSWIN_CHECK_DIR winssl,.\lib\VC\
1227 dnl MSWIN_CHECK_DIR winssl,\libs\openssl\
1229 dnl MSWIN_DISPLAY wsslAES,Windows Open SSL AES
1230 dnl MSWIN_IF_FEATURE wsslAES,winssl
1231 dnl MSWIN_CHECK_FILE wsslAES,include\openssl\aes.h,P_WINSSL_AES=1
1232 dnl MSWIN_CHECK_DIR wsslAES,.\lib\VC\
1233 dnl MSWIN_CHECK_DIR wsslAES,\libs\openssl\
1235 AC_ARG_ENABLE(openssl,
1236 [ --disable-openssl disable OpenSSL support])
1238 if test "${enable_openssl}z" = "z" ; then
1239 enable_openssl=$default_openssl
1243 if test "$enable_openssl" = "no" ; then
1244 AC_MSG_NOTICE(OpenSSL disabled)
1247 dnl check to see OPENSSLDIR is set
1248 dnl if it is, we assume it correct - no further checking required
1249 if test ${OPENSSLDIR:-unset} != "unset" ; then
1250 AC_MSG_CHECKING([for ${OPENSSLDIR}/include/openssl/ssl.h])
1251 if test -e ${OPENSSLDIR}/include/openssl/ssl.h ; then
1254 SSLINCLUDEDIR="${OPENSSLDIR}/include"
1255 SSLLIBDIR="${OPENSSLDIR}/lib"
1262 dnl if OPENSSLDIR is not set, then check to see if OpenSSL
1263 dnl is installed in the standard system dirs. And also see if
1264 dnl if it works using crazy RedHat checks
1265 if test "${SSLHDR:-unset}" = "unset" ; then
1266 AC_CHECK_HEADERS(openssl/ssl.h,SSLHDR=1)
1267 if test "${SSLHDR:-unset}" = "unset" ; then
1268 AC_MSG_CHECKING([if openssl/ssl.h works with OPENSSL_NO_KRB5])
1269 AC_COMPILE_IFELSE([[#define OPENSSL_NO_KRB5
1270 #include <openssl/ssl.h>
1271 int main(int argc,char **argv){}]],SSLHDR=1)
1272 if test "${SSLHDR:-unset}" != "unset" ; then
1274 SSLCCFLAGS=" -DOPENSSL_NO_KRB5"
1275 P_STATIC_LDFLAGS="$P_STATIC_LDFLAGS -L/usr/kerberos/lib"
1276 if test ${OSTYPE} = linux ; then
1277 dnl Linux static libs
1278 P_STATIC_ENDLDLIBS="-lkrb5 -lk5crypto -lcom_err"
1286 dnl if we have not found OpenSSL so far, then look for it in
1287 dnl several standard places, and check for crazy RedHat install too
1288 if test "${SSLHDR:-unset}" = "unset" ; then
1290 for openssl_dir in /usr/local/openssl /usr/local/ssl ; do
1291 AC_MSG_CHECKING([for OpenSSL in $openssl_dir])
1292 if test ! -f ${openssl_dir}/include/openssl/ssl.h ; then
1295 AC_LANG_CONFTEST([[#include "${openssl_dir}/include/openssl/ssl.h"
1296 int main(int argc,char **argv){ return 0; }]])
1297 $CXX $CXXFLAGS -I${openssl_dir}/include -c conftest.cc > /dev/null 2>&1
1298 if test $? = 0 ; then
1302 SSLINCLUDEDIR="${openssl_dir}/include"
1303 SSLLIBDIR="${openssl_dir}/lib"
1307 AC_MSG_CHECKING([if ${openssl_dir}/include/openssl/ssl.h works with OPENSSL_NO_KRB5...])
1308 AC_LANG_CONFTEST([[#define OPENSSL_NO_KRB5
1309 #include "${openssl_dir}/include/openssl/ssl.h"
1310 int main(int argc,char **argv){}]])
1311 $CXX $CXXFLAGS -I${openssl_dir}/openssl/include -c conftest.cc > /dev/null 2>&1
1312 if test $? = 0 ; then
1315 SSLCCFLAGS=" -DOPENSSL_NO_KRB5"
1316 SSLINCLUDEDIR="${openssl_dir}/include"
1317 SSLLIBDIR="${openssl_dir}/lib"
1318 P_STATIC_LDFLAGS="$P_STATIC_LDFLAGS -L/usr/kerberos/lib"
1319 if test ${OSTYPE} = linux ; then
1320 dnl Linux static libs
1321 P_STATIC_ENDLDLIBS="-lkrb5 -lk5crypto -lcom_err"
1332 if test ${SSLHDR:-unset} != "unset" ; then
1333 AC_DEFINE(P_SSL, 1, "OpenSSL found")
1335 if test ${SSLINCLUDEDIR:-unset} != "unset" ; then
1336 STDCCFLAGS="$STDCCFLAGS -I${SSLINCLUDEDIR}"
1338 if test ${SSLLIBDIR:-unset} != "unset" ; then
1339 LDFLAGS="$LDFLAGS -L${SSLLIBDIR}"
1341 STDCCFLAGS="${STDCCFLAGS}${SSLCCFLAGS}"
1342 ENDLDLIBS="$ENDLDLIBS -lssl -lcrypto"
1344 AC_CHECK_HEADERS(openssl/aes.h, HAS_SSL_AES=yes, HAS_SSL_AES=no)
1345 if test "$HAS_SSL_AES" = yes ; then
1346 AC_DEFINE(P_SSL_AES, 1, "openssl with AES yes")
1349 AC_MSG_CHECKING(for const arg to d2i_AutoPrivateKey)
1350 AC_TRY_COMPILE([#include <openssl/evp.h>],
1351 [ EVP_PKEY **a; const unsigned char **p; long l;
1352 d2i_AutoPrivateKey(a, p, l);
1353 ], P_SSL_USE_CONST=yes, )
1354 if test "${P_SSL_USE_CONST}x" = "x" ; then
1358 AC_DEFINE(P_SSL_USE_CONST, 1, "SSL with const")
1363 AC_SUBST(HAS_OPENSSL)
1364 AC_SUBST(P_STATIC_ENDLDLIBS)
1365 AC_SUBST(P_STATIC_LDFLAGS)
1367 dnl ########################################################################
1368 dnl look for expat XML parser
1370 dnl MSWIN_DISPLAY expat,Expat XML
1371 dnl MSWIN_CHECK_FILE expat,Release\expat.lib,P_EXPAT=1
1372 dnl MSWIN_DIR_SYMBOL expat,EXPAT_DIR
1373 dnl MSWIN_CHECK_DIR expat,..\expat\
1374 dnl MSWIN_CHECK_DIR expat,..\external\expat\
1375 dnl MSWIN_CHECK_DIR expat,\expat
1376 dnl MSWIN_CHECK_DIR expat,c:\expat\
1377 dnl MSWIN_CHECK_DIR expat,\libs\expat\
1379 dnl MSWIN_DISPLAY winexpat,Windows Expat XML
1380 dnl MSWIN_IF_FEATURE winexpat,!expat
1381 dnl MSWIN_CHECK_FILE winexpat,libs\libexpat.lib,P_WINEXPAT=1
1382 dnl MSWIN_DIR_SYMBOL winexpat,WINEXPAT_DIR
1383 dnl MSWIN_CHECK_DIR winexpat,source\lib
1384 dnl MSWIN_CHECK_DIR winexpat,\libs\expat\
1386 AC_ARG_ENABLE(expat,
1387 [ --disable-expat disable XML support])
1389 if test "${enable_expat}z" = "z" ; then
1390 enable_expat=$default_expat
1394 if test "$enable_expat" = "no" ; then
1395 AC_MSG_NOTICE(Expat disabled)
1397 if test "${EXPATDIR}z" != "z" ; then
1398 AC_CHECK_FILE(${EXPATDIR}/include/expat.h, HAS_EXPAT=1)
1399 if test "${HAS_EXPAT:-unset}" != "unset" ; then
1400 EXPATINCLUDEDIR=${EXPATDIR}/include
1401 EXPATLIBDIR=${EXPATDIR}/lib
1404 AC_CHECK_HEADERS(expat.h, HAS_EXPAT=1)
1405 if test "${HAS_EXPAT:-unset}" != "unset" ; then
1406 AC_CHECK_LIB(expat, XML_ParserCreate, HAS_EXPAT=1, HAS_EXPAT=)
1408 AC_CHECK_FILE(/usr/local/include/expat.h, HAS_EXPAT=1)
1409 if test "${HAS_EXPAT:-unset}" != "unset" ; then
1410 EXPATINCLUDEDIR=/usr/local/include
1411 EXPATLIBDIR=/usr/local/lib
1416 if test "${HAS_EXPAT:-unset}" != "unset" ; then
1418 AC_DEFINE(P_EXPAT, 1, "expat found")
1419 if test ${EXPATINCLUDEDIR:-unset} != "unset" ; then
1420 STDCCFLAGS="$STDCCFLAGS -I${EXPATINCLUDEDIR}"
1422 if test ${EXPATLIBDIR:-unset} != "unset" ; then
1423 LDFLAGS="$LDFLAGS -L${EXPATLIBDIR}"
1425 ENDLDLIBS="$ENDLDLIBS -lexpat"
1430 dnl ########################################################################
1431 dnl handle modules dependent on Expat
1433 dnl MSWIN_DISPLAY vxml,VXML
1434 dnl MSWIN_DEFINE vxml,P_VXML
1435 dnl MSWIN_IF_FEATURE vxml,expat|winexpat
1437 dnl MSWIN_DISPLAY jabber,Jabber
1438 dnl MSWIN_DEFINE jabber,P_JABBER
1439 dnl MSWIN_IF_FEATURE jabber,expat|winexpat
1441 dnl MSWIN_DISPLAY xmlrpc,XMLRPC
1442 dnl MSWIN_DEFINE xmlrpc,P_XMLRPC
1443 dnl MSWIN_IF_FEATURE xmlrpc,expat|winexpat
1445 dnl MSWIN_DISPLAY soap,SOAP
1446 dnl MSWIN_DEFINE soap,P_SOAP
1447 dnl MSWIN_IF_FEATURE soap,expat|winexpat
1453 if test "$enable_expat" = "no" ; then
1454 AC_MSG_NOTICE(VXML disabled as Expat is disabled)
1455 AC_MSG_NOTICE(Jabber disabled as Expat is disabled)
1456 AC_MSG_NOTICE(XMLRPC disabled as Expat is disabled)
1459 dnl ########################################################################
1463 [ --disable-vxml disable VXML support])
1465 if test "${enable_vxml}z" = "z" ; then
1466 enable_vxml=$default_vxml
1468 if test "$enable_vxml" = "no" ; then
1469 AC_MSG_NOTICE(VXML disabled)
1471 AC_DEFINE(P_VXML, 1)
1475 dnl ########################################################################
1478 AC_ARG_ENABLE(jabber,
1479 [ --disable-jabber disable Jabber support])
1481 if test "${enable_jabber}z" = "z" ; then
1482 enable_jabber=$default_jabber
1484 if test "$enable_jabber" = "no" ; then
1485 AC_MSG_NOTICE(Jabber disabled)
1487 AC_DEFINE(P_JABBER, 1)
1491 dnl ########################################################################
1494 AC_ARG_ENABLE(xmlrpc,
1495 [ --disable-xmlrpc disable XMLRPC support])
1497 if test "${enable_xmlrpc}z" = "z" ; then
1498 enable_xmlrpc=$default_xmlrpc
1500 if test "$enable_xmlrpc" = "no" ; then
1501 AC_MSG_NOTICE(XMLRPC disabled)
1503 AC_DEFINE(P_XMLRPC, 1)
1507 dnl ########################################################################
1511 [ --disable-soap disable SOAP support])
1513 if test "${enable_soap}z" = "z" ; then
1514 enable_soap=$default_soap
1516 if test "$enable_soap" = "no" ; then
1517 AC_MSG_NOTICE(SOAP disabled)
1519 AC_DEFINE(P_SOAP, 1)
1525 AC_SUBST(HAS_JABBER)
1526 AC_SUBST(HAS_XMLRPC)
1529 dnl ########################################################################
1532 dnl MSWIN_DISPLAY sapi,Speech API
1533 dnl MSWIN_CHECK_FILE sapi,include\sphelper.h,P_SAPI=1
1534 dnl MSWIN_DEFINE sapi,P_TTS
1535 dnl MSWIN_DIR_SYMBOL sapi,SAPI_DIR
1536 dnl MSWIN_CHECK_DIR sapi,\Program Files\Microsoft Speech SDK 5.1\
1538 AC_ARG_ENABLE(expat,
1539 [ --disable-tts disable Text-ToSpeech support (default enabled)])
1541 if test "${enable_tts}z" = "z" ; then
1542 enable_tts=$default_tts
1546 if test "$enable_tts" = "no" ; then
1547 AC_MSG_NOTICE(Text-to-speech disabled)
1554 dnl ########################################################################
1555 dnl look for IPV6 functions
1557 dnl MSWIN_DISPLAY ipv6,IPv6 Support
1558 dnl MSWIN_CHECK_FILE ipv6,ws2tcpip.h|sin6_scope_id,P_HAS_IPV6=1
1559 dnl MSWIN_DIR_SYMBOL ipv6,IPV6_DIR
1560 dnl MSWIN_CHECK_DIR ipv6,\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\
1561 dnl MSWIN_CHECK_DIR ipv6,\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\Include\
1562 dnl MSWIN_CHECK_DIR ipv6,\Program Files\Microsoft Visual Studio\VC98\Include\
1563 dnl MSWIN_CHECK_DIR ipv6,\Program Files\Microsoft SDK\Include\
1564 dnl MSWIN_CHECK_DIR ipv6,\Program Files\Microsoft Platform Sdk for Windows Server 2003 R2\Include
1567 [ --disable-ipv6 disable IPV6 support])
1569 if test "${enable_ipv6}z" = "z" ; then
1570 enable_ipv6=$default_ipv6
1575 if test "$enable_ipv6" = "no" ; then
1576 AC_MSG_NOTICE(IPV6 disabled)
1578 AC_MSG_CHECKING(for IPv6 support)
1579 AC_TRY_COMPILE([#include <sys/types.h>
1580 #include <netinet/in.h>],
1581 [struct sockaddr_in6 s; s.sin6_scope_id = 0;], HAS_IPV6=yes, HAS_IPV6=no)
1582 if test $HAS_IPV6 = no ; then
1585 AC_TRY_COMPILE([#include <sys/socket.h>
1586 #include <netdb.h>],
1587 [getnameinfo(NULL, 0, NULL, 0, NULL, 0, 0);], HAS_IPV6=yes, HAS_IPV6=no)
1588 if test $HAS_IPV6 = no ; then
1592 AC_DEFINE(P_HAS_IPV6, 1, "IPV6 enabled")
1599 dnl ########################################################################
1600 dnl look for QoS functions
1602 dnl MSWIN_DISPLAY qos,QoS Support
1603 dnl MSWIN_CHECK_FILE qos,qossp.h|QOS_DESTADDR,P_HAS_QOS=1
1604 dnl MSWIN_DIR_SYMBOL qos,QOS_DIR
1605 dnl MSWIN_CHECK_DIR qos,\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\
1606 dnl MSWIN_CHECK_DIR qos,\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\Include\
1607 dnl MSWIN_CHECK_DIR qos,\Program Files\Microsoft Visual Studio\VC98\Include\
1608 dnl MSWIN_CHECK_DIR qos,\Program Files\Microsoft SDK\include\
1609 dnl MSWIN_CHECK_DIR qos,\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\
1612 [ --disable-qos disable QOS support])
1614 if test "${enable_qos}z" = "z" ; then
1615 enable_qos=$default_qos
1618 if test "$enable_qos" != "no" ; then
1619 AC_DEFINE([P_HAS_QOS], [1], [Have QOS])
1623 dnl ########################################################################
1624 dnl look for SDL, but only if we have pthreads
1626 dnl MSWIN_DISPLAY libsdl,Simple DirectMedia Layer
1627 dnl MSWIN_CHECK_FILE libsdl,include\SDL_video.h,P_SDL=1
1628 dnl MSWIN_CHECK_FILE libsdl,lib\SDL.lib,P_SDL_LIBDIR="lib"
1629 dnl MSWIN_DIR_SYMBOL libsdl,SDL_DIR
1630 dnl MSWIN_CHECK_DIR libsdl,..\sdl\
1631 dnl MSWIN_CHECK_DIR libsdl,..\external\sdl\
1632 dnl MSWIN_CHECK_DIR libsdl,\sdl\
1633 dnl MSWIN_CHECK_DIR libsdl,c:\sdl\
1636 [ --disable-sdl disable SDL support])
1638 if test "${enable_sdl}z" = "z" ; then
1639 enable_sdl=$default_sdl
1643 if test "$enable_sdl" = "no" ; then
1644 AC_MSG_NOTICE(SDL disabled)
1648 if test "${SDLLIB:-unset}" = "unset" ; then
1653 AC_CHECK_HEADERS(SDL/SDL.h, HAS_SDL=1)
1654 if test "${HAS_SDL:-unset}" != "unset" ; then
1655 if test "${X11LIBDIR:-unset}" == "unset" ; then
1656 X11LIBDIR=/usr/X11R6/lib
1658 AC_CHECK_LIB(SDL, SDL_CreateYUVOverlay, HAS_SDL=1, HAS_SDL=, -L${X11LIBDIR} -lpthread -lX11 -lXext)
1661 dnl FreeBSD SDL check
1662 if test "${HAS_SDL:-unset}" = "unset" ; then
1663 AC_CHECK_HEADER(SDL11/SDL.h, HAS_SDL=1)
1664 if test "${HAS_SDL:-unset}" != "unset" ; then
1669 if test "${HAS_SDL:-unset}" != "unset" ; then
1671 AC_DEFINE(P_SDL, 1, "SDL found")
1672 if test ${SDLINCLUDEDIR:-unset} != "unset" ; then
1673 STDCCFLAGS="$STDCCFLAGS -I${SDLINCLUDEDIR}"
1675 if test ${SDLLIBDIR:-unset} != "unset" ; then
1676 LDFLAGS="$LDFLAGS -L${SDLLIBDIR}"
1678 ENDLDLIBS="$ENDLDLIBS -l${SDLLIB}"
1684 dnl ########################################################################
1685 dnl check for video capture support.
1686 dnl videodev.h on linux
1687 dnl machine/ioctl_meteor on FreeBSD
1688 dnl i386/ioctl_meteor on OpenBSD
1689 dnl dev/ic/bt8xx on NetBSD
1691 dnl MSWIN_DISPLAY video,Video Support
1692 dnl MSWIN_DEFINE video,P_VIDEO
1694 AC_ARG_ENABLE(video,
1695 [ --disable-video disable video device support])
1697 if test "${enable_video}z" = "z" ; then
1698 enable_video=$default_video
1704 if test "$enable_video" = "no" ; then
1705 AC_DEFINE([NO_VIDEO_CAPTURE], [], [No video capture])
1707 AC_DEFINE(P_VIDEO, 1)
1709 if test "$enable_plugins" = "yes" ; then
1712 AC_CHECK_HEADER(linux/videodev.h, HAS_VIDEO_CAPTURE=1)
1713 dnl AC_CHECK_HEADER(machine/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
1714 dnl AC_CHECK_HEADER(i386/ioctl_meteor.h, HAS_VIDEO_CAPTURE=1)
1715 dnl AC_CHECK_HEADER(dev/ic/bt8xx.h, HAS_VIDEO_CAPTURE=1)
1716 if test "${HAS_VIDEO_CAPTURE}z" = "z" ; then
1717 AC_MSG_NOTICE(No Video Capture support)
1718 AC_DEFINE([NO_VIDEO_CAPTURE], [], [No video capture])
1721 dnl these are needed to pass through to plugin configure
1722 AC_ARG_ENABLE(v4l, [ --enable-v4l enable V4L video support])
1723 AC_ARG_ENABLE(v4l2, [ --enable-v4l2 enable V4L2 video support])
1724 AC_ARG_ENABLE(bsdvideo, [ --enable-bsdvideo enable BSD video support])
1725 AC_ARG_ENABLE(avc, [ --enable-avc enable IEEE1394/AVC video support])
1726 AC_ARG_ENABLE(dc, [ --enable-dc enable IEEE1394/DC video support])
1730 AC_SUBST(HAS_VIDEO_CAPTURE)
1732 dnl ########################################################################
1733 dnl enable shared memory video devices (static video plugin)
1736 AC_ARG_ENABLE(shm_video,
1737 [ --enable-shmvideo enable shared memory video devices],
1738 shm_video=$enableval)
1740 if test "${enable_shmvideo}z" = "z" ; then
1741 shm_video=$default_shmvideo
1744 USE_SHM_VIDEO_DEVICES=
1745 if test "$shm_video" = "yes" ; then
1746 USE_SHM_VIDEO_DEVICES=1
1747 AC_MSG_NOTICE(Shared memory video devices enabled)
1749 AC_MSG_NOTICE(Shared memory video devices disabled)
1751 AC_SUBST(USE_SHM_VIDEO_DEVICES)
1753 dnl ########################################################################
1754 dnl check for enabling ASN support
1756 dnl MSWIN_DISPLAY asn,ASN Support
1757 dnl MSWIN_DEFINE asn,P_ASN
1760 [ --disable-asn disable ASN decoding/encoding support])
1762 if test "${enable_asn}z" = "z" ; then
1763 enable_asn=$default_asn
1767 if test "$enable_asn" = "no" ; then
1768 AC_MSG_NOTICE(ASN decoding/encoding support disabled)
1775 dnl ########################################################################
1776 dnl check for enabling STUN support
1778 dnl MSWIN_DISPLAY stun,STUN Support
1779 dnl MSWIN_DEFINE stun,P_STUN
1782 [ --disable-stun disable STUN protocol support])
1784 if test "${enable_stun}z" = "z" ; then
1785 enable_stun=$default_stun
1789 if test "$enable_stun" = "no" ; then
1790 AC_MSG_NOTICE(STUN decoding/encoding support disabled)
1793 AC_DEFINE(P_STUN, 1)
1797 dnl ########################################################################
1798 dnl check for enabling PIPECHAN support
1800 dnl MSWIN_DISPLAY pipechan,pipe channel Support
1801 dnl MSWIN_DEFINE pipechan,P_PIPECHAN
1803 AC_ARG_ENABLE(pipechan,
1804 [ --disable-pipechan disable pipechannel support])
1806 if test "${enable_pipechan}z" = "z" ; then
1807 enable_pipechan=$default_pipechan
1811 if test "$enable_pipechan" = "no" ; then
1812 AC_MSG_NOTICE(pipechannel support disabled)
1815 AC_DEFINE(P_PIPECHAN, 1)
1817 AC_SUBST(HAS_PIPECHAN)
1819 dnl ########################################################################
1820 dnl check for enabling DTMF support
1822 dnl MSWIN_DISPLAY dtmf,DTMF encoding/decoding support
1823 dnl MSWIN_DEFINE dtmf,P_DTMF
1826 [ --disable-dtmf disable DTMF protocol support])
1828 if test "${enable_dtmf}z" = "z" ; then
1829 enable_dtmf=$default_dtmf
1833 if test "$enable_dtmf" = "no" ; then
1834 AC_MSG_NOTICE(DTMF decoding/encoding support disabled)
1837 AC_DEFINE(P_DTMF, 1)
1841 dnl ########################################################################
1842 dnl check for enabling WAVFILE support
1844 dnl MSWIN_DISPLAY wavfile,WAV file support
1845 dnl MSWIN_DEFINE wavfile,P_WAVFILE
1847 AC_ARG_ENABLE(wavfile,
1848 [ --disable-wavfile disable WAVFILE support])
1850 if test "${enable_wavfile}z" = "z" ; then
1851 enable_wavfile=$default_wavfile
1855 if test "$enable_wavfile" = "no" ; then
1856 AC_MSG_NOTICE(WAV file support disabled)
1859 AC_DEFINE(P_WAVFILE, 1)
1861 AC_SUBST(HAS_WAVFILE)
1863 dnl ########################################################################
1864 dnl check for enabling SOCKS support
1866 dnl MSWIN_DISPLAY socks,SOCKS protocol support
1867 dnl MSWIN_DEFINE socks,P_SOCKS
1869 AC_ARG_ENABLE(socks,
1870 [ --disable-socks disable SOCKS protocol support])
1872 if test "${enable_socks}z" = "z" ; then
1873 enable_socks=$default_socks
1877 if test "$enable_socks" = "no" ; then
1878 AC_MSG_NOTICE(SOCKS decoding/encoding support disabled)
1881 AC_DEFINE(P_SOCKS, 1)
1885 dnl ########################################################################
1886 dnl check for enabling FTP support
1888 dnl MSWIN_DISPLAY ftp,FTP protocol support
1889 dnl MSWIN_DEFINE ftp,P_FTP
1892 [ --disable-ftp disable FTP support])
1894 if test "${enable_ftp}z" = "z" ; then
1895 enable_ftp=$default_ftp
1899 if test "$enable_ftp" = "no" ; then
1900 AC_MSG_NOTICE(FTP protocol support disabled)
1907 dnl ########################################################################
1908 dnl check for enabling SNMP support
1910 dnl MSWIN_DISPLAY snmp,SNMP protocol support
1911 dnl MSWIN_DEFINE snmp,P_SNMP
1914 [ --disable-snmp disable SNMP protocol support])
1916 if test "${enable_snmp}z" = "z" ; then
1917 enable_snmp=$default_snmp
1921 if test "$enable_snmp" = "no" ; then
1922 AC_MSG_NOTICE(SNMP protocol support disabled)
1925 AC_DEFINE(P_SNMP, 1)
1929 dnl ########################################################################
1930 dnl check for enabling TELNET support
1932 dnl MSWIN_DISPLAY telnet,Telnet protocol support
1933 dnl MSWIN_DEFINE telnet,P_TELNET
1935 AC_ARG_ENABLE(telnet,
1936 [ --disable-telnet disable Telnet protocol support])
1938 if test "${enable_telnet}z" = "z" ; then
1939 enable_telnet=$default_telnet
1943 if test "$enable_telnet" = "no" ; then
1944 AC_MSG_NOTICE(Telnet protocol support disabled)
1947 AC_DEFINE(P_TELNET, 1)
1949 AC_SUBST(HAS_TELNET)
1951 dnl ########################################################################
1952 dnl check for enabling REMCONN support
1954 dnl MSWIN_DISPLAY remconn,remote connection support
1955 dnl MSWIN_DEFINE remconn,P_REMCONN
1957 AC_ARG_ENABLE(remconn,
1958 [ --disable-remconn disable remote connection support])
1960 if test "${enable_remconn}z" = "z" ; then
1961 enable_remconn=$default_remconn
1965 if test "$enable_remconn" = "no" ; then
1966 AC_MSG_NOTICE(Remote connection support disabled)
1969 AC_DEFINE(P_REMCONN, 1)
1971 AC_SUBST(HAS_REMCONN)
1973 dnl ########################################################################
1974 dnl check for enabling serial port handling
1976 dnl MSWIN_DISPLAY serial,Serial Support
1977 dnl MSWIN_DEFINE serial,P_SERIAL
1979 AC_ARG_ENABLE(serial,
1980 [ --disable-serial disable serial port support])
1982 if test "${enable_serial}z" = "z" ; then
1983 enable_serial=$default_serial
1987 if test "$enable_serial" = "no" ; then
1988 AC_MSG_NOTICE(Serial port support disabled)
1991 AC_DEFINE(P_SERIAL, 1)
1993 AC_SUBST(HAS_SERIAL)
1995 dnl ########################################################################
1996 dnl check for POP3/SMTP support
1998 dnl MSWIN_DISPLAY pop3smtp,POP3/SMTP Support
1999 dnl MSWIN_DEFINE pop3smtp,P_POP3SMTP
2001 AC_ARG_ENABLE(pop3smtp,
2002 [ --disable-pop3smtp disable POP3/SMTP support])
2004 if test "${enable_pop3smtp}z" = "z" ; then
2005 enable_pop3smtp=$default_pop3smtp
2009 if test "$enable_pop3smtp" = "no" ; then
2010 AC_MSG_NOTICE(POP3/SMTP protocol support disabled)
2013 AC_DEFINE(P_POP3SMTP, 1)
2015 AC_SUBST(HAS_POP3SMTP)
2017 dnl ########################################################################
2018 dnl check for HTTP support
2020 dnl MSWIN_DISPLAY http,HTTP Support
2021 dnl MSWIN_DEFINE http,P_HTTP
2024 [ --disable-http disable HTTP support])
2026 if test "${enable_http}z" = "z" ; then
2027 enable_http=$default_http
2031 if test "$enable_http" = "no" ; then
2032 AC_MSG_NOTICE(HTTP protocol support disabled)
2035 AC_DEFINE(P_HTTP, 1)
2039 dnl ########################################################################
2040 dnl check for HTTPSVC support
2042 dnl MSWIN_DISPLAY httpsvc,HTTP service Support
2043 dnl MSWIN_DEFINE httpsvc,P_HTTPSVC
2045 AC_ARG_ENABLE(httpsvc,
2046 [ --disable-httpsvc disable HTTP service support])
2048 if test "${enable_httpsvc}z" = "z" ; then
2049 enable_httpsvc=$default_httpsvc
2053 if test "$enable_httpsvc" = "no" ; then
2054 AC_MSG_NOTICE(HTTP service support disabled)
2057 AC_DEFINE(P_HTTPSVC, 1)
2059 AC_SUBST(HAS_HTTPSVC)
2061 dnl ########################################################################
2062 dnl check for enabling config file support
2064 dnl MSWIN_DISPLAY config_file,Config file protocol support
2065 dnl MSWIN_DEFINE config_file,P_CONFIG_FILE
2067 AC_ARG_ENABLE(configfile,
2068 [ --disable-configfile disable config file support])
2070 if test "${enable_configfile}z" = "z" ; then
2071 enable_configfile=$default_configfile
2075 if test "$enable_configfile" = "no" ; then
2076 AC_MSG_NOTICE(Config file support disabled)
2079 AC_DEFINE(P_CONFIG_FILE, 1)
2081 AC_SUBST(HAS_CONFIG_FILE)
2083 dnl ########################################################################
2084 dnl check for enabling socket aggregation
2086 dnl MSWIN_DISPLAY sockagg,Socket aggregation support
2087 dnl MSWIN_DEFINE sockagg,P_SOCKAGG
2089 AC_ARG_ENABLE(sockagg,
2090 [ --enable-sockagg enable socket aggregation (experimental)])
2092 if test "${enable_sockagg}z" = "z" ; then
2093 enable_sockagg=$default_sockagg
2097 if test "$enable_sockagg" = "no" ; then
2098 AC_MSG_NOTICE(Socket aggregation support disabled)
2100 AC_MSG_NOTICE(Socket aggregation support enabled (experimental))
2102 AC_DEFINE(P_SOCKAGG, 1)
2104 AC_SUBST(HAS_SOCKAGG)
2106 dnl ########################################################################
2107 dnl check for enabling video file support
2109 dnl MSWIN_DISPLAY vidfile,Video file support
2110 dnl MSWIN_DEFINE vidfile,P_VIDFILE
2112 if test "$HAS_VIDEO" \!= "1" ; then
2116 AC_ARG_ENABLE(vidfile,
2117 [ --enable-vidfile enable video file support])
2119 if test "${enable_vidfile}z" = "z" ; then
2120 enable_vidfile=$default_vidfile
2124 if test "$enable_vidfile" = "no" ; then
2125 AC_MSG_NOTICE(Video file support disabled)
2127 AC_MSG_NOTICE(Video file support enabled)
2129 AC_DEFINE(P_VIDFILE, 1)
2131 AC_SUBST(HAS_VIDFILE)
2133 dnl ########################################################################
2134 dnl check for sound support
2136 dnl MSWIN_DISPLAY audio,Sound support
2137 dnl MSWIN_DEFINE audio,P_AUDIO
2139 AC_ARG_ENABLE(audio,
2140 [ --disable-audio disable audio support])
2142 if test "${enable_audio}z" = "z" ; then
2143 enable_audio=$default_audio
2147 if test "$enable_audio" = "no" ; then
2148 AC_MSG_NOTICE(Audio support disabled)
2155 dnl ########################################################################
2156 dnl check for for audio drivers
2160 if test "$enable_audio" = "yes" ; then
2162 dnl these are needed to pass through to the plugin configure program
2163 AC_ARG_ENABLE(alsa, [ --enable-alsa enable ALSA audio support],enable_alsa=$enableval)
2164 AC_ARG_ENABLE(oss, [ --enable-oss enable OSS audio support],enable_oss=$enableval)
2166 if test "$enable_plugins" = "no" ; then
2168 if test "${enable_alsa}z" = "z" ; then
2169 enable_alsa=$default_alsa
2172 if test "${enable_oss}z" = "z" ; then
2173 enable_oss=$default_oss
2176 if test "$enable_alsa" = "yes" ; then
2177 AC_CHECK_HEADER(alsa/asoundlib.h, HAS_ALSA=1)
2178 AC_MSG_CHECKING(for ALSA sound support)
2179 if test "${HAS_ALSA}z" != "z"; then
2181 ENDLDLIBS="$ENDLDLIBS -lasound"
2188 if test "${HAS_ALSA}z" = "z" ; then
2189 if test "$enable_oss" = "yes" ; then
2190 AC_CHECK_HEADER(sys/soundcard.h, SNDCARDHDR=1)
2191 AC_MSG_CHECKING(for OSS sound support)
2192 if test "${SNDCARDHDR}z" != "z"; then
2193 AC_SUBST(HAS_OSS, 1)
2207 dnl ########################################################################
2208 dnl look for Direct Sound
2210 dnl MSWIN_DISPLAY dsound,Direct Sound Support
2211 dnl MSWIN_CHECK_FILE dsound,include\dsound.h,P_DIRECTSOUND=1
2212 dnl MSWIN_DIR_SYMBOL dsound,DIRECTX_DIR
2213 dnl MSWIN_FIND_FILE dsound,P_DIRECTSOUND_LIB64,dsound.lib,lib/x64
2214 dnl MSWIN_FIND_FILE dsound,P_DIRECTSOUND_LIB32,dsound.lib,lib/x86
2215 dnl MSWIN_FIND_FILE dsound,P_DIRECTSOUND_LIB32,dsound.lib,lib
2216 dnl MSWIN_CHECK_DIR dsound,\Program Files\Microsoft DirectX SDK\
2217 dnl MSWIN_CHECK_DIR dsound,\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\
2218 dnl MSWIN_CHECK_DIR dsound,\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\
2219 dnl MSWIN_CHECK_DIR dsound,\Program Files\Microsoft SDK\
2220 dnl MSWIN_CHECK_DIR dsound,\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\
2223 dnl ########################################################################
2224 dnl check for various functions
2225 dnl According to Andre Schulze <as8@rncmm2.urz.tu-dresden.de>
2226 dnl Solaris swab should not be used
2227 if test "$OSTYPE" = "solaris" ; then
2230 AC_CHECK_FUNC(swab,USE_SYSTEM_SWAB=1)
2232 if test "x$ac_cv_func_swab" = "xyes" ; then
2233 AC_DEFINE([USE_SYSTEM_SWAB], [], [Use system swab()])
2236 dnl ########################################################################
2237 dnl look for MEMORY_CHECK enabled.
2239 AC_ARG_ENABLE(memcheck,
2240 [ --enable-memcheck enable leak testing code (off by default)],
2241 memcheck=$enableval)
2243 if test "$memcheck" = "yes" ; then
2244 AC_DEFINE(PMEMORY_CHECK, 1)
2245 AC_MSG_NOTICE(Memory checking enabled)
2249 dnl ########################################################################
2250 dnl look for ODBC code
2252 dnl MSWIN_DISPLAY odbc,ODBC support
2253 dnl MSWIN_CHECK_FILE odbc,odbcinst.h,P_ODBC=1
2254 dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft Visual Studio 8\VC\PlatformSDK\Include\
2255 dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft Visual Studio .NET 2003\VC7\PlatformSDK\Include\
2256 dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft SDK\include\
2257 dnl MSWIN_CHECK_DIR odbc,\Program Files\Microsoft Platform SDK for Windows Server 2003 R2\Include\
2260 [ --disable-odbc disable ODBC support])
2262 if test "${enable_odbc}z" = "z" ; then
2263 enable_odbc=$default_odbc
2267 if test "$enable_odbc" = "no" ; then
2268 AC_MSG_NOTICE(ODBC support disabled)
2270 AC_CHECK_HEADERS(sql.h, HAS_ODBC=1)
2271 if test "${HAS_ODBC:-unset}" != "unset" ; then
2272 AC_CHECK_LIB(odbc, SQLAllocStmt, HAS_ODBC=1, HAS_ODBC=)
2274 AC_CHECK_FILE(/usr/local/include/sql.h, HAS_ODBC=1)
2275 if test "${HAS_ODBC:-unset}" != "unset" ; then
2276 ODBCINCLUDEDIR=/usr/local/include
2277 ODBCLIBDIR=/usr/local/lib
2281 if test "${HAS_ODBC:-unset}" != "unset" ; then
2283 AC_DEFINE(P_ODBC, 1, "ODBC found")
2284 if test ${ODBCINCLUDEDIR:-unset} != "unset" ; then
2285 STDCCFLAGS="$STDCCFLAGS -I${ODBCINCLUDEDIR}"
2287 if test ${ODBCLIBDIR:-unset} != "unset" ; then
2288 LDFLAGS="$LDFLAGS -L${ODBCLIBDIR}"
2290 ENDLDLIBS="$ENDLDLIBS -lodbc"
2291 AC_MSG_NOTICE(ODBC support enabled)
2298 dnl ########################################################################
2299 dnl output make directives
2301 dnl resolver needs to be at the end
2302 if test "${HAS_RESOLVER:-unset}" != "unset" ; then
2303 if test "${RESOLVER_LIBS:-unset}" != "unset" ; then
2304 ENDLDLIBS="$ENDLDLIBS $RESOLVER_LIBS"
2308 dnl dl needs to be at the end
2309 if test "${OSTYPE}" != "Darwin" ; then
2310 if test ${HAS_LIBDL} = yes ; then
2311 ENDLDLIBS="$ENDLDLIBS -ldl"
2315 dnl ########################################################################
2316 dnl this reduces the size of all executables and libraries
2318 AC_ARG_ENABLE(exceptions,
2319 [ --exceptions enable C++ exceptions])
2321 if test "${enable_exceptions}z" != "yesz" ; then
2322 AC_MSG_NOTICE(C++ exceptions disabled)
2323 STDCCFLAGS="$STDCCFLAGS -fno-exceptions"
2325 AC_DEFINE(P_EXCEPTIONS, 1)
2326 AC_MSG_NOTICE(C++ exceptions enabled)
2327 STDCCFLAGS="$STDCCFLAGS -fexceptions"
2330 dnl ########################################################################
2331 dnl final declarations
2333 AC_SUBST(STDCCFLAGS)
2334 AC_SUBST(STDCXXFLAGS)
2335 AC_SUBST(OPTSTDCCFLAGS)
2338 AC_SUBST(DEBUG_FLAG)
2341 AC_CONFIG_FILES(make/ptbuildopts.mak)
2342 AC_CONFIG_FILES([make/ptlib-config], [chmod a+x make/ptlib-config])
2343 AC_CONFIG_FILES(Makefile)
2345 dnl ########################################################################
2346 dnl output header file
2347 #AC_CONFIG_FILES(include/ptbuildopts.h.in)
2348 AC_CONFIG_HEADERS(include/ptbuildopts.h)