source: trunk/configure.ac @ 3523

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

trying to get "make distcheck" to work right

File size: 6.2 KB
Line 
1AC_INIT([transmission],[0.90],[http://transmission.m0k.org/trac/newticket])
2PEERID_PREFIX="-TR0900-"
3USERAGENT_PREFIX="0.90"
4
5AC_PREREQ(2.54)
6dnl AM_CONFIG_HEADER(config.h)
7AC_CONFIG_SRCDIR(libtransmission/transmission.h)
8AM_INIT_AUTOMAKE([1.9 tar-ustar])
9AC_PROG_LIBTOOL
10
11GLIB_MINIMUM=2.6.0
12GTK_MINIMUM=2.6.0
13WX_MINIMUM=2.6.0
14AC_SUBST(GLIB_MINIMUM)
15AC_SUBST(GTK_MINIMUM)
16AC_SUBST(WX_MINIMUM)
17
18AC_PROG_CC
19AC_PROG_CXX
20if test "x$GCC" = "xyes" ; then
21    CFLAGS="-g -Wall -W -O3 -funroll-loops"
22    CXXFLAGS="-g -Wall -W -O3 -funroll-loops"
23fi
24AC_HEADER_STDC
25AC_HEADER_TIME
26AC_CHECK_FUNCS([lrintf strlcpy strlcat daemon dirname basename])
27AC_PROG_INSTALL
28AC_PROG_MAKE_SET
29AC_PROG_RANLIB
30ACX_PTHREAD
31
32AC_CHECK_LIB([crypto],[CRYPTO_new_ex_data])
33AC_CHECK_LIB([ssl],[SSL_library_init])
34AC_SEARCH_LIBS([socket], [socket net])
35AC_SEARCH_LIBS([gethostbyname], [nsl bind])
36
37dnl ----------------------------------------------------------------------------
38dnl
39dnl  libevent fun
40
41AC_CONFIG_SUBDIRS([third-party/libevent])
42AC_MSG_NOTICE([invoking libevent's configure script])
43LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent"
44AC_SUBST(LIBEVENT_CPPFLAGS)
45
46
47dnl ----------------------------------------------------------------------------
48dnl
49dnl  detection for the GTK+ client
50
51have_gtk=yes
52PKG_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])
56AC_ARG_WITH(gtk, AC_HELP_STRING([--with-gtk], [Build gtk client]),
57                 [want_gtk=$withval],
58                 [want_gtk=$have_gtk])
59use_gtk=no
60if 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
66fi
67AM_CONDITIONAL([WITH_GTK],[test "x$use_gtk" = "xyes"])
68AC_SUBST(GTK_LIBS)
69AC_SUBST(GTK_CFLAGS)
70
71if 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)
79fi
80
81dnl ----------------------------------------------------------------------------
82dnl
83dnl  wxWidgets detection for the wxWidgets client
84
85
86AM_OPTIONS_WXCONFIG
87AM_PATH_WXCONFIG($WX_MINIMUM,[have_wx=yes],[have_wx=no])
88AC_ARG_WITH(wx, AC_HELP_STRING([--with-wx], [Build wxWidgets client]),
89                [want_wx=$withval],
90                [want_wx=no])
91dnl                [want_wx=$have_wx])
92use_wx=no
93if 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
99fi
100AM_CONDITIONAL([HAVE_WX],[test "x$use_wx" = "xyes"])
101
102
103
104dnl ----------------------------------------------------------------------------
105dnl
106dnl  platform-specific stuff.
107
108AC_CANONICAL_HOST
109beos="no"
110darwin="no"
111msw="no"
112case $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
163You 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.
169EOF
170      exit 1
171    fi
172    ;;
173
174esac
175AM_CONDITIONAL([HAVE_BEOS],[test "x$beos" = "xyes"])
176AM_CONDITIONAL([HAVE_DARWIN],[test "x$darwin" = "xyes"])
177AM_CONDITIONAL([HAVE_WINDOWS],[test "x$msw" = "xyes"])
178
179
180dnl ----------------------------------------------------------------------------
181dnl
182dnl  Version files
183
184
185dnl constraint: strlen(MAJOR MINOR MAINT BETA) must be 4
186dnl convention: BETA: "Z" for a beta, "0" for a stable
187SVN_REVISION=`svn info . | sed -ne "s/^Revision: \(.*\:\)\{0,1\}\(.*\)$/\2/p"`
188AC_SUBST(PEERID_PREFIX,[$PEERID_PREFIX])
189AC_SUBST(USERAGENT_PREFIX,[$USERAGENT_PREFIX])
190AC_SUBST(SVN_REVISION,[$SVN_REVISION])
191AC_SUBST(BUNDLE_VERSION,[$SVN_REVISION])
192AC_SUBST(VERSION_PACKAGE,$USERAGENT_PREFIX-r$SVN_REVISION)
193
194
195dnl ----------------------------------------------------------------------------
196dnl
197dnl  Generate the output
198
199AC_CONFIG_FILES([Makefile
200                 transmission.spec
201                 beos/Makefile
202                 cli/Makefile
203                 daemon/Makefile
204                 libtransmission/Makefile
205                 libtransmission/version.h
206                 third-party/Makefile
207                 macosx/Makefile
208                 wx/Makefile
209                 wx/images/Makefile])
210
211if test "x$use_gtk" = "xyes"; then
212    AC_CONFIG_FILES([gtk/Makefile
213                     po/Makefile.in])
214fi
215
216ac_configure_args="$ac_configure_args --enable-static --disable-shared -q"
217AC_OUTPUT
218
219echo "
220
221Configuration:
222
223        Source code location:    ${srcdir}
224        Compiler:                ${CXX}
225        Build libtransmission:   yes
226        Build Daemon:            yes
227        Build BeOS client:       ${beos}
228        Build GTK+ client:       ${use_gtk}
229        Build OS X client:       ${darwin}
230        Build wxWidgets client:  ${use_wx}
231
232"
Note: See TracBrowser for help on using the repository browser.