source: branches/1.5x/configure.ac @ 7885

Last change on this file since 7885 was 7885, checked in by charles, 12 years ago

(1.5x) bump version to 1.50 beta 6

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