File: configure.in

package info (click to toggle)
smtpfeed 1.02-2
  • links: PTS
  • area: main
  • in suites: potato
  • size: 824 kB
  • ctags: 765
  • sloc: ansic: 13,150; sh: 230; perl: 133; makefile: 97
file content (326 lines) | stat: -rw-r--r-- 9,060 bytes parent folder | download
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
dnl * Copyright (c) 1997,1998 Motonori Nakamura <motonori@econ.kyoto-u.ac.jp>
dnl * Copyright (c) 1997,1998 WIDE Project
dnl * Copyright (c) 1997,1998 Kyoto University
dnl * All rights reserved.
dnl *
dnl * Redistribution and use in source and binary forms, with or without
dnl * modification, are permitted provided that the following conditions
dnl * are met:
dnl *
dnl * 1. Redistributions of source code must retain the above copyright
dnl *    notice, this list of conditions and the following disclaimer.
dnl * 2. Redistributions in binary form must reproduce the above copyright
dnl *    notice, this list of conditions and the following disclaimer in the
dnl *    documentation and/or other materials provided with the distribution.
dnl * 3. All advertising materials mentioning features or use of this software
dnl *    must display the following acknowledgement:
dnl *      This product includes software developed by WIDE Project and
dnl *      its contributors.
dnl * 4. Neither the name of the Project, the University nor the names of
dnl *    its contributors may be used to endorse or promote products derived
dnl *    from this software without specific prior written permission.
dnl *
dnl * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
dnl * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
dnl * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
dnl * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
dnl * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
dnl * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
dnl * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
dnl * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
dnl * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
dnl * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
dnl * SUCH DAMAGE.

dnl $Id: configure.in,v 1.40 1999/10/16 07:55:37 motonori Exp $

dnl definition of directory checking routine.
AC_DEFUN(AC_CHECK_DIR_PATH,
[AC_MSG_CHECKING([for $1])
 AC_CACHE_VAL(my_cv_path_$1,
 [for dir in $2; do
   if test -d [$]dir; then
    my_cv_path_$1=[$]dir
    break
   fi
  done
 ])
 $1=[$]my_cv_path_$1
 AC_MSG_RESULT([$]$1)
])

dnl initializing
AC_INIT(main.c)
AC_PREFIX_DEFAULT(/usr)
AC_CONFIG_HEADER(compat.h)
AC_CONFIG_AUX_DIR(aux)
AC_CHECK_DIR_PATH(lib_exec, [$]libexecdir /usr/libexec /usr/lib)
AC_SUBST(lib_exec)

dnl check programs.
AC_PROG_CC
AC_PROG_INSTALL
AC_PATH_PROG(RM, rm)

dnl manual configurations
AC_ARG_WITH(fds,
[  --with-fds=FD_SETSIZE	Specify FD_SETSIZE],
[if test "${withval}" != "yes" ; then
  CFLAGS="${CFLAGS} -DFD_SETSIZE=${withval}"
 fi])
AC_ARG_WITH(static,
[  --with-static		Generate static-linked binary],
[if test "$ac_cv_prog_gcc" = "yes" ; then
  LDFLAGS="${LDFLAGS} -static"
 else
  LDFLAGS="${LDFLAGS} -Bstatic"
 fi])
AC_ARG_WITH(bind4,
[  --with-bind4=DIR	Specify BIND4 installed directory],
[if test "${withval}" != "yes" ; then
  CPPFLAGS="${CPPFLAGS} -I${withval}/compat/include -I${withval}/include"
  CFLAGS="${CFLAGS} -I${withval}/compat/include -I${withval}/include"
  LDFLAGS="${LDFLAGS} -L${withval}/res -L${withval}/compat/lib"
 fi])
AC_ARG_WITH(bind8,
[  --with-bind8=DIR	Use BIND8],
[AC_CHECK_HEADERS(port_before.h port_after.h)
 if test "${withval}" != "yes" ; then
  CPPFLAGS="${CPPFLAGS} -I${withval}/include"
  CFLAGS="${CFLAGS} -I${withval}/include"
  LDFLAGS="${LDFLAGS} -L${withval}/lib"
  bind8=yes
 fi])

AC_MSG_CHECKING([whether to enable ipv6])
AC_ARG_ENABLE(ipv6,
[  --enable-ipv6		Use INET6 domain],
[ case "$enableval" in
  no)	ipv6=no ;;
  *)	ipv6=yes ;;
  esac ],

  AC_TRY_RUN([ /* AF_INET6 avalable check */
#include <sys/types.h>
#include <sys/socket.h>
main()
{
 if (socket(AF_INET6, SOCK_STREAM, 0) < 0)
   exit(1);
 else
   exit(0);
}
],
  ipv6=yes, ipv6=no, ipv6=no))

AC_MSG_RESULT($ipv6)

ipv6type=unknown
ipv6lib=none
v6trylibc=no

if test "$ipv6" = "yes"; then
	AC_CHECK_DIR_PATH(lib_exec, [$]libexecdir /usr/local/v6/sbin /usr/libexec /usr/lib)
	AC_MSG_CHECKING([ipv6 stack type])
	dnl linux is checked later, as it does not have #define for IPv6
	for i in inria kame toshiba v6d zeta linux-glibc linux-libinet6 bsdi; do
		case $i in
		inria)
			dnl http://www.inria.fr/
			AC_EGREP_CPP(yes, [dnl
#include <netinet/in.h>
#ifdef IPV6_INRIA_VERSION
yes
#endif],
				[ipv6type=$i;
				IPV6_DEF="-DINET6"])
			;;
		kame)
			dnl http://www.kame.net/
			AC_EGREP_CPP(yes, [dnl
#include <netinet/in.h>
#ifdef __KAME__
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				ipv6libdir=/usr/local/v6/lib;
				v6trylibc=yes;
				IPV6_DEF="-DINET6"])
			;;
		toshiba)
			AC_EGREP_CPP(yes, [dnl
#include <sys/param.h>
#ifdef _TOSHIBA_INET6
yes
#endif],
				[ipv6type=$i;
				ipv6lib=inet6;
				ipv6libdir=/usr/local/v6/lib;
				IPV6_DEF="-DINET6"])
			;;
		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;
				IPV6_DEF="-DINET6 -I/usr/local/v6/include"])
			;;
		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;
				IPV6_DEF="-DINET6"])
			;;
		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
			;;
		bsdi)
			dnl http://www.bsdi.com/
			usys=`uname -s`;
			if test "$usys" = "BSD/OS"; then
				case `uname -r` in
				4.0*)
					ipv6type=$i
					IPV6_DEF="-DINET6"
					;;
				esac
			fi
			;;
		esac
		if test "$ipv6type" != "unknown"; then
			break
		fi
	done
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"
		AC_MSG_RESULT("$ipv6type using lib$ipv6lib")
	else
		if test "$v6trylibc" = "yes"; then
			AC_MSG_RESULT("$ipv6type using libc")
		else
			echo
			echo "Fatal: no IPv6 library lib$v6lib.a found."
			exit 1
		fi
	fi
	dnl AC_CHECK_LIB($ipv6lib, main)
else
	AC_MSG_RESULT("$ipv6type using libc")
fi
AC_SUBST(IPV6_DEF)

dnl check libraries.
AC_CHECK_LIB(nsl, main)
AC_CHECK_FUNC(connect,, [AC_CHECK_LIB(socket, connect)])
AC_CHECK_LIB(util, setproctitle)

if test "$ipv6" = "yes"; then
	AC_MSG_CHECKING(for IPv6 resolver type)
	CPPFLAGS="${IPV6_DEF} ${CPPFLAGS}"
	AC_TRY_COMPILE(dnl
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <resolv.h>], [_res_ext.nsaddr_list[0].__ss_family = 1;],
	[AC_DEFINE(RESOLVER_KAME)
	resolver=kame],
	[AC_TRY_COMPILE(dnl
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <resolv.h>], [_res_ext.nsaddr_list[0].ss_family = 1;],
	[AC_DEFINE(RESOLVER_KAME)
	resolver=kame],
	[AC_TRY_COMPILE(dnl
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <resolv.h>], [_res.nsaddr_list_un[0].sin6.sin6_family = 1;],
	[AC_DEFINE(RESOLVER_OLDKAME)
	resolver=oldkame],
	[AC_TRY_COMPILE(dnl
[#include <sys/types.h>
#include <sys/socket.h>
#include <netinet/in.h>
#include <resolv.h>], [_res.nsaddr_list[0].sin_family = 1;],
			[AC_DEFINE(RESOLVER_V4)
			resolver=normal], [resolver=unknown])])])])
	AC_MSG_RESULT($resolver)
fi

if test "${bind8}" = "yes" ; then
 AC_CHECK_LIB(bind, inet_ntoa, AC_CHECK_LIB(bind, __inet_aton))
elif test "${ipv6type}" != "v6d" ; then
 AC_CHECK_LIB(resolv, main)
 AC_CHECK_LIB(resolv, inet_aton, AC_CHECK_LIB(44bsd, inet_aton))
fi

dnl check headers.
AC_HEADER_STDC
AC_CHECK_HEADERS(fcntl.h sys/time.h syslog.h unistd.h)

AC_CHECK_HEADER(netinet/in.h,
	AC_EGREP_HEADER(sin_len, netinet/in.h,
		AC_MSG_RESULT(Your <netinet/in.h> has sin_len in sockaddr_in.),
		AC_DEFINE(MISSING_SIN_LEN)))

dnl Checks for typedefs, structures, and compiler characteristics.
AC_C_CONST
AC_TYPE_SIZE_T
AC_HEADER_TIME

dnl Checks for library functions.
AC_PROG_GCC_TRADITIONAL
AC_TYPE_SIGNAL
dnl AC_CHECK_FUNCS(gethostname select socket strerror strstr snprintf)
AC_CHECK_FUNCS(strerror snprintf)
AC_CHECK_FUNC(setproctitle, [AC_DEFINE(SPT_TYPE, SPT_BUILTIN)],
[AC_CHECK_FUNC(pstat, [AC_DEFINE(SPT_TYPE, SPT_PSTAT)],
[AC_CHECK_HEADER(sys/sysnews.h, [AC_DEFINE(SPT_TYPE, SPT_SYSMIPS)])])])

dnl supply missing objects
OBJSADD=''
if test "$ac_cv_func_snprintf" = "no" ; then
	OBJSADD="$OBJSADD snprintf.o"
fi
if test "$ac_cv_func_strerror" = "no" ; then
	OBJSADD="$OBJSADD strerror.o"
fi
AC_SUBST(OBJSADD)

dnl reset CPPFLAGS
CPPFLAGS=''

AC_OUTPUT(Makefile)

dnl AC_MSG_RESULT(NOTICE: Append "-static" switch or something at LDFLAGS= in Makefile if needed.)