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