2008-08-09 05:09:35 +00:00
|
|
|
AC_INIT([transmission],[1.32+],[http://trac.transmissionbt.com/newticket])
|
|
|
|
PEERID_PREFIX="-TR132Z-"
|
|
|
|
USERAGENT_PREFIX="1.32+"
|
2007-10-24 19:57:47 +00:00
|
|
|
AC_SUBST(PEERID_PREFIX,[$PEERID_PREFIX])
|
|
|
|
AC_SUBST(USERAGENT_PREFIX,[$USERAGENT_PREFIX])
|
2007-07-28 04:10:09 +00:00
|
|
|
|
2007-07-18 23:04:26 +00:00
|
|
|
AC_PREREQ(2.54)
|
2007-07-28 04:10:09 +00:00
|
|
|
dnl AM_CONFIG_HEADER(config.h)
|
2007-07-18 23:04:26 +00:00
|
|
|
AC_CONFIG_SRCDIR(libtransmission/transmission.h)
|
2007-10-24 15:25:43 +00:00
|
|
|
AM_INIT_AUTOMAKE([1.9 tar-ustar])
|
2007-08-15 02:48:32 +00:00
|
|
|
AC_PROG_LIBTOOL
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2008-04-24 12:02:15 +00:00
|
|
|
OPENSSL_MINIMUM=0.9.4
|
2008-08-06 23:33:29 +00:00
|
|
|
CURL_MINIMUM=7.15.0
|
2008-03-09 15:27:08 +00:00
|
|
|
GIO_MINIMUM=2.15.5
|
2007-07-19 03:36:29 +00:00
|
|
|
GLIB_MINIMUM=2.6.0
|
|
|
|
GTK_MINIMUM=2.6.0
|
2007-07-18 23:04:26 +00:00
|
|
|
WX_MINIMUM=2.6.0
|
2008-02-24 15:42:31 +00:00
|
|
|
LIBNOTIFY_MINIMUM=0.4.4
|
2008-04-13 02:56:26 +00:00
|
|
|
DBUS_GLIB_MINIMUM=0.70
|
2008-05-19 11:55:16 +00:00
|
|
|
AC_SUBST(OPENSSL_MINIMUM)
|
2008-04-24 01:42:53 +00:00
|
|
|
AC_SUBST(CURL_MINIMUM)
|
2008-03-09 15:27:08 +00:00
|
|
|
AC_SUBST(GIO_MINIMUM)
|
2007-07-18 23:04:26 +00:00
|
|
|
AC_SUBST(GLIB_MINIMUM)
|
|
|
|
AC_SUBST(GTK_MINIMUM)
|
|
|
|
AC_SUBST(WX_MINIMUM)
|
2008-02-24 15:42:31 +00:00
|
|
|
AC_SUBST(LIBNOTIFY_MINIMUM)
|
2008-04-13 02:56:26 +00:00
|
|
|
AC_SUBST(DBUS_GLIB_MINIMUM)
|
2007-07-18 23:04:26 +00:00
|
|
|
|
|
|
|
AC_PROG_CC
|
|
|
|
AC_PROG_CXX
|
2007-08-14 20:15:55 +00:00
|
|
|
if test "x$GCC" = "xyes" ; then
|
2007-08-17 04:33:57 +00:00
|
|
|
CFLAGS="-g -Wall -W -O3 -funroll-loops"
|
|
|
|
CXXFLAGS="-g -Wall -W -O3 -funroll-loops"
|
2007-08-14 20:15:55 +00:00
|
|
|
fi
|
2007-07-18 23:04:26 +00:00
|
|
|
AC_HEADER_STDC
|
|
|
|
AC_HEADER_TIME
|
2008-06-16 22:11:50 +00:00
|
|
|
AC_CHECK_FUNCS([lrintf strlcpy daemon dirname basename daemon strcasecmp])
|
2007-10-31 18:10:55 +00:00
|
|
|
AC_CHECK_SIZEOF([void*])
|
2007-07-18 23:04:26 +00:00
|
|
|
AC_PROG_INSTALL
|
|
|
|
AC_PROG_MAKE_SET
|
|
|
|
AC_PROG_RANLIB
|
|
|
|
ACX_PTHREAD
|
|
|
|
|
2007-07-19 03:17:49 +00:00
|
|
|
AC_SEARCH_LIBS([socket], [socket net])
|
|
|
|
AC_SEARCH_LIBS([gethostbyname], [nsl bind])
|
2008-04-24 12:02:15 +00:00
|
|
|
PKG_CHECK_MODULES(OPENSSL, [openssl >= $OPENSSL_MINIMUM])
|
|
|
|
PKG_CHECK_MODULES(LIBCURL, [libcurl >= $CURL_MINIMUM])
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2007-10-29 14:44:00 +00:00
|
|
|
AC_SYS_LARGEFILE
|
|
|
|
|
2007-10-27 21:29:41 +00:00
|
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl
|
|
|
|
dnl va_copy
|
|
|
|
|
|
|
|
AC_MSG_CHECKING([how to copy va_list])
|
|
|
|
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; va_copy(ap1, ap2);],
|
|
|
|
AC_MSG_RESULT([va_copy]),
|
|
|
|
[ AH_TEMPLATE([va_copy], [define if va_copy is not available])
|
|
|
|
AC_TRY_LINK([#include <stdarg.h>], [va_list ap1, ap2; __va_copy(ap1, ap2);],
|
|
|
|
[ AC_DEFINE([va_copy], [__va_copy])
|
|
|
|
AC_MSG_RESULT([__va_copy])],
|
|
|
|
[ AC_DEFINE([va_copy(dest,src)], [memcpy(&dest,&src,sizeof(va_list))])
|
|
|
|
AC_MSG_RESULT([memcpy])]
|
|
|
|
)
|
|
|
|
])
|
|
|
|
|
|
|
|
|
2007-07-18 23:04:26 +00:00
|
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl
|
2007-08-14 19:26:49 +00:00
|
|
|
dnl libevent fun
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2007-08-14 19:26:49 +00:00
|
|
|
AC_CONFIG_SUBDIRS([third-party/libevent])
|
|
|
|
AC_MSG_NOTICE([invoking libevent's configure script])
|
|
|
|
LIBEVENT_CPPFLAGS="-I\$(top_srcdir)/third-party/libevent"
|
|
|
|
AC_SUBST(LIBEVENT_CPPFLAGS)
|
2007-07-18 23:04:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl
|
2007-07-19 14:06:50 +00:00
|
|
|
dnl detection for the GTK+ client
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2008-01-13 17:29:50 +00:00
|
|
|
PKG_CHECK_MODULES(GTK,
|
|
|
|
[gtk+-2.0 >= $GTK_MINIMUM
|
|
|
|
glib-2.0 >= $GLIB_MINIMUM
|
|
|
|
gmodule-2.0 >= $GLIB_MINIMUM
|
|
|
|
gthread-2.0 >= $GLIB_MINIMUM],
|
|
|
|
[have_gtk=yes],
|
|
|
|
[have_gtk=no])
|
|
|
|
AC_ARG_ENABLE([gtk],
|
|
|
|
AC_HELP_STRING([--enable-gtk],[build gtk client]),
|
|
|
|
[want_gtk=${enableval}],
|
|
|
|
[want_gtk=${have_gtk}])
|
|
|
|
build_gtk=no
|
2008-05-08 17:12:57 +00:00
|
|
|
use_gio=no
|
|
|
|
use_libnotify=no
|
|
|
|
use_dbus_glib=no
|
2007-07-18 23:04:26 +00:00
|
|
|
if test "x$want_gtk" = "xyes" ; then
|
|
|
|
if test "x$have_gtk" = "xyes"; then
|
2008-01-13 17:29:50 +00:00
|
|
|
build_gtk=yes
|
2007-07-18 23:04:26 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR("GTK+ not found!")
|
|
|
|
fi
|
|
|
|
fi
|
2008-01-13 17:29:50 +00:00
|
|
|
AM_CONDITIONAL([BUILD_GTK],[test "x$build_gtk" = "xyes"])
|
2007-08-16 00:28:00 +00:00
|
|
|
AC_SUBST(GTK_LIBS)
|
|
|
|
AC_SUBST(GTK_CFLAGS)
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2008-05-08 17:12:57 +00:00
|
|
|
if test "x$build_gtk" = "xyes"; then
|
2008-03-09 15:27:08 +00:00
|
|
|
|
2008-05-08 17:12:57 +00:00
|
|
|
PKG_CHECK_MODULES([GIO],
|
|
|
|
[gio-2.0 >= $GIO_MINIMUM],
|
|
|
|
[use_gio=yes],
|
|
|
|
[use_gio=no])
|
|
|
|
AC_SUBST(GIO_LIBS)
|
|
|
|
AC_SUBST(GIO_CFLAGS)
|
|
|
|
if test "x$use_gio" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_GIO], 1)
|
2008-04-20 13:43:29 +00:00
|
|
|
fi
|
2008-02-24 15:42:31 +00:00
|
|
|
|
2008-05-08 17:12:57 +00:00
|
|
|
PKG_CHECK_MODULES([LIBNOTIFY],
|
|
|
|
[libnotify >= $LIBNOTIFY_MINIMUM],
|
|
|
|
[have_libnotify=yes],
|
|
|
|
[have_libnotify=no])
|
|
|
|
AC_ARG_ENABLE([libnotify],
|
|
|
|
AS_HELP_STRING([--enable-libnotify],[enable notifications]),,
|
|
|
|
[enable_libnotify=yes])
|
|
|
|
use_libnotify=no
|
|
|
|
if test "x$enable_libnotify" = "xyes" ; then
|
|
|
|
if test "x$have_libnotify" = "xyes"; then
|
|
|
|
use_libnotify=yes
|
|
|
|
AC_SUBST(LIBNOTIFY_LIBS)
|
|
|
|
AC_SUBST(LIBNOTIFY_CFLAGS)
|
|
|
|
AC_DEFINE([HAVE_LIBNOTIFY], 1)
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
|
|
|
PKG_CHECK_MODULES([DBUS_GLIB],
|
|
|
|
[dbus-glib-1 >= $DBUS_GLIB_MINIMUM],
|
|
|
|
[use_dbus_glib=yes],
|
|
|
|
[use_dbus_glib=no])
|
|
|
|
AC_SUBST(DBUS_GLIB_LIBS)
|
|
|
|
AC_SUBST(DBUS_GLIB_CFLAGS)
|
|
|
|
if test "x$use_dbus_glib" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_DBUS_GLIB], 1)
|
|
|
|
fi
|
2008-04-13 02:56:26 +00:00
|
|
|
fi
|
|
|
|
|
2008-04-05 20:49:51 +00:00
|
|
|
AC_CHECK_HEADERS([libintl.h])
|
2007-11-01 19:14:40 +00:00
|
|
|
IT_PROG_INTLTOOL([0.23],[no-xml])
|
|
|
|
GETTEXT_PACKAGE=transmission
|
|
|
|
AC_SUBST(GETTEXT_PACKAGE)
|
|
|
|
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],["$GETTEXT_PACKAGE"],[Gettext package])
|
|
|
|
AM_GLIB_GNU_GETTEXT
|
|
|
|
transmissionlocaledir='${prefix}/${DATADIRNAME}/locale'
|
|
|
|
AC_SUBST(transmissionlocaledir)
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2008-01-13 17:29:50 +00:00
|
|
|
|
2007-07-19 14:06:50 +00:00
|
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl
|
|
|
|
dnl wxWidgets detection for the wxWidgets client
|
|
|
|
|
|
|
|
AM_OPTIONS_WXCONFIG
|
|
|
|
AM_PATH_WXCONFIG($WX_MINIMUM,[have_wx=yes],[have_wx=no])
|
2008-01-13 17:29:50 +00:00
|
|
|
AC_ARG_ENABLE([wx],
|
|
|
|
AC_HELP_STRING([--enable-wx],[build wxWidgets client]),
|
|
|
|
[want_wx=${enableval}],
|
|
|
|
[want_wx=no])
|
|
|
|
build_wx=no
|
2007-07-19 14:06:50 +00:00
|
|
|
if test "x$want_wx" = "xyes" ; then
|
|
|
|
if test "x$have_wx" = "xyes"; then
|
2008-01-13 17:29:50 +00:00
|
|
|
build_wx=yes
|
2007-07-19 14:06:50 +00:00
|
|
|
else
|
|
|
|
AC_MSG_ERROR("wxWidgets not found!")
|
|
|
|
fi
|
|
|
|
fi
|
2008-01-13 17:29:50 +00:00
|
|
|
AM_CONDITIONAL([BUILD_WX],[test "x$build_wx" = "xyes"])
|
2007-07-19 14:06:50 +00:00
|
|
|
|
|
|
|
|
2007-07-18 23:04:26 +00:00
|
|
|
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl
|
|
|
|
dnl platform-specific stuff.
|
|
|
|
|
|
|
|
AC_CANONICAL_HOST
|
2008-01-13 17:29:50 +00:00
|
|
|
have_beos="no"
|
|
|
|
have_darwin="no"
|
|
|
|
have_msw="no"
|
2007-07-18 23:04:26 +00:00
|
|
|
case $host_os in
|
|
|
|
|
|
|
|
*cygwin|*mingw32*)
|
2008-01-13 17:29:50 +00:00
|
|
|
have_msw="yes"
|
2007-07-18 23:04:26 +00:00
|
|
|
CXXFLAGS="$CXXFLAGS -mms-bitfields -mwin32 -mwindows"
|
2007-07-31 16:55:47 +00:00
|
|
|
CPPFLAGS="$CPPFLAGS -DWIN32 -DWIN32_LEAN_AND_MEAN"
|
2007-07-18 23:04:26 +00:00
|
|
|
LIBS="$LIBS -lshell32 -lws2_32"
|
|
|
|
transmissionlocaledir="locale"
|
|
|
|
if test -z "$host_alias"; then
|
|
|
|
hostaliaswindres=
|
|
|
|
else
|
|
|
|
hostaliaswindres="$host_alias-windres";
|
|
|
|
fi
|
|
|
|
AC_PATH_PROGS([WINDRES], [windres $hostaliaswindres $host_os-windres])
|
|
|
|
if test "x$WINDRES" = "x"; then
|
|
|
|
AC_MSG_ERROR([windres could not be found within your path.])
|
|
|
|
fi
|
|
|
|
AC_SUBST(WINDRES)
|
|
|
|
;;
|
|
|
|
|
2007-08-04 01:17:39 +00:00
|
|
|
*beos*)
|
2008-01-13 17:29:50 +00:00
|
|
|
have_beos="yes"
|
2007-07-18 23:04:26 +00:00
|
|
|
RELEASE=`uname -r`
|
|
|
|
case $RELEASE in
|
|
|
|
6.*|5.0.4) # Zeta or R5 / BONE beta 7
|
|
|
|
;;
|
|
|
|
5.0*) # R5 / net_server
|
|
|
|
CPPFLAGS="$CPPFLAGS -DBEOS_NETSERVER"
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR("Unsupported BeOS version")
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
GCCVER=`$CC -dumpversion`
|
|
|
|
case $GCCVER in
|
|
|
|
2.95.3*|3*|4*)
|
|
|
|
;;
|
|
|
|
2.9*)
|
|
|
|
BEOS_OLDCC=yes
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
AC_MSG_ERROR("Unsupported gcc version")
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
|
2007-07-19 01:30:45 +00:00
|
|
|
*darwin*)
|
2008-01-13 17:29:50 +00:00
|
|
|
have_darwin="yes"
|
2007-07-18 23:04:26 +00:00
|
|
|
# Make sure the Universal SDK is installed
|
2007-07-19 01:30:45 +00:00
|
|
|
if test ! -d /Developer/SDKs/MacOSX10.4u.sdk; then
|
2007-07-18 23:04:26 +00:00
|
|
|
cat << EOF
|
|
|
|
You need to install the Universal SDK in order to build Transmission:
|
|
|
|
Get your Xcode CD or package
|
|
|
|
Restart the install
|
|
|
|
When it gets to "Installation Type", select "Customize"
|
|
|
|
Select "Mac OS X 10.4 (Universal) SDK" under "Cross Development"
|
|
|
|
Finish the install.
|
|
|
|
EOF
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
2008-01-13 17:29:50 +00:00
|
|
|
|
|
|
|
AC_ARG_ENABLE([beos],
|
|
|
|
[AC_HELP_STRING([--enable-beos],[build OS X client])],
|
|
|
|
[build_beos=${enableval}],
|
|
|
|
[build_beos=${have_beos}])
|
|
|
|
AM_CONDITIONAL([BUILD_BEOS],[test "x$build_beos" = "xyes"])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([cli],
|
|
|
|
[AC_HELP_STRING([--enable-cli],[build command-line client])],
|
|
|
|
[build_cli=${enableval}],
|
|
|
|
[build_cli="yes"])
|
|
|
|
AM_CONDITIONAL([BUILD_CLI],[test "x$build_cli" = "xyes"])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([darwin],
|
|
|
|
[AC_HELP_STRING([--enable-darwin],[build OS X client])],
|
|
|
|
[build_darwin=${enableval}],
|
|
|
|
[build_darwin=${have_darwin}])
|
|
|
|
AM_CONDITIONAL([BUILD_DARWIN],[test "x$build_darwin" = "xyes"])
|
|
|
|
|
|
|
|
AC_ARG_ENABLE([daemon],
|
|
|
|
[AC_HELP_STRING([--enable-daemon],[build daemon])],
|
|
|
|
[build_daemon=${enableval}],
|
|
|
|
[build_daemon="yes"])
|
|
|
|
AM_CONDITIONAL([BUILD_DAEMON],[test "x$build_daemon" = "xyes"])
|
|
|
|
|
|
|
|
|
2008-02-17 01:23:58 +00:00
|
|
|
if test "x$have_beos" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_BEOS], 1)
|
|
|
|
fi
|
|
|
|
if test "x$have_darwin" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_DARWIN], 1)
|
|
|
|
fi
|
|
|
|
if test "x$have_msw" = "xyes"; then
|
|
|
|
AC_DEFINE([HAVE_MSW], 1)
|
|
|
|
fi
|
2007-07-18 23:04:26 +00:00
|
|
|
|
|
|
|
|
|
|
|
dnl ----------------------------------------------------------------------------
|
|
|
|
dnl
|
|
|
|
dnl Generate the output
|
|
|
|
|
|
|
|
AC_CONFIG_FILES([Makefile
|
|
|
|
transmission.spec
|
|
|
|
beos/Makefile
|
|
|
|
cli/Makefile
|
|
|
|
daemon/Makefile
|
2008-05-21 14:31:43 +00:00
|
|
|
doc/Makefile
|
2007-07-18 23:04:26 +00:00
|
|
|
libtransmission/Makefile
|
2007-08-14 19:26:49 +00:00
|
|
|
third-party/Makefile
|
2007-11-06 16:02:50 +00:00
|
|
|
third-party/miniupnp/Makefile
|
2007-12-08 19:34:15 +00:00
|
|
|
third-party/libnatpmp/Makefile
|
2008-05-12 18:33:52 +00:00
|
|
|
third-party/shttpd/Makefile
|
2007-07-18 23:04:26 +00:00
|
|
|
macosx/Makefile
|
2007-07-19 14:06:50 +00:00
|
|
|
wx/Makefile
|
2007-11-01 19:14:40 +00:00
|
|
|
wx/images/Makefile
|
|
|
|
gtk/Makefile
|
2008-02-07 20:02:06 +00:00
|
|
|
gtk/icons/Makefile
|
2007-11-01 19:14:40 +00:00
|
|
|
po/Makefile.in])
|
2007-07-18 23:04:26 +00:00
|
|
|
|
2007-08-17 02:50:55 +00:00
|
|
|
ac_configure_args="$ac_configure_args --enable-static --disable-shared -q"
|
2007-07-18 23:04:26 +00:00
|
|
|
AC_OUTPUT
|
|
|
|
|
|
|
|
echo "
|
|
|
|
|
|
|
|
Configuration:
|
|
|
|
|
2008-01-13 17:29:50 +00:00
|
|
|
Source code location: ${srcdir}
|
|
|
|
Compiler: ${CXX}
|
|
|
|
Build Command-Line client: ${build_cli}
|
|
|
|
Build Daemon: ${build_daemon}
|
|
|
|
Build BeOS client: ${build_beos}
|
|
|
|
Build GTK+ client: ${build_gtk}
|
2008-03-09 15:27:08 +00:00
|
|
|
... gio support: ${use_gio}
|
2008-04-13 02:56:26 +00:00
|
|
|
... dbus-glib support: ${use_dbus_glib}
|
2008-04-20 13:43:29 +00:00
|
|
|
... libnotify support: ${use_libnotify}
|
2008-01-13 17:29:50 +00:00
|
|
|
Build OS X client: ${build_darwin}
|
|
|
|
Build wxWidgets client: ${build_wx}
|
2007-07-18 23:04:26 +00:00
|
|
|
|
|
|
|
"
|