source: trunk/configure.ac

Last change on this file was 14733, checked in by mikedld, 6 years ago

#5921: Use libsystemd instead of libsystemd-daemon (original patches by Sandro Tosi and Mike Gilbert)

In systemd v209, released over two years ago, the various libsystemd-*
libraries (libsystemd-journal.so, libsystemd-login.so, libsystem-daemon.so,
libsystemd-id128.so) were merged into a single libsystemd.so library to
reduce code duplication and avoid cyclic dependencies.

File size: 22.7 KB
RevLine 
[7033]1dnl convention: -TR MAJOR MINOR MAINT STATUS - (each a single char)
[7662]2dnl STATUS: "X" for prerelease beta builds,
[7033]3dnl         "Z" for unsupported trunk builds,
4dnl         "0" for stable, supported releases
5dnl these should be the only two lines you need to change
[14715]6m4_define([user_agent_prefix],[2.92+])
7m4_define([peer_id_prefix],[-TR292Z-])
[6532]8
[13517]9AC_INIT([transmission],[user_agent_prefix],[http://trac.transmissionbt.com/newticket])
[7034]10AC_SUBST(USERAGENT_PREFIX,[user_agent_prefix])
11AC_SUBST(PEERID_PREFIX,[peer_id_prefix])
[6532]12
[9169]13m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])])
14
[6874]15AC_CONFIG_MACRO_DIR([m4])
[6532]16
[2526]17dnl AM_CONFIG_HEADER(config.h)
[2400]18AC_CONFIG_SRCDIR(libtransmission/transmission.h)
[13776]19AM_INIT_AUTOMAKE([1.9 tar-pax no-dist-gzip dist-xz])
[13517]20LT_INIT
[14328]21LT_LIB_M
[2400]22
[7739]23if test m4_substr(peer_id_prefix,6,1) = "0"; then
24  supported_build=yes
[9047]25  CPPFLAGS="$CPPFLAGS -DNDEBUG"
[7739]26else
[7726]27  supported_build=no
[7918]28  if test "x$GCC" = "xyes" ; then
29    CFLAGS="$CFLAGS -g -O0"
30    CXXFLAGS="$CXXFLAGS -g -O0"
31  fi
[6532]32fi
[7726]33AM_CONDITIONAL(TR_UNSTABLE, test "x$supported_build" = "xno")
[14515]34AM_CONDITIONAL(HAVE_REVISION_FILE, test -f REVISION)
[6532]35
[10133]36##
37##
38##   MANDATORY for everything
39##
40##
[14436]41
[10339]42CURL_MINIMUM=7.15.4
[9926]43AC_SUBST(CURL_MINIMUM)
[11548]44LIBEVENT_MINIMUM=2.0.10
[13985]45AC_SUBST(LIBEVENT_MINIMUM)
[14324]46ZLIB_MINIMUM=1.2.3
[14323]47AC_SUBST(ZLIB_MINIMUM)
[9926]48
[14436]49# crypto backends
[14575]50OPENSSL_MINIMUM=0.9.7
[14436]51AC_SUBST(OPENSSL_MINIMUM)
52CYASSL_MINIMUM=3.0
53AC_SUBST(CYASSL_MINIMUM)
[14443]54POLARSSL_MINIMUM=0x01020000 # 1.2
[14441]55AC_SUBST(POLARSSL_MINIMUM)
[14436]56
[10133]57##
58##
59##   MANDATORY for the GTK+ client
60##
61##
[12964]62
[13441]63GTK_MINIMUM=3.4.0
[13388]64AC_SUBST(GTK_MINIMUM)
65GLIB_MINIMUM=2.32.0
[12638]66AC_SUBST(GLIB_MINIMUM)
67GIO_MINIMUM=2.26.0
68AC_SUBST(GIO_MINIMUM)
[9926]69
[10133]70##
71##
72##   OPTIONAL for the GTK+ client
73##
74##
[12638]75
[10133]76# create the tray icon with AppIndicator
[13290]77LIBAPPINDICATOR_MINIMUM=0.4.90
[12643]78AC_SUBST(LIBAPPINDICATOR_MINIMUM)
[2400]79
[9926]80
[2400]81AC_PROG_CC
82AC_PROG_CXX
[7575]83AC_C_INLINE
[2755]84if test "x$GCC" = "xyes" ; then
[7784]85
[14363]86    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"
[7784]87
88    dnl figure out gcc version
89    AC_MSG_CHECKING([gcc version])
90    GCC_VERSION=`$CC -dumpversion`
91    GCC_MAJOR=`echo $GCC_VERSION | cut -d . -f1`
92    GCC_MINOR=`echo $GCC_VERSION | cut -d . -f2`
93    GCC_VERSION_NUM=`(expr $GCC_MAJOR "*" 100 + $GCC_MINOR) 2>/dev/null`
94
95    AC_MSG_RESULT($GCC_VERSION)
96    if test $GCC_VERSION_NUM -ge 304; then
97        dnl these were added in 3.4
[14520]98        CFLAGS="$CFLAGS -Wextra -Winit-self"
[7784]99    fi
[11290]100    if test $GCC_VERSION_NUM -ge 403; then
101        dnl these were added in 4.3
102        CFLAGS="$CFLAGS -Wvariadic-macros"
103    fi
[2755]104fi
[6532]105
[2400]106AC_HEADER_STDC
107AC_HEADER_TIME
[7098]108
[14645]109AC_CHECK_HEADERS([stdbool.h xlocale.h])
[14678]110AC_CHECK_FUNCS([iconv 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 uselocale _configthreadlocale])
[2400]111AC_PROG_INSTALL
112AC_PROG_MAKE_SET
113ACX_PTHREAD
114
[8887]115if test "x$ac_cv_func_strtold" != "xyes" ; then
116    CPPFLAGS="$CPPFLAGS -Dstrtold=strtod"
117fi
118
[8790]119AC_SEARCH_LIBS(cos, [m])
[2421]120AC_SEARCH_LIBS([socket], [socket net])
121AC_SEARCH_LIBS([gethostbyname], [nsl bind])
[14259]122AC_SEARCH_LIBS([quotacursor_skipidtype], [quota])
[5680]123PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM])
[11548]124PKG_CHECK_MODULES(LIBEVENT, [libevent >= $LIBEVENT_MINIMUM])
[14323]125PKG_CHECK_MODULES(ZLIB, [zlib >= $ZLIB_MINIMUM])
[2400]126
[14436]127
128AC_ARG_WITH([crypto], AS_HELP_STRING([--with-crypto=PKG],
[14441]129            [Use specified crypto library: auto (default), openssl, cyassl, polarssl]),
[14436]130            [want_crypto=$withval], [want_crypto=auto])
131
132AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xopenssl"], [
133    PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM],
134        [want_crypto="openssl"; CRYPTO_PKG="openssl"; CRYPTO_CFLAGS="$OPENSSL_CFLAGS"; CRYPTO_LIBS="$OPENSSL_LIBS"],
135        [AS_IF([test "x$want_crypto" = "xopenssl"],
136            [AC_MSG_ERROR([OpenSSL support requested, but library not found.])]
137        )]
138    )
139])
140AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xcyassl"], [
[14478]141    PKG_CHECK_MODULES(WOLFSSL, [wolfssl >= $CYASSL_MINIMUM],
142        [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$WOLFSSL_CFLAGS"; CRYPTO_LIBS="$WOLFSSL_LIBS"],
143        [PKG_CHECK_MODULES(CYASSL, [cyassl >= $CYASSL_MINIMUM],
144            [want_crypto="cyassl"; CRYPTO_PKG="cyassl"; CRYPTO_CFLAGS="$CYASSL_CFLAGS"; CRYPTO_LIBS="$CYASSL_LIBS"],
145            [AS_IF([test "x$want_crypto" = "xcyassl"],
146                [AC_MSG_ERROR([CyaSSL support requested, but library not found.])]
147            )]
[14436]148        )]
149    )
150])
[14441]151AS_IF([test "x$want_crypto" = "xauto" -o "x$want_crypto" = "xpolarssl"], [
152    AC_CHECK_HEADER([polarssl/version.h],
153        [AC_EGREP_CPP([version_ok], [#include <polarssl/version.h>
154                                     #if defined (POLARSSL_VERSION_NUMBER) && POLARSSL_VERSION_NUMBER >= $POLARSSL_MINIMUM
155                                     version_ok
156                                     #endif],
[14444]157            [AC_CHECK_LIB([polarssl], [dhm_calc_secret],
[14441]158                [want_crypto="polarssl"; CRYPTO_PKG="polarssl"; CRYPTO_CFLAGS=""; CRYPTO_LIBS="-lpolarssl"],
159                [AS_IF([test "x$want_crypto" = "xpolarssl"],
160                    [AC_MSG_ERROR([PolarSSL support requested, but library not found.])]
161                )]
162            )],
163            [AS_IF([test "x$want_crypto" = "xpolarssl"],
164                [AC_MSG_ERROR([PolarSSL support requested, but version not suitable.])]
165            )]
166        )],
167        [AS_IF([test "x$want_crypto" = "xpolarssl"],
168            [AC_MSG_ERROR([PolarSSL support requested, but headers not found.])]
169        )]
170    )
171])
[14436]172# we should have found the library by now
173AS_IF([test "x$CRYPTO_PKG" = "x"], [
174    AS_IF([test "x$want_crypto" = "xauto"],
175        [AC_MSG_ERROR([Unable to find any supported crypto library.])],
176        [AC_MSG_ERROR([Requested crypto library "$want_crypto" is not supported.])],
177    )
178])
179
[14459]180AM_CONDITIONAL([CRYPTO_USE_OPENSSL],[test "x$CRYPTO_PKG" = "xopenssl"])
181AM_CONDITIONAL([CRYPTO_USE_CYASSL],[test "x$CRYPTO_PKG" = "xcyassl"])
182AM_CONDITIONAL([CRYPTO_USE_POLARSSL],[test "x$CRYPTO_PKG" = "xpolarssl"])
[14436]183AC_SUBST(CRYPTO_PKG)
184AC_SUBST(CRYPTO_CFLAGS)
185AC_SUBST(CRYPTO_LIBS)
186
187
[3636]188AC_SYS_LARGEFILE
189
[13696]190AC_FUNC_GETMNTENT
[7798]191
[2400]192dnl ----------------------------------------------------------------------------
193dnl
[7798]194dnl posix_fadvise
195
196dnl can posix_fadvise be used
197AC_CHECK_DECLS(posix_fadvise, [], [], [
198#define _XOPEN_SOURCE 600
199#include <fcntl.h>])
200AC_CHECK_FUNCS([posix_fadvise])
201
202
203dnl ----------------------------------------------------------------------------
204dnl
[7979]205dnl file monitoring for the daemon
206
[13191]207AC_ARG_WITH([inotify],
[14651]208            [AS_HELP_STRING([--with-inotify], [Enable inotify support (default=auto)])],
209            [WANT_INOTIFY=${withval}],
210            [WANT_INOTIFY=auto])
211HAVE_INOTIFY=0
212AS_IF([test "x$WANT_INOTIFY" != "xno"],
213      [AC_CHECK_HEADER([sys/inotify.h],
214                       [AC_CHECK_FUNC([inotify_init],
215                                      [HAVE_INOTIFY=1])],
216                       [AS_IF([test "x$WANT_INOTIFY" = "xyes"],
217                              [AC_MSG_ERROR("inotify not found!")])])])
218AM_CONDITIONAL([USE_INOTIFY], [test "x$WANT_INOTIFY" != "xno" -a $HAVE_INOTIFY -eq 1])
[7979]219
[13191]220AC_ARG_WITH([kqueue],
221            [AS_HELP_STRING([--with-kqueue],[Enable kqueue support (default=auto)])],
[14660]222            [WANT_KQUEUE=${withval}],
223            [WANT_KQUEUE=auto])
[14651]224HAVE_KQUEUE=0
[14660]225AS_IF([test "x$WANT_KQUEUE" != "xno"],
[14651]226      [AC_CHECK_HEADER([sys/event.h],
227                       [AC_CHECK_FUNC([kqueue],
228                                      [HAVE_KQUEUE=1])],
229                       [AS_IF([test "x$WANT_KQUEUE" = "xyes"],
230                              [AC_MSG_ERROR("kqueue not found!")])])])
[14660]231AM_CONDITIONAL([USE_KQUEUE], [test "x$WANT_KQUEUE" != "xno" -a $HAVE_KQUEUE -eq 1])
[13191]232
[14651]233
[11627]234AC_CHECK_HEADERS([sys/statvfs.h \
235                  xfs/xfs.h])
[7979]236
[8142]237
[7979]238dnl ----------------------------------------------------------------------------
239dnl
[14084]240dnl file monitoring for the daemon
241
242# Check whether to enable systemd startup notification.
[14733]243# This requires libsystemd.
244AC_ARG_WITH([systemd], AS_HELP_STRING([--with-systemd],
[14250]245            [Add support for systemd startup notification (default is autodetected)]),
[14733]246            [USE_SYSTEMD=$withval], [USE_SYSTEMD=auto])
247AS_IF([test "x$USE_SYSTEMD" != "xno"], [
248    PKG_CHECK_MODULES([SYSTEMD], [libsystemd],
249        [AC_DEFINE(USE_SYSTEMD,1,[Use systemd startup notification])],
250        [AS_IF([test "x$USE_SYSTEMD" = "xyes"],
251            [AC_MSG_ERROR([systemd startup notification support requested, but libsystemd not found.])]
[14084]252        )]
253    )
254])
255
256
257dnl ----------------------------------------------------------------------------
258dnl
[8719]259dnl  dht
260
[9522]261DHT_CFLAGS="-I\$(top_srcdir)/third-party/dht"
262DHT_LIBS="\$(top_builddir)/third-party/dht/libdht.a"
[14409]263DHT_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/dht/libdht.a"
[14410]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"])
[8719]278AC_SUBST(DHT_CFLAGS)
279AC_SUBST(DHT_LIBS)
[14409]280AC_SUBST(DHT_LIBS_QT)
[8719]281
282
283dnl ----------------------------------------------------------------------------
284dnl
[14422]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
[14429]296    LIBB64_CFLAGS="-DUSE_SYSTEM_B64"
[14422]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
[11920]310dnl  utp
311
[12064]312AC_CHECK_LIB([rt],
313             [clock_gettime],
314             [libutp_extra_libs="-lrt"],
315             [libutp_extra_libs=""])
316
[12040]317AC_MSG_CHECKING([µTP])
318build_utp="no"
[14407]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)
[14408]328LIBS="$ac_save_LIBS"
[14407]329
[14408]330if test "x$have_utp" = "xyes" -o "x$CXX" != "x"; then
331    want_utp_default="yes"
332else
333    want_utp_default="no"
334fi
335
[11960]336AC_ARG_ENABLE([utp],
337              AS_HELP_STRING([--enable-utp],[build µTP support]),
[12040]338              [want_utp=${enableval}],
[14408]339              [want_utp=${want_utp_default}])
[14407]340if test "x$want_utp" = "xyes"; then
[13191]341    if test "x$have_utp" = "xyes"; then
[14407]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
[12040]349        LIBUTP_CFLAGS="-I\$(top_srcdir)/third-party/"
[12374]350        LIBUTP_LIBS="\$(top_builddir)/third-party/libutp/libutp.a"
[13200]351        LIBUTP_LIBS_QT="\$\${TRANSMISSION_TOP}/third-party/libutp/libutp.a"
[12957]352        if test "x$libutp_extra_libs" != "x" ; then
353            LIBUTP_LIBS="$LIBUTP_LIBS $libutp_extra_libs"
[13200]354            LIBUTP_LIBS_QT="$LIBUTP_LIBS_QT $libutp_extra_libs"
[12957]355        fi
[12040]356        AC_DEFINE([WITH_UTP],[1])
357        build_utp="yes"
[13191]358    else
359      AC_MSG_ERROR("Unable to build uTP support -- C++ compiler not found")
360    fi
361fi
[11920]362AC_SUBST(LIBUTP_CFLAGS)
363AC_SUBST(LIBUTP_LIBS)
[13200]364AC_SUBST(LIBUTP_LIBS_QT)
[11960]365AM_CONDITIONAL([BUILD_UTP],[test "x$build_utp" = "xyes"])
[12040]366AC_MSG_RESULT([$build_utp])
[11920]367
368
[12957]369dnl
370dnl  look for preinstalled miniupnpc...
371dnl
372
[13191]373ac_save_LIBS="$LIBS"
374LIBS="-lminiupnpc"
[14262]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([[
[13191]406    #include <stdlib.h>
[14262]407    #include <errno.h>
[13191]408    #include <miniupnpc/miniupnpc.h>
409    #include <miniupnpc/upnpcommands.h>
[14262]410  ]], [[
[13191]411    struct UPNPDev * devlist;
[14262]412    struct UPNPUrls urls;
413    struct IGDdatas data;
[13191]414    char lanaddr[16];
415    char portStr[8];
416    char intPort[8];
417    char intClient[16];
[14262]418    upnpDiscover( 2000, NULL, NULL, 0, 0, &errno );
[13191]419    UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
420    UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
[14262]421                        portStr, "TCP", intClient, intPort, NULL, NULL, NULL );
422  ]])],[
[14271]423  AC_DEFINE(MINIUPNPC_API_VERSION, 8, [miniupnpc 1.6 has API version 8])
[14262]424  upnp_version="1.6"])
425fi
[13191]426
[14262]427dnl Or maybe it's miniupnp 1.5
428if test "x$upnp_version" = "xunknown" ; then
429  AC_LINK_IFELSE([AC_LANG_PROGRAM([[
[13191]430    #include <stdlib.h>
431    #include <miniupnpc/miniupnpc.h>
432    #include <miniupnpc/upnpcommands.h>
[14262]433  ]], [[
[13191]434    struct UPNPDev * devlist;
[14262]435    struct UPNPUrls urls;
436    struct IGDdatas data;
[13191]437    char lanaddr[16];
438    char portStr[8];
439    char intPort[8];
440    char intClient[16];
[14262]441    upnpDiscover( 2000, NULL, NULL, 0 );
[13191]442    UPNP_GetValidIGD( devlist, &urls, &data, lanaddr, sizeof( lanaddr ) );
443    UPNP_GetSpecificPortMappingEntry( urls.controlURL, data.first.servicetype,
[14262]444                        portStr, "TCP", intClient, intPort );
445  ]])],[
[14271]446  AC_DEFINE(MINIUPNPC_API_VERSION, 5, [miniupnpc 1.5 has API version 5])
[14262]447  upnp_version="1.5"])
448fi
[12957]449
450# ... and the results of our tests
[13191]451LIBS="$ac_save_LIBS"
[12957]452AC_MSG_RESULT([$upnp_version])
[13191]453AM_CONDITIONAL([BUILD_MINIUPNP],[test "x$upnp_version" = "xnone"])
[12957]454if test "x$upnp_version" = "xnone" ; then
[13191]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"
[12957]458else
[13191]459    AC_DEFINE([SYSTEM_MINIUPNP])
460    LIBUPNP_CFLAGS=""
461    LIBUPNP_LIBS="-lminiupnpc"
462    LIBUPNP_LIBS_QT="-lminiupnpc"
[12957]463fi
[13191]464AC_SUBST(LIBUPNP_CFLAGS)
465AC_SUBST(LIBUPNP_LIBS)
466AC_SUBST(LIBUPNP_LIBS_QT)
[12957]467
468
[13199]469 
470
[11920]471dnl ----------------------------------------------------------------------------
472dnl
[13199]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
[2431]498dnl  detection for the GTK+ client
[2400]499
[13191]500AC_ARG_ENABLE([nls],
[12964]501              [AS_HELP_STRING([--enable-nls],[enable native language support])],,
502              [enable_nls=yes])
[13394]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])
[13517]510AC_ARG_WITH([gtk], AS_HELP_STRING([--with-gtk],[with Gtk]),
[13388]511            [with_gtk=$withval],
[13394]512            [with_gtk=$have_gtk])
[12964]513AM_CONDITIONAL([BUILD_GTK],[test "x$with_gtk" = "xyes"])
[10133]514use_libappindicator=no
[12964]515if test "x$with_gtk" = "xyes" ; then
516
517    if test "x$enable_nls" = "xno" ; then
[13079]518        AC_MSG_ERROR("The gtk client cannot be built without nls support.  Try adding either --enable-nls or --without-gtk" )
[12964]519    fi
[2400]520
[13388]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])
[10436]530    if test "x$have_libappindicator" = "xyes"; then
[12964]531        use_libappindicator=yes
[13191]532        AC_DEFINE([HAVE_LIBAPPINDICATOR], 1)
[12964]533    else
534        LIBAPPINDICATOR_CFLAGS=
535        LIBAPPINDICATOR_LIBS=
[10133]536    fi
[5605]537fi
538
[8736]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.
[8744]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
[7258]549use_nls=no
550if test "x$enable_nls" = "xyes" ; then
551    use_nls=yes
[13193]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.")])
[7258]555    AC_CHECK_HEADERS([libintl.h])
[11121]556    GETTEXT_PACKAGE=transmission-gtk
[7258]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
[10290]563AC_SUBST(INTLLIBS)
[4650]564
[2400]565
566dnl ----------------------------------------------------------------------------
567dnl
568dnl  platform-specific stuff.
569
570AC_CANONICAL_HOST
[4650]571have_darwin="no"
572have_msw="no"
[2400]573case $host_os in
574
[8887]575   *mingw32*)
[4650]576     have_msw="yes"
[2400]577     CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows"
[14382]578     CPPFLAGS="$CPPFLAGS -DWINVER=0x0600 -D_WIN32_WINNT=0x0600 -DWIN32_LEAN_AND_MEAN"
[14383]579     # CPPFLAGS="$CPPFLAGS -D__USE_MINGW_ANSI_STDIO=1 -D__STDC_FORMAT_MACROS=1"
[10816]580     LIBS="$LIBS -liphlpapi -lshell32 -lws2_32"
[2400]581     transmissionlocaledir="locale"
582     if test -z "$host_alias"; then
583       hostaliaswindres=
584     else
585       hostaliaswindres="$host_alias-windres";
586     fi
[6726]587     AC_CHECK_TOOL(WINDRES, windres)
[2400]588     ;;
589
[2418]590  *darwin*)
[4650]591    have_darwin="yes"
[2400]592    ;;
593
594esac
595
[11775]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"])
[13191]600if test "x$enable_lightweight" = "xyes" ; then
[11775]601  AC_DEFINE([TR_LIGHTWEIGHT],[1],[optimize libtransmission for low-resource systems])
[13191]602fi
[11775]603
[4650]604AC_ARG_ENABLE([cli],
[7418]605              [AS_HELP_STRING([--enable-cli],[build command-line client])],
[4650]606              [build_cli=${enableval}],
[14659]607              [build_cli="no"])
[4650]608AM_CONDITIONAL([BUILD_CLI],[test "x$build_cli" = "xyes"])
609
[6539]610AC_ARG_ENABLE([mac],
[8820]611              [AS_HELP_STRING([--enable-mac],[build Mac client])],
[6539]612              [build_mac=${enableval}],
613              [build_mac=${have_darwin}])
614AM_CONDITIONAL([BUILD_MAC],[test "x$build_mac" = "xyes"])
[4650]615
616AC_ARG_ENABLE([daemon],
[7418]617              [AS_HELP_STRING([--enable-daemon],[build daemon])],
[4650]618              [build_daemon=${enableval}],
619              [build_daemon="yes"])
620AM_CONDITIONAL([BUILD_DAEMON],[test "x$build_daemon" = "xyes"])
621
622
[10046]623if test "x$build_mac" = "xyes" ; then
[14214]624   AC_DEFINE([BUILD_MAC_CLIENT], 1)
[10046]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
[6713]639AM_CONDITIONAL(WIN32, test "x$have_msw" = "xyes")
[4650]640
[2400]641dnl ----------------------------------------------------------------------------
642dnl
643dnl  Generate the output
644
645AC_CONFIG_FILES([Makefile
[11121]646                 transmission-gtk.spec
[2400]647                 cli/Makefile
648                 daemon/Makefile
[11093]649                 extras/Makefile
[2400]650                 libtransmission/Makefile
[10783]651                 utils/Makefile
[2749]652                 third-party/Makefile
[12962]653                 third-party/dht/Makefile
[14422]654                 third-party/libb64/Makefile
[12962]655                 third-party/libutp/Makefile
[4092]656                 third-party/libnatpmp/Makefile
[12962]657                 third-party/miniupnp/Makefile
[2400]658                 macosx/Makefile
[3685]659                 gtk/Makefile
[4967]660                 gtk/icons/Makefile
[13200]661                 qt/config.pri
[9773]662                 web/Makefile
663                 web/images/Makefile
[12983]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
[9773]670                 web/javascript/Makefile
671                 web/javascript/jquery/Makefile
[3685]672                 po/Makefile.in])
[2400]673
674AC_OUTPUT
675
676echo "
677
678Configuration:
679
[10386]680   Source code location:                              ${srcdir}
681   Compiler:                                          ${CXX}
[2400]682
[11775]683   Build libtransmission:                             yes
684      * optimized for low-resource systems:           ${enable_lightweight}
[11960]685      * µTP enabled:                                  ${build_utp}
[14436]686      * crypto library:                               ${CRYPTO_PKG}
[11775]687
[10386]688   Build Command-Line client:                         ${build_cli}
[8600]689
[13388]690   Build GTK+ client:                                 ${with_gtk}
[10688]691      * libappindicator for an Ubuntu-style tray:     ${use_libappindicator}
[10204]692
[10386]693   Build Daemon:                                      ${build_daemon}
694
695   Build Mac client:                                  ${build_mac}
696
[2400]697"
Note: See TracBrowser for help on using the repository browser.