source: trunk/configure.ac @ 3536

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

don't require the user to have svn installed when building from tarball

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