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

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

compatability with older C copmilers (ticket #422, patch by fizz)

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