source: trunk/configure.ac @ 5694

Last change on this file since 5694 was 5694, checked in by charles, 13 years ago

lower the minimum requirement for libcurl

File size: 8.9 KB
Line 
1AC_INIT([transmission],[1.11Z],[http://trac.transmissionbt.com/newticket])
2PEERID_PREFIX="-TR111Z-"
3USERAGENT_PREFIX="1.11+"
4AC_SUBST(PEERID_PREFIX,[$PEERID_PREFIX])
5AC_SUBST(USERAGENT_PREFIX,[$USERAGENT_PREFIX])
6
7AC_PREREQ(2.54)
8dnl AM_CONFIG_HEADER(config.h)
9AC_CONFIG_SRCDIR(libtransmission/transmission.h)
10AM_INIT_AUTOMAKE([1.9 tar-ustar])
11AC_PROG_LIBTOOL
12
13OPENSSL_MINIMUM=0.9.4
14CURL_MINIMUM=7.15.0
15GIO_MINIMUM=2.15.5
16GLIB_MINIMUM=2.6.0
17GTK_MINIMUM=2.6.0
18WX_MINIMUM=2.6.0
19LIBNOTIFY_MINIMUM=0.4.4
20DBUS_GLIB_MINIMUM=0.70
21AC_SUBST(CURL_MINIMUM)
22AC_SUBST(GIO_MINIMUM)
23AC_SUBST(GLIB_MINIMUM)
24AC_SUBST(GTK_MINIMUM)
25AC_SUBST(WX_MINIMUM)
26AC_SUBST(LIBNOTIFY_MINIMUM)
27AC_SUBST(DBUS_GLIB_MINIMUM)
28
29AC_PROG_CC
30AC_PROG_CXX
31if test "x$GCC" = "xyes" ; then
32    CFLAGS="-g -Wall -W -O3 -funroll-loops"
33    CXXFLAGS="-g -Wall -W -O3 -funroll-loops"
34fi
35AC_HEADER_STDC
36AC_HEADER_TIME
37AC_CHECK_FUNCS([lrintf strlcpy strlcat daemon dirname basename])
38AC_CHECK_SIZEOF([void*])
39AC_PROG_INSTALL
40AC_PROG_MAKE_SET
41AC_PROG_RANLIB
42ACX_PTHREAD
43
44AC_SEARCH_LIBS([socket], [socket net])
45AC_SEARCH_LIBS([gethostbyname], [nsl bind])
46PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM])
47PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM])
48
49AC_SYS_LARGEFILE
50
51dnl ----------------------------------------------------------------------------
52dnl
53dnl va_copy
54
55AC_MSG_CHECKING([how to copy va_list])
56AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
57    AC_MSG_RESULT([va_copy]),
58        [ AH_TEMPLATE([va_copy], [define if va_copy is not available])
59        AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
60        [ AC_DEFINE([va_copy], [__va_copy])
61        AC_MSG_RESULT([__va_copy])],
62        [ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
63        AC_MSG_RESULT([memcpy])]
64    )
65])
66
67
68dnl ----------------------------------------------------------------------------
69dnl
70dnl  libevent fun
71
72AC_CONFIG_SUBDIRS([third-party/libevent])
73AC_MSG_NOTICE([invoking libevent's configure script])
74LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent"
75AC_SUBST(LIBEVENT_CPPFLAGS)
76
77
78dnl ----------------------------------------------------------------------------
79dnl
80dnl  detection for the GTK+ client
81
82PKG_CHECK_MODULES(GTK,
83                  [gtk+-2.0 >= $GTK_MINIMUM
84                   glib-2.0 >= $GLIB_MINIMUM
85                   gmodule-2.0 >= $GLIB_MINIMUM
86                   gthread-2.0 >= $GLIB_MINIMUM],
87                  [have_gtk=yes],
88                  [have_gtk=no])
89AC_ARG_ENABLE([gtk],
90              AC_HELP_STRING([--enable-gtk],[build gtk client]),
91              [want_gtk=${enableval}],
92              [want_gtk=${have_gtk}])
93build_gtk=no
94if test "x$want_gtk" = "xyes" ; then
95    if test "x$have_gtk" = "xyes"; then
96      build_gtk=yes
97    else
98      AC_MSG_ERROR("GTK+ not found!")
99    fi
100fi
101AM_CONDITIONAL([BUILD_GTK],[test "x$build_gtk" = "xyes"])
102AC_SUBST(GTK_LIBS)
103AC_SUBST(GTK_CFLAGS)
104
105PKG_CHECK_MODULES([GIO],
106                  [gio-2.0 >= $GIO_MINIMUM],
107                  [use_gio=yes],
108                  [use_gio=no])
109AC_SUBST(GIO_LIBS)
110AC_SUBST(GIO_CFLAGS)
111if test "x$use_gio" = "xyes"; then
112    AC_DEFINE([HAVE_GIO], 1)
113fi
114
115PKG_CHECK_MODULES([LIBNOTIFY],
116                  [libnotify >= $LIBNOTIFY_MINIMUM],
117                  [have_libnotify=yes],
118                  [have_libnotify=no])
119AC_ARG_ENABLE([libnotify],
120              AS_HELP_STRING([--enable-libnotify],[enable notifications]),,
121              [enable_libnotify=yes])
122use_libnotify=no
123if test "x$enable_libnotify" = "xyes" ; then
124    if test "x$have_libnotify" = "xyes"; then
125        use_libnotify=yes
126        AC_SUBST(LIBNOTIFY_LIBS)
127        AC_SUBST(LIBNOTIFY_CFLAGS)
128        AC_DEFINE([HAVE_LIBNOTIFY], 1)
129    fi
130fi
131
132PKG_CHECK_MODULES([DBUS_GLIB],
133                  [dbus-glib-1 >= $DBUS_GLIB_MINIMUM],
134                  [use_dbus_glib=yes],
135                  [use_dbus_glib=no])
136AC_SUBST(DBUS_GLIB_LIBS)
137AC_SUBST(DBUS_GLIB_CFLAGS)
138if test "x$use_dbus_glib" = "xyes"; then
139    AC_DEFINE([HAVE_DBUS_GLIB], 1)
140fi
141
142AC_CHECK_HEADERS([libintl.h])
143IT_PROG_INTLTOOL([0.23],[no-xml])
144GETTEXT_PACKAGE=transmission
145AC_SUBST(GETTEXT_PACKAGE)
146AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
147AM_GLIB_GNU_GETTEXT
148transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
149AC_SUBST(transmissionlocaledir)
150
151
152dnl ----------------------------------------------------------------------------
153dnl
154dnl  wxWidgets detection for the wxWidgets client
155
156AM_OPTIONS_WXCONFIG
157AM_PATH_WXCONFIG($WX_MINIMUM,[have_wx=yes],[have_wx=no])
158AC_ARG_ENABLE([wx],
159              AC_HELP_STRING([--enable-wx],[build wxWidgets client]),
160              [want_wx=${enableval}],
161              [want_wx=no])
162build_wx=no
163if test "x$want_wx" = "xyes" ; then
164    if test "x$have_wx" = "xyes"; then
165      build_wx=yes
166    else
167      AC_MSG_ERROR("wxWidgets not found!")
168    fi
169fi
170AM_CONDITIONAL([BUILD_WX],[test "x$build_wx" = "xyes"])
171
172
173
174dnl ----------------------------------------------------------------------------
175dnl
176dnl  platform-specific stuff.
177
178AC_CANONICAL_HOST
179have_beos="no"
180have_darwin="no"
181have_msw="no"
182case $host_os in
183
184   *cygwin|*mingw32*)
185     have_msw="yes"
186     CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows"
187     CPPFLAGS="$CPPFLAGS -DWIN32 -DWIN32_LEAN_AND_MEAN"
188     LIBS="$LIBS -lshell32 -lws2_32"
189     transmissionlocaledir="locale"
190     if test -z "$host_alias"; then
191       hostaliaswindres=
192     else
193       hostaliaswindres="$host_alias-windres";
194     fi
195     AC_PATH_PROGS([WINDRES], [windres $hostaliaswindres $host_os-windres])
196     if test "x$WINDRES" = "x"; then
197       AC_MSG_ERROR([windres could not be found within your path.])
198     fi
199     AC_SUBST(WINDRES)
200     ;;
201
202  *beos*)
203    have_beos="yes"
204    RELEASE=`uname -r`
205    case $RELEASE in
206      6.*|5.0.4) # Zeta or R5 / BONE beta 7
207        ;;
208      5.0*)       # R5 / net_server
209        CPPFLAGS="$CPPFLAGS -DBEOS_NETSERVER"
210        ;;
211      *)
212        AC_MSG_ERROR("Unsupported BeOS version")
213        ;;
214    esac
215    GCCVER=`$CC -dumpversion`
216    case $GCCVER in
217      2.95.3*|3*|4*)
218        ;;
219      2.9*)
220        BEOS_OLDCC=yes
221        ;;
222      *)
223        AC_MSG_ERROR("Unsupported gcc version")
224        ;;
225    esac
226    ;;
227
228  *darwin*)
229    have_darwin="yes"
230    # Make sure the Universal SDK is installed
231    if test ! -d /Developer/SDKs/MacOSX10.4u.sdk; then
232      cat << EOF
233You need to install the Universal SDK in order to build Transmission:
234  Get your Xcode CD or package
235  Restart the install
236  When it gets to "Installation Type", select "Customize"
237  Select "Mac OS X 10.4 (Universal) SDK" under "Cross Development"
238  Finish the install.
239EOF
240      exit 1
241    fi
242    ;;
243
244esac
245
246AC_ARG_ENABLE([beos],
247              [AC_HELP_STRING([--enable-beos],[build OS X client])],
248              [build_beos=${enableval}],
249              [build_beos=${have_beos}])
250AM_CONDITIONAL([BUILD_BEOS],[test "x$build_beos" = "xyes"])
251
252AC_ARG_ENABLE([cli],
253              [AC_HELP_STRING([--enable-cli],[build command-line client])],
254              [build_cli=${enableval}],
255              [build_cli="yes"])
256AM_CONDITIONAL([BUILD_CLI],[test "x$build_cli" = "xyes"])
257
258AC_ARG_ENABLE([darwin],
259              [AC_HELP_STRING([--enable-darwin],[build OS X client])],
260              [build_darwin=${enableval}],
261              [build_darwin=${have_darwin}])
262AM_CONDITIONAL([BUILD_DARWIN],[test "x$build_darwin" = "xyes"])
263
264AC_ARG_ENABLE([daemon],
265              [AC_HELP_STRING([--enable-daemon],[build daemon])],
266              [build_daemon=${enableval}],
267              [build_daemon="yes"])
268AM_CONDITIONAL([BUILD_DAEMON],[test "x$build_daemon" = "xyes"])
269
270
271if test "x$have_beos" = "xyes"; then
272    AC_DEFINE([HAVE_BEOS], 1)
273fi
274if test "x$have_darwin" = "xyes"; then
275    AC_DEFINE([HAVE_DARWIN], 1)
276fi
277if test "x$have_msw" = "xyes"; then
278    AC_DEFINE([HAVE_MSW], 1)
279fi
280
281
282dnl ----------------------------------------------------------------------------
283dnl
284dnl  Generate the output
285
286AC_CONFIG_FILES([Makefile
287                 transmission.spec
288                 beos/Makefile
289                 cli/Makefile
290                 daemon/Makefile
291                 libtransmission/Makefile
292                 third-party/Makefile
293                 third-party/miniupnp/Makefile
294                 third-party/libnatpmp/Makefile
295                 macosx/Makefile
296                 wx/Makefile
297                 wx/images/Makefile
298                 gtk/Makefile
299                 gtk/icons/Makefile
300                 po/Makefile.in])
301
302ac_configure_args="$ac_configure_args --enable-static --disable-shared -q"
303AC_OUTPUT
304
305echo "
306
307Configuration:
308
309        Source code location:       ${srcdir}
310        Compiler:                   ${CXX}
311        Build Command-Line client:  ${build_cli}
312        Build Daemon:               ${build_daemon}
313        Build BeOS client:          ${build_beos}
314        Build GTK+ client:          ${build_gtk}
315          ... gio support:          ${use_gio}
316          ... dbus-glib support:    ${use_dbus_glib}
317          ... libnotify support:    ${use_libnotify}
318        Build OS X client:          ${build_darwin}
319        Build wxWidgets client:     ${build_wx}
320
321"
Note: See TracBrowser for help on using the repository browser.