1 | dnl convention: -TR MAJOR MINOR MAINT STATUS - (each a single char) |
---|
2 | dnl STATUS: "X" for prerelease beta builds, |
---|
3 | dnl "Z" for unsupported trunk builds, |
---|
4 | dnl "0" for stable, supported releases |
---|
5 | dnl these should be the only two lines you need to change |
---|
6 | m4_define([user_agent_prefix],[2.83+]) |
---|
7 | m4_define([peer_id_prefix],[-TR283Z-]) |
---|
8 | |
---|
9 | AC_INIT([transmission],[user_agent_prefix],[http://trac.transmissionbt.com/newticket]) |
---|
10 | AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix]) |
---|
11 | AC_SUBST(PEERID_PREFIX,[peer_id_prefix]) |
---|
12 | |
---|
13 | m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) |
---|
14 | |
---|
15 | AC_CONFIG_MACRO_DIR([m4]) |
---|
16 | |
---|
17 | dnl AM_CONFIG_HEADER(config.h) |
---|
18 | AC_CONFIG_SRCDIR(libtransmission/transmission.h) |
---|
19 | AM_INIT_AUTOMAKE([1.9 tar-pax no-dist-gzip dist-xz]) |
---|
20 | LT_INIT |
---|
21 | |
---|
22 | if test m4_substr(peer_id_prefix,6,1) = "0"; then |
---|
23 | supported_build=yes |
---|
24 | CPPFLAGS="$CPPFLAGS -DNDEBUG" |
---|
25 | else |
---|
26 | supported_build=no |
---|
27 | if test "x$GCC" = "xyes" ; then |
---|
28 | CFLAGS="$CFLAGS -g -O0" |
---|
29 | CXXFLAGS="$CXXFLAGS -g -O0" |
---|
30 | fi |
---|
31 | fi |
---|
32 | AM_CONDITIONAL(TR_UNSTABLE, test "x$supported_build" = "xno") |
---|
33 | |
---|
34 | ## |
---|
35 | ## |
---|
36 | ## MANDATORY for everything |
---|
37 | ## |
---|
38 | ## |
---|
39 | CURL_MINIMUM=7.15.4 |
---|
40 | AC_SUBST(CURL_MINIMUM) |
---|
41 | LIBEVENT_MINIMUM=2.0.10 |
---|
42 | AC_SUBST(LIBEVENT_MINIMUM) |
---|
43 | OPENSSL_MINIMUM=0.9.4 |
---|
44 | AC_SUBST(OPENSSL_MINIMUM) |
---|
45 | |
---|
46 | ## |
---|
47 | ## |
---|
48 | ## MANDATORY for the GTK+ client |
---|
49 | ## |
---|
50 | ## |
---|
51 | |
---|
52 | GTK_MINIMUM=3.4.0 |
---|
53 | AC_SUBST(GTK_MINIMUM) |
---|
54 | GLIB_MINIMUM=2.32.0 |
---|
55 | AC_SUBST(GLIB_MINIMUM) |
---|
56 | GIO_MINIMUM=2.26.0 |
---|
57 | AC_SUBST(GIO_MINIMUM) |
---|
58 | |
---|
59 | ## |
---|
60 | ## |
---|
61 | ## OPTIONAL for the GTK+ client |
---|
62 | ## |
---|
63 | ## |
---|
64 | |
---|
65 | # create the tray icon with AppIndicator |
---|
66 | LIBAPPINDICATOR_MINIMUM=0.4.90 |
---|
67 | AC_SUBST(LIBAPPINDICATOR_MINIMUM) |
---|
68 | |
---|
69 | |
---|
70 | AC_PROG_CC |
---|
71 | AC_PROG_CXX |
---|
72 | AC_C_INLINE |
---|
73 | if test "x$GCC" = "xyes" ; then |
---|
74 | |
---|
75 | CFLAGS="$CFLAGS -std=gnu99 -ggdb3 -Wall -W -Wpointer-arith -Wformat-security -Wcast-align -Wundef -Wcast-align -Wstrict-prototypes -Wmissing-declarations -Wmissing-format-attribute -Wredundant-decls -Wnested-externs -Wunused-parameter -Wwrite-strings -Winline -Wfloat-equal" |
---|
76 | |
---|
77 | dnl figure out gcc version |
---|
78 | AC_MSG_CHECKING([gcc version]) |
---|
79 | GCC_VERSION=`$CC -dumpversion` |
---|
80 | GCC_MAJOR=`echo $GCC_VERSION | cut -d . -f1` |
---|
81 | GCC_MINOR=`echo $GCC_VERSION | cut -d . -f2` |
---|
82 | GCC_VERSION_NUM=`(expr $GCC_MAJOR "*" 100 + $GCC_MINOR) 2>/dev/null` |
---|
83 | |
---|
84 | AC_MSG_RESULT($GCC_VERSION) |
---|
85 | if test $GCC_VERSION_NUM -ge 304; then |
---|
86 | dnl these were added in 3.4 |
---|
87 | CFLAGS="$CFLAGS -Wextra -Wdeclaration-after-statement -Winit-self" |
---|
88 | fi |
---|
89 | if test $GCC_VERSION_NUM -ge 403; then |
---|
90 | dnl these were added in 4.3 |
---|
91 | CFLAGS="$CFLAGS -Wvariadic-macros" |
---|
92 | fi |
---|
93 | fi |
---|
94 | |
---|
95 | AC_HEADER_STDC |
---|
96 | AC_HEADER_TIME |
---|
97 | |
---|
98 | AC_CHECK_HEADERS([stdbool.h]) |
---|
99 | AC_CHECK_FUNCS([iconv_open pread pwrite lrintf strlcpy daemon dirname basename strcasecmp localtime_r fallocate64 posix_fallocate memmem strsep strtold syslog valloc getpagesize posix_memalign statvfs htonll ntohll mkdtemp]) |
---|
100 | AC_PROG_INSTALL |
---|
101 | AC_PROG_MAKE_SET |
---|
102 | ACX_PTHREAD |
---|
103 | |
---|
104 | if test "x$ac_cv_func_strtold" != "xyes" ; then |
---|
105 | CPPFLAGS="$CPPFLAGS -Dstrtold=strtod" |
---|
106 | fi |
---|
107 | |
---|
108 | AC_SEARCH_LIBS(cos, [m]) |
---|
109 | AC_SEARCH_LIBS([socket], [socket net]) |
---|
110 | AC_SEARCH_LIBS([gethostbyname], [nsl bind]) |
---|
111 | AC_SEARCH_LIBS([quotacursor_skipidtype], [quota]) |
---|
112 | PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM], , [CHECK_SSL()]) |
---|
113 | PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM]) |
---|
114 | PKG_CHECK_MODULES(LIBEVENT, [libevent >= $LIBEVENT_MINIMUM]) |
---|
115 | AC_PATH_ZLIB |
---|
116 | |
---|
117 | AC_SYS_LARGEFILE |
---|
118 | AC_CHECK_FUNCS([lseek64]) |
---|
119 | |
---|
120 | AC_FUNC_GETMNTENT |
---|
121 | |
---|
122 | dnl ---------------------------------------------------------------------------- |
---|
123 | dnl |
---|
124 | dnl posix_fadvise |
---|
125 | |
---|
126 | dnl can posix_fadvise be used |
---|
127 | AC_CHECK_DECLS(posix_fadvise, [], [], [ |
---|
128 | #define _XOPEN_SOURCE 600 |
---|
129 | #include <fcntl.h>]) |
---|
130 | AC_CHECK_FUNCS([posix_fadvise]) |
---|
131 | |
---|
132 | |
---|
133 | dnl ---------------------------------------------------------------------------- |
---|
134 | dnl |
---|
135 | dnl file monitoring for the daemon |
---|
136 | |
---|
137 | AC_CHECK_HEADER([sys/inotify.h], |
---|
138 | [AC_CHECK_FUNC([inotify_init],[have_inotify="yes"],[have_inotify="no"])], |
---|
139 | [have_inotify="no"]) |
---|
140 | AC_ARG_WITH([inotify], |
---|
141 | [AS_HELP_STRING([--with-inotify],[Enable inotify support (default=auto)])], |
---|
142 | [want_inotify=${withval}], |
---|
143 | [want_inotify=${have_inotify}]) |
---|
144 | if test "x$want_inotify" = "xyes" ; then |
---|
145 | if test "x$have_inotify" = "xyes"; then |
---|
146 | AC_DEFINE([WITH_INOTIFY],[1]) |
---|
147 | else |
---|
148 | AC_MSG_ERROR("inotify not found!") |
---|
149 | fi |
---|
150 | fi |
---|
151 | |
---|
152 | AC_CHECK_HEADER([sys/event.h], |
---|
153 | [AC_CHECK_FUNC([kqueue],[have_kqueue="yes"],[have_kqueue="no"])], |
---|
154 | [have_kqueue="no"]) |
---|
155 | AC_ARG_WITH([kqueue], |
---|
156 | [AS_HELP_STRING([--with-kqueue],[Enable kqueue support (default=auto)])], |
---|
157 | [want_kqueue=${withval}], |
---|
158 | [want_kqueue=${have_kqueue}]) |
---|
159 | if test "x$want_kqueue" = "xyes" ; then |
---|
160 | if test "x$have_kqueue" = "xyes"; then |
---|
161 | AC_DEFINE([WITH_KQUEUE],[1]) |
---|
162 | else |
---|
163 | AC_MSG_ERROR("kqueue not found!") |
---|
164 | fi |
---|
165 | fi |
---|
166 | |
---|
167 | AC_CHECK_HEADERS([sys/statvfs.h \ |
---|
168 | xfs/xfs.h]) |
---|
169 | |
---|
170 | |
---|
171 | dnl ---------------------------------------------------------------------------- |
---|
172 | dnl |
---|
173 | dnl file monitoring for the daemon |
---|
174 | |
---|
175 | # Check whether to enable systemd startup notification. |
---|
176 | # This requires libsystemd-daemon. |
---|
177 | AC_ARG_WITH([systemd-daemon], AS_HELP_STRING([--with-systemd-daemon], |
---|
178 | [Add support for systemd startup notification (default is autodetected)]), |
---|
179 | [USE_SYSTEMD_DAEMON=$withval], [USE_SYSTEMD_DAEMON=auto]) |
---|
180 | AS_IF([test "x$USE_SYSTEMD_DAEMON" != "xno"], [ |
---|
181 | PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon], |
---|
182 | [AC_DEFINE(USE_SYSTEMD_DAEMON,1,[Use systemd startup notification])], |
---|
183 | [AS_IF([test "x$USE_SYSTEMD_DAEMON" = "xyes"], |
---|
184 | [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd-daemon not found.])] |
---|
185 | )] |
---|
186 | ) |
---|
187 | ]) |
---|
188 | |
---|
189 | |
---|
190 | dnl ---------------------------------------------------------------------------- |
---|
191 | dnl |
---|
192 | dnl dht |
---|
193 | |
---|
194 | DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht" |
---|
195 | DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a" |
---|
196 | AC_SUBST(DHT_CFLAGS) |
---|
197 | AC_SUBST(DHT_LIBS) |
---|
198 | |
---|
199 | |
---|
200 | dnl ---------------------------------------------------------------------------- |
---|
201 | dnl |
---|
202 | dnl utp |
---|
203 | |
---|
204 | AC_CHECK_LIB([rt], |
---|
205 | [clock_gettime], |
---|
206 | [libutp_extra_libs="-lrt"], |
---|
207 | [libutp_extra_libs=""]) |
---|
208 | |
---|
209 | AC_MSG_CHECKING([µTP]) |
---|
210 | build_utp="no" |
---|
211 | if test "x$CXX" != "x" ; then |
---|
212 | have_utp="yes" |
---|
213 | else |
---|
214 | have_utp="no" |
---|
215 | fi |
---|
216 | AC_ARG_ENABLE([utp], |
---|
217 | AS_HELP_STRING([--enable-utp],[build µTP support]), |
---|
218 | [want_utp=${enableval}], |
---|
219 | [want_utp=${have_utp}]) |
---|
220 | if test "x$want_utp" = "xyes" ; then |
---|
221 | if test "x$have_utp" = "xyes"; then |
---|
222 | LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/" |
---|
223 | LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a" |
---|
224 | LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a" |
---|
225 | if test "x$libutp_extra_libs" != "x" ; then |
---|
226 | LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs" |
---|
227 | LIBUTP_LIBS_QT="$LIBUTP_LIBS_QT $libutp_extra_libs" |
---|
228 | fi |
---|
229 | AC_DEFINE([WITH_UTP],[1]) |
---|
230 | build_utp="yes" |
---|
231 | else |
---|
232 | AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found") |
---|
233 | fi |
---|
234 | fi |
---|
235 | AC_SUBST(LIBUTP_CFLAGS) |
---|
236 | AC_SUBST(LIBUTP_LIBS) |
---|
237 | AC_SUBST(LIBUTP_LIBS_QT) |
---|
238 | AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"]) |
---|
239 | AC_MSG_RESULT([$build_utp]) |
---|
240 | |
---|
241 | |
---|
242 | dnl |
---|
243 | dnl look for preinstalled miniupnpc... |
---|
244 | dnl |
---|
245 | |
---|
246 | ac_save_LIBS="$LIBS" |
---|
247 | LIBS="-lminiupnpc" |
---|
248 | AC_MSG_CHECKING([system miniupnpc library]) |
---|
249 | |
---|
250 | dnl See if ANY version of miniupnpc is installed |
---|
251 | AC_LINK_IFELSE( |
---|
252 | [AC_LANG_PROGRAM([#include <miniupnpc/miniupnpc.h>], |
---|
253 | [struct UPNPDev dev;])], |
---|
254 | [upnp_version="unknown"], |
---|
255 | [upnp_version="none"] |
---|
256 | ) |
---|
257 | |
---|
258 | dnl Let's hope it's 1.7 or higher, since it provides |
---|
259 | dnl MINIUPNPC_API_VERSION and we won't have to figure |
---|
260 | dnl it out on our own |
---|
261 | if test "x$upnp_version" = "xunknown" ; then |
---|
262 | AC_RUN_IFELSE( |
---|
263 | [AC_LANG_PROGRAM( |
---|
264 | [#include <stdlib.h> |
---|
265 | #include <miniupnpc/miniupnpc.h>], |
---|
266 | [#ifdef MINIUPNPC_API_VERSION |
---|
267 | return EXIT_SUCCESS; |
---|
268 | #else |
---|
269 | return EXIT_FAILURE; |
---|
270 | #endif] |
---|
271 | )], |
---|
272 | [upnp_version=">= 1.7"] |
---|
273 | ) |
---|
274 | fi |
---|
275 | |
---|
276 | dnl Or maybe it's miniupnp 1.6 |
---|
277 | if test "x$upnp_version" = "xunknown" ; then |
---|
278 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
---|
279 | #include <stdlib.h> |
---|
280 | #include <errno.h> |
---|
281 | #include <miniupnpc/miniupnpc.h> |
---|
282 | #include <miniupnpc/upnpcommands.h> |
---|
283 | ]], [[ |
---|
284 | struct UPNPDev * devlist; |
---|
285 | struct UPNPUrls urls; |
---|
286 | struct IGDdatas data; |
---|
287 | char lanaddr[16]; |
---|
288 | char portStr[8]; |
---|
289 | char intPort[8]; |
---|
290 | char intClient[16]; |
---|
291 | upnpDiscover( 2000, NULL, NULL, 0, 0, &errno ); |
---|
292 | UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) ); |
---|
293 | UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype, |
---|
294 | portStr, "TCP", intClient, intPort, NULL, NULL, NULL ); |
---|
295 | ]])],[ |
---|
296 | AC_DEFINE(MINIUPNPC_API_VERSION, 8, [miniupnpc 1.6 has API version 8]) |
---|
297 | upnp_version="1.6"]) |
---|
298 | fi |
---|
299 | |
---|
300 | dnl Or maybe it's miniupnp 1.5 |
---|
301 | if test "x$upnp_version" = "xunknown" ; then |
---|
302 | AC_LINK_IFELSE([AC_LANG_PROGRAM([[ |
---|
303 | #include <stdlib.h> |
---|
304 | #include <miniupnpc/miniupnpc.h> |
---|
305 | #include <miniupnpc/upnpcommands.h> |
---|
306 | ]], [[ |
---|
307 | struct UPNPDev * devlist; |
---|
308 | struct UPNPUrls urls; |
---|
309 | struct IGDdatas data; |
---|
310 | char lanaddr[16]; |
---|
311 | char portStr[8]; |
---|
312 | char intPort[8]; |
---|
313 | char intClient[16]; |
---|
314 | upnpDiscover( 2000, NULL, NULL, 0 ); |
---|
315 | UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) ); |
---|
316 | UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype, |
---|
317 | portStr, "TCP", intClient, intPort ); |
---|
318 | ]])],[ |
---|
319 | AC_DEFINE(MINIUPNPC_API_VERSION, 5, [miniupnpc 1.5 has API version 5]) |
---|
320 | upnp_version="1.5"]) |
---|
321 | fi |
---|
322 | |
---|
323 | # ... and the results of our tests |
---|
324 | LIBS="$ac_save_LIBS" |
---|
325 | AC_MSG_RESULT([$upnp_version]) |
---|
326 | AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$upnp_version" = "xnone"]) |
---|
327 | if test "x$upnp_version" = "xnone" ; then |
---|
328 | LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/" |
---|
329 | LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a" |
---|
330 | LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a" |
---|
331 | else |
---|
332 | AC_DEFINE([SYSTEM_MINIUPNP]) |
---|
333 | LIBUPNP_CFLAGS="" |
---|
334 | LIBUPNP_LIBS="-lminiupnpc" |
---|
335 | LIBUPNP_LIBS_QT="-lminiupnpc" |
---|
336 | fi |
---|
337 | AC_SUBST(LIBUPNP_CFLAGS) |
---|
338 | AC_SUBST(LIBUPNP_LIBS) |
---|
339 | AC_SUBST(LIBUPNP_LIBS_QT) |
---|
340 | |
---|
341 | |
---|
342 | |
---|
343 | |
---|
344 | dnl ---------------------------------------------------------------------------- |
---|
345 | dnl |
---|
346 | dnl Allow usage of system natpmp library |
---|
347 | |
---|
348 | LIBNATPMP_CFLAGS="-I\$(top_srcdir)/third-party/libnatpmp/" |
---|
349 | LIBNATPMP_LIBS="\$(top_builddir)/third-party/libnatpmp/libnatpmp.a" |
---|
350 | LIBNATPMP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a" |
---|
351 | build_bundled_natpmp="yes" |
---|
352 | AC_ARG_ENABLE([external-natpmp], |
---|
353 | AS_HELP_STRING([--enable-external-natpmp],[Use system external-natpmp]), |
---|
354 | [want_external_natpmp=${enableval}], |
---|
355 | [want_external_natpmp=no]) |
---|
356 | if test "x$want_external_natpmp" != "xno" ; then |
---|
357 | dnl Would be lovely if it had pkgconfig |
---|
358 | LIBNATPMP_CFLAGS="" |
---|
359 | LIBNATPMP_LIBS="-lnatpmp" |
---|
360 | LIBNATPMP_LIBS_QT="-lnatpmp" |
---|
361 | build_bundled_natpmp="no" |
---|
362 | fi |
---|
363 | AM_CONDITIONAL([BUILD_NATPMP],[test "x$build_bundled_natpmp" = "xyes"]) |
---|
364 | AC_SUBST(LIBNATPMP_CFLAGS) |
---|
365 | AC_SUBST(LIBNATPMP_LIBS) |
---|
366 | AC_SUBST(LIBNATPMP_LIBS_QT) |
---|
367 | |
---|
368 | |
---|
369 | dnl ---------------------------------------------------------------------------- |
---|
370 | dnl |
---|
371 | dnl detection for the GTK+ client |
---|
372 | |
---|
373 | AC_ARG_ENABLE([nls], |
---|
374 | [AS_HELP_STRING([--enable-nls],[enable native language support])],, |
---|
375 | [enable_nls=yes]) |
---|
376 | PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK_MINIMUM |
---|
377 | glib-2.0 >= $GLIB_MINIMUM |
---|
378 | gio-2.0 >= $GIO_MINIMUM, |
---|
379 | gmodule-2.0 >= $GLIB_MINIMUM |
---|
380 | gthread-2.0 >= $GLIB_MINIMUM], |
---|
381 | [have_gtk=yes], |
---|
382 | [have_gtk=no]) |
---|
383 | AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk],[with Gtk]), |
---|
384 | [with_gtk=$withval], |
---|
385 | [with_gtk=$have_gtk]) |
---|
386 | AM_CONDITIONAL([BUILD_GTK],[test "x$with_gtk" = "xyes"]) |
---|
387 | use_libappindicator=no |
---|
388 | if test "x$with_gtk" = "xyes" ; then |
---|
389 | |
---|
390 | if test "x$enable_nls" = "xno" ; then |
---|
391 | AC_MSG_ERROR("The gtk client cannot be built without nls support. Try adding either --enable-nls or --without-gtk" ) |
---|
392 | fi |
---|
393 | |
---|
394 | PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_MINIMUM |
---|
395 | glib-2.0 >= $GLIB_MINIMUM |
---|
396 | gio-2.0 >= $GIO_MINIMUM, |
---|
397 | gmodule-2.0 >= $GLIB_MINIMUM |
---|
398 | gthread-2.0 >= $GLIB_MINIMUM]) |
---|
399 | PKG_CHECK_MODULES([LIBAPPINDICATOR], |
---|
400 | [appindicator3-0.1 >= $LIBAPPINDICATOR_MINIMUM], |
---|
401 | [have_libappindicator=yes], |
---|
402 | [have_libappindicator=no]) |
---|
403 | if test "x$have_libappindicator" = "xyes"; then |
---|
404 | use_libappindicator=yes |
---|
405 | AC_DEFINE([HAVE_LIBAPPINDICATOR], 1) |
---|
406 | else |
---|
407 | LIBAPPINDICATOR_CFLAGS= |
---|
408 | LIBAPPINDICATOR_LIBS= |
---|
409 | fi |
---|
410 | fi |
---|
411 | |
---|
412 | dnl This section is only used for internationalization. |
---|
413 | dnl If you don't need translations and this section gives you trouble -- |
---|
414 | dnl such as if you're building for a headless system -- |
---|
415 | dnl it's okay to tear this section out and re-build the configure script. |
---|
416 | dnl |
---|
417 | dnl Note to packagers: the bump to intltool 0.40 was made to fix |
---|
418 | dnl a "make check" failure on some systems. if upgrading to 0.40 is |
---|
419 | dnl a problem and the old version was working fine for you, |
---|
420 | dnl it should be safe to re-edit 0.40 back down to 0.23 |
---|
421 | |
---|
422 | use_nls=no |
---|
423 | if test "x$enable_nls" = "xyes" ; then |
---|
424 | use_nls=yes |
---|
425 | m4_ifdef([IT_PROG_INTLTOOL], |
---|
426 | [IT_PROG_INTLTOOL([0.35.0],[no-xml])], |
---|
427 | [AC_MSG_ERROR("--enable-nls requires intltool to be installed.")]) |
---|
428 | AC_CHECK_HEADERS([libintl.h]) |
---|
429 | GETTEXT_PACKAGE=transmission-gtk |
---|
430 | AC_SUBST(GETTEXT_PACKAGE) |
---|
431 | AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package]) |
---|
432 | AM_GLIB_GNU_GETTEXT |
---|
433 | transmissionlocaledir='${prefix}/${DATADIRNAME}/locale' |
---|
434 | AC_SUBST(transmissionlocaledir) |
---|
435 | fi |
---|
436 | AC_SUBST(INTLLIBS) |
---|
437 | |
---|
438 | |
---|
439 | dnl ---------------------------------------------------------------------------- |
---|
440 | dnl |
---|
441 | dnl platform-specific stuff. |
---|
442 | |
---|
443 | AC_CANONICAL_HOST |
---|
444 | have_darwin="no" |
---|
445 | have_msw="no" |
---|
446 | case $host_os in |
---|
447 | |
---|
448 | *mingw32*) |
---|
449 | have_msw="yes" |
---|
450 | CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows" |
---|
451 | CPPFLAGS="$CPPFLAGS -DWIN32 -D_WIN32 -DWIN32_LEAN_AND_MEAN" |
---|
452 | LIBS="$LIBS -liphlpapi -lshell32 -lws2_32" |
---|
453 | transmissionlocaledir="locale" |
---|
454 | if test -z "$host_alias"; then |
---|
455 | hostaliaswindres= |
---|
456 | else |
---|
457 | hostaliaswindres="$host_alias-windres"; |
---|
458 | fi |
---|
459 | AC_CHECK_TOOL(WINDRES, windres) |
---|
460 | ;; |
---|
461 | |
---|
462 | *darwin*) |
---|
463 | have_darwin="yes" |
---|
464 | ;; |
---|
465 | |
---|
466 | esac |
---|
467 | |
---|
468 | AC_ARG_ENABLE([lightweight], |
---|
469 | AS_HELP_STRING([--enable-lightweight],[optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc.]), |
---|
470 | [enable_lightweight=${enableval}], |
---|
471 | [enable_lightweight="no"]) |
---|
472 | if test "x$enable_lightweight" = "xyes" ; then |
---|
473 | AC_DEFINE([TR_LIGHTWEIGHT],[1],[optimize libtransmission for low-resource systems]) |
---|
474 | fi |
---|
475 | |
---|
476 | AC_ARG_ENABLE([cli], |
---|
477 | [AS_HELP_STRING([--enable-cli],[build command-line client])], |
---|
478 | [build_cli=${enableval}], |
---|
479 | [build_cli="yes"]) |
---|
480 | AM_CONDITIONAL([BUILD_CLI],[test "x$build_cli" = "xyes"]) |
---|
481 | |
---|
482 | AC_ARG_ENABLE([mac], |
---|
483 | [AS_HELP_STRING([--enable-mac],[build Mac client])], |
---|
484 | [build_mac=${enableval}], |
---|
485 | [build_mac=${have_darwin}]) |
---|
486 | AM_CONDITIONAL([BUILD_MAC],[test "x$build_mac" = "xyes"]) |
---|
487 | |
---|
488 | AC_ARG_ENABLE([daemon], |
---|
489 | [AS_HELP_STRING([--enable-daemon],[build daemon])], |
---|
490 | [build_daemon=${enableval}], |
---|
491 | [build_daemon="yes"]) |
---|
492 | AM_CONDITIONAL([BUILD_DAEMON],[test "x$build_daemon" = "xyes"]) |
---|
493 | |
---|
494 | |
---|
495 | if test "x$build_mac" = "xyes" ; then |
---|
496 | AC_DEFINE([BUILD_MAC_CLIENT], 1) |
---|
497 | # Make sure the proper Mac SDK is installed |
---|
498 | if test ! -d /Developer/SDKs/MacOSX10.5.sdk; then |
---|
499 | cat << EOF |
---|
500 | You need to install the Mac OS X 10.5 SDK in order to build Transmission |
---|
501 | with --enable-mac: |
---|
502 | Get your Xcode CD or package |
---|
503 | Restart the install |
---|
504 | When it gets to "Installation Type", select "Customize" |
---|
505 | Select "Mac OS X 10.5 SDK" under "Cross Development" |
---|
506 | Finish the install. |
---|
507 | EOF |
---|
508 | exit 1 |
---|
509 | fi |
---|
510 | fi |
---|
511 | if test "x$have_msw" = "xyes"; then |
---|
512 | AC_DEFINE([HAVE_MSW], 1) |
---|
513 | fi |
---|
514 | AM_CONDITIONAL(WIN32, test "x$have_msw" = "xyes") |
---|
515 | |
---|
516 | dnl ---------------------------------------------------------------------------- |
---|
517 | dnl |
---|
518 | dnl Generate the output |
---|
519 | |
---|
520 | AC_CONFIG_FILES([Makefile |
---|
521 | transmission-gtk.spec |
---|
522 | cli/Makefile |
---|
523 | daemon/Makefile |
---|
524 | extras/Makefile |
---|
525 | libtransmission/Makefile |
---|
526 | utils/Makefile |
---|
527 | third-party/Makefile |
---|
528 | third-party/dht/Makefile |
---|
529 | third-party/libutp/Makefile |
---|
530 | third-party/libnatpmp/Makefile |
---|
531 | third-party/miniupnp/Makefile |
---|
532 | macosx/Makefile |
---|
533 | gtk/Makefile |
---|
534 | gtk/icons/Makefile |
---|
535 | qt/config.pri |
---|
536 | web/Makefile |
---|
537 | web/images/Makefile |
---|
538 | web/style/Makefile |
---|
539 | web/style/jqueryui/Makefile |
---|
540 | web/style/jqueryui/images/Makefile |
---|
541 | web/style/transmission/Makefile |
---|
542 | web/style/transmission/images/Makefile |
---|
543 | web/style/transmission/images/buttons/Makefile |
---|
544 | web/javascript/Makefile |
---|
545 | web/javascript/jquery/Makefile |
---|
546 | po/Makefile.in]) |
---|
547 | |
---|
548 | AC_OUTPUT |
---|
549 | |
---|
550 | echo " |
---|
551 | |
---|
552 | Configuration: |
---|
553 | |
---|
554 | Source code location: ${srcdir} |
---|
555 | Compiler: ${CXX} |
---|
556 | |
---|
557 | Build libtransmission: yes |
---|
558 | * optimized for low-resource systems: ${enable_lightweight} |
---|
559 | * µTP enabled: ${build_utp} |
---|
560 | |
---|
561 | Build Command-Line client: ${build_cli} |
---|
562 | |
---|
563 | Build GTK+ client: ${with_gtk} |
---|
564 | * libappindicator for an Ubuntu-style tray: ${use_libappindicator} |
---|
565 | |
---|
566 | Build Daemon: ${build_daemon} |
---|
567 | |
---|
568 | Build Mac client: ${build_mac} |
---|
569 | |
---|
570 | " |
---|