source: trunk/configure.ac @ 5605

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

(gtk) #307: inhibit/prevent hibernation when downloading

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