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
|
$NetBSD: patch-aa,v 1.9 2011/10/17 20:14:50 spz Exp $
--- configure.in.orig 2006-09-12 17:40:57.000000000 +0000
+++ configure.in
@@ -13,7 +13,7 @@ case "${host_os}" in
freebsd2* )
disable_thread=yes
;;
- solaris*|linux*|freebsd* )
+ solaris*|linux*|freebsd*|dragonfly*|netbsd* )
disable_thread=no
;;
* )
@@ -21,17 +21,22 @@ case "${host_os}" in
;;
esac
-AC_ARG_ENABLE(thread,
-[ --disable-thread disable thread always],
-[disable_thread=yes],)
-
-AC_ARG_ENABLE(thread,
-[ --enable-thread enable thread (on non-solaris platform)],
-[disable_thread=no],)
-
-AC_ARG_ENABLE(wall,
-[ --disable-wall disable -Wall option always],
-[disable_wall=yes],)
+AC_ARG_ENABLE([thread],
+AS_HELP_STRING([--enable-thread],[enable thread (on non-solaris platform)]))
+
+AC_ARG_ENABLE([thread],
+AS_HELP_STRING([--disable-thread],[disable thread always]))
+
+AS_IF([test "x$enable_thread" = "xyes"], [
+ disable_thread=no
+])
+AS_IF([test "x$enable_thread" = "xno"], [
+ disable_thread=yes
+])
+
+
+AC_ARG_ENABLE([wall],
+AS_HELP_STRING([--disable-wall],[disable -Wall option always]))
pwd=`pwd`
pwd=`basename $pwd`
@@ -52,7 +57,7 @@ MODULES=""
EXTRA_INCLUDE_DIRS=""
EXTRA_LIBS=""
-CPPFLAGS="-DFUNCPROTO -I../../include"
+CPPFLAGS="$CPPFLAGS -DFUNCPROTO -I../../include"
dnl defining FUNCPROTO ensures that struct library uses portotype
dnl we don't expect non-ANSI (K&R) C compilers to be used
dnl Some compiles may define __STDC__ by itself which makes it enable,
@@ -66,7 +71,7 @@ dnl CFLAGS="-g -O"
dnl fi
AC_MSG_CHECKING(for -Wall option)
-if test "$disable_wall" = yes; then
+if test "x$enable_wall" = "xno"; then
if test "$GCC" != "yes"; then
dnl shut up SUN WorkShop Compilers
CFLAGS="$CFLAGS -w"
@@ -83,7 +88,7 @@ fi
QUANTIFY="quantify"
PURIFY="purify"
-AC_DEFUN(AC_FILE_EXIST, [
+AC_DEFUN([AC_FILE_EXIST], [
if test -f "$1" >/dev/null 2>&1; then
ifelse([$2], , :, [$2])
ifelse([$3], , , [else $3])
@@ -109,33 +114,17 @@ dnl fi
esac
case "${host_os}" in
- solaris* )
- CRYPT_LIB="-lcrypt"
- ;;
bsdi* )
LIBS="$LIBS -lipc"
;;
- freebsd*|netbsd*|openbsd* )
- if test "$disable_thread" != yes; then
- LDFLAGS="$LDFLAGS -pthread"
- THREAD_CFLAGS="-D_THREAD_SAFE -pthread"
- fi
- CRYPT_LIB="-lcrypt"
- ac_pthrlib="c_r"
- ;;
- linux* )
+ solaris*|freebsd*|dragonfly*|netbsd*|openbsd*|linux* )
CRYPT_LIB="-lcrypt"
;;
osf* )
if test $CC = "cc" ; then
- CPPFLAGS="$CPPFLAGS -taso -pthread"
+ CPPFLAGS="$CPPFLAGS -taso"
fi
- if test "$disable_thread" != yes; then
- LDFLAGS="$LDFLAGS -lc_r"
- THREAD_CFLAGS="-D_THREAD_SAFE"
- fi
CPPFLAGS="$CPPFLAGS -L/usr/shlib"
- ac_pthrlib="pthreads"
;;
esac
@@ -153,34 +142,44 @@ fi
AC_SUBST(MAKEDEPCLEAN)
dnl Checks for pthread libraries. (linux has pthread.h only, so ...)
-if test "$disable_thread" = yes; then
- AC_MSG_CHECKING(for thread support)
- AC_MSG_RESULT(disabled)
-else
- if test ! -n "$ac_pthrlib"; then
- ac_pthrlib="pthread"
- fi;
- AC_CHECK_LIB($ac_pthrlib, pthread_create, [
- AC_CHECK_HEADERS(pthread.h, [pthread="yes"])])
-fi
-
-AC_MSG_CHECKING(for thread support)
-if test "$pthread" = yes; then
- AC_MSG_RESULT(yes)
- AC_DEFINE(HAVE_LIBPTHREAD)
- CFLAGS="$CFLAGS $THREAD_CFLAGS"
- CPPFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS $CPPFLAGS"
- QUANTIFY="$QUANTIFY -threads=yes -max-threads=80"
- PURIFY="$PURIFY -threads=yes -max-threads=80"
- THREADLIBS="-l$ac_pthrlib"
- LIBS="$LIBS $THREADLIBS"
-dnl at least FreeBSD 3.1 doesn't have this
- AC_CHECK_LIB($ac_pthrlib, pthread_attr_setscope,
- AC_DEFINE(HAVE_PTHREAD_ATTR_SETSCOPE))
- AC_CHECK_FUNCS(thr_setconcurrency)
-else
- AC_MSG_RESULT(no)
-fi
+AS_IF([test "x$disable_thread" = "xyes"],[
+ AC_MSG_CHECKING(for thread support)
+ AC_MSG_RESULT(disabled)
+],[
+ case "${host_os}" in
+ osf*)
+ THREAD_CFLAGS="-D_THREAD_SAFE"
+ ;;
+ *)
+ THREAD_CFLAGS="$PTHREAD_CFLAGS"
+ esac
+
+ ac_pthrlib="$PTHREAD_LIBS"
+ if test ! -n "$ac_pthrlib"; then
+ ac_pthrlib="pthread"
+ fi
+
+ THREADLIBS="$PTHREAD_LIBS"
+ AC_CHECK_LIB($ac_pthrlib, pthread_create, [
+ AC_CHECK_HEADERS(pthread.h, [pthread="yes"])])
+
+ AC_MSG_CHECKING(for thread support)
+ if test "$pthread" = yes; then
+ AC_MSG_RESULT(yes)
+ AC_DEFINE([HAVE_LIBPTHREAD],[],[Define if you have pthread library (-lpthread)])
+ CFLAGS="$CFLAGS $THREAD_CFLAGS"
+ CPPFLAGS="-D_REENTRANT -D_POSIX_PTHREAD_SEMANTICS $CPPFLAGS"
+ QUANTIFY="$QUANTIFY -threads=yes -max-threads=80"
+ PURIFY="$PURIFY -threads=yes -max-threads=80"
+ LIBS="$LIBS $THREADLIBS"
+ dnl at least FreeBSD 3.1 doesn't have this
+ AC_CHECK_LIB($ac_pthrlib, pthread_attr_setscope,
+ AC_DEFINE([HAVE_PTHREAD_ATTR_SETSCOPE],[],[Define if you have pthread_attr_setscope]))
+ AC_CHECK_FUNCS(thr_setconcurrency)
+ else
+ AC_MSG_RESULT(no)
+ fi
+])
dnl Checks for various functions
@@ -231,13 +230,13 @@ AC_PATH_PROG(SENDMAIL_PATH,sendmail,no,$
if test $SENDMAIL_PATH = no; then
SENDMAIL_PATH=""
else
- AC_DEFINE(HAVE_SENDMAIL)
+ AC_DEFINE([HAVE_SENDMAIL],[],[Define if you have any sendmail program])
fi
AC_PATH_PROG(MAIL_PATH,mail,no)
if test $MAIL_PATH = no; then
MAIL_PATH=""
else
- AC_DEFINE(HAVE_MAIL)
+ AC_DEFINE([HAVE_MAIL],[],[Define if you have the mail program])
fi
dnl Prefer GPG, second choice PGP version 5
@@ -287,7 +286,7 @@ else
PGPS_PATH=""
PGPV_PATH=""
PGPDIR=gpg
- AC_DEFINE(PGP)
+ AC_DEFINE([PGP],[],[Define if you have any pgp program])
fi
AC_SUBST(PGP)
AC_SUBST(PGPDIR)
@@ -300,19 +299,19 @@ AC_PATH_PROG(GZIP_PATH,gzip,no)
if test $GZIP_PATH = no; then
GZIP_PATH=""
else
- AC_DEFINE(HAVE_GZIP)
+ AC_DEFINE([HAVE_GZIP],[],[Define if you have gzip])
fi
AC_PATH_PROG(IRRDCACHER_PATH,irrdcacher,no)
if test $IRRDCACHER_PATH = no; then
IRRDCACHER_PATH=""
else
- AC_DEFINE(HAVE_IRRDCACHER)
+ AC_DEFINE([HAVE_IRRDCACHER],[],[Define if you have irrdcacher])
fi
AC_PATH_PROG(WGET_PATH,wget,no)
if test $WGET_PATH = no; then
WGET_PATH=""
else
- AC_DEFINE(HAVE_WGET)
+ AC_DEFINE([HAVE_WGET],[],[Define if you have wget])
fi
AC_SUBST(SENDMAIL_PATH)
AC_SUBST(MAIL_PATH)
@@ -340,11 +339,11 @@ AC_STRUCT_TM
dnl u_char, u_int, u_short, and u_long
AC_MSG_CHECKING([u_char, u_int, u_short, and u_long])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <sys/types.h>]], [[
- u_char c; u_int i; u_short s; u_long l;]])],[AC_DEFINE(HAVE_U_TYPES) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]);
+ u_char c; u_int i; u_short s; u_long l;]])],[AC_DEFINE([HAVE_U_TYPES],[],[Define if you have u_char, u_int, u_short, and u_long]) AC_MSG_RESULT(yes)],[AC_MSG_RESULT(no)]);
dnl Check for in6_addr structure definition
AC_EGREP_HEADER(struct in6_addr, netinet/in.h,
- AC_DEFINE(HAVE_STRUCT_IN6_ADDR))
+ AC_DEFINE([HAVE_STRUCT_IN6_ADDR],[],[Define if you have struct in6_addr]))
dnl Checks for library functions.
AC_CHECK_FUNCS(localtime_r strtok_r gethostbyname_r gethostbyaddr_r)
@@ -358,12 +357,12 @@ AC_CHECK_FUNCS(mkdtemp)
AC_CHECK_FUNCS(snprintf)
AC_CHECK_FUNCS(dirname basename)
-AC_DEFUN(AC_TYPE_SOCKLEN_T,
+AC_DEFUN([AC_TYPE_SOCKLEN_T],
[AC_CACHE_CHECK(for socklen_t in sys/socket.h, ac_cv_type_socklen_t,
[AC_EGREP_HEADER(socklen_t, sys/socket.h,
ac_cv_type_socklen_t=yes, ac_cv_type_socklen_t=no)])
if test $ac_cv_type_socklen_t = no; then
- AC_DEFINE(socklen_t, int)
+ AC_DEFINE([socklen_t], [int], [define socklen_t if necessary])
fi
])
|