source: trunk/configure.ac @ 5100

Last change on this file since 5100 was 5100, checked in by charles, 14 years ago

(gtk) added optional libnotify support to gtk client. (wereHamster, charles)

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