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

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

fix the "./configure --without-gtk" --> "po/Makefile is not ready" issue (#389)

File size: 6.3 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
95IT_PROG_INTLTOOL([0.23],[no-xml])
96GETTEXT_PACKAGE=transmission
97AC_SUBST(GETTEXT_PACKAGE)
98AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
99AM_GLIB_GNU_GETTEXT
100transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
101AC_SUBST(transmissionlocaledir)
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                 gtk/Makefile
217                 po/Makefile.in])
218
219ac_configure_args="$ac_configure_args --enable-static --disable-shared -q"
220AC_OUTPUT
221
222echo "
223
224Configuration:
225
226        Source code location:    ${srcdir}
227        Compiler:                ${CXX}
228        Build libtransmission:   yes
229        Build Daemon:            yes
230        Build BeOS client:       ${beos}
231        Build GTK+ client:       ${use_gtk}
232        Build OS X client:       ${darwin}
233        Build wxWidgets client:  ${use_wx}
234
235"
Note: See TracBrowser for help on using the repository browser.