File: configure.in

package info (click to toggle)
uclmmbase 1.2.16.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k, jessie, jessie-kfreebsd, lenny, squeeze, wheezy
  • size: 1,460 kB
  • ctags: 1,276
  • sloc: ansic: 11,847; sh: 2,734; makefile: 249
file content (387 lines) | stat: -rw-r--r-- 9,943 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
dnl Process this file with autoconf to produce a configure script.

AC_INIT(src/base64.c)

AC_CANONICAL_HOST

AC_PROG_CC
AC_PROG_CPP
AC_PROG_RANLIB

AC_HEADER_STDC
AC_HEADER_SYS_WAIT
AC_CHECK_HEADERS(sys/time.h)
if test "$ac_cv_header_sys_time_h" = "yes"; then
	AC_HEADER_TIME
fi
AC_C_CONST
AC_TYPE_SIZE_T

AC_CHECK_HEADERS(stropts.h sys/filio.h)
AC_CHECK_HEADERS(stdint.h inttypes.h)

###############################################################################
# Check for standard size types.  The defaults are only valid on some
# systems so we hope that <inttypes.h> exists when they're wrong.
AC_CHECK_TYPE(int8_t,  signed char)
AC_CHECK_TYPE(int16_t, short)
AC_CHECK_TYPE(int32_t, long)
AC_CHECK_TYPE(int64_t, long long)

# Some systems have these in <stdint.h>, just to be difficult...
AC_CACHE_CHECK(for uint8_t in <stdint.h>, ucl_cv_uint8_t_in_stdint_h,
	AC_EGREP_HEADER(uint8_t,
			stdint.h,
			ucl_cv_uint8_t_in_stdint_h=yes,
			ucl_cv_uint8_t_in_stdint_h=no))
if test $ucl_cv_uint8_t_in_stdint_h = "no"
then
	 AC_CHECK_TYPE(uint8_t,  unsigned char)
fi

AC_CACHE_CHECK(for uint16_t in <stdint.h>, ucl_cv_uint16_t_in_stdint_h,
	AC_EGREP_HEADER(uint16_t,
			stdint.h,
			ucl_cv_uint16_t_in_stdint_h=yes,
			ucl_cv_uint16_t_in_stdint_h=no))
if test $ucl_cv_uint16_t_in_stdint_h = "no"
then
	 AC_CHECK_TYPE(uint16_t,  unsigned short)
fi

AC_CACHE_CHECK(for uint32_t in <stdint.h>, ucl_cv_uint32_t_in_stdint_h,
	AC_EGREP_HEADER(uint32_t,
			stdint.h,
			ucl_cv_uint32_t_in_stdint_h=yes,
			ucl_cv_uint32_t_in_stdint_h=no))
if test $ucl_cv_uint32_t_in_stdint_h = "no"
then
	 AC_CHECK_TYPE(uint32_t,  unsigned int)
fi

###############################################################################
# The following two macros cause autoconf to complain.
AC_C_BIGENDIAN
AC_C_CHAR_UNSIGNED
#
# Some of the codecs in rat don't with with unsigned characters. 
# Force the compiler to use signed chars, to be consistent.
if test $ac_cv_c_char_unsigned = yes
then
	if test "$GCC" = yes
	then
		CFLAGS="$CFLAGS -fsigned-char"
	else
		case "$host_os" in
		# I don't know when "-signed" was added to IRIX CC
		# so err on the side of using it.
		irix*)	CFLAGS="$CFLAGS -signed"
			;;
		# need e.g. --force-signed-chars=-signed
		*)	AC_MSG_ERROR([I don't know how to force signed chars])
			;;
		esac
	fi
fi
#  __CHAR_UNSIGNED__ will be defined; hope this is OK.

###############################################################################
# The following causes autoconf to complain.
AC_CHECK_FILE(/dev/urandom,AC_DEFINE(HAVE_DEV_URANDOM))

# If more files than mbus.c use vsnprintf, split it out into
# vsnprintf.c and add it to AC_REPLACE_FUNCS
# AC_CHECK_FUNC(vsnprintf,,AC_DEFINE(NEED_VSNPRINTF))
AC_REPLACE_FUNCS(vsnprintf)

###############################################################################
# If inet_aton is actually needed somewhere, split it out into
# inet_aton.c and add it to AC_REPLACE_FUNCS 
#
# AC_CHECK_FUNC succeeds on our IRIX 6.2 boxes, but it is not 
# declared anywhere, use egrep header to check (ugh lame, but works)

AC_CACHE_CHECK(for inet_pton in <arpa/inet.h>, ucl_cv_inet_pton_in_inet_h,
	AC_EGREP_HEADER(uint16_t,
			stdint.h,
			ucl_cv_inet_pton_in_inet_h=yes,
			ucl_cv_inet_pton_in_inet_h=no))
if test $ucl_cv_inet_pton_in_inet_h = "no"
then
	AC_DEFINE(NEED_INET_PTON)
	LIBOBJS="$LIBOBJS inet_pton.o"
fi
AC_CACHE_CHECK(for inet_ntop in <arpa/inet.h>, ucl_cv_inet_ntop_in_inet_h,
	AC_EGREP_HEADER(uint16_t,
			stdint.h,
			ucl_cv_inet_ntop_in_inet_h=yes,
			ucl_cv_inet_ntop_in_inet_h=no))
if test $ucl_cv_inet_ntop_in_inet_h = "no"
then
	AC_DEFINE(NEED_INET_NTOP)
	LIBOBJS="$LIBOBJS inet_ntop.o"
else
	AC_DEFINE(HAVE_INET_NTOP)
fi
AC_SUBST(LIBOBJS)

dnl AC_REPLACE_FUNCS(inet_pton inet_ntop)

AC_SEARCH_LIBS(socket, socket)
AC_SEARCH_LIBS(inet_addr, nsl)

###############################################################################
#  -profile
AC_ARG_ENABLE(profile,
	[  --enable-profile        enable profiling],
	[if test $enableval = yes
	then
		if test "$GCC" = yes
		then
			CFLAGS="$CFLAGS -pg"
		else
			AC_ERROR([Don't know how to enable profiling for $CC])
		fi
	fi])

#  -bounds
#       add -fbounds-checking to CFLAGS
#       add -lcheck to LIBS
AC_ARG_ENABLE(bounds,
	[  --enable-bounds         enable bounds checking],
	[if test $enableval = yes
	then
		if test "$GCC" = yes
		then
			CFLAGS="$CFLAGS -fbounds-checking"
			LIBS="$LIBS -lcheck"
		else
			AC_ERROR([Don't know how to enable profiling for $CC])
		fi
	fi])

# -DDEBUG
# -DDEBUG_MEM
# -DNDEBUG
AC_ARG_ENABLE(debug,
	[  --enable-debug          enable debug messages and code],
	[if test $enableval = yes
	then
		AC_DEFINE(DEBUG)
	fi])
AC_ARG_ENABLE(debug-mem,
	[  --enable-debug-mem      enable memory debugging code],
	[if test $enableval = yes
	then
		AC_DEFINE(DEBUG_MEM)
	fi])

###############################################################################
# IPv6 related configuration options (using tcpdump's configure.in)
AC_MSG_CHECKING([whether to enable IPv6])
AC_ARG_ENABLE(ipv6,
        [  --enable-ipv6           enable ipv6],
	[ case "$enableval" in
	  yes)	AC_MSG_RESULT(yes)
		AC_DEFINE(HAVE_IPv6)
		ipv6=yes
		;;
	  *)	AC_MSG_RESULT(no)
		ipv6=no
		;;
	  esac
	],
	[ AC_MSG_RESULT(no)
	  ipv6=no
	])
ipv6type=unknown
ipv6lib=none
ipv6trylibc=no

# IPv6 Stack Type Detector
if test "$ipv6" = "yes"; then
	AC_MSG_CHECKING([ipv6 stack type])
	for i in inria kame linux-glibc linux-libinet6 toshiba v6d zeta; do
		case $i in
		inria)
			dnl http://www.kame.net/
			AC_EGREP_CPP(yes, [dnl
#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION
yes
#endif],
				[ipv6type=$i;
				CFLAGS="-DINET6 $CFLAGS"])
			;;
		kame)
			dnl http://www.kame.net/
			AC_EGREP_CPP(yes, [dnl
#include <netinet/in.h>
#ifdef __KAME__
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				if test -x /usr/local/v6/lib; then
					ipv6libdir=/usr/local/v6/lib;
				else
					ipv6type=freebsd/netbsd/openbsd
					ipv6libdir=/usr/lib;
				fi;
				ipv6trylibc=yes;
				CFLAGS="-DINET6 $CFLAGS"])
			;;
		linux-glibc)
			dnl http://www.v6.linux.or.jp/
			AC_EGREP_CPP(yes, [dnl
#include <features.h>
#if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
yes
#endif],
				[ipv6type=$i;
				CFLAGS="-DINET6 $CFLAGS"])
			;;
		linux-libinet6)
			dnl http://www.v6.linux.or.jp/
			if test -d /usr/inet6 -o -f /usr/include/netinet/ip6.h; then
				ipv6type=$i
				ipv6lib=inet6
				ipv6libdir=/usr/inet6/lib
				ipv6trylibc=yes;
				CFLAGS="-DINET6 -I/usr/inet6/include $CFLAGS"
			fi
			;;
		toshiba)
			AC_EGREP_CPP(yes, [dnl
#include <sys/param.h>
#ifdef _TOSHIBA_INET6
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				ipv6libdir=/usr/local/v6/lib;
				CFLAGS="-DINET6 $CFLAGS"])
			;;
		v6d)
			AC_EGREP_CPP(yes, [dnl
#include </usr/local/v6/include/sys/v6config.h>
#ifdef __V6D__
yes
#endif],
				[ipv6type=$i;
				ipv6lib=v6;
				ipv6libdir=/usr/local/v6/lib;
				CFLAGS="-I/usr/local/v6/include $CFLAGS"])
			;;
		zeta)
			AC_EGREP_CPP(yes, [dnl
#include <sys/param.h>
#ifdef _ZETA_MINAMI_INET6
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				ipv6libdir=/usr/local/v6/lib;
				CFLAGS="-DINET6 $CFLAGS"])
			;;
		esac
		if test "$ipv6type" != "unknown"; then
			break
		fi
	done
	AC_MSG_RESULT($ipv6type)
fi

if test "$ipv6" = "yes" -a "$ipv6lib" != "none"; then
	if test -d $ipv6libdir -a -f $ipv6libdir/lib$ipv6lib.a; then
		LIBS="-L$ipv6libdir -l$ipv6lib $LIBS"
		echo "You have $ipv6lib library, using it"
	else
		if test "$ipv6trylibc" = "yes"; then
			echo "You do not have $ipv6lib library, using libc"
		else
			echo 'Fatal: no $ipv6lib library found.  cannot continue.'
			echo "You need to fetch lib$ipv6lib.a from appropriate"
			echo 'ipv6 kit and compile beforehand.'
			exit 1
		fi
	fi
fi

# Test below are IPv6 specific.  Their result has no bearing if HAVE_IPv6 is
# not defined.  They are kept outside IPv6 enable check to keep code readable.

AC_CACHE_CHECK(for getipnodebyname in <netdb.h>, ucl_cv_getipnodebyname_in_netdb_h,
	AC_EGREP_HEADER(getipnodebyname,
		netdb.h,
		ucl_cv_getipnodebyname_in_netdb_h=yes,	
		ucl_cv_getipnodebyname_in_netdb_h=no))
if test $ucl_cv_getipnodebyname_in_netdb_h
then
	AC_DEFINE(HAVE_GETIPNODEBYNAME) 
fi

AC_CACHE_CHECK(for struct addrinfo in <netdb.h>, ucl_cv_st_addrinfo_in_netdb_h,
	AC_EGREP_HEADER(addrinfo,
		netdb.h,
		ucl_cv_st_addrinfo_in_netdb_h=yes,	
		ucl_cv_st_addrinfo_in_netdb_h=no))
if test $ucl_cv_st_addrinfo_in_netdb_h
then
	AC_DEFINE(HAVE_ST_ADDRINFO) 
fi

AC_CACHE_CHECK(for sin6_len in struct sockaddr_in6, ucl_cv_sin6_len,
	[AC_TRY_COMPILE([
		#include <netinet/in.h>
	],[
		struct sockaddr_in6	s_in;
		s_in.sin6_len = 0;
	],
		ucl_cv_sin6_len=yes,	
		ucl_cv_sin6_len=no
	)])
if test $ucl_cv_sin6_len = yes
then
	AC_DEFINE(HAVE_SIN6_LEN) 
fi

AC_CACHE_CHECK(for msg_control in struct msghdr, ucl_cv_control,
        [AC_TRY_COMPILE([
                #include <sys/types.h>
		#include <sys/socket.h>
        ],[
                struct msghdr msg;
                msg.msg_control = 0;
        ],
                ucl_cv_control=yes,
                ucl_cv_control=no
        )])
if test $ucl_cv_control = yes
then
        AC_DEFINE(HAVE_MSGHDR_MSGCTRL)
fi

###############################################################################
# Check whether gtk-doc is installed

AC_CHECK_PROG(GTKDOC, gtkdoc-scan, yes, no, $PATH)
if test "$GTKDOC" = yes 
then
	OPTDOC=doc
else
	OPTDOC=
fi
AC_SUBST(OPTDOC)

###############################################################################
# GCC-specific warning flags
if test "$GCC" = yes
then
        CFLAGS="$CFLAGS -W -Wall -Wwrite-strings -Wbad-function-cast -Wmissing-prototypes -Wcast-qual -Wmissing-declarations -Werror"
fi

###############################################################################
# Done, create the output files....
AC_CONFIG_HEADER(src/uclconf.h:src/config.h.in)
AC_OUTPUT(Makefile doc/Makefile examples/Makefile examples/rtp/Makefile src/Makefile tests/Makefile)