blob: 8bc454e8f7786e2cce3da798765773b506f9b8b6 [file] [log] [blame]
Benny Prijonoc4c61d02006-08-20 20:47:34 +00001AC_INIT(pjproject,0.5.8)
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
10 ])
11AC_CONFIG_FILES([build.mak
12 build/os-auto.mak
13 pjlib/build/os-auto.mak
14 pjlib-util/build/os-auto.mak
15 pjmedia/build/os-auto.mak
16 pjsip/build/os-auto.mak
17 ])
Benny Prijonoc1fe23d2006-09-13 09:38:06 +000018
19dnl
20dnl Setup default CFLAGS
21dnl
22if test "$CFLAGS" = ""; then
Benny Prijonod1459822006-10-04 20:56:39 +000023 CFLAGS="-O2"
Benny Prijonoc1fe23d2006-09-13 09:38:06 +000024else
25 CFLAGS="$CFLAGS"
26fi
27
28CXXFLAGS="$CFLAGS $CXXFLAGS"
29
Benny Prijonoa9b372a2006-07-24 02:07:11 +000030AC_PROG_CC
Benny Prijonoc4c61d02006-08-20 20:47:34 +000031AC_PROG_CXX
Benny Prijonoa9b372a2006-07-24 02:07:11 +000032AC_LANG_C
33
Benny Prijonoc4c61d02006-08-20 20:47:34 +000034AC_CHECK_LIB(pthread,pthread_create)
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000035AC_CHECK_LIB(wsock32,puts)
36AC_CHECK_LIB(ws2_32,puts)
37AC_CHECK_LIB(ole32,puts)
38AC_CHECK_LIB(winmm,puts)
39AC_CHECK_LIB(socket,puts)
40AC_CHECK_LIB(rt,puts)
41AC_CHECK_LIB(nsl,puts)
Benny Prijonoc4c61d02006-08-20 20:47:34 +000042
43AC_MSG_RESULT([Setting PJ_M_NAME to $target_cpu])
44AC_DEFINE_UNQUOTED(PJ_M_NAME,["$target_cpu"])
45
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000046dnl
Benny Prijono1d971622006-09-10 22:27:40 +000047dnl Memory alignment detection
48dnl
49AC_MSG_CHECKING([memory alignment])
50case $target in
51 ia64-* | x86_64-* )
52 AC_DEFINE(PJ_POOL_ALIGNMENT, 8)
53 AC_MSG_RESULT([8 bytes])
54 ;;
55 * )
56 AC_DEFINE(PJ_POOL_ALIGNMENT, 4)
57 AC_MSG_RESULT([4 bytes (default)])
58 ;;
59esac
60
61
62dnl
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000063dnl Endianness detection
64dnl
Benny Prijonob466e232006-09-10 08:53:59 +000065AC_C_BIGENDIAN
Benny Prijonoc4c61d02006-08-20 20:47:34 +000066
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +000067dnl
68dnl Legacy macros
69dnl
70case $target in
71 *mingw* | *cygw* | *win32* | *w32* )
72 AC_DEFINE(PJ_WIN32,1)
73 AC_DEFINE(PJ_WIN32_WINNT,0x0400)
74 AC_DEFINE(WIN32_LEAN_AND_MEAN)
75 ;;
76 *darwin*)
77 AC_DEFINE(PJ_DARWINOS,1)
78 ;;
79 *linux*)
80 AC_DEFINE(PJ_LINUX,1)
81 ;;
82 *rtems*)
83 AC_DEFINE(PJ_RTEMS,1)
84 ;;
85 *sunos* | *solaris* )
86 AC_DEFINE(PJ_SUNOS,1)
87 ;;
88 *)
89 ;;
90esac
91
92
93
94
Benny Prijonob466e232006-09-10 08:53:59 +000095dnl # --disable-floating-point option
Benny Prijonoc4c61d02006-08-20 20:47:34 +000096AC_ARG_ENABLE(floating-point,
97 AC_HELP_STRING([--disable-floating-point],
98 [Disable floating point where possible]),
99 [if test "$enable_floating_point" = "no"; then
100 AC_DEFINE(PJ_HAS_FLOATING_POINT,0)
101 AC_MSG_RESULT([Checking if floating point is disabled... yes])
102 fi],
103 [
104 AC_DEFINE(PJ_HAS_FLOATING_POINT,1)
105 AC_MSG_RESULT([Checking if floating point is disabled... no])
106 AC_CHECK_LIB(m,fmod)
107 ])
108
109
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000110AC_CHECK_HEADER(arpa/inet.h,[AC_DEFINE(PJ_HAS_ARPA_INET_H,1)])
111AC_CHECK_HEADER(assert.h,[AC_DEFINE(PJ_HAS_ASSERT_H,1)])
112AC_CHECK_HEADER(ctype.h,[AC_DEFINE(PJ_HAS_CTYPE_H,1)])
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000113
114case $target in
115 *mingw* | *cygw* | *win32* | *w32* )
116 AC_DEFINE(PJ_HAS_ERRNO_H,0)
117 ;;
118 *)
119 AC_CHECK_HEADER(errno.h,[AC_DEFINE(PJ_HAS_ERRNO_H,1)])
120 ;;
121esac
122
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000123AC_CHECK_HEADER(linux/socket.h,[AC_DEFINE(PJ_HAS_LINUX_SOCKET_H,1)])
124AC_CHECK_HEADER(malloc.h,[AC_DEFINE(PJ_HAS_MALLOC_H,1)])
125AC_CHECK_HEADER(netdb.h,[AC_DEFINE(PJ_HAS_NETDB_H,1)])
126AC_CHECK_HEADER(netinet/in.h,[AC_DEFINE(PJ_HAS_NETINET_IN_H,1)])
127AC_CHECK_HEADER(setjmp.h,[AC_DEFINE(PJ_HAS_SETJMP_H,1)])
128AC_CHECK_HEADER(stdarg.h,[AC_DEFINE(PJ_HAS_STDARG_H,1)])
129AC_CHECK_HEADER(stddef.h,[AC_DEFINE(PJ_HAS_STDDEF_H,1)])
130AC_CHECK_HEADER(stdio.h,[AC_DEFINE(PJ_HAS_STDIO_H,1)])
131AC_CHECK_HEADER(stdlib.h,[AC_DEFINE(PJ_HAS_STDLIB_H,1)])
132AC_CHECK_HEADER(string.h,[AC_DEFINE(PJ_HAS_STRING_H,1)])
133AC_CHECK_HEADER(sys/ioctl.h,[AC_DEFINE(PJ_HAS_SYS_IOCTL_H,1)])
134AC_CHECK_HEADER(sys/select.h,[AC_DEFINE(PJ_HAS_SYS_SELECT_H,1)])
135AC_CHECK_HEADER(sys/socket.h,[AC_DEFINE(PJ_HAS_SYS_SOCKET_H,1)])
136AC_CHECK_HEADER(sys/time.h,[AC_DEFINE(PJ_HAS_SYS_TIME_H,1)])
137AC_CHECK_HEADER(sys/timeb.h,[AC_DEFINE(PJ_HAS_SYS_TIMEB_H,1)])
138AC_CHECK_HEADER(sys/types.h,[AC_DEFINE(PJ_HAS_SYS_TYPES_H,1)])
139AC_CHECK_HEADER(time.h,[AC_DEFINE(PJ_HAS_TIME_H,1)])
140AC_CHECK_HEADER(unistd.h,[AC_DEFINE(PJ_HAS_UNISTD_H,1)])
141AC_CHECK_HEADER(mswsock.h,[AC_DEFINE(PJ_HAS_MSWSOCK_H,1)])
142AC_CHECK_HEADER(winsock.h,[AC_DEFINE(PJ_HAS_WINSOCK_H,1)])
143AC_CHECK_HEADER(winsock2.h,[AC_DEFINE(PJ_HAS_WINSOCK2_H,1)])
144
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000145AC_MSG_RESULT([Setting PJ_OS_NAME to $target])
146AC_DEFINE_UNQUOTED(PJ_OS_NAME,["$target"])
147
148AC_MSG_RESULT([Setting PJ_HAS_ERRNO_VAR to 1])
149AC_DEFINE(PJ_HAS_ERRNO_VAR,1)
150
151AC_MSG_RESULT([Setting PJ_HAS_HIGH_RES_TIMER to 1])
152AC_DEFINE(PJ_HAS_HIGH_RES_TIMER,1)
153
154AC_MSG_RESULT([Setting PJ_HAS_MALLOC to 1])
155AC_DEFINE(PJ_HAS_MALLOC,1)
156
157AC_MSG_RESULT([Setting PJ_NATIVE_STRING_IS_UNICODE to 0])
158AC_DEFINE(PJ_NATIVE_STRING_IS_UNICODE,0)
159
160AC_MSG_RESULT([Setting PJ_ATOMIC_VALUE_TYPE to long])
161AC_DEFINE(PJ_ATOMIC_VALUE_TYPE,long)
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000162
Benny Prijonob466e232006-09-10 08:53:59 +0000163dnl # Determine if inet_aton() is available
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000164AC_MSG_CHECKING([if inet_aton is available])
Benny Prijonob466e232006-09-10 08:53:59 +0000165AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <arpa/inet.h>]],
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000166 [inet_aton(0, 0);])],
167 [AC_DEFINE(PJ_SOCK_HAS_INET_ATON,1)
168 AC_MSG_RESULT(yes)],
169 [AC_MSG_RESULT(no)])
170
Benny Prijonob466e232006-09-10 08:53:59 +0000171dnl # Determine if sockaddr_in has sin_len member
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000172AC_MSG_CHECKING([if sockaddr_in has sin_len member])
Benny Prijonob466e232006-09-10 08:53:59 +0000173AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
174 #include <sys/socket.h>
175 #include <netinet/in.h>
176 #include <arpa/inet.h>]],
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000177 [struct sockaddr_in a; a.sin_len=0;])],
178 [AC_DEFINE(PJ_SOCKADDR_HAS_LEN,1)
179 AC_MSG_RESULT(yes)],
180 AC_MSG_RESULT(no))
181
Benny Prijonob466e232006-09-10 08:53:59 +0000182dnl # Determine if socklen_t is available
Benny Prijono30f85c62006-09-09 20:05:33 +0000183AC_MSG_CHECKING([if socklen_t is available])
Benny Prijono1d971622006-09-10 22:27:40 +0000184AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/socket.h>]],
Benny Prijono30f85c62006-09-09 20:05:33 +0000185 [socklen_t xxx = 0;])],
186 [AC_DEFINE(PJ_HAS_SOCKLEN_T,1)
187 AC_MSG_RESULT(yes)],
188 AC_MSG_RESULT(no))
189
Benny Prijonob466e232006-09-10 08:53:59 +0000190dnl # Determine if SO_ERROR is available
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000191AC_MSG_CHECKING([if SO_ERROR is available])
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000192case $target in
193 *mingw* | *cygw* | *win32* | *w32* )
194 AC_DEFINE(PJ_HAS_SO_ERROR,1)
195 AC_MSG_RESULT(yes)
196 ;;
197 *)
198 AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>
199 #include <sys/socket.h>
200 #include <netinet/in.h>
201 #include <arpa/inet.h>]],
202 [int i=SO_ERROR;])],
203 [AC_DEFINE(PJ_HAS_SO_ERROR,1)
204 AC_MSG_RESULT(yes)],
205 AC_MSG_RESULT(no))
206 ;;
207esac
208
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000209
Benny Prijonob466e232006-09-10 08:53:59 +0000210dnl # Determine if RW-mutex is available
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000211AC_MSG_CHECKING([if pthread_rwlock_t is available])
212AC_COMPILE_IFELSE([AC_LANG_PROGRAM([#include <pthread.h>],
213 [pthread_rwlock_t *x;])],
214 [AC_DEFINE(PJ_EMULATE_RWMUTEX,0)
215 AC_MSG_RESULT(yes)],
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000216 [AC_DEFINE(PJ_EMULATE_RWMUTEX,1)
217 AC_MSG_RESULT(no)])
218
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000219AC_SUBST(ac_os_objs)
220case $target in
221 *mingw* | *cygw* | *win32* | *w32* )
222 ac_os_objs="os_core_win32.o os_error_win32.o os_time_win32.o os_timestamp_win32.o guid_win32.o ioqueue_select.o"
223 ;;
224 *)
225 ac_os_objs="os_core_unix.o os_error_unix.o os_time_unix.o os_timestamp_posix.o guid_simple.o ioqueue_select.o"
226 ;;
227esac
228
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000229
Benny Prijonob466e232006-09-10 08:53:59 +0000230dnl ##########################################
231dnl #
232dnl # PJMEDIA
233dnl #
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000234
Benny Prijonob466e232006-09-10 08:53:59 +0000235dnl # Sound device backend selection
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000236AC_SUBST(ac_pjmedia_snd)
Benny Prijono1d971622006-09-10 22:27:40 +0000237AC_ARG_ENABLE(sound,
238 AC_HELP_STRING([--disable-sound],
239 [Exclude sound (i.e. use null sound)]),
240 [if test "$enable_sound" = "no"; then
241 [ac_pjmedia_snd=null]
242 AC_MSG_RESULT([Checking if sound is disabled... yes])
243 fi]
244 )
245
Benny Prijono39ae2da2006-10-13 17:57:42 +0000246AC_SUBST(ac_pa_cflags)
Benny Prijono1d971622006-09-10 22:27:40 +0000247if test "$enable_sound" = "no"; then
248 true;
249else
250 case $target in
Benny Prijonob466e232006-09-10 08:53:59 +0000251 *darwin*)
Benny Prijono39ae2da2006-10-13 17:57:42 +0000252 LIBS="$LIBS -framework CoreAudio -framework CoreServices -framework AudioUnit -framework AudioToolbox"
253 if test "`uname -r`" = "6.8"; then
254 #ac_pa_cflags="-DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS"
255 #AC_MSG_RESULT([Setting additional PortAudio CFLAGS.. -DPA_OLD_CORE_AUDIO -DMOSX_USE_NON_ATOMIC_FLAG_BITS])
256 ac_pjmedia_snd=pa_old_darwinos
257 AC_MSG_RESULT([Checking sound device backend... old coreaudio])
258 else
259 ac_pjmedia_snd=pa_darwinos
260 AC_MSG_RESULT([Checking sound device backend... coreaudio])
261 fi
Benny Prijonob466e232006-09-10 08:53:59 +0000262 ;;
263 *cygwin* | *mingw*)
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000264 ac_pjmedia_snd=pa_win32
265 AC_MSG_RESULT([Checking sound device backend... win32 sound])
266 ;;
267 *rtems*)
268 ac_pjmedia_snd=null
269 AC_MSG_RESULT([Checking sound device backend... null sound])
270 ;;
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000271 *)
272 ac_pjmedia_snd=pa_unix
273 AC_CHECK_HEADER(alsa/version.h,
274 [AC_SUBST(ac_pa_use_alsa,1)
275 LIBS="$LIBS -lasound"
276 ],
277 [AC_SUBST(ac_pa_use_alsa,0)])
278 AC_MSG_RESULT([Checking sound device backend... unix])
279 ;;
Benny Prijono1d971622006-09-10 22:27:40 +0000280 esac
281fi
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000282
Benny Prijonob466e232006-09-10 08:53:59 +0000283dnl # Include resampling small filter
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000284AC_SUBST(ac_no_small_filter)
285AC_ARG_ENABLE(small-filter,
286 AC_HELP_STRING([--disable-small-filter],
287 [Exclude small filter in resampling]),
288 [if test "$enable_small_filter" = "no"; then
289 [ac_no_small_filter='-DPJMEDIA_HAS_SMALL_FILTER=0']
290 AC_MSG_RESULT([Checking if small filter is disabled... yes])
291 fi],
292 AC_MSG_RESULT([Checking if small filter is disabled... no]))
293
Benny Prijonob466e232006-09-10 08:53:59 +0000294dnl # Include resampling large filter
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000295AC_SUBST(ac_no_large_filter)
296AC_ARG_ENABLE(large-filter,
297 AC_HELP_STRING([--disable-large-filter],
298 [Exclude large filter in resampling]),
299 [if test "$enable_large_filter" = "no"; then
300 [ac_no_large_filter='-DPJMEDIA_HAS_LARGE_FILTER=0']
301 AC_MSG_RESULT([Checking if large filter is disabled... yes])
302 fi],
303 AC_MSG_RESULT([Checking if large filter is disabled... no]))
304
Benny Prijonob466e232006-09-10 08:53:59 +0000305dnl # Include G.711 Annex A PLC
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000306AC_SUBST(ac_no_g711_plc)
307AC_ARG_ENABLE(g711-plc,
308 AC_HELP_STRING([--disable-g711-plc],
309 [Exclude G.711 Annex A PLC]),
310 [if test "$enable_g711_plc" = "no"; then
311 [ac_no_g711_plc='-DPJMEDIA_HAS_G711_PLC=0']
312 AC_MSG_RESULT([Checking if G.711 Annex A PLC is disabled...yes])
313 fi],
314 AC_MSG_RESULT([Checking if G.711 Annex A PLC is disabled...no]))
315
Benny Prijonob466e232006-09-10 08:53:59 +0000316dnl # Include Speex AEC
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000317AC_SUBST(ac_no_speex_aec)
318AC_ARG_ENABLE(speex-aec,
319 AC_HELP_STRING([--disable-speex-aec],
320 [Exclude Speex Acoustic Echo Canceller/AEC]),
321 [if test "$enable_speex_aec" = "no"; then
322 [ac_no_speex_aec='-DPJMEDIA_HAS_SPEEX_AEC=0']
323 AC_MSG_RESULT([Checking if Speex AEC is disabled...yes])
324 fi],
325 AC_MSG_RESULT([Checking if Speex AEC is disabled...no]))
326
Benny Prijonob466e232006-09-10 08:53:59 +0000327dnl # Include G711 codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000328AC_SUBST(ac_no_g711_codec)
329AC_ARG_ENABLE(g711-codec,
330 AC_HELP_STRING([--disable-g711-codec],
331 [Exclude G.711 codecs from the build]),
332 [if test "$enable_g711_codec" = "no"; then
333 [ac_no_g711_codec=1]
334 AC_MSG_RESULT([Checking if G.711 codec is disabled...yes])
335 fi],
336 AC_MSG_RESULT([Checking if G.711 codec is disabled...no]))
337
338
Benny Prijonob466e232006-09-10 08:53:59 +0000339dnl # Include L16 codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000340AC_SUBST(ac_no_l16_codec)
341AC_ARG_ENABLE(l16-codec,
342 AC_HELP_STRING([--disable-l16-codec],
343 [Exclude Linear/L16 codec family from the build]),
344 [if test "$enable_l16_codec" = "no"; then
345 [ac_no_l16_codec=1]
346 AC_MSG_RESULT([Checking if L16 codecs are disabled...yes])
347 fi],
Benny Prijonoc1fe23d2006-09-13 09:38:06 +0000348 AC_MSG_RESULT([Checking if L16 codec is disabled...no]))
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000349
350
Benny Prijonob466e232006-09-10 08:53:59 +0000351dnl # Include GSM codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000352AC_SUBST(ac_no_gsm_codec)
353AC_ARG_ENABLE(gsm-codec,
354 AC_HELP_STRING([--disable-gsm-codec],
355 [Exclude GSM codec in the build]),
356 [if test "$enable_gsm_codec" = "no"; then
357 [ac_no_gsm_codec=1]
358 AC_MSG_RESULT([Checking if GSM codec is disabled...yes])
359 fi],
360 AC_MSG_RESULT([Checking if GSM codec is disabled...no]))
361
Benny Prijonob466e232006-09-10 08:53:59 +0000362dnl # Include Speex codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000363AC_SUBST(ac_no_speex_codec)
364AC_ARG_ENABLE(speex-codec,
365 AC_HELP_STRING([--disable-speex-codec],
366 [Exclude Speex codecs in the build]),
367 [if test "$enable_speex_codec" = "no"; then
368 [ac_no_speex_codec=1]
369 AC_MSG_RESULT([Checking if Speex codec is disabled...yes])
370 fi],
371 AC_MSG_RESULT([Checking if Speex codec is disabled...no]))
372
Benny Prijonob466e232006-09-10 08:53:59 +0000373dnl # Include iLBC codec
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000374AC_SUBST(ac_no_ilbc_codec)
375AC_ARG_ENABLE(ilbc-codec,
376 AC_HELP_STRING([--disable-ilbc-codec],
377 [Exclude iLBC codec in the build]),
378 [if test "$enable_ilbc_codec" = "no"; then
379 [ac_no_ilbc_codec=1]
380 AC_MSG_RESULT([Checking if iLBC codec is disabled...yes])
381 fi],
382 AC_MSG_RESULT([Checking if iLBC codec is disabled...no]))
383
384
385
Benny Prijonob466e232006-09-10 08:53:59 +0000386dnl ##########################################
387dnl #
388dnl # MANUAL CONFIG
389dnl #
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000390
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000391
Benny Prijonob466e232006-09-10 08:53:59 +0000392dnl # Determine if select() requires nfds to be filled up with
393dnl # correct value (max_fd+1). If zero, nfds will be filled up with
394dnl # PJ_FD_SETSIZE
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000395AC_MSG_CHECKING([if select() needs correct nfds])
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000396case $target in
397 *rtems*) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,1)
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000398 AC_MSG_RESULT(yes)
399 ;;
400 *) AC_DEFINE(PJ_SELECT_NEEDS_NFDS,0)
401 AC_MSG_RESULT([no (default)])
402 AC_MSG_RESULT([** Decided that select() doesn't need correct nfds (please check)])
403 ;;
404esac
405
Benny Prijonob466e232006-09-10 08:53:59 +0000406dnl # Determine if pj_thread_create() should enforce thread stack size when
407dnl # creating thread. Default is zero, to allow OS to allocate appropriate
408dnl # thread's stack size.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000409AC_MSG_CHECKING([if pj_thread_create() should enforce stack size])
410case $target in
411 *rtems*) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,1)
412 AC_MSG_RESULT(yes)
413 ;;
414 *) AC_DEFINE(PJ_THREAD_SET_STACK_SIZE,0)
415 AC_MSG_RESULT([no (default)])
416 ;;
417esac
418
Benny Prijonob466e232006-09-10 08:53:59 +0000419dnl # Determine if pj_thread_create() should allocate thread's stack from
420dnl # the pool. Default is zero, to let OS allocate thread's stack.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000421AC_MSG_CHECKING([if pj_thread_create() should allocate stack])
422case $target in
423 *rtems*) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,1)
424 AC_MSG_RESULT(yes)
425 ;;
426 *) AC_DEFINE(PJ_THREAD_ALLOCATE_STACK,0)
427 AC_MSG_RESULT([no (default)])
428 ;;
429esac
430
Benny Prijonob466e232006-09-10 08:53:59 +0000431dnl # This value specifies the value set in errno by the OS when a non-blocking
432dnl # socket recv() can not return immediate data.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000433case $target in
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000434 *mingw* | *cygw* | *win32* | *w32* )
435 AC_DEFINE(PJ_BLOCKING_ERROR_VAL,WSAEWOULDBLOCK)
436 ;;
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000437 *) AC_DEFINE(PJ_BLOCKING_ERROR_VAL,EAGAIN)
438 AC_MSG_RESULT([** Setting non-blocking recv() retval to EAGAIN (please check)])
439 ;;
440esac
441
Benny Prijonob466e232006-09-10 08:53:59 +0000442dnl # This value specifies the value set in errno by the OS when a non-blocking
443dnl # socket connect() can not get connected immediately.
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000444case $target in
Benny Prijonoc5b6dbf2006-09-10 16:33:48 +0000445 *mingw* | *cygw* | *win32* | *w32* )
446 AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,WSAEWOULDBLOCK)
447 ;;
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000448 *) AC_DEFINE(PJ_BLOCKING_CONNECT_ERROR_VAL,EINPROGRESS)
449 AC_MSG_RESULT([** Setting non-blocking connect() retval to EINPROGRESS (please check)])
450 ;;
451esac
452
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000453
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000454AC_SUBST(target)
455AC_SUBST(ac_cross_compile)
456if test "$build" = "$host"; then
457 ac_cross_compile=
458else
Benny Prijono5b818b22006-09-17 22:58:51 +0000459 ac_cross_compile=${host_orig}-
Benny Prijonoc4c61d02006-08-20 20:47:34 +0000460fi
461AC_SUBST(ac_linux_poll,select)
462AC_SUBST(ac_host,unix)
463AC_SUBST(ac_main_obj)
464case $target in
465 *rtems*)
466 ac_main_obj=main_rtems.o
467 ;;
468 *)
469 ac_main_obj=main.o
470 ;;
471esac
472AC_SUBST(CC)
Benny Prijonoa9b372a2006-07-24 02:07:11 +0000473AC_OUTPUT()
474