forked from jonasob/jwhois
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconfigure.in
219 lines (194 loc) · 6.52 KB
/
configure.in
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
dnl Process this file with autoconf to produce a configure script.
##
## This file is part of jwhois
## Copyright (C) 1999-2005 Free Software Foundation, Inc.
##
## This program is free software; you can redistribute it and/or modify
## it under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2 of the License, or
## (at your option) any later version.
##
## This program is distributed in the hope that it will be useful,
## but WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
## GNU General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with this program; if not, write to the Free Software
## Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
##
AC_INIT
AC_CONFIG_SRCDIR([src/jconfig.c])
AM_INIT_AUTOMAKE(jwhois,4.0)
AM_CONFIG_HEADER(config.h)
AH_TEMPLATE([PACKAGE], [package name])
AH_TEMPLATE([VERSION], [package version])
AH_TEMPLATE([DEFAULTHOST], [Default Whois server])
AH_TEMPLATE([CACHEFILE], [Default filename for the cache functionality])
AH_TEMPLATE([CACHEEXPIRE], [Default expire time for the cache functionality])
AH_TEMPLATE([HAVE_GETADDRINFO], [Define if you have the getaddrinfo function. ])
AH_TEMPLATE([NOCACHE], [Define if you want to disable cache functionality])
AH_TEMPLATE([HAVE_DBM_OPEN], [Define if you have the dbm_open function. ])
AH_TEMPLATE([HAVE_GDBM_OPEN], [Define if you have the gdbm_open function. ])
AH_TEMPLATE([WHOISSERVERS], [Default whois-servers.net domain for the whois-servers support])
AC_ARG_ENABLE(DEFAULTHOST,
[ --enable-DEFAULTHOST=HOST default whois host (default whois.internic.net)],
[AC_DEFINE_UNQUOTED(DEFAULTHOST, "$enable_DEFAULTHOST")],
[AC_DEFINE(DEFAULTHOST, "whois.internic.net")])
AC_ARG_ENABLE(WHOISSERVERS,
[ --enable-WHOISSERVERS=DOMAIN default whois-servers.net domain (default whois-servers.net)],
[AC_DEFINE_UNQUOTED(WHOISSERVERS, "$enable_WHOISSERVERS")],
[AC_DEFINE(WHOISSERVERS, "whois-servers.net")])
AC_ARG_ENABLE(CACHEEXPIRE,
[ --enable-CACHEEXPIRE=HOURS default expire time in hours for cached objects
(default 168 hours)],
[AC_DEFINE_UNQUOTED(CACHEEXPIRE, "$enable_CACHEEXPIRE")],
[AC_DEFINE(CACHEEXPIRE, "168")])
AC_ARG_ENABLE(GROUP,
[ --enable-GROUP=group group that owns the cache database
(default "nogroup")],
[GROUP="$enable_GROUP"],
[GROUP="nogroup"])
AC_SUBST(GROUP)
AC_ARG_WITH(cache,
[ --without-cache disable cache manager (see README for more info)],
[if test x$withval = xno; then
AC_DEFINE(NOCACHE,1)
cache=no
elif test x$withval = xyes; then
cache=yes
fi],
[cache=yes])
AC_SUBST(cache)
AC_ARG_WITH(sgid,
[ --enable-sgid enable installation with setgid GROUP]
,
[if test x$withval = xno; then
sgid=yes
elif test x$withval = xyes; then
sgid=no
fi],
[sgid=no])
AC_SUBST(sgid)
AC_ARG_WITH(localedir,
[ --with-localedir=DIR locale info in DIR [PREFIX/share/locale]]
,localedir=$withval,localedir='${prefix}/share/locale')
AC_SUBST(localedir)
ALL_LINGUAS="es fr hu id it nl pl pt_BR ro ru rw sv tr vi zh_TW"
AC_PROG_INSTALL
AC_PROG_CC
GETTEXT_PACKAGE=jwhois
AC_SUBST(GETTEXT_PACKAGE)
AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Gettext package])
AM_GNU_GETTEXT([external])
AM_ICONV
AC_PATH_PROG(CHGRP, chgrp, $PATH:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/libexec)
AC_PATH_PROG(CHMOD, chmod, $PATH:/bin:/usr/bin:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin:/usr/libexec)
AC_C_BIGENDIAN
AC_CHECK_FUNC(connect,,
AC_CHECK_LIB(socket, connect))
AC_CHECK_FUNC(socket,,
AC_CHECK_LIB(socket, socket)
AC_CHECK_LIB(inet, socket))
AC_CHECK_FUNCS(getipnodebyname)
AC_CHECK_FUNC(getaddrinfo,
[AC_DEFINE(HAVE_GETADDRINFO,1)
AC_CHECK_FUNCS(gai_strerror)],
[AC_CHECK_FUNC(gethostbyname,,
AC_CHECK_LIB(nsl, gethostbyname))
AC_CHECK_FUNC(inet_aton)])
AC_CHECK_LIB(inet6, main,
AC_CHECK_LIB(resolv, main))
AC_CHECK_FUNCS(memcpy strtol)
AC_CHECK_FUNCS(strcasecmp strncasecmp getopt_long)
AC_HEADER_STDC([])
AC_CHECK_HEADERS(sys/types.h sys/socket.h netinet/in.h netdb.h sys/time.h sys/stat.h sys/fcntl.h malloc.h locale.h stdint.h inttypes.h idna.h)
AC_HEADER_TIME
dnl check for inet_pton
AC_CHECK_FUNCS(inet_pton)
dnl Some systems have it, but not IPv6
if test "$ac_cv_func_inet_pton" = "yes" ; then
AC_MSG_CHECKING(if inet_pton supports IPv6)
AC_TRY_RUN(
[
#ifdef HAVE_SYS_TYPES_H
#include <sys/types.h>
#endif
#ifdef HAVE_SYS_SOCKET_H
#include <sys/socket.h>
#endif
#ifdef HAVE_NETINET_IN_H
#include <netinet/in.h>
#endif
int main()
{
struct in6_addr addr6;
if (inet_pton(AF_INET6, "::1", &addr6) < 1)
exit(1);
else
exit(0);
}
], [
AC_MSG_RESULT(yes)
AC_DEFINE_UNQUOTED(HAVE_INET_PTON_IPV6,1,[Define to 1 if inet_pton supports IPv6.])
], AC_MSG_RESULT(no),AC_MSG_RESULT(no))
fi
AC_ARG_WITH(libidn, AC_HELP_STRING([--with-libidn=[DIR]],
[Support IDN (needs GNU Libidn)]),
libidn=$withval, libidn=yes)
if test "$libidn" != "no"; then
if test "$libidn" != "yes"; then
LDFLAGS="${LDFLAGS} -L$libidn/lib"
CPPFLAGS="${CPPFLAGS} -I$libidn/include"
fi
AC_CHECK_HEADER(idna.h,
AC_CHECK_LIB(idn, stringprep_check_version,
[libidn=yes LIBS="${LIBS} -lidn"], libidn=no),
libidn=no)
fi
if test "$libidn" != "no" ; then
AC_DEFINE(LIBIDN, 1, [Define to 1 if you want IDN support.])
else
AC_MSG_WARN([Libidn not found])
fi
AC_MSG_CHECKING([if Libidn should be used])
AC_MSG_RESULT($libidn)
found=no
if test x$cache = xyes; then
AC_CHECK_FUNC(dbm_open,
[AC_DEFINE(HAVE_DBM_OPEN)
found=yes])
if test x$found = xno; then
AC_CHECK_LIB(gdbm, gdbm_open,
[AC_DEFINE(HAVE_GDBM_OPEN)
LIBS="-lgdbm $LIBS"
found=yes])
fi
if test x$found = xno; then
AC_CHECK_LIB(ndbm, dbm_open,
[AC_DEFINE(HAVE_DBM_OPEN)
LIBS="-lndbm $LIBS"
found=yes])
fi
if test x$found = xno; then
AC_MSG_WARN("You don\'t have any dbm libraries installed -- disabling cache functions")
AC_DEFINE(NOCACHE,1)
cache=no
else
AC_CHECK_HEADERS(gdbm.h ndbm.h dbm.h db1/ndbm.h)
fi
fi
if test "$ac_cv_lib_intl_bindtextdomain" = "yes" -o "$ac_cv_lib_intl_gettext" = "yes"; then
LIBS="-lintl $LIBS"
AC_CHECK_HEADERS(libintl.h)
fi
OLDCFLAGS=$CFLAGS
AC_SUBST(OLDCFLAGS)
AC_OUTPUT([ po/Makefile.in m4/Makefile
Makefile
doc/Makefile
doc/sv/Makefile
src/Makefile
example/Makefile
jwhois.spec
])