source: trunk/configure.ac @ 14478

Last change on this file since 14478 was 14478, checked in by mikedld, 7 years ago

Add support for WolfSSL (autoconf)

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