source: trunk/configure.ac @ 14459

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

#5881: Explicitly state all possible crypto backend source files so that they are included into archive by make dist

File size: 22.4 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(CYASSL, [cyassl >= $CYASSL_MINIMUM],
141        [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$CYASSL_CFLAGS"; CRYPTO_LIBS="$CYASSL_LIBS"],
142        [AS_IF([test "x$want_crypto" = "xcyassl"],
143            [AC_MSG_ERROR([CyaSSL support requested, but library not found.])]
144        )]
145    )
146])
147AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [
148    AC_CHECK_HEADER([polarssl/version.h],
149        [AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
150                                     #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
151                                     version_ok
152                                     #endif],
153            [AC_CHECK_LIB([polarssl], [dhm_calc_secret],
154                [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"],
155                [AS_IF([test "x$want_crypto" = "xpolarssl"],
156                    [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
157                )]
158            )],
159            [AS_IF([test "x$want_crypto" = "xpolarssl"],
160                [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])]
161            )]
162        )],
163        [AS_IF([test "x$want_crypto" = "xpolarssl"],
164            [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])]
165        )]
166    )
167])
168# we should have found the library by now
169AS_IF([test "x$CRYPTO_PKG" = "x"], [
170    AS_IF([test "x$want_crypto" = "xauto"],
171        [AC_MSG_ERROR([Unable to find any supported crypto library.])],
172        [AC_MSG_ERROR([Requested crypto library "$want_crypto" is not supported.])],
173    )
174])
175
176AM_CONDITIONAL([CRYPTO_USE_OPENSSL],[test "x$CRYPTO_PKG" = "xopenssl"])
177AM_CONDITIONAL([CRYPTO_USE_CYASSL],[test "x$CRYPTO_PKG" = "xcyassl"])
178AM_CONDITIONAL([CRYPTO_USE_POLARSSL],[test "x$CRYPTO_PKG" = "xpolarssl"])
179AC_SUBST(CRYPTO_PKG)
180AC_SUBST(CRYPTO_CFLAGS)
181AC_SUBST(CRYPTO_LIBS)
182
183
184AC_SYS_LARGEFILE
185AC_CHECK_FUNCS([lseek64])
186
187AC_FUNC_GETMNTENT
188
189dnl ----------------------------------------------------------------------------
190dnl
191dnl posix_fadvise
192
193dnl can posix_fadvise be used
194AC_CHECK_DECLS(posix_fadvise, [], [], [
195#define _XOPEN_SOURCE 600
196#include <fcntl.h>])
197AC_CHECK_FUNCS([posix_fadvise])
198
199
200dnl ----------------------------------------------------------------------------
201dnl
202dnl file monitoring for the daemon
203
204AC_CHECK_HEADER([sys/inotify.h],
205                [AC_CHECK_FUNC([inotify_init],[have_inotify="yes"],[have_inotify="no"])],
206                [have_inotify="no"])
207AC_ARG_WITH([inotify],
208            [AS_HELP_STRING([--with-inotify],[Enable inotify support (default=auto)])],
209            [want_inotify=${withval}],
210            [want_inotify=${have_inotify}])
211if test "x$want_inotify" = "xyes" ; then
212    if test "x$have_inotify" = "xyes"; then
213      AC_DEFINE([WITH_INOTIFY],[1])
214    else
215      AC_MSG_ERROR("inotify not found!")
216    fi
217fi
218
219AC_CHECK_HEADER([sys/event.h],
220                [AC_CHECK_FUNC([kqueue],[have_kqueue="yes"],[have_kqueue="no"])],
221                [have_kqueue="no"])
222AC_ARG_WITH([kqueue],
223            [AS_HELP_STRING([--with-kqueue],[Enable kqueue support (default=auto)])],
224            [want_kqueue=${withval}],
225            [want_kqueue=${have_kqueue}])
226if test "x$want_kqueue" = "xyes" ; then
227    if test "x$have_kqueue" = "xyes"; then
228      AC_DEFINE([WITH_KQUEUE],[1])
229    else
230      AC_MSG_ERROR("kqueue not found!")
231    fi
232fi
233
234AC_CHECK_HEADERS([sys/statvfs.h \
235                  xfs/xfs.h])
236
237
238dnl ----------------------------------------------------------------------------
239dnl
240dnl file monitoring for the daemon
241
242# Check whether to enable systemd startup notification.
243# This requires libsystemd-daemon.
244AC_ARG_WITH([systemd-daemon], AS_HELP_STRING([--with-systemd-daemon],
245            [Add support for systemd startup notification (default is autodetected)]),
246            [USE_SYSTEMD_DAEMON=$withval], [USE_SYSTEMD_DAEMON=auto])
247AS_IF([test "x$USE_SYSTEMD_DAEMON" != "xno"], [
248    PKG_CHECK_MODULES([SYSTEMD_DAEMON], [libsystemd-daemon],
249        [AC_DEFINE(USE_SYSTEMD_DAEMON,1,[Use systemd startup notification])],
250        [AS_IF([test "x$USE_SYSTEMD_DAEMON" = "xyes"],
251            [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd-daemon not found.])]
252        )]
253    )
254])
255
256
257dnl ----------------------------------------------------------------------------
258dnl
259dnl  dht
260
261DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
262DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
263DHT_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/dht/libdht.a"
264build_bundled_dht="yes"
265AC_ARG_ENABLE([external-dht],
266              AS_HELP_STRING([--enable-external-dht],[Use system external-dht]),
267              [want_external_dht=${enableval}],
268              [want_external_dht=no])
269if test "x$want_external_dht" != "xno" ; then
270       dnl Would be lovely if it had pkgconfig
271       DHT_CFLAGS=""
272       DHT_LIBS="-ldht"
273       DHT_LIBS_QT="-ldht"
274       build_bundled_dht="no"
275fi
276
277AM_CONDITIONAL([BUILD_DHT],[test "x$build_bundled_dht" = "xyes"])
278AC_SUBST(DHT_CFLAGS)
279AC_SUBST(DHT_LIBS)
280AC_SUBST(DHT_LIBS_QT)
281
282
283dnl ----------------------------------------------------------------------------
284dnl
285dnl  libb64
286
287LIBB64_CFLAGS="-I\$(top_srcdir)/third-party/libb64"
288LIBB64_LIBS="\$(top_builddir)/third-party/libb64/libb64.a"
289LIBB64_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libb64/libb64.a"
290build_bundled_b64="yes"
291AC_ARG_ENABLE([external-b64],
292              AS_HELP_STRING([--enable-external-b64],[Use system libb64]),
293              [want_external_b64=${enableval}],
294              [want_external_b64=no])
295if test "x$want_external_b64" != "xno" ; then
296    LIBB64_CFLAGS="-DUSE_SYSTEM_B64"
297    LIBB64_LIBS="-lb64"
298    LIBB64_LIBS_QT="-lb64"
299    build_bundled_b64="no"
300fi
301
302AM_CONDITIONAL([BUILD_B64],[test "x$build_bundled_b64" = "xyes"])
303AC_SUBST(LIBB64_CFLAGS)
304AC_SUBST(LIBB64_LIBS)
305AC_SUBST(LIBB64_LIBS_QT)
306
307
308dnl ----------------------------------------------------------------------------
309dnl
310dnl  utp
311
312AC_CHECK_LIB([rt],
313             [clock_gettime],
314             [libutp_extra_libs="-lrt"],
315             [libutp_extra_libs=""])
316
317AC_MSG_CHECKING([µTP])
318build_utp="no"
319
320ac_save_LIBS="$LIBS"
321LIBS="-lutp"
322AC_LINK_IFELSE(
323  [AC_LANG_PROGRAM([#include <libutp/utp.h>],
324                   [struct UTPFunctionTable func;])],
325  [have_utp="yes"],
326  [have_utp="no"]
327)
328LIBS="$ac_save_LIBS"
329
330if test "x$have_utp" = "xyes" -o "x$CXX" != "x"; then
331    want_utp_default="yes"
332else
333    want_utp_default="no"
334fi
335
336AC_ARG_ENABLE([utp],
337              AS_HELP_STRING([--enable-utp],[build µTP support]),
338              [want_utp=${enableval}],
339              [want_utp=${want_utp_default}])
340if test "x$want_utp" = "xyes"; then
341    if test "x$have_utp" = "xyes"; then
342        dnl Would be lovely if it had pkgconfig
343        LIBUTP_CFLAGS=""
344        LIBUTP_LIBS="-lutp $libutp_extra_libs"
345        LIBUTP_LIBS_QT="-lutp $libutp_extra_libs"
346        AC_DEFINE([WITH_UTP],[1])
347        build_utp="system"
348    elif test "x$CXX" != "x"; then
349        LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
350        LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
351        LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a"
352        if test "x$libutp_extra_libs" != "x" ; then
353            LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
354            LIBUTP_LIBS_QT="$LIBUTP_LIBS_QT $libutp_extra_libs"
355        fi
356        AC_DEFINE([WITH_UTP],[1])
357        build_utp="yes"
358    else
359      AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
360    fi
361fi
362AC_SUBST(LIBUTP_CFLAGS)
363AC_SUBST(LIBUTP_LIBS)
364AC_SUBST(LIBUTP_LIBS_QT)
365AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"])
366AC_MSG_RESULT([$build_utp])
367
368
369dnl
370dnl  look for preinstalled miniupnpc...
371dnl
372
373ac_save_LIBS="$LIBS"
374LIBS="-lminiupnpc"
375AC_MSG_CHECKING([system miniupnpc library])
376
377dnl See if ANY version of miniupnpc is installed
378AC_LINK_IFELSE(
379  [AC_LANG_PROGRAM([#include <miniupnpc/miniupnpc.h>],
380                   [struct UPNPDev dev;])],
381  [upnp_version="unknown"],
382  [upnp_version="none"]
383)
384
385dnl Let's hope it's 1.7 or higher, since it provides
386dnl MINIUPNPC_API_VERSION and we won't have to figure
387dnl it out on our own
388if test "x$upnp_version" = "xunknown" ; then
389  AC_RUN_IFELSE(
390    [AC_LANG_PROGRAM(
391      [#include <stdlib.h>
392       #include <miniupnpc/miniupnpc.h>],
393      [#ifdef MINIUPNPC_API_VERSION
394       return EXIT_SUCCESS;
395       #else
396       return EXIT_FAILURE;
397       #endif]
398    )],
399    [upnp_version=">= 1.7"]
400  )
401fi
402
403dnl Or maybe it's miniupnp 1.6
404if test "x$upnp_version" = "xunknown" ; then
405  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
406    #include <stdlib.h>
407    #include <errno.h>
408    #include <miniupnpc/miniupnpc.h>
409    #include <miniupnpc/upnpcommands.h>
410  ]], [[
411    struct UPNPDev * devlist;
412    struct UPNPUrls urls;
413    struct IGDdatas data;
414    char lanaddr[16];
415    char portStr[8];
416    char intPort[8];
417    char intClient[16];
418    upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
419    UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
420    UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
421                        portStr, "TCP", intClient, intPort, NULL, NULL, NULL );
422  ]])],[
423  AC_DEFINE(MINIUPNPC_API_VERSION, 8, [miniupnpc 1.6 has API version 8])
424  upnp_version="1.6"])
425fi
426
427dnl Or maybe it's miniupnp 1.5
428if test "x$upnp_version" = "xunknown" ; then
429  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
430    #include <stdlib.h>
431    #include <miniupnpc/miniupnpc.h>
432    #include <miniupnpc/upnpcommands.h>
433  ]], [[
434    struct UPNPDev * devlist;
435    struct UPNPUrls urls;
436    struct IGDdatas data;
437    char lanaddr[16];
438    char portStr[8];
439    char intPort[8];
440    char intClient[16];
441    upnpDiscover( 2000, NULL, NULL, 0 );
442    UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
443    UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
444                        portStr, "TCP", intClient, intPort );
445  ]])],[
446  AC_DEFINE(MINIUPNPC_API_VERSION, 5, [miniupnpc 1.5 has API version 5])
447  upnp_version="1.5"])
448fi
449
450# ... and the results of our tests
451LIBS="$ac_save_LIBS"
452AC_MSG_RESULT([$upnp_version])
453AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$upnp_version" = "xnone"])
454if test "x$upnp_version" = "xnone" ; then
455    LIBUPNP_CFLAGS="-I\$(top_srcdir)/third-party/"
456    LIBUPNP_LIBS="\$(top_builddir)/third-party/miniupnp/libminiupnp.a"
457    LIBUPNP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/miniupnp/libminiupnp.a"
458else
459    AC_DEFINE([SYSTEM_MINIUPNP])
460    LIBUPNP_CFLAGS=""
461    LIBUPNP_LIBS="-lminiupnpc"
462    LIBUPNP_LIBS_QT="-lminiupnpc"
463fi
464AC_SUBST(LIBUPNP_CFLAGS)
465AC_SUBST(LIBUPNP_LIBS)
466AC_SUBST(LIBUPNP_LIBS_QT)
467
468
469 
470
471dnl ----------------------------------------------------------------------------
472dnl
473dnl  Allow usage of system natpmp library
474
475LIBNATPMP_CFLAGS="-I\$(top_srcdir)/third-party/libnatpmp/"
476LIBNATPMP_LIBS="\$(top_builddir)/third-party/libnatpmp/libnatpmp.a"
477LIBNATPMP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libnatpmp/libnatpmp.a"
478build_bundled_natpmp="yes"
479AC_ARG_ENABLE([external-natpmp],
480              AS_HELP_STRING([--enable-external-natpmp],[Use system external-natpmp]),
481              [want_external_natpmp=${enableval}],
482              [want_external_natpmp=no])
483if test "x$want_external_natpmp" != "xno" ; then
484        dnl Would be lovely if it had pkgconfig
485        LIBNATPMP_CFLAGS="" 
486        LIBNATPMP_LIBS="-lnatpmp"
487        LIBNATPMP_LIBS_QT="-lnatpmp"
488        build_bundled_natpmp="no"
489fi
490AM_CONDITIONAL([BUILD_NATPMP],[test "x$build_bundled_natpmp" = "xyes"])
491AC_SUBST(LIBNATPMP_CFLAGS)
492AC_SUBST(LIBNATPMP_LIBS)
493AC_SUBST(LIBNATPMP_LIBS_QT)
494
495
496dnl ----------------------------------------------------------------------------
497dnl
498dnl  detection for the GTK+ client
499
500AC_ARG_ENABLE([nls],
501              [AS_HELP_STRING([--enable-nls],[enable native language support])],,
502              [enable_nls=yes])
503PKG_CHECK_EXISTS([gtk+-3.0 >= $GTK_MINIMUM
504                  glib-2.0 >= $GLIB_MINIMUM
505                  gio-2.0 >= $GIO_MINIMUM,
506                  gmodule-2.0 >= $GLIB_MINIMUM
507                  gthread-2.0 >= $GLIB_MINIMUM],
508                 [have_gtk=yes],
509                 [have_gtk=no])
510AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk],[with Gtk]),
511            [with_gtk=$withval],
512            [with_gtk=$have_gtk])
513AM_CONDITIONAL([BUILD_GTK],[test "x$with_gtk" = "xyes"])
514use_libappindicator=no
515if test "x$with_gtk" = "xyes" ; then
516
517    if test "x$enable_nls" = "xno" ; then
518        AC_MSG_ERROR("The gtk client cannot be built without nls support.  Try adding either --enable-nls or --without-gtk" )
519    fi
520
521    PKG_CHECK_MODULES([GTK], [gtk+-3.0 >= $GTK_MINIMUM
522                              glib-2.0 >= $GLIB_MINIMUM
523                              gio-2.0 >= $GIO_MINIMUM,
524                              gmodule-2.0 >= $GLIB_MINIMUM
525                              gthread-2.0 >= $GLIB_MINIMUM])
526    PKG_CHECK_MODULES([LIBAPPINDICATOR],
527                      [appindicator3-0.1 >= $LIBAPPINDICATOR_MINIMUM],
528                      [have_libappindicator=yes],
529                      [have_libappindicator=no])
530    if test "x$have_libappindicator" = "xyes"; then
531        use_libappindicator=yes
532        AC_DEFINE([HAVE_LIBAPPINDICATOR], 1)
533    else
534        LIBAPPINDICATOR_CFLAGS=
535        LIBAPPINDICATOR_LIBS=
536    fi
537fi
538
539dnl This section is only used for internationalization.
540dnl If you don't need translations and this section gives you trouble --
541dnl such as if you're building for a headless system --
542dnl it's okay to tear this section out and re-build the configure script.
543dnl
544dnl Note to packagers: the bump to intltool 0.40 was made to fix
545dnl a "make check" failure on some systems.  if upgrading to 0.40 is
546dnl a problem and the old version was working fine for you,
547dnl it should be safe to re-edit 0.40 back down to 0.23
548
549use_nls=no
550if test "x$enable_nls" = "xyes" ; then
551    use_nls=yes
552    m4_ifdef([IT_PROG_INTLTOOL],
553             [IT_PROG_INTLTOOL([0.35.0],[no-xml])],
554             [AC_MSG_ERROR("--enable-nls requires intltool to be installed.")])
555    AC_CHECK_HEADERS([libintl.h])
556    GETTEXT_PACKAGE=transmission-gtk
557    AC_SUBST(GETTEXT_PACKAGE)
558    AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
559    AM_GLIB_GNU_GETTEXT
560    transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
561    AC_SUBST(transmissionlocaledir)
562fi
563AC_SUBST(INTLLIBS)
564
565
566dnl ----------------------------------------------------------------------------
567dnl
568dnl  platform-specific stuff.
569
570AC_CANONICAL_HOST
571have_darwin="no"
572have_msw="no"
573case $host_os in
574
575   *mingw32*)
576     have_msw="yes"
577     CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows"
578     CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DWIN32_LEAN_AND_MEAN"
579     # CPPFLAGS="$CPPFLAGS -D__USE_MINGW_ANSI_STDIO=1 -D__STDC_FORMAT_MACROS=1"
580     LIBS="$LIBS -liphlpapi -lshell32 -lws2_32"
581     transmissionlocaledir="locale"
582     if test -z "$host_alias"; then
583       hostaliaswindres=
584     else
585       hostaliaswindres="$host_alias-windres";
586     fi
587     AC_CHECK_TOOL(WINDRES, windres)
588     ;;
589
590  *darwin*)
591    have_darwin="yes"
592    ;;
593
594esac
595
596AC_ARG_ENABLE([lightweight],
597              AS_HELP_STRING([--enable-lightweight],[optimize libtransmission for low-resource systems: smaller cache size, prefer unencrypted peer connections, etc.]),
598              [enable_lightweight=${enableval}],
599              [enable_lightweight="no"])
600if test "x$enable_lightweight" = "xyes" ; then
601  AC_DEFINE([TR_LIGHTWEIGHT],[1],[optimize libtransmission for low-resource systems])
602fi
603
604AC_ARG_ENABLE([cli],
605              [AS_HELP_STRING([--enable-cli],[build command-line client])],
606              [build_cli=${enableval}],
607              [build_cli="yes"])
608AM_CONDITIONAL([BUILD_CLI],[test "x$build_cli" = "xyes"])
609
610AC_ARG_ENABLE([mac],
611              [AS_HELP_STRING([--enable-mac],[build Mac client])],
612              [build_mac=${enableval}],
613              [build_mac=${have_darwin}])
614AM_CONDITIONAL([BUILD_MAC],[test "x$build_mac" = "xyes"])
615
616AC_ARG_ENABLE([daemon],
617              [AS_HELP_STRING([--enable-daemon],[build daemon])],
618              [build_daemon=${enableval}],
619              [build_daemon="yes"])
620AM_CONDITIONAL([BUILD_DAEMON],[test "x$build_daemon" = "xyes"])
621
622
623if test "x$build_mac" = "xyes" ; then
624   AC_DEFINE([BUILD_MAC_CLIENT], 1)
625    # Make sure the proper Mac SDK is installed
626    if test ! -d /Developer/SDKs/MacOSX10.5.sdk; then
627      cat << EOF
628You need to install the Mac OS X 10.5 SDK in order to build Transmission
629with --enable-mac:
630  Get your Xcode CD or package
631  Restart the install
632  When it gets to "Installation Type", select "Customize"
633  Select "Mac OS X 10.5 SDK" under "Cross Development"
634  Finish the install.
635EOF
636      exit 1
637    fi
638fi
639AM_CONDITIONAL(WIN32, test "x$have_msw" = "xyes")
640
641dnl ----------------------------------------------------------------------------
642dnl
643dnl  Generate the output
644
645AC_CONFIG_FILES([Makefile
646                 transmission-gtk.spec
647                 cli/Makefile
648                 daemon/Makefile
649                 extras/Makefile
650                 libtransmission/Makefile
651                 utils/Makefile
652                 third-party/Makefile
653                 third-party/dht/Makefile
654                 third-party/libb64/Makefile
655                 third-party/libutp/Makefile
656                 third-party/libnatpmp/Makefile
657                 third-party/miniupnp/Makefile
658                 macosx/Makefile
659                 gtk/Makefile
660                 gtk/icons/Makefile
661                 qt/config.pri
662                 web/Makefile
663                 web/images/Makefile
664                 web/style/Makefile
665                 web/style/jqueryui/Makefile
666                 web/style/jqueryui/images/Makefile
667                 web/style/transmission/Makefile
668                 web/style/transmission/images/Makefile
669                 web/style/transmission/images/buttons/Makefile
670                 web/javascript/Makefile
671                 web/javascript/jquery/Makefile
672                 po/Makefile.in])
673
674AC_OUTPUT
675
676echo "
677
678Configuration:
679
680   Source code location:                              ${srcdir}
681   Compiler:                                          ${CXX}
682
683   Build libtransmission:                             yes
684      * optimized for low-resource systems:           ${enable_lightweight}
685      * µTP enabled:                                  ${build_utp}
686      * crypto library:                               ${CRYPTO_PKG}
687
688   Build Command-Line client:                         ${build_cli}
689
690   Build GTK+ client:                                 ${with_gtk}
691      * libappindicator for an Ubuntu-style tray:     ${use_libappindicator}
692
693   Build Daemon:                                      ${build_daemon}
694
695   Build Mac client:                                  ${build_mac}
696
697"
Note: See TracBrowser for help on using the repository browser.