8
AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h
9
pjlib/include/pj/compat/m_auto.h
10
pjmedia/include/pjmedia/config_auto.h
11
pjmedia/include/pjmedia-codec/config_auto.h
12
pjsip/include/pjsip/sip_autoconf.h
14
AC_CONFIG_FILES([build.mak
17
pjlib/build/os-auto.mak
18
pjlib-util/build/os-auto.mak
19
pjmedia/build/os-auto.mak
20
pjsip/build/os-auto.mak
21
third_party/build/os-auto.mak
22
third_party/build/portaudio/os-auto.mak
27
dnl Setup default CFLAGS
29
if test "$CFLAGS" = ""; then
35
CXXFLAGS="$CFLAGS $CXXFLAGS"
45
dnl # Setup CROSS_COMPILE variable
47
if test -z "$CROSS_COMPILE"; then
48
CROSS_COMPILE=`echo ${CC} | sed 's/gcc//'`
51
if test "$AR" = ""; then AR="${CROSS_COMPILE}ar rv"; fi
53
if test "$LD" = ""; then LD="$CC"; fi
55
if test "$LDOUT" = ""; then LDOUT="-o "; fi
57
if test "$RANLIB" = ""; then RANLIB="${CROSS_COMPILE}ranlib"; fi
59
if test "$OBJEXT" = ""; then OBJEXT='o'; fi
61
if test "$LIBEXT" = ""; then LIBEXT='a'; fi
63
if test "$LIBEXT2" = ""; then LIBEXT2=""; fi
65
if test "$CC_OUT" = ""; then CC_OUT="-o "; fi
67
if test "$CC_INC" = ""; then CC_INC="-I"; fi
69
if test "$CC_DEF" = ""; then CC_DEF="-D"; fi
71
if test "$CC_OPTIMIZE" = ""; then CC_OPTIMIZE="-O2"; fi
73
if test "$CC_CFLAGS" = ""; then CC_CFLAGS="-Wall"; fi
79
AC_SUBST(ac_build_mak_vars)
82
*mingw* | *cygw* | *win32* | *w32* )
83
if pwd -W 2&> /dev/null; then
86
# We're probably cross-compiling mingw on Linux
95
AC_SUBST(ac_shlib_suffix)
97
*mingw* | *cygw* | *win32* | *w32* )
101
ac_shlib_suffix=dylib
108
AC_SUBST(ac_cross_compile)
109
if test "$build" = "$host"; then
112
ac_cross_compile=${host_orig}-
115
AC_CHECK_LIB(pthread,pthread_create)
116
AC_CHECK_LIB(wsock32,puts)
117
AC_CHECK_LIB(ws2_32,puts)
118
AC_CHECK_LIB(ole32,puts)
119
AC_CHECK_LIB(winmm,puts)
120
AC_CHECK_LIB(socket,puts)
121
AC_CHECK_LIB(rt,puts)
122
AC_CHECK_LIB(nsl,puts)
123
AC_CHECK_LIB(uuid,uuid_generate)
124
AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1])
126
AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])
127
AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"])
130
dnl Memory alignment detection
132
AC_MSG_CHECKING([memory alignment])
134
sparc64-* | ia64-* | x86_64-* )
135
AC_DEFINE(PJ_POOL_ALIGNMENT, 8)
136
AC_MSG_RESULT([8 bytes])
139
AC_DEFINE(PJ_POOL_ALIGNMENT, 4)
140
AC_MSG_RESULT([4 bytes (default)])
146
dnl Endianness detection
150
if test "x$ac_cv_c_bigendian" = "xyes"; then
151
CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=1 -DPJ_IS_LITTLE_ENDIAN=0"
153
CFLAGS="$CFLAGS -DPJ_IS_BIG_ENDIAN=0 -DPJ_IS_LITTLE_ENDIAN=1"
160
*mingw* | *cygw* | *win32* | *w32* )
161
AC_DEFINE(PJ_WIN32,1)
162
AC_DEFINE(PJ_WIN32_WINNT,0x0400)
163
AC_DEFINE(WIN32_LEAN_AND_MEAN)
166
AC_DEFINE(PJ_DARWINOS,1)
169
AC_DEFINE(PJ_LINUX,1)
172
AC_DEFINE(PJ_RTEMS,1)
174
*sunos* | *solaris* )
175
AC_DEFINE(PJ_SUNOS,1)
184
dnl # --disable-floating-point option
185
AC_ARG_ENABLE(floating-point,
186
AC_HELP_STRING([--disable-floating-point],
187
[Disable floating point where possible]),
188
[if test "$enable_floating_point" = "no"; then
189
AC_DEFINE(PJ_HAS_FLOATING_POINT,0)
190
AC_MSG_RESULT([Checking if floating point is disabled... yes])
193
AC_DEFINE(PJ_HAS_FLOATING_POINT,1)
194
AC_MSG_RESULT([Checking if floating point is disabled... no])
199
AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)])
200
AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)])
201
AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)])
204
*mingw* | *cygw* | *win32* | *w32* )
205
AC_DEFINE(PJ_HAS_ERRNO_H,0)
208
AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
212
AC_CHECK_HEADER(fcntl.h,[AC_DEFINE(PJ_HAS_FCNTL_H,1)])
213
AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)])
214
AC_CHECK_HEADER(limits.h,[AC_DEFINE(PJ_HAS_LIMITS_H,1)])
215
AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)])
216
AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
217
AC_CHECK_HEADER(netinet/in_systm.h,[AC_DEFINE(PJ_HAS_NETINET_IN_SYSTM_H,1)])
218
AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
219
AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[],
220
[#if PJ_HAS_SYS_TYPES_H
221
# include <sys/types.h>
223
#if PJ_HAS_NETINET_IN_SYSTM_H
224
# include <netinet/in_systm.h>
226
#if PJ_HAS_NETINET_IN_H
227
# include <netinet/in.h>
230
AC_CHECK_HEADER(netinet/tcp.h,[AC_DEFINE(PJ_HAS_NETINET_TCP_H,1)])
231
AC_CHECK_HEADER(ifaddrs.h,
232
[AC_CHECK_FUNC(getifaddrs,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)])])
233
AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)])
234
AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)])
235
AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)])
236
AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)])
237
AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)])
238
AC_CHECK_HEADER(stdint.h,[AC_DEFINE(PJ_HAS_STDINT_H,1)])
239
AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)])
240
AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)])
241
AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)])
242
AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)])
243
AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)])
244
AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
245
AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
246
AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
247
AC_CHECK_HEADER(sys/filio.h,[AC_DEFINE(PJ_HAS_SYS_FILIO_H,1)])
248
AC_CHECK_HEADER(sys/sockio.h,[AC_DEFINE(PJ_HAS_SYS_SOCKIO_H,1)])
249
AC_CHECK_HEADER(sys/utsname.h,[AC_DEFINE(PJ_HAS_SYS_UTSNAME_H,1)])
250
AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
251
AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
252
AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
253
AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)])
254
AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)],[],
255
[#if PJ_HAS_WINSOCK2_H
256
# include <winsock2.h>
257
#elif PJ_HAS_WINSOCK_H
258
# include <winsock.h>
261
AC_CHECK_HEADER(ws2tcpip.h,[AC_DEFINE(PJ_HAS_WS2TCPIP_H,1)])
262
AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1])
263
AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)],[],
264
[#if PJ_HAS_SYS_TYPES_H
265
# include <sys/types.h>
267
#if PJ_HAS_SYS_SOCKET_H
269
# include <sys/socket.h>
272
AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
273
AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
275
AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1])
276
AC_DEFINE(PJ_HAS_ERRNO_VAR,1)
278
AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1])
279
AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1)
281
AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1])
282
AC_DEFINE(PJ_HAS_MALLOC,1)
284
AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0])
285
AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0)
287
AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long])
288
AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long)
290
dnl # Determine if inet_aton() is available
291
AC_MSG_CHECKING([if inet_aton() is available])
292
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
293
#include <sys/socket.h>
294
#include <arpa/inet.h>]],
295
[inet_aton(0, 0);])],
296
[AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1)
300
dnl # Determine if inet_pton() is available
301
AC_MSG_CHECKING([if inet_pton() is available])
302
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
303
#include <sys/socket.h>
304
#include <arpa/inet.h>]],
305
[inet_pton(0, 0, 0);])],
306
[AC_DEFINE(PJ_SOCK_HAS_INET_PTON,1)
310
dnl # Determine if inet_ntop() is available
311
AC_MSG_CHECKING([if inet_ntop() is available])
312
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
313
#include <sys/socket.h>
314
#include <arpa/inet.h>]],
315
[inet_ntop(0, 0, 0, 0);])],
316
[AC_DEFINE(PJ_SOCK_HAS_INET_NTOP,1)
320
dnl # Determine if getaddrinfo() is available
321
AC_MSG_CHECKING([if getaddrinfo() is available])
322
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
323
#include <sys/socket.h>
324
#include <netdb.h>]],
325
[getaddrinfo(0, 0, 0, 0);])],
326
[AC_DEFINE(PJ_SOCK_HAS_GETADDRINFO,1)
330
dnl # Determine if sockaddr_in has sin_len member
331
AC_MSG_CHECKING([if sockaddr_in has sin_len member])
332
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
333
#include <sys/socket.h>
334
#include <netinet/in.h>
335
#include <arpa/inet.h>]],
336
[struct sockaddr_in a; a.sin_len=0;])],
337
[AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1)
341
dnl # Determine if socklen_t is available
342
AC_MSG_CHECKING([if socklen_t is available])
343
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
344
#include <sys/socket.h>]],
345
[socklen_t xxx = 0;])],
346
[AC_DEFINE(PJ_HAS_SOCKLEN_T,1)
350
dnl # Determine if SO_ERROR is available
351
AC_MSG_CHECKING([if SO_ERROR is available])
353
*mingw* | *cygw* | *win32* | *w32* )
354
AC_DEFINE(PJ_HAS_SO_ERROR,1)
358
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
359
#include <sys/socket.h>
360
#include <netinet/in.h>
361
#include <arpa/inet.h>]],
363
[AC_DEFINE(PJ_HAS_SO_ERROR,1)
370
dnl # Determine if RW-mutex is available
371
AC_MSG_CHECKING([if pthread_rwlock_t is available])
372
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
373
[pthread_rwlock_t *x;])],
374
[AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
377
[AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
381
dnl # If rwmutex is not detected, check again but this time
382
dnl # with _POSIX_READER_WRITER_LOCKS defined (newlib needs this)
383
if test "$ac_rwmutex" = "no"; then
384
AC_MSG_CHECKING([if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS])
385
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_READER_WRITER_LOCKS
386
#include <pthread.h>]],
387
[pthread_rwlock_t *x;])],
388
[AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
389
CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS"
391
[AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
395
dnl # Do we have pthread_mutexattr_settype()?
396
AC_MSG_CHECKING([if pthread_mutexattr_settype() is available])
397
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
398
[pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);])],
399
[AC_DEFINE(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE,1)
403
dnl # Does pthread_mutexattr_t has "recursive" member?
404
AC_MSG_CHECKING([if pthread_mutexattr_t has recursive member])
405
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
406
[[pthread_mutexattr_t attr;
407
attr.recursive=1;]])],
408
[AC_DEFINE(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE,1)
412
dnl ######################
413
dnl # ioqueue selection
416
AC_MSG_CHECKING([ioqueue backend])
418
AC_HELP_STRING([--enable-epoll],
419
[Use /dev/epoll ioqueue on Linux (experimental)]),
421
ac_os_objs=ioqueue_epoll.o
422
AC_MSG_RESULT([/dev/epoll])
425
ac_os_objs=ioqueue_select.o
426
AC_MSG_RESULT([select()])
430
dnl ######################
431
dnl # OS specific files
434
*mingw* | *cygw* | *win32* | *w32* )
435
ac_os_objs="$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"
438
ac_os_objs="$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"
441
ac_os_objs="$ac_os_objs os_info_iphone.o"
445
if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then
446
ac_os_objs="$ac_os_objs guid_uuid.o"
448
ac_os_objs="$ac_os_objs guid_simple.o"
455
ac_os_objs="$ac_os_objs os_core_darwin.o"
459
dnl ##########################################
464
dnl # Use external Speex installation
465
AC_SUBST(ac_external_speex,0)
466
AC_ARG_WITH(external-speex,
467
AC_HELP_STRING([--with-external-speex],
468
[Use external Speex development files, not the one in "third_party" directory. When this option is set, make sure that Speex is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
470
if test "x$with_external_speex" != "xno"; then
471
# Test Speex installation
472
AC_MSG_CHECKING([if external Speex devkit is installed])
473
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <speex/speex.h>
474
#include <speex/speex_echo.h>
476
[speex_echo_state_init(0, 0); speex_encoder_init(0); ])],
477
[AC_MSG_RESULT(yes!!)
478
AC_DEFINE(PJMEDIA_EXTERNAL_SPEEX_CODEC, 1)
479
ac_external_speex="1"
481
[AC_MSG_ERROR([Unable to use external Speex library. If Speex development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
486
dnl # Use external GSM codec library installation
487
AC_SUBST(ac_external_gsm,0)
488
AC_ARG_WITH(external-gsm,
489
AC_HELP_STRING([--with-external-gsm],
490
[Use external GSM codec library, not the one in "third_party" directory. When this option is set, make sure that the GSM include/lib files are accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
492
if test "x$with_external_gsm" != "xno"; then
493
# Test GSM library installation
494
AC_MSG_CHECKING([if external GSM devkit is installed as gsm/gsm.h])
496
[AC_LANG_PROGRAM([[#include <gsm/gsm.h> ]], [gsm_create(); ]) ],
497
[AC_MSG_RESULT(yes!!)
498
AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1)
499
AC_DEFINE(PJMEDIA_EXTERNAL_GSM_GSM_H, 1)
504
AC_MSG_CHECKING([if external GSM devkit is installed as gsm.h])
506
[AC_LANG_PROGRAM([[#include <gsm.h> ]], [gsm_create(); ]) ],
507
[AC_MSG_RESULT(yes!!)
508
AC_DEFINE(PJMEDIA_EXTERNAL_GSM_CODEC, 1)
509
AC_DEFINE(PJMEDIA_EXTERNAL_GSM_H, 1)
512
[AC_MSG_ERROR([Unable to use external GSM library. If GSM development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])
523
dnl # Sound device backend selection
524
AC_SUBST(ac_pjmedia_snd)
526
AC_HELP_STRING([--disable-sound],
527
[Exclude sound (i.e. use null sound)]),
528
[if test "$enable_sound" = "no"; then
529
[ac_pjmedia_snd=null]
530
AC_MSG_RESULT([Checking if sound is disabled... yes])
534
dnl # Use external PortAudio installation
535
AC_SUBST(ac_external_pa,0)
536
AC_ARG_WITH(external-pa,
537
AC_HELP_STRING([--with-external-pa],
538
[Use external PortAudio development files, not the one in "third_party" directory. When this option is set, make sure that PortAudio is accessible to use (hint: use CFLAGS and LDFLAGS env var to set the include/lib paths)]),
540
if test "x$with_external_pa" != "xno"; then
541
# Test PortAudio installation
542
AC_MSG_CHECKING([if external PortAudio devkit is installed])
543
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <portaudio.h>
545
[Pa_Initialize();])],
546
[AC_MSG_RESULT(yes!!)
549
[AC_MSG_ERROR([Unable to use PortAudio. If PortAudio development files are not available in the default locations, use CFLAGS and LDFLAGS env var to set the include/lib paths])])
554
AC_SUBST(ac_pa_cflags)
555
AC_CHECK_HEADER(sys/soundcard.h,
556
[ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"])
557
AC_CHECK_HEADER(linux/soundcard.h,
558
[ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H"])
559
AC_CHECK_HEADER(machine/soundcard.h,
560
[ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H"])
562
if test "x$ac_cv_c_bigendian" = "xyes"; then
563
ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN"
565
ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN"
568
if test "$enable_sound" = "no"; then
573
LIBS="$LIBS -framework CoreAudio -framework CoreFoundation -framework AudioToolbox -framework CFNetwork -framework UIKit"
574
AC_MSG_RESULT([Checking sound device backend... AudioUnit])
577
LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"
578
if test "`uname -r`" = "6.8"; then
579
#ac_pa_cflags="$ac_pa_cflags -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS"
580
#AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS])
581
ac_pjmedia_snd=pa_old_darwinos
582
AC_MSG_RESULT([Checking sound device backend... old coreaudio])
584
ac_pjmedia_snd=pa_darwinos
585
AC_MSG_RESULT([Checking sound device backend... coreaudio])
589
ac_pjmedia_snd=pa_win32
590
AC_MSG_RESULT([Checking sound device backend... win32 sound])
594
AC_MSG_RESULT([Checking sound device backend... null sound])
597
dnl # Check if ALSA is available
598
ac_pjmedia_snd=pa_unix
599
AC_CHECK_HEADER(alsa/version.h,
600
[AC_SUBST(ac_pa_use_alsa,1)
601
LIBS="$LIBS -lasound"
603
[AC_SUBST(ac_pa_use_alsa,0)])
604
AC_MSG_RESULT([Checking sound device backend... unix])
606
dnl # Check if OSS is disabled
607
AC_SUBST(ac_pa_use_oss,1)
609
AC_HELP_STRING([--disable-oss],
610
[Disable OSS audio (default: not disabled)]),
612
if test "$enable_oss" = "no"; then
614
AC_MSG_RESULT([Checking if OSS audio is disabled... yes])
621
AC_SUBST(ac_pjmedia_video)
623
dnl # --disable-video option
625
AC_HELP_STRING([--disable-video],
626
[Disable video feature]),
627
[if test "$enable_video" = "no"; then
628
#AC_DEFINE(PJMEDIA_HAS_VIDEO,0)
629
AC_MSG_RESULT([Video is disabled])
638
LIBS="$LIBS -framework UIKit"
641
LIBS="$LIBS -framework Foundation -framework AppKit"
645
if test "$enable_video" = "no"; then
650
ac_pjmedia_video=iphone_os
651
AC_SUBST(ac_pjmedia_video_has_ios)
652
AC_SUBST(ac_ios_cflags)
654
LIBS="-framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
655
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_ios=yes],[ac_pjmedia_video_has_ios=no])
657
if test "$ac_pjmedia_video_has_ios" = "yes"; then
658
ac_ios_cflags="-DPJMEDIA_VIDEO_DEV_HAS_IOS=1"
659
LIBS="$LIBS -framework AVFoundation -framework CoreGraphics -framework QuartzCore -framework CoreVideo -framework CoreMedia"
660
AC_MSG_RESULT([Checking if AVFoundation framework is available... yes])
662
AC_MSG_RESULT([Checking if AVFoundation framework is available... no])
666
ac_pjmedia_video=mac_os
667
AC_SUBST(ac_pjmedia_video_has_qt)
668
AC_SUBST(ac_qt_cflags)
670
LIBS="-framework QTKit"
671
AC_LINK_IFELSE([AC_LANG_PROGRAM([[]], [])],[ac_pjmedia_video_has_qt=yes],[ac_pjmedia_video_has_qt=no])
673
if test "$ac_pjmedia_video_has_qt" = "yes"; then
674
ac_qt_cflags="-DPJMEDIA_VIDEO_DEV_HAS_QT=1"
675
LIBS="$LIBS -framework QTKit -framework QuartzCore -framework OpenGL"
676
AC_MSG_RESULT([Checking if QTKit framework is available... yes])
678
AC_MSG_RESULT([Checking if QTKit framework is available... no])
684
AC_ARG_ENABLE(ext_sound,
685
AC_HELP_STRING([--enable-ext-sound],
686
[PJMEDIA will not provide any sound device backend]),
687
[if test "$enable_ext_sound" = "yes"; then
688
[ac_pjmedia_snd=external]
689
AC_MSG_RESULT([Checking if external sound is set... yes])
693
dnl # Include resampling small filter
694
AC_SUBST(ac_no_small_filter)
695
AC_ARG_ENABLE(small-filter,
696
AC_HELP_STRING([--disable-small-filter],
697
[Exclude small filter in resampling]),
698
[if test "$enable_small_filter" = "no"; then
699
[ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0']
700
AC_MSG_RESULT([Checking if small filter is disabled... yes])
702
AC_MSG_RESULT([Checking if small filter is disabled... no]))
704
dnl # Include resampling large filter
705
AC_SUBST(ac_no_large_filter)
706
AC_ARG_ENABLE(large-filter,
707
AC_HELP_STRING([--disable-large-filter],
708
[Exclude large filter in resampling]),
709
[if test "$enable_large_filter" = "no"; then
710
[ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0']
711
AC_MSG_RESULT([Checking if large filter is disabled... yes])
713
AC_MSG_RESULT([Checking if large filter is disabled... no]))
715
dnl # Include Speex AEC
716
AC_SUBST(ac_no_speex_aec)
717
AC_ARG_ENABLE(speex-aec,
718
AC_HELP_STRING([--disable-speex-aec],
719
[Exclude Speex Acoustic Echo Canceller/AEC]),
720
[if test "$enable_speex_aec" = "no"; then
721
[ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0']
722
AC_MSG_RESULT([Checking if Speex AEC is disabled...yes])
724
AC_MSG_RESULT([Checking if Speex AEC is disabled...no]))
726
dnl # Include G711 codec
727
AC_SUBST(ac_no_g711_codec)
728
AC_ARG_ENABLE(g711-codec,
729
AC_HELP_STRING([--disable-g711-codec],
730
[Exclude G.711 codecs from the build]),
731
[if test "$enable_g711_codec" = "no"; then
733
AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0)
734
AC_MSG_RESULT([Checking if G.711 codec is disabled...yes])
736
AC_MSG_RESULT([Checking if G.711 codec is disabled...no]))
739
dnl # Include L16 codec
740
AC_SUBST(ac_no_l16_codec)
741
AC_ARG_ENABLE(l16-codec,
742
AC_HELP_STRING([--disable-l16-codec],
743
[Exclude Linear/L16 codec family from the build]),
744
[if test "$enable_l16_codec" = "no"; then
746
AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0)
747
AC_MSG_RESULT([Checking if L16 codecs are disabled...yes])
749
AC_MSG_RESULT([Checking if L16 codec is disabled...no]))
752
dnl # Include GSM codec
753
AC_SUBST(ac_no_gsm_codec)
754
AC_ARG_ENABLE(gsm-codec,
755
AC_HELP_STRING([--disable-gsm-codec],
756
[Exclude GSM codec in the build]),
757
[if test "$enable_gsm_codec" = "no"; then
759
AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0)
760
AC_MSG_RESULT([Checking if GSM codec is disabled...yes])
762
AC_MSG_RESULT([Checking if GSM codec is disabled...no]))
764
dnl # Include G.722 codec
765
AC_SUBST(ac_no_g722_codec)
766
AC_ARG_ENABLE(g722-codec,
767
AC_HELP_STRING([--disable-g722-codec],
768
[Exclude G.722 codec in the build]),
769
[if test "$enable_g722_codec" = "no"; then
771
AC_DEFINE(PJMEDIA_HAS_G722_CODEC,0)
772
AC_MSG_RESULT([Checking if G.722 codec is disabled...yes])
774
AC_MSG_RESULT([Checking if G.722 codec is disabled...no]))
776
dnl # Include G722.1 codec
777
AC_SUBST(ac_no_g7221_codec)
778
AC_ARG_ENABLE(g7221-codec,
779
AC_HELP_STRING([--disable-g7221-codec],
780
[Exclude G.7221 codec in the build]),
781
[if test "$enable_g7221_codec" = "no"; then
782
[ac_no_g7221_codec=1]
783
AC_DEFINE(PJMEDIA_HAS_G7221_CODEC,0)
784
AC_MSG_RESULT([Checking if G.722.1 codec is disabled...yes])
786
AC_MSG_RESULT([Checking if G.722.1 codec is disabled...no]))
788
dnl # Include Speex codec
789
AC_SUBST(ac_no_speex_codec)
790
AC_ARG_ENABLE(speex-codec,
791
AC_HELP_STRING([--disable-speex-codec],
792
[Exclude Speex codecs in the build]),
793
[if test "$enable_speex_codec" = "no"; then
794
[ac_no_speex_codec=1]
795
AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0)
796
AC_MSG_RESULT([Checking if Speex codec is disabled...yes])
798
AC_MSG_RESULT([Checking if Speex codec is disabled...no]))
800
dnl # Include iLBC codec
801
AC_SUBST(ac_no_ilbc_codec)
802
AC_ARG_ENABLE(ilbc-codec,
803
AC_HELP_STRING([--disable-ilbc-codec],
804
[Exclude iLBC codec in the build]),
805
[if test "$enable_ilbc_codec" = "no"; then
807
AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0)
808
AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])
810
AC_MSG_RESULT([Checking if iLBC codec is disabled...no]))
812
dnl # Include libsamplerate
813
AC_ARG_ENABLE(libsamplerate,
814
AC_HELP_STRING([--enable-libsamplerate],
815
[Link with libsamplerate when available. Note that PJMEDIA_RESAMPLE_IMP must also be configured]),
816
[ AC_CHECK_LIB(samplerate,src_new) ],
817
AC_MSG_RESULT([Skipping libsamplerate detection])
820
dnl # Include libsamplerate
821
AC_SUBST(ac_resample_dll)
822
AC_ARG_ENABLE(resample_dll,
823
AC_HELP_STRING([--enable-resample-dll],
824
[Build libresample as shared library]),
825
[if test "$enable_resample_dll" = "yes"; then
827
AC_MSG_RESULT([Building libresample as shared library... yes])
829
AC_MSG_RESULT([Building libresample as shared library... no])
834
AC_HELP_STRING([--with-sdl=DIR],
835
[Specify alternate libSDL prefix]),
840
dnl # Do not use default SDL installation if we are cross-compiling
841
if test "x$ac_cross_compile" != "x" -a "x$with_sdl" = "xno"; then
847
AC_HELP_STRING([--disable-sdl],
848
[Disable SDL (default: not disabled)]),
850
if test "$enable_sdl" = "no"; then
851
AC_MSG_RESULT([Checking if SDL is disabled... yes])
855
if test "x$with_sdl" != "xno" -a "x$with_sdl" != "x"; then
856
AC_MSG_RESULT([Using SDL prefix... $with_sdl])
857
AC_PATH_PROGS(SDL_CONFIG,sdl2-config sdl-config,,$with_sdl/bin)
859
AC_PATH_PROGS(SDL_CONFIG, sdl2-config sdl-config)
862
AC_MSG_CHECKING([SDL availability])
863
if test "x$SDL_CONFIG" = "x"; then
864
AC_MSG_RESULT([not found])
865
elif (sh -c "$SDL_CONFIG --version" | grep -e '^1\.3' -e '^2\.') then
866
AC_SUBST(ac_sdl_cflags)
867
AC_SUBST(ac_sdl_ldflags)
868
ac_sdl_cflags=`$SDL_CONFIG --cflags`
869
ac_sdl_cflags="-DPJMEDIA_VIDEO_DEV_HAS_SDL=1 $ac_sdl_cflags"
870
ac_sdl_ldflags=`$SDL_CONFIG --libs`
871
LIBS="$LIBS $ac_sdl_ldflags"
873
AC_MSG_RESULT([Unsupported SDL version])
879
AC_HELP_STRING([--with-ffmpeg=DIR],
880
[Specify alternate FFMPEG prefix]),
885
dnl # Do not use default ffmpeg installation if we are cross-compiling
886
if test "x$ac_cross_compile" != "x" -a "x$with_ffmpeg" = "xno"; then
891
AC_ARG_ENABLE(ffmpeg,
892
AC_HELP_STRING([--disable-ffmpeg],
893
[Disable ffmpeg (default: not disabled)]),
895
AC_SUBST(ac_has_ffmpeg,0)
896
if test "$enable_ffmpeg" = "no"; then
897
AC_MSG_RESULT([Checking if ffmpeg is disabled... yes])
901
AC_SUBST(ac_ffmpeg_cflags)
902
AC_SUBST(ac_ffmpeg_ldflags)
905
AC_SUBST(SAVED_PKG_CONFIG_PATH)
906
SAVED_PKG_CONFIG_PATH=$PKG_CONFIG_PATH
907
if test "x$with_ffmpeg" != "xno" -a "x$with_ffmpeg" != "x"; then
908
FFMPEG_PREFIX=$with_ffmpeg
909
AC_MSG_RESULT([Using ffmpeg prefix... $FFMPEG_PREFIX])
910
export PKG_CONFIG_PATH=$FFMPEG_PREFIX/lib/pkgconfig
913
AC_CHECK_PROGS(PKG_CONFIG,pkg-config "python pkgconfig.py",none)
915
if test "$PKG_CONFIG" != "none"; then
916
AC_MSG_CHECKING([ffmpeg packages])
918
if $PKG_CONFIG --exists libdevice; then
919
ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1"
920
av_pkg="$av_pkg libdevice"
922
if $PKG_CONFIG --exists libavformat; then
923
ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVFORMAT=1"
924
av_pkg="$av_pkg libavformat"
926
if $PKG_CONFIG --exists libavcodec; then
927
ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCODEC=1"
928
av_pkg="$av_pkg libavcodec"
930
if $PKG_CONFIG --exists libswscale; then
931
ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
932
av_pkg="$av_pkg libswscale"
934
if $PKG_CONFIG --exists libavutil; then
935
ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1"
936
av_pkg="$av_pkg libavutil"
938
if $PKG_CONFIG --exists libavcore; then
939
ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCORE=1"
940
av_pkg="$av_pkg libavcore"
943
if test "x$av_pkg" == "x"; then
944
AC_MSG_RESULT([none detected (check the prefix)! **])
946
AC_MSG_RESULT([$av_pkg])
949
ac_ffmpeg_cflags="$ac_ffmpeg_cflags `$PKG_CONFIG --cflags $av_pkg`"
950
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags `$PKG_CONFIG --libs $av_pkg`"
954
dnl # Use hardcoded values to configure ffmpeg
957
AC_MSG_RESULT([*** Warning: neither pkg-config nor python is available, ffmpeg dependency cannot be calculated. If ffmpeg libraries are not detected, you need to specify the correct CFLAGS and LDFLAGS settings for ffmpeg prior to invoking configure ***])
959
LIBS="-L$FFMPEG_PREFIX/lib $LIBS"
960
LDFLAGS="-L$FFMPEG_PREFIX/lib $LDFLAGS"
961
CFLAGS="-I$FFMPEG_PREFIX/include $CFLAGS"
963
AC_CHECK_LIB(avdevice,
965
[ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVDEVICE=1"
966
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavdevice"
971
[ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVUTIL=1"
972
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavutil"
975
AC_CHECK_LIB(avcodec,
977
[ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCODEC=1"
978
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcodec"
983
AC_CHECK_LIB(avformat,
985
[ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVFORMAT=1"
986
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavformat"
991
AC_CHECK_LIB(swscale,
993
[ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBSWSCALE=1"
994
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lswscale"
1001
[ac_ffmpeg_cflags="$ac_ffmpeg_cflags -DPJMEDIA_HAS_LIBAVCORE=1"
1002
ac_ffmpeg_ldflags="$ac_ffmpeg_ldflags -lavcore"
1008
LIBS="$LIBS $ac_ffmpeg_ldflags"
1009
export PKG_CONFIG_PATH=$SAVED_PKG_CONFIG_PATH
1013
dnl # Video for Linux 2
1015
AC_HELP_STRING([--disable-v4l2],
1016
[Disable Video4Linux2 (default: not disabled)]),
1018
if test "$enable_v4l2" = "no"; then
1019
AC_MSG_RESULT([Checking if V4L2 is disabled... yes])
1023
AC_SUBST(ac_v4l2_cflags)
1024
AC_SUBST(ac_v4l2_ldflags)
1027
[ac_v4l2_cflags="-DPJMEDIA_VIDEO_DEV_HAS_V4L2=1"
1028
ac_v4l2_ldflags="-lv4l2"
1034
dnl ########################################################
1035
dnl # Intel IPP support
1038
AC_HELP_STRING([--enable-ipp],
1039
[Enable Intel IPP support. Specify the Intel IPP package and samples location using IPPROOT and IPPSAMPLES env var or with --with-ipp and --with-ipp-samples options]),
1045
AC_HELP_STRING([--with-ipp=DIR],
1046
[Specify the Intel IPP location]),
1051
AC_ARG_WITH(ipp-samples,
1052
AC_HELP_STRING([--with-ipp-samples=DIR],
1053
[Specify the Intel IPP samples location]),
1055
[with_ipp_samples=no]
1058
AC_ARG_WITH(ipp-arch,
1059
AC_HELP_STRING([--with-ipp-arch=ARCH],
1060
[Specify the Intel IPP ARCH suffix, e.g. "64" or "em64t. Default is blank for IA32"]),
1065
if test "x$enable_ipp" != "xno"; then
1067
dnl # Verifying Intel IPP path
1069
AC_MSG_CHECKING([Intel IPP location])
1071
if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then
1072
AC_MSG_RESULT([$with_ipp])
1074
elif test "x$IPPROOT" = "x"; then
1075
if test -d /opt/intel/ipp; then
1076
IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1`
1077
AC_MSG_RESULT([autodetected in $IPPROOT])
1080
AC_MSG_RESULT([$IPPROOT])
1083
if test "x$with_ipp_arch" != "xno"; then
1084
IPP_SUFFIX=$with_ipp_arch
1085
AC_MSG_RESULT([IPP arch suffix is set to $IPP_SUFFIX])
1088
AC_MSG_RESULT([IPP arch suffix is set to empty])
1091
if test x$IPPROOT = x; then
1092
AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option])
1093
elif test ! -d $IPPROOT; then
1094
AC_MSG_ERROR([not found])
1095
elif test ! -d $IPPROOT/include; then
1096
AC_MSG_ERROR([directory doesn't seem to be valid])
1098
# IPP directory looks okay.
1099
# Remove trailing backslash
1100
IPPROOT=`echo $IPPROOT | sed 's/\/$//'`
1102
SAVED_CFLAGS="$CFLAGS"
1103
SAVED_LDFLAGS="$LDFLAGS"
1106
IPP_CFLAGS="-I$IPPROOT/include"
1107
IPP_LIBS="-lippsc${IPP_SUFFIX} -lipps${IPP_SUFFIX} -lippcore${IPP_SUFFIX}"
1110
# Some differences between Mac OS X and Linux
1113
IPP_LDFLAGS="-L$IPPROOT/Libraries -L$IPPROOT/lib"
1116
# Find out where the libraries live.
1118
if test -d $IPPROOT/lib/intel64; then
1120
elif test -d $IPPROOT/lib/ia32; then
1122
elif test -d $IPPROOT/lib/mic; then
1126
if test -z "$IPP7_ARCH"; then
1127
# IPP6 (and possibly below)
1128
IPP_LDFLAGS="-L$IPPROOT/sharedlib"
1129
IPP_LIBS="$IPP_LIBS -lippsr${IPP_SUFFIX} -lguide"
1132
if ! test -d $IPPROOT/../compiler; then
1133
AC_MSG_ERROR([Cannot find $IPPROOT/../compiler directory. Please set IPPROOT variable correctly])
1135
IPP_CFLAGS="$IPP_CFLAGS"
1136
IPP_LDFLAGS="-L$IPPROOT/lib/intel64 -L$IPPROOT/../compiler/lib/$IPP7_ARCH"
1137
IPP_LIBS="$IPP_LIBS -liomp5"
1142
#IPP_LDFLAGS="-L$IPPROOT/sharedlib"
1144
#IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore"
1146
CFLAGS="$CFLAGS $IPP_CFLAGS"
1147
LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
1148
LIBS="$IPP_LIBS $LIBS"
1151
AC_MSG_CHECKING([Intel IPP usability])
1152
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ippcore.h>
1154
[ippStaticInit();])],
1155
[AC_MSG_RESULT(ok)],
1156
[AC_MSG_FAILURE([Error: unable to recognize your IPP installation. Make sure the paths and ARCH suffix are set correctly, run with --help for more info])])
1158
CFLAGS="$SAVED_CFLAGS"
1159
LDFLAGS="$SAVED_LDFLAGS"
1164
dnl # Verifying Intel IPP samples path
1166
AC_MSG_CHECKING([Intel IPP samples location])
1168
if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then
1169
AC_MSG_RESULT([$with_ipp_samples])
1170
IPPSAMPLES=$with_ipp_samples
1171
elif test "x$IPPSAMPLES" = "x"; then
1172
if test -d /opt/intel/ipp-samples; then
1173
IPPSAMPLES=/opt/intel/ipp-samples
1174
AC_MSG_RESULT([autodetected in $IPPSAMPLES])
1177
AC_MSG_RESULT([$IPPSAMPLES])
1180
if test x$IPPSAMPLES = x; then
1181
AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option])
1182
elif test ! -d $IPPSAMPLES; then
1183
AC_MSG_ERROR([not found])
1184
elif test ! -d $IPPSAMPLES/speech-codecs; then
1185
AC_MSG_ERROR([directory doesn't seem to be valid])
1187
# Remove trailing backslash
1188
IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'`
1190
# Guess the libusc.a/libspeech.a build location
1191
AC_MSG_CHECKING([Intel IPP USC build location])
1192
if test -d $IPPSAMPLES/speech-codecs/bin; then
1194
IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
1195
elif test -d $IPPSAMPLES/speech-codecs/_bin; then
1197
if test -d $IPPSAMPLES/speech-codecs/_bin/*gcc*; then
1199
IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib | head -1`
1200
elif test -d $IPPSAMPLES/speech-codecs/_bin/*icc*; then
1202
IPPSAMP_DIR=`ls -d $IPPSAMPLES/speech-codecs/_bin/*icc*/lib | head -1`
1204
AC_MSG_FAILURE([Unable to find to find built binaries under $IPPSAMPLES/speech-codecs/{bin,_bin}. Have you built the IPP samples?])
1207
AC_MSG_FAILURE([unable to find $IPPSAMPLES/speech-codecs/bin/*gcc*/lib or $IPPSAMPLES/speech-codecs/_bin/*gcc*/lib directory. Have you built the samples?])
1210
# Test the directory
1211
if test ! -d $IPPSAMP_DIR; then
1212
AC_MSG_FAILURE([There's something wrong with this script, directory $IPPSAMP_DIR does not exist])
1216
if test "x$IPPVER" = "x5"; then
1217
IPPSAMP_LIBS="libusc.a"
1218
IPPSAMP_LDLIBS="-lusc"
1219
elif test "x$IPPVER" = "x6"; then
1220
IPPSAMP_LIBS="libspeech.a"
1221
IPPSAMP_LDLIBS="-lspeech"
1223
AC_MSG_FAILURE([bug in this script: unsupported IPP version])
1226
if test ! -f $IPPSAMP_DIR/$IPPSAMP_LIBS; then
1227
AC_MSG_FAILURE([$IPPSAMP_LIBS doesn't exist in $IPPSAMP_DIR])
1230
AC_MSG_RESULT([$IPPSAMP_DIR])
1232
SAVED_CFLAGS="$CFLAGS"
1233
SAVED_LDFLAGS="$LDFLAGS"
1236
IPPSAMP_INC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
1237
CFLAGS="$CFLAGS $IPPSAMP_INC"
1238
LDFLAGS="$LDFLAGS -L$IPPSAMP_DIR"
1239
LIBS="$IPPSAMP_LDLIBS $LIBS"
1241
AC_MSG_CHECKING([Intel IPP USC usability])
1242
AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <usc.h>
1244
[extern USC_Fxns USC_G729AFP_Fxns;])],
1245
[AC_MSG_RESULT(ok)],
1246
[AC_MSG_FAILURE(failed)])
1248
CFLAGS="$SAVED_CFLAGS"
1249
LDFLAGS="$IPP_LDFLAGS $SAVED_LDFLAGS"
1250
LIBS="$IPP_LIBS $SAVED_LIBS"
1252
IPP_CFLAGS="$IPP_CFLAGS $IPPSAMP_INC"
1253
IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMP_DIR"
1254
IPP_LIBS="$IPPSAMP_LDLIBS $IPP_LIBS"
1257
CFLAGS="$CFLAGS $IPP_CFLAGS"
1258
LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
1259
LIBS="$LIBS $IPP_LIBS"
1261
ac_build_mak_vars="$ac_build_mak_vars\n\
1262
export IPP_CFLAGS=$IPP_CFLAGS\n\
1263
export IPP_LDFLAGS=$IPP_LDFLAGS\n\
1264
export IPP_LIBS=$IPP_LIBS"
1266
AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)])
1270
dnl ##########################################
1275
dnl # SSL alt prefix
1277
AC_HELP_STRING([--with-ssl=DIR],
1278
[Specify alternate libssl prefix]),
1283
dnl # Do not use default SSL installation if we are cross-compiling
1284
if test "x$ac_cross_compile" != "x" -a "x$with_ssl" = "xno"; then
1288
dnl # Include SSL support
1291
AC_HELP_STRING([--disable-ssl],
1292
[Exclude SSL support the build (default: autodetect)])
1295
if test "$enable_ssl" = "no"; then
1297
AC_MSG_RESULT([Checking if SSL support is disabled... yes])
1301
AC_MSG_RESULT([checking for OpenSSL installations..])
1302
if test "x$with_ssl" != "xno" -a "x$with_ssl" != "x"; then
1303
CFLAGS="$CFLAGS -I$with_ssl/include"
1304
LDFLAGS="$LDFLAGS -L$with_ssl/lib"
1305
AC_MSG_RESULT([Using SSL prefix... $with_ssl])
1307
AC_SUBST(openssl_h_present)
1308
AC_SUBST(libssl_present)
1309
AC_SUBST(libcrypto_present)
1310
AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
1311
AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"])
1312
AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"])
1313
if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
1314
AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
1315
# PJSIP_HAS_TLS_TRANSPORT setting follows PJ_HAS_SSL_SOCK
1316
#AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1)
1317
AC_DEFINE(PJ_HAS_SSL_SOCK, 1)
1319
AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **])
1323
dnl # opencore-amrnb alt prefix
1324
AC_ARG_WITH(opencore-amrnb,
1325
AC_HELP_STRING([--with-opencore-amrnb=DIR],
1326
[Specify alternate libopencore-amrnb prefix]),
1328
[with_opencore_amrnb=no]
1331
dnl # Do not use default opencore-amrnb installation if we are cross-compiling
1332
if test "x$ac_cross_compile" != "x" -a "x$with_opencore_amrnb" = "xno"; then
1333
enable_opencore_amrnb=no
1336
dnl # Include opencore-amrnb support
1337
AC_SUBST(ac_no_opencore_amrnb)
1338
AC_ARG_ENABLE(opencore_amrnb,
1339
AC_HELP_STRING([--disable-opencore-amrnb],
1340
[Exclude OpenCORE AMR-NB support from the build (default: autodetect)])
1343
if test "$enable_opencore_amrnb" = "no"; then
1344
[ac_no_opencore_amrnb=1]
1345
AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
1346
AC_MSG_RESULT([Checking if OpenCORE AMR-NB support is disabled... yes])
1350
AC_MSG_RESULT([checking for OpenCORE AMR-NB installations..])
1351
if test "x$with_opencore_amrnb" != "xno" -a "x$with_opencore_amrnb" != "x"; then
1352
CFLAGS="$CFLAGS -I$with_opencore_amrnb/include"
1353
LDFLAGS="$LDFLAGS -L$with_opencore_amrnb/lib"
1354
AC_MSG_RESULT([Using OpenCORE AMR-NB prefix... $with_opencore_amrnb])
1356
AC_SUBST(opencore_amrnb_h_present)
1357
AC_SUBST(opencore_amrnb_present)
1358
AC_CHECK_HEADER(opencore-amrnb/interf_enc.h,[opencore_amrnb_h_present=1])
1359
AC_CHECK_LIB(opencore-amrnb,Encoder_Interface_init,[opencore_amrnb_present=1 && LIBS="$LIBS -lopencore-amrnb"])
1360
if test "x$opencore_amrnb_h_present" = "x1" -a "x$opencore_amrnb_present" = "x1"; then
1361
AC_MSG_RESULT([OpenCORE AMR-NB library found, AMR-NB support enabled])
1362
AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,1)
1364
[ac_no_opencore_amrnb=1]
1365
AC_DEFINE(PJMEDIA_HAS_OPENCORE_AMRNB_CODEC,0)
1369
dnl ##########################################
1375
dnl # Determine if select() requires nfds to be filled up with
1376
dnl # correct value (max_fd+1). If zero, nfds will be filled up with
1378
AC_MSG_CHECKING([if select() needs correct nfds])
1380
*rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1)
1383
*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0)
1384
AC_MSG_RESULT([no (default)])
1385
AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)])
1389
dnl # Determine if pj_thread_create() should enforce thread stack size when
1390
dnl # creating thread. Default is zero, to allow OS to allocate appropriate
1391
dnl # thread's stack size.
1392
AC_MSG_CHECKING([if pj_thread_create() should enforce stack size])
1394
*rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1)
1397
*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0)
1398
AC_MSG_RESULT([no (default)])
1402
dnl # Determine if pj_thread_create() should allocate thread's stack from
1403
dnl # the pool. Default is zero, to let OS allocate thread's stack.
1404
AC_MSG_CHECKING([if pj_thread_create() should allocate stack])
1406
*rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1)
1409
*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0)
1410
AC_MSG_RESULT([no (default)])
1414
dnl # This value specifies the value set in errno by the OS when a non-blocking
1415
dnl # socket recv() can not return immediate data.
1417
*mingw* | *cygw* | *win32* | *w32* )
1418
AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK)
1420
*) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
1421
AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
1425
dnl # This value specifies the value set in errno by the OS when a non-blocking
1426
dnl # socket connect() can not get connected immediately.
1428
*mingw* | *cygw* | *win32* | *w32* )
1429
AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK)
1431
*) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
1432
AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
1438
AC_SUBST(ac_linux_poll,select)
1439
AC_SUBST(ac_host,unix)
1440
AC_SUBST(ac_main_obj)
1443
ac_main_obj=main_rtems.o
1451
ac_build_mak_vars=`echo $ac_build_mak_vars | sed 's/\\\\n/\n/g'`
1457
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.
1459
Further customizations can be put in:
1461
- 'pjlib/include/pj/config_site.h'
1463
The next step now is to run 'make dep' and 'make'.