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
|
#MIN_CONFIG(3.3)
AM_INIT_AUTOMAKE(ktorrent,2.2.8)
dnl #### Check for FSEEK variants
AC_SYS_LARGEFILE
AC_FUNC_FSEEKO
AC_CHECK_FUNCS(fopen64, ktorrent_cv_func_fopen64=yes, ktorrent_cv_func_fopen64=no)
AC_CHECK_FUNCS(fseeko64, ktorrent_cv_func_fseek64=yes, ktorrent_cv_func_fseek64=no)
AC_CHECK_FUNCS(ftello64, ktorrent_cv_func_ftell64=yes, ktorrent_cv_func_ftell64=no)
AC_CHECK_FUNCS(fstat64, ktorrent_cv_func_fstat64=yes, ktorrent_cv_func_fstat64=no)
AC_CHECK_FUNCS(stat64, ktorrent_cv_func_stat64=yes, ktorrent_cv_func_stat64=no)
AC_CHECK_FUNCS(ftruncate64, ktorrent_cv_func_ftruncate64=yes, ktorrent_cv_func_ftruncate64=no)
AC_CHECK_FUNCS(lseek64, ktorrent_cv_func_lseek64=yes, ktorrent_cv_func_lseek64=no)
AC_CHECK_FUNCS(mmap64, ktorrent_cv_func_mmap64=yes, ktorrent_cv_func_mmap64=no)
AC_CHECK_FUNCS(munmap64, ktorrent_cv_func_munmap64=yes, ktorrent_cv_func_munmap64=no)
AC_CHECK_FUNCS(posix_fallocate, ktorrent_cv_func_posix_fallocate=yes,ktorrent_cv_func_posix_fallocate=no)
AC_CHECK_FUNCS(posix_fallocate64, ktorrent_cv_func_posix_fallocate64=yes,ktorrent_cv_func_posix_fallocate64=no)
AC_CHECK_FUNCS(statvfs, ktorrent_cv_func_statvfs=yes,ktorrent_cv_func_statvfs=no)
AC_CHECK_FUNCS(statvfs64, ktorrent_cv_func_statvfs64=yes,ktorrent_cv_func_statvfs64=no)
AC_LANG_PUSH([C++])
AC_CHECK_HEADERS([xfs/xfs.h])
AC_CHECK_TYPES([__u64, __s64], [], [], [#include <xfs/xfs.h>])
AC_LANG_POP
if test "$ktorrent_cv_func_posix_fallocate" = yes ; then
AC_DEFINE(HAVE_POSIX_FALLOCATE, 1)
else
AC_DEFINE(HAVE_POSIX_FALLOCATE, 0)
fi
if test "$ktorrent_cv_func_posix_fallocate64" = yes ; then
AC_DEFINE(HAVE_POSIX_FALLOCATE64, 1)
else
AC_DEFINE(HAVE_POSIX_FALLOCATE64, 0)
fi
if test "$ktorrent_cv_func_fopen64" = yes ; then
AC_DEFINE(HAVE_FOPEN64, 1)
else
AC_DEFINE(HAVE_FOPEN64, 0)
fi
if test "$ktorrent_cv_func_fseek64" = yes -a "$ktorrent_cv_func_ftell64" = yes; then
AC_DEFINE(HAVE_FSEEKO64, 1)
else
AC_DEFINE(HAVE_FSEEKO64, 0)
fi
if test "$ktorrent_cv_func_fstat64" = yes -a "$ktorrent_cv_func_stat64" = yes ; then
AC_DEFINE(HAVE_STAT64,1)
else
AC_DEFINE(HAVE_STAT64,0)
fi
if test "$ktorrent_cv_func_ftruncate64" = yes ; then
AC_DEFINE(HAVE_FTRUNCATE64,1)
else
AC_DEFINE(HAVE_FTRUNCATE64,0)
fi
if test "$ktorrent_cv_func_lseek64" = yes ; then
AC_DEFINE(HAVE_LSEEK64,1)
else
AC_DEFINE(HAVE_LSEEK64,0)
fi
if test "$ktorrent_cv_func_mmap64" = yes ; then
AC_DEFINE(HAVE_MMAP64, 1)
else
AC_DEFINE(HAVE_MMAP64, 0)
fi
if test "$ktorrent_cv_func_munmap64" = yes ; then
AC_DEFINE(HAVE_MUNMAP64, 1)
else
AC_DEFINE(HAVE_MUNMAP64, 0)
fi
if test "$ktorrent_cv_func_statvfs" = yes ; then
AC_DEFINE(HAVE_STATVFS, 1)
else
AC_DEFINE(HAVE_STATVFS, 0)
fi
if test "$ktorrent_cv_func_statvfs64" = yes ; then
AC_DEFINE(HAVE_STATVFS64, 1)
else
AC_DEFINE(HAVE_STATVFS64, 0)
fi
KDE_CHECK_LIB(gmp, __gmpz_init, [have_gmp=yes],
[
have_gmp=no
AC_MSG_ERROR(libgmp is required to install this program)
])
KDE_CHECK_HEADER(gmp.h, [have_gmp=yes],
[
have_gmp=no
AC_MSG_ERROR(libgmp is required to install this program)
])
KDE_CHECK_HEADER(GeoIP.h, [have_system_geoip=yes], [have_system_geoip=no])
KDE_INIT_DOXYGEN([The API Reference], [Version $VERSION])
AC_ARG_ENABLE(
memleak-check,
[AS_HELP_STRING(--enable-memleak-check,[Enable memory leak checking])],
[CXXFLAGS="$CXXFLAGS -DKT_LEAKTRACE"])
AC_ARG_ENABLE(
profile,
[AS_HELP_STRING(--enable-profile,[Enable profiling])],
[CXXFLAGS="$CXXFLAGS -DKT_PROFILE"])
AC_ARG_ENABLE(geoip,
[AS_HELP_STRING(--enable-geoip,[Enables builtin GeoIP database installation])],
[case "${enableval}" in
yes) geoip=true ;;
no) geoip=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-geoip) ;;
esac],[geoip=true])
AC_ARG_ENABLE(system-geoip,
[AS_HELP_STRING(--enable-system-geoip,[Enables use of system-wide GeoIP database (implies --disable-geoip) (auto by default)])],
[case "${enableval}" in
yes) if test "$have_system_geoip" = yes; then
system_geoip=true
geoip=false
else
AC_MSG_ERROR(cannot enable system geoip. GeoIP library headers were not found on your system)
fi ;;
no) system_geoip=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-system-geoip) ;;
esac],[system_geoip=auto])
if test x$system_geoip = xauto; then
if test "$have_system_geoip" = yes; then
system_geoip=true
geoip=false
else
system_geoip=false
fi
fi
AM_CONDITIONAL(ENABLE_GEOIP, test x$geoip = xtrue)
AM_CONDITIONAL(USE_SYSTEM_GEOIP, test x$system_geoip = xtrue)
if test x$system_geoip = xtrue; then
AC_DEFINE(USE_SYSTEM_GEOIP, 1, [Use system geoip])
fi
AC_ARG_ENABLE(builtin-country-flags,
[AS_HELP_STRING(--enable-builtin-country-flags,[Install and prefer builtin country flags to the ones provided by KDE (auto by default)])],
[case "${enableval}" in
yes) builtin_country_flags=true ;;
no) builtin_country_flags=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-builtin-country-flags) ;;
esac],[builtin_country_flags=auto])
if test x$builtin_country_flags = xauto; then
if test x$geoip = xtrue; then
builtin_country_flags=true
else
builtin_country_flags=false
fi
fi
AM_CONDITIONAL(ENABLE_BUILTIN_COUNTRY_FLAGS, test x$builtin_country_flags = xtrue)
AC_ARG_ENABLE(torrent-mimetype,
[ --enable-torrent-mimetype Enables the installation of the torrent mimetype which uses a KTorrent based icon],
[case "${enableval}" in
yes) mimetype_install=true ;;
no) mimetype_install=false ;;
*) AC_MSG_ERROR(bad value ${enableval} for --enable-torrent-mimetype) ;;
esac],[mimetype_install=false])
AM_CONDITIONAL(ENABLE_TORRENT_MIMETYPE, test x$mimetype_install = xtrue)
## -- BEGIN -- ADDED BY Kevin ---
# Check for pkg-config manually first, as if its not installed the
# PKG_PROG_PKG_CONFIG macro won't be defined.
AC_CHECK_PROG(have_pkg_config, pkg-config, yes, no)
if test x"$have_pkg_config" = "xno"; then
AC_MSG_ERROR(pkg-config is required to install this program)
fi
m4_pattern_allow(PKG_CONFIG_MIN_VERSION)
PKG_PROG_PKG_CONFIG
PKG_CHECK_MODULES( AVAHI, avahi-client >= 0.6.10,
[
AC_SUBST(AVAHI_CFLAGS)
AC_SUBST(AVAHI_LIBS)
avahi=true
],
[
missing_avahi_warning=yes
avahi=false
])
PKG_CHECK_MODULES( AVAHI_TQT, avahi-tqt >= 0.6.10,
[
AC_SUBST(AVAHI_TQT_CFLAGS)
AC_SUBST(AVAHI_TQT_LIBS)
avahi=true
],
[
missing_avahi_warning=yes
avahi=false
])
AM_CONDITIONAL(COMPILE_ZEROCONF, test x$avahi = xtrue)
|