source: branches/0.9x/configure.ac @ 3627

Last change on this file since 3627 was 3627, checked in by charles, 15 years ago

bump 0.9x branch to 0.91

File size: 6.4 KB
Line 
1AC_INIT([transmission],[0.91],[http://transmission.m0k.org/trac/newticket])
2
3dnl constraint: strlen(MAJOR MINOR MAINT BETA) must be 4
4dnl convention: BETA: "Z" for a beta, "0" for a stable
5PEERID_PREFIX="-TR0910-"
6USERAGENT_PREFIX="0.91"
7AC_SUBST(PEERID_PREFIX,[$PEERID_PREFIX])
8AC_SUBST(USERAGENT_PREFIX,[$USERAGENT_PREFIX])
9
10AC_PREREQ(2.54)
11dnl AM_CONFIG_HEADER(config.h)
12AC_CONFIG_SRCDIR(libtransmission/transmission.h)
13AM_INIT_AUTOMAKE([1.9 tar-ustar])
14AC_PROG_LIBTOOL
15
16GLIB_MINIMUM=2.6.0
17GTK_MINIMUM=2.6.0
18WX_MINIMUM=2.6.0
19AC_SUBST(GLIB_MINIMUM)
20AC_SUBST(GTK_MINIMUM)
21AC_SUBST(WX_MINIMUM)
22
23AC_PROG_CC
24AC_PROG_CXX
25if test "x$GCC" = "xyes" ; then
26    CFLAGS="-g -Wall -W -O3 -funroll-loops"
27    CXXFLAGS="-g -Wall -W -O3 -funroll-loops"
28fi
29AC_HEADER_STDC
30AC_HEADER_TIME
31AC_CHECK_FUNCS([lrintf strlcpy strlcat daemon dirname basename])
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.8])
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
92if test "x$use_gtk" = "xyes"; then
93    IT_PROG_INTLTOOL([0.23],[no-xml])
94    GETTEXT_PACKAGE=transmission
95    AC_SUBST(GETTEXT_PACKAGE)
96    AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
97    AM_GLIB_GNU_GETTEXT
98    transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
99    AC_SUBST(transmissionlocaledir)
100fi
101
102dnl ----------------------------------------------------------------------------
103dnl
104dnl  wxWidgets detection for the wxWidgets client
105
106
107AM_OPTIONS_WXCONFIG
108AM_PATH_WXCONFIG($WX_MINIMUM,[have_wx=yes],[have_wx=no])
109AC_ARG_WITH(wx, AC_HELP_STRING([--with-wx], [Build wxWidgets client]),
110                [want_wx=$withval],
111                [want_wx=no])
112dnl                [want_wx=$have_wx])
113use_wx=no
114if test "x$want_wx" = "xyes" ; then
115    if test "x$have_wx" = "xyes"; then
116      use_wx=yes
117    else
118      AC_MSG_ERROR("wxWidgets not found!")
119    fi
120fi
121AM_CONDITIONAL([HAVE_WX],[test "x$use_wx" = "xyes"])
122
123
124
125dnl ----------------------------------------------------------------------------
126dnl
127dnl  platform-specific stuff.
128
129AC_CANONICAL_HOST
130beos="no"
131darwin="no"
132msw="no"
133case $host_os in
134
135   *cygwin|*mingw32*)
136     msw="yes"
137     CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows"
138     CPPFLAGS="$CPPFLAGS -DWIN32 -DWIN32_LEAN_AND_MEAN"
139     LIBS="$LIBS -lshell32 -lws2_32"
140     transmissionlocaledir="locale"
141     if test -z "$host_alias"; then
142       hostaliaswindres=
143     else
144       hostaliaswindres="$host_alias-windres";
145     fi
146     AC_PATH_PROGS([WINDRES], [windres $hostaliaswindres $host_os-windres])
147     if test "x$WINDRES" = "x"; then
148       AC_MSG_ERROR([windres could not be found within your path.])
149     fi
150     AC_SUBST(WINDRES)
151     ;;
152
153  *beos*)
154    beos="yes"
155    RELEASE=`uname -r`
156    case $RELEASE in
157      6.*|5.0.4) # Zeta or R5 / BONE beta 7
158        ;;
159      5.0*)       # R5 / net_server
160        CPPFLAGS="$CPPFLAGS -DBEOS_NETSERVER"
161        ;;
162      *)
163        AC_MSG_ERROR("Unsupported BeOS version")
164        ;;
165    esac
166    GCCVER=`$CC -dumpversion`
167    case $GCCVER in
168      2.95.3*|3*|4*)
169        ;;
170      2.9*)
171        BEOS_OLDCC=yes
172        ;;
173      *)
174        AC_MSG_ERROR("Unsupported gcc version")
175        ;;
176    esac
177    ;;
178
179  *darwin*)
180    darwin="yes"
181    # Make sure the Universal SDK is installed
182    if test ! -d /Developer/SDKs/MacOSX10.4u.sdk; then
183      cat << EOF
184You need to install the Universal SDK in order to build Transmission:
185  Get your Xcode CD or package
186  Restart the install
187  When it gets to "Installation Type", select "Customize"
188  Select "Mac OS X 10.4 (Universal) SDK" under "Cross Development"
189  Finish the install.
190EOF
191      exit 1
192    fi
193    ;;
194
195esac
196AM_CONDITIONAL([HAVE_BEOS],[test "x$beos" = "xyes"])
197AM_CONDITIONAL([HAVE_DARWIN],[test "x$darwin" = "xyes"])
198AM_CONDITIONAL([HAVE_WINDOWS],[test "x$msw" = "xyes"])
199
200
201dnl ----------------------------------------------------------------------------
202dnl
203dnl  Generate the output
204
205AC_CONFIG_FILES([Makefile
206                 transmission.spec
207                 beos/Makefile
208                 cli/Makefile
209                 daemon/Makefile
210                 libtransmission/Makefile
211                 third-party/Makefile
212                 macosx/Makefile
213                 wx/Makefile
214                 wx/images/Makefile])
215
216if test "x$use_gtk" = "xyes"; then
217    AC_CONFIG_FILES([gtk/Makefile
218                     po/Makefile.in])
219fi
220
221ac_configure_args="$ac_configure_args --enable-static --disable-shared -q"
222AC_OUTPUT
223
224echo "
225
226Configuration:
227
228        Source code location:    ${srcdir}
229        Compiler:                ${CXX}
230        Build libtransmission:   yes
231        Build Daemon:            yes
232        Build BeOS client:       ${beos}
233        Build GTK+ client:       ${use_gtk}
234        Build OS X client:       ${darwin}
235        Build wxWidgets client:  ${use_wx}
236
237"
Note: See TracBrowser for help on using the repository browser.