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

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

"corruption" fix part 3: cleanup. remove unneeded possible points of failure.

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