source: trunk/configure.ac @ 4629

Last change on this file since 4629 was 4629, checked in by livings124, 14 years ago

update version

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