source: trunk/configure.ac @ 5230

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

(gtk) #772, #753: added `watch dir' for automatically adding torrents. delete files to trashcan, rather than unlinking them. These features require 2.15.5 or higher.

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