source: trunk/configure.ac @ 14443

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

Lower minimum PolarSSL version required down to 1.2

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