source: trunk/configure.ac @ 6726

Last change on this file since 6726 was 6726, checked in by muks, 13 years ago

(win32) Add application icon as a resource

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