blob: 082da8fe2c7224533ce575e755db6b50e3d53299 [file] [log] [blame]
Benny Prijono0822c192008-08-21 20:59:58 +00001AC_INIT(pjproject,1.0)
Benny Prijono5b818b22006-09-17 22:58:51 +00002
3host_orig="$host"
4
Benny Prijonoc4c61d02006-08-20 20:47:34 +00005AC_CANONICAL_BUILD
6AC_CANONICAL_HOST
Benny Prijonoa9b372a2006-07-24 02:07:11 +00007AC_CANONICAL_TARGET
Benny Prijonoc4c61d02006-08-20 20:47:34 +00008AC_CONFIG_HEADER([pjlib/include/pj/compat/os_auto.h
9 pjlib/include/pj/compat/m_auto.h
Benny Prijonofe9bffd2007-01-27 17:44:13 +000010 pjmedia/include/pjmedia/config_auto.h
11 pjmedia/include/pjmedia-codec/config_auto.h
Benny Prijono7e0d75f2006-12-25 20:34:14 +000012 pjsip/include/pjsip/sip_autoconf.h
Benny Prijonoc4c61d02006-08-20 20:47:34 +000013 ])
14AC_CONFIG_FILES([build.mak
15 build/os-auto.mak
16 pjlib/build/os-auto.mak
17 pjlib-util/build/os-auto.mak
18 pjmedia/build/os-auto.mak
19 pjsip/build/os-auto.mak
Benny Prijonod9627842007-04-18 09:24:31 +000020 third_party/build/portaudio/os-auto.mak
21 third_party/build/os-auto.mak
Benny Prijonoc4c61d02006-08-20 20:47:34 +000022 ])
Benny Prijonoc1fe23d2006-09-13 09:38:06 +000023
Benny Prijono12483112007-03-12 10:44:38 +000024
Benny Prijonoc1fe23d2006-09-13 09:38:06 +000025dnl
26dnl Setup default CFLAGS
27dnl
28if test "$CFLAGS" = ""; then
Benny Prijonod1459822006-10-04 20:56:39 +000029 CFLAGS="-O2"
Benny Prijonoc1fe23d2006-09-13 09:38:06 +000030else
31 CFLAGS="$CFLAGS"
32fi
33
34CXXFLAGS="$CFLAGS $CXXFLAGS"
35
Benny Prijonoa9b372a2006-07-24 02:07:11 +000036AC_PROG_CC
Benny Prijonoc4c61d02006-08-20 20:47:34 +000037AC_PROG_CXX
Benny Prijonoa9b372a2006-07-24 02:07:11 +000038AC_LANG_C
39
Benny Prijono12483112007-03-12 10:44:38 +000040AC_SUBST(ac_pjdir)
Benny Prijono0822c192008-08-21 20:59:58 +000041AC_SUBST(ac_build_mak_vars)
Benny Prijono53847a32007-09-24 16:10:13 +000042case $target in
43 *mingw* | *cygw* | *win32* | *w32* )
44 ac_pjdir=`pwd -W`
45 ;;
46 *)
47 ac_pjdir=`pwd`
48 ;;
49esac
Benny Prijono12483112007-03-12 10:44:38 +000050
Benny Prijonoc4c61d02006-08-20 20:47:34 +000051AC_CHECK_LIB(pthread,pthread_create)
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000052AC_CHECK_LIB(wsock32,puts)
53AC_CHECK_LIB(ws2_32,puts)
54AC_CHECK_LIB(ole32,puts)
55AC_CHECK_LIB(winmm,puts)
56AC_CHECK_LIB(socket,puts)
57AC_CHECK_LIB(rt,puts)
58AC_CHECK_LIB(nsl,puts)
Benny Prijono4e48b512007-05-16 13:41:00 +000059AC_CHECK_LIB(uuid,uuid_generate)
60AC_CHECK_LIB(uuid,uuid_generate,[ac_has_uuid_lib=1])
Benny Prijonoc4c61d02006-08-20 20:47:34 +000061
62AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])
63AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"])
64
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000065dnl
Benny Prijono1d971622006-09-10 22:27:40 +000066dnl Memory alignment detection
67dnl
68AC_MSG_CHECKING([memory alignment])
69case $target in
70 ia64-* | x86_64-* )
71 AC_DEFINE(PJ_POOL_ALIGNMENT, 8)
72 AC_MSG_RESULT([8 bytes])
73 ;;
74 * )
75 AC_DEFINE(PJ_POOL_ALIGNMENT, 4)
76 AC_MSG_RESULT([4 bytes (default)])
77 ;;
78esac
79
80
81dnl
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000082dnl Endianness detection
83dnl
Benny Prijonob466e232006-09-10 08:53:59 +000084AC_C_BIGENDIAN
Benny Prijonoc4c61d02006-08-20 20:47:34 +000085
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000086dnl
87dnl Legacy macros
88dnl
89case $target in
90 *mingw* | *cygw* | *win32* | *w32* )
91 AC_DEFINE(PJ_WIN32,1)
92 AC_DEFINE(PJ_WIN32_WINNT,0x0400)
93 AC_DEFINE(WIN32_LEAN_AND_MEAN)
94 ;;
95 *darwin*)
96 AC_DEFINE(PJ_DARWINOS,1)
97 ;;
98 *linux*)
99 AC_DEFINE(PJ_LINUX,1)
100 ;;
101 *rtems*)
102 AC_DEFINE(PJ_RTEMS,1)
103 ;;
104 *sunos* | *solaris* )
105 AC_DEFINE(PJ_SUNOS,1)
106 ;;
107 *)
108 ;;
109esac
110
111
112
113
Benny Prijonob466e232006-09-10 08:53:59 +0000114dnl # --disable-floating-point option
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000115AC_ARG_ENABLE(floating-point,
116 AC_HELP_STRING([--disable-floating-point],
117 [Disable floating point where possible]),
118 [if test "$enable_floating_point" = "no"; then
119 AC_DEFINE(PJ_HAS_FLOATING_POINT,0)
120 AC_MSG_RESULT([Checking if floating point is disabled... yes])
121 fi],
122 [
123 AC_DEFINE(PJ_HAS_FLOATING_POINT,1)
124 AC_MSG_RESULT([Checking if floating point is disabled... no])
125 AC_CHECK_LIB(m,fmod)
126 ])
127
128
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000129AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)])
130AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)])
131AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)])
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000132
133case $target in
134 *mingw* | *cygw* | *win32* | *w32* )
135 AC_DEFINE(PJ_HAS_ERRNO_H,0)
136 ;;
137 *)
138 AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
139 ;;
140esac
141
Benny Prijono1d481ab2008-01-24 15:27:30 +0000142AC_CHECK_HEADER(fcntl.h,[AC_DEFINE(PJ_HAS_FCNTL_H,1)])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000143AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)])
144AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)])
145AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
Benny Prijono37fc9de2008-08-04 14:45:02 +0000146AC_CHECK_HEADER(netinet/in_systm.h,[AC_DEFINE(PJ_HAS_NETINET_IN_SYSTM_H,1)])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000147AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
Benny Prijono37fc9de2008-08-04 14:45:02 +0000148AC_CHECK_HEADER(netinet/ip.h,[AC_DEFINE(PJ_HAS_NETINET_IP_H,1)],[],
149 [#if PJ_HAS_NETINET_IN_SYSTM_H
150 # include <netinet/in_systm.h>
151 #endif
152 ])
Benny Prijono1d65f702007-12-03 04:03:17 +0000153AC_CHECK_HEADER(ifaddrs.h,[AC_DEFINE(PJ_HAS_IFADDRS_H,1)])
Benny Prijono1c5f4e42008-02-07 13:11:39 +0000154AC_CHECK_HEADER(semaphore.h,[AC_DEFINE(PJ_HAS_SEMAPHORE_H,1)])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000155AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)])
156AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)])
157AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)])
158AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)])
Benny Prijonofdafd402008-01-23 14:34:46 +0000159AC_CHECK_HEADER(stdint.h,[AC_DEFINE(PJ_HAS_STDINT_H,1)])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000160AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)])
161AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)])
162AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)])
163AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)])
164AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)])
165AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
166AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
167AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
168AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
169AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000170AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
171AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)])
Benny Prijonoa9948e62008-03-25 14:03:01 +0000172AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)],[],
173 [#if PJ_HAS_WINSOCK2_H
174 # include <winsock2.h>
175 #elif PJ_HAS_WINSOCK_H
176 # include <winsock.h>
177 #endif
178 ])
Benny Prijonoe2746132008-09-27 13:16:35 +0000179AC_CHECK_HEADER(ws2tcpip.h,[AC_DEFINE(PJ_HAS_WS2TCPIP_H,1)])
Benny Prijono4e48b512007-05-16 13:41:00 +0000180AC_CHECK_HEADER(uuid/uuid.h,[ac_has_uuid_h=1])
Benny Prijonoa9948e62008-03-25 14:03:01 +0000181AC_CHECK_HEADER(net/if.h,[AC_DEFINE(PJ_HAS_NET_IF_H,1)],[],
Benny Prijono188ba7e2008-03-25 13:53:16 +0000182 [#if PJ_HAS_SYS_SOCKET_H
183 # include <sys/socket.h>
184 #endif
185 ])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000186
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000187AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
188AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
189
190AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1])
191AC_DEFINE(PJ_HAS_ERRNO_VAR,1)
192
193AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1])
194AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1)
195
196AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1])
197AC_DEFINE(PJ_HAS_MALLOC,1)
198
199AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0])
200AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0)
201
202AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long])
203AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long)
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000204
Benny Prijonob466e232006-09-10 08:53:59 +0000205dnl # Determine if inet_aton() is available
Benny Prijonoc16c6e32007-11-18 14:53:47 +0000206AC_MSG_CHECKING([if inet_aton() is available])
207AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
208 #include <sys/socket.h>
209 #include <arpa/inet.h>]],
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000210 [inet_aton(0, 0);])],
211 [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1)
212 AC_MSG_RESULT(yes)],
213 [AC_MSG_RESULT(no)])
214
Benny Prijonoc16c6e32007-11-18 14:53:47 +0000215dnl # Determine if inet_pton() is available
216AC_MSG_CHECKING([if inet_pton() is available])
217AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
218 #include <sys/socket.h>
219 #include <arpa/inet.h>]],
220 [inet_pton(0, 0, 0);])],
221 [AC_DEFINE(PJ_SOCK_HAS_INET_PTON,1)
222 AC_MSG_RESULT(yes)],
223 [AC_MSG_RESULT(no)])
224
225dnl # Determine if inet_ntop() is available
226AC_MSG_CHECKING([if inet_ntop() is available])
227AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
228 #include <sys/socket.h>
229 #include <arpa/inet.h>]],
230 [inet_ntop(0, 0, 0, 0);])],
231 [AC_DEFINE(PJ_SOCK_HAS_INET_NTOP,1)
232 AC_MSG_RESULT(yes)],
233 [AC_MSG_RESULT(no)])
234
235dnl # Determine if getaddrinfo() is available
236AC_MSG_CHECKING([if getaddrinfo() is available])
237AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
238 #include <sys/socket.h>
239 #include <netdb.h>]],
240 [getaddrinfo(0, 0, 0, 0);])],
241 [AC_DEFINE(PJ_SOCK_HAS_GETADDRINFO,1)
242 AC_MSG_RESULT(yes)],
243 [AC_MSG_RESULT(no)])
244
Benny Prijonob466e232006-09-10 08:53:59 +0000245dnl # Determine if sockaddr_in has sin_len member
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000246AC_MSG_CHECKING([if sockaddr_in has sin_len member])
Benny Prijonob466e232006-09-10 08:53:59 +0000247AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
248 #include <sys/socket.h>
249 #include <netinet/in.h>
250 #include <arpa/inet.h>]],
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000251 [struct sockaddr_in a; a.sin_len=0;])],
252 [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1)
253 AC_MSG_RESULT(yes)],
254 AC_MSG_RESULT(no))
255
Benny Prijonob466e232006-09-10 08:53:59 +0000256dnl # Determine if socklen_t is available
Benny Prijono30f85c62006-09-09 20:05:33 +0000257AC_MSG_CHECKING([if socklen_t is available])
Benny Prijono1d971622006-09-10 22:27:40 +0000258AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
Benny Prijono30f85c62006-09-09 20:05:33 +0000259 [socklen_t xxx = 0;])],
260 [AC_DEFINE(PJ_HAS_SOCKLEN_T,1)
261 AC_MSG_RESULT(yes)],
262 AC_MSG_RESULT(no))
263
Benny Prijonob466e232006-09-10 08:53:59 +0000264dnl # Determine if SO_ERROR is available
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000265AC_MSG_CHECKING([if SO_ERROR is available])
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000266case $target in
267 *mingw* | *cygw* | *win32* | *w32* )
268 AC_DEFINE(PJ_HAS_SO_ERROR,1)
269 AC_MSG_RESULT(yes)
270 ;;
271 *)
272 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
273 #include <sys/socket.h>
274 #include <netinet/in.h>
275 #include <arpa/inet.h>]],
276 [int i=SO_ERROR;])],
277 [AC_DEFINE(PJ_HAS_SO_ERROR,1)
278 AC_MSG_RESULT(yes)],
279 AC_MSG_RESULT(no))
280 ;;
281esac
282
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000283
Benny Prijonob466e232006-09-10 08:53:59 +0000284dnl # Determine if RW-mutex is available
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000285AC_MSG_CHECKING([if pthread_rwlock_t is available])
286AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
287 [pthread_rwlock_t *x;])],
288 [AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
Benny Prijono1c5f4e42008-02-07 13:11:39 +0000289 ac_rwmutex="yes"
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000290 AC_MSG_RESULT(yes)],
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000291 [AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
Benny Prijono1c5f4e42008-02-07 13:11:39 +0000292 ac_rwmutex="no"
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000293 AC_MSG_RESULT(no)])
294
Benny Prijono1c5f4e42008-02-07 13:11:39 +0000295dnl # If rwmutex is not detected, check again but this time
296dnl # with _POSIX_READER_WRITER_LOCKS defined (newlib needs this)
297if test "$ac_rwmutex" = "no"; then
298 AC_MSG_CHECKING([if pthread_rwlock_t is available with _POSIX_READER_WRITER_LOCKS])
299 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#define _POSIX_READER_WRITER_LOCKS
300 #include <pthread.h>]],
301 [pthread_rwlock_t *x;])],
302 [AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
303 CFLAGS="$CFLAGS -D_POSIX_THREADS -D_POSIX_READER_WRITER_LOCKS"
304 AC_MSG_RESULT(yes)],
305 [AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
306 AC_MSG_RESULT(no)])
307fi
308
309dnl # Do we have pthread_mutexattr_settype()?
310AC_MSG_CHECKING([if pthread_mutexattr_settype() is available])
311AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
312 [pthread_mutexattr_settype(0,PTHREAD_MUTEX_FAST_NP);])],
313 [AC_DEFINE(PJ_HAS_PTHREAD_MUTEXATTR_SETTYPE,1)
314 AC_MSG_RESULT(yes)],
315 [AC_MSG_RESULT(no)])
316
317dnl # Does pthread_mutexattr_t has "recursive" member?
318AC_MSG_CHECKING([if pthread_mutexattr_t has recursive member])
319AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
320 [[pthread_mutexattr_t attr;
321 attr.recursive=1;]])],
322 [AC_DEFINE(PJ_PTHREAD_MUTEXATTR_T_HAS_RECURSIVE,1)
323 AC_MSG_RESULT(yes)],
324 [AC_MSG_RESULT(no)])
325
Benny Prijono99eec382008-09-18 21:22:16 +0000326dnl ######################
327dnl # ioqueue selection
328dnl #
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000329AC_SUBST(ac_os_objs)
Benny Prijono99eec382008-09-18 21:22:16 +0000330AC_MSG_CHECKING([ioqueue backend])
331AC_ARG_ENABLE(epoll,
332 AC_HELP_STRING([--enable-epoll],
Benny Prijono9489e7a2008-09-19 22:18:50 +0000333 [Use /dev/epoll ioqueue on Linux (experimental)]),
Benny Prijono99eec382008-09-18 21:22:16 +0000334 [
335 ac_os_objs=ioqueue_epoll.o
336 AC_MSG_RESULT([/dev/epoll])
337 ],
338 [
339 ac_os_objs=ioqueue_select.o
340 AC_MSG_RESULT([select()])
341 ])
342
343
344dnl ######################
345dnl # OS specific files
346dnl #
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000347case $target in
348 *mingw* | *cygw* | *win32* | *w32* )
Benny Prijono99eec382008-09-18 21:22:16 +0000349 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"
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000350 ;;
351 *)
Benny Prijono99eec382008-09-18 21:22:16 +0000352 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"
Benny Prijono4e48b512007-05-16 13:41:00 +0000353 # UUID
354 if test "$ac_has_uuid_lib" = "1" -a "$ac_has_uuid_h" = "1"; then
355 ac_os_objs="$ac_os_objs guid_uuid.o"
356 else
357 ac_os_objs="$ac_os_objs guid_simple.o"
358 fi
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000359 ;;
360esac
361
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000362
Benny Prijono4e48b512007-05-16 13:41:00 +0000363
Benny Prijonob466e232006-09-10 08:53:59 +0000364dnl ##########################################
365dnl #
366dnl # PJMEDIA
367dnl #
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000368
Benny Prijonob466e232006-09-10 08:53:59 +0000369dnl # Sound device backend selection
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000370AC_SUBST(ac_pjmedia_snd)
Benny Prijono1d971622006-09-10 22:27:40 +0000371AC_ARG_ENABLE(sound,
372 AC_HELP_STRING([--disable-sound],
373 [Exclude sound (i.e. use null sound)]),
374 [if test "$enable_sound" = "no"; then
375 [ac_pjmedia_snd=null]
376 AC_MSG_RESULT([Checking if sound is disabled... yes])
377 fi]
378 )
379
Benny Prijono39ae2da2006-10-13 17:57:42 +0000380AC_SUBST(ac_pa_cflags)
Benny Prijono27c98722007-04-09 21:28:15 +0000381AC_CHECK_HEADER(sys/soundcard.h,
382 [ac_pa_cflags="$ac_pa_cflags -DHAVE_SYS_SOUNDCARD_H"])
383AC_CHECK_HEADER(linux/soundcard.h,
384 [ac_pa_cflags="$ac_pa_cflags -DHAVE_LINUX_SOUNDCARD_H"])
385AC_CHECK_HEADER(machine/soundcard.h,
386 [ac_pa_cflags="$ac_pa_cflags -DHAVE_MACHINE_SOUNDCARD_H"])
387
Benny Prijono3e091672008-01-09 15:43:02 +0000388if test "x$ac_cv_c_bigendian" = "xyes"; then
389 ac_pa_cflags="$ac_pa_cflags -DPA_BIG_ENDIAN"
390else
391 ac_pa_cflags="$ac_pa_cflags -DPA_LITTLE_ENDIAN"
392fi
393
Benny Prijono1d971622006-09-10 22:27:40 +0000394if test "$enable_sound" = "no"; then
395 true;
396else
397 case $target in
Benny Prijonob466e232006-09-10 08:53:59 +0000398 *darwin*)
Benny Prijono39ae2da2006-10-13 17:57:42 +0000399 LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"
400 if test "`uname -r`" = "6.8"; then
Benny Prijono27c98722007-04-09 21:28:15 +0000401 #ac_pa_cflags="$ac_pa_cflags -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS"
Benny Prijono39ae2da2006-10-13 17:57:42 +0000402 #AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS])
403 ac_pjmedia_snd=pa_old_darwinos
404 AC_MSG_RESULT([Checking sound device backend... old coreaudio])
405 else
406 ac_pjmedia_snd=pa_darwinos
407 AC_MSG_RESULT([Checking sound device backend... coreaudio])
408 fi
Benny Prijonob466e232006-09-10 08:53:59 +0000409 ;;
410 *cygwin* | *mingw*)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000411 ac_pjmedia_snd=pa_win32
412 AC_MSG_RESULT([Checking sound device backend... win32 sound])
413 ;;
414 *rtems*)
415 ac_pjmedia_snd=null
416 AC_MSG_RESULT([Checking sound device backend... null sound])
417 ;;
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000418 *)
Benny Prijono0b462322008-03-12 22:44:24 +0000419 dnl # Check if ALSA is available
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000420 ac_pjmedia_snd=pa_unix
421 AC_CHECK_HEADER(alsa/version.h,
422 [AC_SUBST(ac_pa_use_alsa,1)
423 LIBS="$LIBS -lasound"
424 ],
425 [AC_SUBST(ac_pa_use_alsa,0)])
426 AC_MSG_RESULT([Checking sound device backend... unix])
Benny Prijono0b462322008-03-12 22:44:24 +0000427
428 dnl # Check if OSS is disabled
429 AC_SUBST(ac_pa_use_oss,1)
430 AC_ARG_ENABLE(oss,
431 AC_HELP_STRING([--disable-oss],
432 [Disable OSS audio (default: not disabled)])
433 ,
434 [
435 if test "$enable_oss" = "no"; then
436 [ac_pa_use_oss=0]
437 AC_MSG_RESULT([Checking if OSS audio is disabled... yes])
438 fi
439 ])
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000440 ;;
Benny Prijono1d971622006-09-10 22:27:40 +0000441 esac
442fi
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000443
Benny Prijonoebb2c332008-07-28 23:40:58 +0000444AC_ARG_ENABLE(ext_sound,
445 AC_HELP_STRING([--enable-ext-sound],
446 [PJMEDIA will not provide any sound device backend]),
447 [if test "$enable_ext_sound" = "yes"; then
448 [ac_pjmedia_snd=external]
449 AC_MSG_RESULT([Checking if external sound is set... yes])
450 fi]
451 )
452
Benny Prijonob466e232006-09-10 08:53:59 +0000453dnl # Include resampling small filter
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000454AC_SUBST(ac_no_small_filter)
455AC_ARG_ENABLE(small-filter,
456 AC_HELP_STRING([--disable-small-filter],
457 [Exclude small filter in resampling]),
458 [if test "$enable_small_filter" = "no"; then
459 [ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0']
460 AC_MSG_RESULT([Checking if small filter is disabled... yes])
461 fi],
462 AC_MSG_RESULT([Checking if small filter is disabled... no]))
463
Benny Prijonob466e232006-09-10 08:53:59 +0000464dnl # Include resampling large filter
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000465AC_SUBST(ac_no_large_filter)
466AC_ARG_ENABLE(large-filter,
467 AC_HELP_STRING([--disable-large-filter],
468 [Exclude large filter in resampling]),
469 [if test "$enable_large_filter" = "no"; then
470 [ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0']
471 AC_MSG_RESULT([Checking if large filter is disabled... yes])
472 fi],
473 AC_MSG_RESULT([Checking if large filter is disabled... no]))
474
Benny Prijonob466e232006-09-10 08:53:59 +0000475dnl # Include Speex AEC
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000476AC_SUBST(ac_no_speex_aec)
477AC_ARG_ENABLE(speex-aec,
478 AC_HELP_STRING([--disable-speex-aec],
479 [Exclude Speex Acoustic Echo Canceller/AEC]),
480 [if test "$enable_speex_aec" = "no"; then
481 [ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0']
482 AC_MSG_RESULT([Checking if Speex AEC is disabled...yes])
483 fi],
484 AC_MSG_RESULT([Checking if Speex AEC is disabled...no]))
485
Benny Prijonob466e232006-09-10 08:53:59 +0000486dnl # Include G711 codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000487AC_SUBST(ac_no_g711_codec)
488AC_ARG_ENABLE(g711-codec,
489 AC_HELP_STRING([--disable-g711-codec],
490 [Exclude G.711 codecs from the build]),
491 [if test "$enable_g711_codec" = "no"; then
492 [ac_no_g711_codec=1]
Benny Prijonofe9bffd2007-01-27 17:44:13 +0000493 AC_DEFINE(PJMEDIA_HAS_G711_CODEC,0)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000494 AC_MSG_RESULT([Checking if G.711 codec is disabled...yes])
495 fi],
496 AC_MSG_RESULT([Checking if G.711 codec is disabled...no]))
497
498
Benny Prijonob466e232006-09-10 08:53:59 +0000499dnl # Include L16 codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000500AC_SUBST(ac_no_l16_codec)
501AC_ARG_ENABLE(l16-codec,
502 AC_HELP_STRING([--disable-l16-codec],
503 [Exclude Linear/L16 codec family from the build]),
504 [if test "$enable_l16_codec" = "no"; then
505 [ac_no_l16_codec=1]
Benny Prijonofe9bffd2007-01-27 17:44:13 +0000506 AC_DEFINE(PJMEDIA_HAS_L16_CODEC,0)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000507 AC_MSG_RESULT([Checking if L16 codecs are disabled...yes])
508 fi],
Benny Prijonoc1fe23d2006-09-13 09:38:06 +0000509 AC_MSG_RESULT([Checking if L16 codec is disabled...no]))
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000510
511
Benny Prijonob466e232006-09-10 08:53:59 +0000512dnl # Include GSM codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000513AC_SUBST(ac_no_gsm_codec)
514AC_ARG_ENABLE(gsm-codec,
515 AC_HELP_STRING([--disable-gsm-codec],
516 [Exclude GSM codec in the build]),
517 [if test "$enable_gsm_codec" = "no"; then
518 [ac_no_gsm_codec=1]
Benny Prijonofe9bffd2007-01-27 17:44:13 +0000519 AC_DEFINE(PJMEDIA_HAS_GSM_CODEC,0)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000520 AC_MSG_RESULT([Checking if GSM codec is disabled...yes])
521 fi],
522 AC_MSG_RESULT([Checking if GSM codec is disabled...no]))
523
Benny Prijono71f657d2008-03-17 14:24:21 +0000524dnl # Include G.722 codec
525AC_SUBST(ac_no_g722_codec)
526AC_ARG_ENABLE(g722-codec,
527 AC_HELP_STRING([--disable-g722-codec],
528 [Exclude G.722 codec in the build]),
529 [if test "$enable_g722_codec" = "no"; then
530 [ac_no_g722_codec=1]
531 AC_DEFINE(PJMEDIA_HAS_G722_CODEC,0)
532 AC_MSG_RESULT([Checking if G.722 codec is disabled...yes])
533 fi],
534 AC_MSG_RESULT([Checking if G.722 codec is disabled...no]))
535
Benny Prijonob466e232006-09-10 08:53:59 +0000536dnl # Include Speex codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000537AC_SUBST(ac_no_speex_codec)
538AC_ARG_ENABLE(speex-codec,
539 AC_HELP_STRING([--disable-speex-codec],
540 [Exclude Speex codecs in the build]),
541 [if test "$enable_speex_codec" = "no"; then
542 [ac_no_speex_codec=1]
Benny Prijonofe9bffd2007-01-27 17:44:13 +0000543 AC_DEFINE(PJMEDIA_HAS_SPEEX_CODEC,0)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000544 AC_MSG_RESULT([Checking if Speex codec is disabled...yes])
545 fi],
546 AC_MSG_RESULT([Checking if Speex codec is disabled...no]))
547
Benny Prijonob466e232006-09-10 08:53:59 +0000548dnl # Include iLBC codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000549AC_SUBST(ac_no_ilbc_codec)
550AC_ARG_ENABLE(ilbc-codec,
551 AC_HELP_STRING([--disable-ilbc-codec],
552 [Exclude iLBC codec in the build]),
553 [if test "$enable_ilbc_codec" = "no"; then
554 [ac_no_ilbc_codec=1]
Benny Prijonofe9bffd2007-01-27 17:44:13 +0000555 AC_DEFINE(PJMEDIA_HAS_ILBC_CODEC,0)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000556 AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])
557 fi],
558 AC_MSG_RESULT([Checking if iLBC codec is disabled...no]))
559
Benny Prijono550a1a62007-10-16 08:54:00 +0000560dnl # Include libsamplerate
561AC_ARG_ENABLE(libsamplerate,
562 AC_HELP_STRING([--enable-libsamplerate],
563 [Link with libsamplerate when available. Note that PJMEDIA_RESAMPLE_IMP must also be configured]),
564 [ AC_CHECK_LIB(samplerate,src_new) ],
565 AC_MSG_RESULT([Skipping libsamplerate detection])
566 )
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000567
568
Benny Prijono0822c192008-08-21 20:59:58 +0000569dnl ########################################################
570dnl # Intel IPP support
571dnl #
572AC_ARG_ENABLE(ipp,
573 AC_HELP_STRING([--enable-ipp],
574 [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]),
575 [],
576 [enable_ipp=no]
577 )
578
579AC_ARG_ENABLE(ipp,
580 AC_HELP_STRING([--with-ipp=DIR],
581 [Specify the Intel IPP location]),
582 [],
583 [with_ipp=no]
584 )
585
586AC_ARG_ENABLE(ipp-samples,
587 AC_HELP_STRING([--with-ipp-samples=DIR],
588 [Specify the Intel IPP samples location]),
589 [],
590 [with_ipp_samples=no]
591 )
592
593if test "x$enable_ipp" != "xno"; then
594 dnl #
595 dnl # Verifying Intel IPP path
596 dnl #
597 AC_MSG_CHECKING([Intel IPP location])
598
599 if test "x$with_ipp" != "xno" -a "x$with_ipp" != "x"; then
600 AC_MSG_RESULT([$with_ipp])
601 IPPROOT=$with_ipp
602 elif test "x$IPPROOT" = "x"; then
603 if test -d /opt/intel/ipp; then
604 IPPROOT=`ls -d /opt/intel/ipp/*/* | head -1`
605 AC_MSG_RESULT([autodetected in $IPPROOT])
606 fi
607 else
608 AC_MSG_RESULT([$IPPROOT])
609 fi
610
611 if test x$IPPROOT = x; then
612 AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPROOT env var or with --with-ipp option])
613 elif test ! -d $IPPROOT; then
614 AC_MSG_ERROR([not found])
615 elif test ! -d $IPPROOT/include; then
616 AC_MSG_ERROR([directory doesn't seem to be valid])
617 else
618 # IPP directory looks okay.
619 # Remove trailing backslash
620 IPPROOT=`echo $IPPROOT/ | sed 's/\/$//'`
621
622 SAVED_CFLAGS="$CFLAGS"
623 SAVED_LDFLAGS="$LDFLAGS"
624 SAVED_LIBS="$LIBS"
625
626 IPP_CFLAGS="-I$IPPROOT/include"
627 IPP_LDFLAGS="-L$IPPROOT/sharedlib"
628 IPP_LIBS="-lippsc -lipps -lippsr -lippcore -lguide"
629 #IPP_LDFLAGS="-L$IPPROOT/sharedlib"
630 #IPP_LIBS="-lippscmerged -lippsrmerged -lippsmerged -lippcore"
631
632 CFLAGS="$CFLAGS $IPP_CFLAGS"
633 LDFLAGS="$LDFLAGS $IPP_LDFLAGS"
634 LIBS="$IPP_LIBS $LIBS"
635
636
637 AC_MSG_CHECKING([Intel IPP usability])
638 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <ippcore.h>
639 ]],
640 [ippStaticInit();])],
641 [AC_MSG_RESULT(ok)],
642 [AC_MSG_FAILURE(failed)])
643
644 CFLAGS="$SAVED_CFLAGS"
645 LDFLAGS="$SAVED_LDFLAGS"
646 LIBS="$SAVED_LIBS"
647 fi
648
649 dnl #
650 dnl # Verifying Intel IPP samples path
651 dnl #
652 AC_MSG_CHECKING([Intel IPP samples location])
653
654 if test "x$with_ipp_samples" != "xno" -a "x$with_ipp_samples" != "x"; then
655 AC_MSG_RESULT([$with_ipp_samples])
656 IPPSAMPLES=$with_ipp_samples
657 elif test "x$IPPSAMPLES" = "x"; then
658 if test -d /opt/intel/ipp-samples; then
659 IPPSAMPLES=/opt/intel/ipp-samples
660 AC_MSG_RESULT([autodetected in $IPPSAMPLES])
661 fi
662 else
663 AC_MSG_RESULT([$IPPSAMPLES])
664 fi
665
666 if test x$IPPSAMPLES = x; then
667 AC_MSG_ERROR([the location is neither specified nor can be guessed. Please specify with IPPSAMPLES env var or with --with-ipp-samples option])
668 elif test ! -d $IPPSAMPLES; then
669 AC_MSG_ERROR([not found])
670 elif test ! -d $IPPSAMPLES/speech-codecs; then
671 AC_MSG_ERROR([directory doesn't seem to be valid])
672 else
673 # Remove trailing backslash
674 IPPSAMPLES=`echo $IPPSAMPLES | sed 's/\/$//'`
675
676 # Guess the libusc.a build location
677 AC_MSG_CHECKING([Intel IPP USC build location])
678 IPPSAMPLESLIB=`ls -d $IPPSAMPLES/speech-codecs/bin/*gcc*/lib | head -1`
679 if test ! -d $IPPSAMPLESLIB; then
680 AC_MSG_FAILURE([the $IPPSAMPLES/speech-codecs/bin/*gcc*/lib directory not found. Have you built the samples?])
681 fi
682 if test ! -f $IPPSAMPLESLIB/libusc.a; then
683 AC_MSG_FAILURE([libusc.a doesn't exist in $IPPSAMPLESLIB])
684 fi
685 AC_MSG_RESULT([$IPPSAMPLESLIB])
686
687 SAVED_CFLAGS="$CFLAGS"
688 SAVED_LDFLAGS="$LDFLAGS"
689 SAVED_LIBS="$LIBS"
690
691 IPPSAMPLESINC="-I$IPPSAMPLES/speech-codecs/core/usc/include"
692 CFLAGS="$CFLAGS $IPPSAMPLESINC"
693 LDFLAGS="$LDFLAGS -L$IPPSAMPLESLIB"
694 LIBS="-lusc $LIBS"
695
696 AC_MSG_CHECKING([Intel IPP USC usability])
697 AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include <usc.h>
698 ]],
699 [extern USC_Fxns USC_G729AFP_Fxns;])],
700 [AC_MSG_RESULT(ok)],
701 [AC_MSG_FAILURE(failed)])
702
703 CFLAGS="$SAVED_CFLAGS"
704 LDFLAGS="\$(IPP_LDFLAGS) $SAVED_LDFLAGS"
705 LIBS="\$(IPP_LIBS) $SAVED_LIBS"
706
707 IPP_CFLAGS="$IPP_CFLAGS $IPPSAMPLESINC"
708 IPP_LDFLAGS="$IPP_LDFLAGS -L$IPPSAMPLESLIB"
709 IPP_LIBS="-lusc $IPP_LIBS"
710 fi
711
712 ac_build_mak_vars="$ac_build_mak_vars\n\
713export IPP_CFLAGS=$IPP_CFLAGS\n\
714export IPP_LDFLAGS=$IPP_LDFLAGS\n\
715export IPP_LIBS=$IPP_LIBS"
716else
717 AC_MSG_RESULT([Skipping Intel IPP settings (not wanted)])
718fi
719
720
Benny Prijonob466e232006-09-10 08:53:59 +0000721dnl ##########################################
722dnl #
Benny Prijono7e0d75f2006-12-25 20:34:14 +0000723dnl # PJSIP CONFIG
724dnl #
725
726dnl # Include SSL support
727AC_SUBST(ac_no_ssl)
728AC_ARG_ENABLE(ssl,
Benny Prijonoce1db762007-02-14 02:21:08 +0000729 AC_HELP_STRING([--disable-ssl],
730 [Exclude SSL support the build (default: autodetect)])
731 ,
Benny Prijono7e0d75f2006-12-25 20:34:14 +0000732 [
733 if test "$enable_ssl" = "no"; then
734 [ac_no_ssl=1]
735 AC_MSG_RESULT([Checking if SSL support is disabled... yes])
736 fi
737 ],
738 [
739 AC_MSG_RESULT([checking for OpenSSL installations..])
740 AC_SUBST(openssl_h_present)
741 AC_SUBST(libssl_present)
742 AC_SUBST(libcrypto_present)
743 AC_CHECK_HEADER(openssl/ssl.h,[openssl_h_present=1])
744 AC_CHECK_LIB(ssl,SSL_library_init,[libssl_present=1 && LIBS="$LIBS -lssl"])
745 AC_CHECK_LIB(crypto,ERR_load_BIO_strings,[libcrypto_present=1 && LIBS="$LIBS -lcrypto"])
746 if test "x$openssl_h_present" = "x1" -a "x$libssl_present" = "x1" -a "x$libcrypto_present" = "x1"; then
747 AC_MSG_RESULT([OpenSSL library found, SSL support enabled])
748 AC_DEFINE(PJSIP_HAS_TLS_TRANSPORT, 1)
749 else
750 AC_MSG_RESULT([** OpenSSL libraries not found, disabling SSL support **])
751 fi
752 ])
753
754
755dnl ##########################################
756dnl #
Benny Prijonob466e232006-09-10 08:53:59 +0000757dnl # MANUAL CONFIG
758dnl #
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000759
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000760
Benny Prijonob466e232006-09-10 08:53:59 +0000761dnl # Determine if select() requires nfds to be filled up with
762dnl # correct value (max_fd+1). If zero, nfds will be filled up with
763dnl # PJ_FD_SETSIZE
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000764AC_MSG_CHECKING([if select() needs correct nfds])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000765case $target in
766 *rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1)
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000767 AC_MSG_RESULT(yes)
768 ;;
769 *) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0)
770 AC_MSG_RESULT([no (default)])
771 AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)])
772 ;;
773esac
774
Benny Prijonob466e232006-09-10 08:53:59 +0000775dnl # Determine if pj_thread_create() should enforce thread stack size when
776dnl # creating thread. Default is zero, to allow OS to allocate appropriate
777dnl # thread's stack size.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000778AC_MSG_CHECKING([if pj_thread_create() should enforce stack size])
779case $target in
780 *rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1)
781 AC_MSG_RESULT(yes)
782 ;;
783 *) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0)
784 AC_MSG_RESULT([no (default)])
785 ;;
786esac
787
Benny Prijonob466e232006-09-10 08:53:59 +0000788dnl # Determine if pj_thread_create() should allocate thread's stack from
789dnl # the pool. Default is zero, to let OS allocate thread's stack.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000790AC_MSG_CHECKING([if pj_thread_create() should allocate stack])
791case $target in
792 *rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1)
793 AC_MSG_RESULT(yes)
794 ;;
795 *) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0)
796 AC_MSG_RESULT([no (default)])
797 ;;
798esac
799
Benny Prijonob466e232006-09-10 08:53:59 +0000800dnl # This value specifies the value set in errno by the OS when a non-blocking
801dnl # socket recv() can not return immediate data.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000802case $target in
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000803 *mingw* | *cygw* | *win32* | *w32* )
804 AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK)
805 ;;
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000806 *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
807 AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
808 ;;
809esac
810
Benny Prijonob466e232006-09-10 08:53:59 +0000811dnl # This value specifies the value set in errno by the OS when a non-blocking
812dnl # socket connect() can not get connected immediately.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000813case $target in
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000814 *mingw* | *cygw* | *win32* | *w32* )
815 AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK)
816 ;;
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000817 *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
818 AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
819 ;;
820esac
821
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000822
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000823AC_SUBST(target)
824AC_SUBST(ac_cross_compile)
825if test "$build" = "$host"; then
826 ac_cross_compile=
827else
Benny Prijono5b818b22006-09-17 22:58:51 +0000828 ac_cross_compile=${host_orig}-
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000829fi
830AC_SUBST(ac_linux_poll,select)
831AC_SUBST(ac_host,unix)
832AC_SUBST(ac_main_obj)
833case $target in
834 *rtems*)
835 ac_main_obj=main_rtems.o
836 ;;
837 *)
838 ac_main_obj=main.o
839 ;;
840esac
841AC_SUBST(CC)
Benny Prijono0822c192008-08-21 20:59:58 +0000842
843ac_build_mak_vars=`echo $ac_build_mak_vars | sed 's/\\\\n/\n/g'`
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000844AC_OUTPUT()
845
Benny Prijonod9627842007-04-18 09:24:31 +0000846
847AC_MSG_RESULT([
848
Benny Prijonoc16c6e32007-11-18 14:53:47 +0000849Configurations 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.
Benny Prijonod9627842007-04-18 09:24:31 +0000850
Benny Prijonoc16c6e32007-11-18 14:53:47 +0000851Further customizations can be put in:
Benny Prijonod9627842007-04-18 09:24:31 +0000852 - 'user.mak'
853 - 'pjlib/include/pj/config_site.h'
854
855The next step now is to run 'make dep' and 'make'.
856])
857