AC_INIT(telepathy-mission-control, 5.0.beta64) AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR(Makefile.am) AM_INIT_AUTOMAKE([1.9 tar-ustar -Wno-portability]) AM_CONFIG_HEADER(config.h) AC_CANONICAL_HOST AC_PROG_CC AC_PROG_CPP AC_PROG_CXX AC_PROG_INSTALL AC_PROG_LIBTOOL AM_PROG_MKDIR_P AC_HEADER_STDC # Recommended CFLAGS for pedantic checking, from telepathy-glib AS_COMPILER_FLAG(-Wall, ERROR_CFLAGS="-Wall", ERROR_CFLAGS="") AC_ARG_ENABLE([Werror], AC_HELP_STRING([--enable-Werror],[compile with -Werror]), [werror=$enableval], [werror=no]) if test "$werror" = yes; then AS_COMPILER_FLAG([-Werror], [ERROR_CFLAGS="$ERROR_CFLAGS -Werror"]) fi #AS_COMPILER_FLAG(-Wextra, wextra=yes, wextra=no) AS_COMPILER_FLAG(-Wno-missing-field-initializers, wno_missing_field_initializers=yes, wno_missing_field_initializers=no) AS_COMPILER_FLAG(-Wno-unused-parameter, wno_unused_parameter=yes, wno_unused_parameter=no) if test x$werror = xyes; then ERROR_CFLAGS="$ERROR_CFLAGS -Werror" fi if test x$wextra = xyes -a \ x$wno_missing_field_initializers = xyes -a \ x$wno_unused_parameter = xyes; then ERROR_CFLAGS="$ERROR_CFLAGS -Wextra -Wno-missing-field-initializers -Wno-unused-parameter" fi AS_COMPILER_FLAG(-Wdeclaration-after-statement, ERROR_CFLAGS="$ERROR_CFLAGS -Wdeclaration-after-statement") AS_COMPILER_FLAG(-Wshadow, ERROR_CFLAGS="$ERROR_CFLAGS -Wshadow") AS_COMPILER_FLAG(-Wstrict-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wstrict-prototypes") AS_COMPILER_FLAG(-Wmissing-prototypes, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-prototypes") AS_COMPILER_FLAG(-Wmissing-declarations, ERROR_CFLAGS="$ERROR_CFLAGS -Wmissing-declarations") AM_CFLAGS="$CFLAGS -fno-strict-aliasing -ansi -DDMALLOC $ERROR_CFLAGS" AC_SUBST([AM_CFLAGS]) define([EXPAND_VARIABLE], [$2=[$]$1 while true; do case "[$]$2" in *\[$]* ) eval "$2=[$]$2" ;; *) break ;; esac done]) EXPAND_VARIABLE(datadir,datadir_expanded) XSLTPROC= AC_CHECK_PROGS([XSLTPROC], [xsltproc]) if test -z "$XSLTPROC"; then AC_MSG_ERROR([xsltproc (from the libxslt source package) is required]) fi PYTHON= AC_CHECK_PROGS([PYTHON], [python2.3 python2.4 python2.5 python]) if test -z "$PYTHON"; then AC_MSG_ERROR([Python is required to compile this package]) fi # Check for a python >= 2.4 with twisted to run python tests AC_MSG_CHECKING([for Python >= 2.4 with Twisted and XMPP protocol support]) for TEST_PYTHON in python2.4 python2.5 python; do if $TEST_PYTHON -c "from sys import version_info; raise SystemExit(version_info < (2, 4, 0, 'final', 0))" \ >/dev/null 2>&1; then if $TEST_PYTHON -c "import twisted.words.xish.domish, twisted.words.protocols.jabber, twisted.internet.reactor" \ >/dev/null 2>&1; then AC_MSG_RESULT([$TEST_PYTHON]) AM_CONDITIONAL([WANT_TWISTED_TESTS], true) break else TEST_PYTHON=false fi fi done AC_SUBST(TEST_PYTHON) AM_CONDITIONAL([WANT_TWISTED_TESTS], test false != "$TEST_PYTHON") AC_ARG_ENABLE(debug, [ --disable-debug compile without debug code],[enable_debug=${enableval}], enable_debug=yes ) if test "x$enable_debug" = "xyes"; then CFLAGS="$CFLAGS -DENABLE_DEBUG" fi AC_ARG_ENABLE(cast-checks, [ --disable-cast-checks compile with GLIB cast checks disabled],[cchecks=${enableval}],cchecks=yes) if test "x$cchecks" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CAST_CHECKS" fi AC_ARG_ENABLE(asserts, [ --disable-asserts compile with GLIB assertions disabled],[asserts=${enableval}],asserts=yes) if test "x$asserts" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_ASSERTS" fi AC_ARG_ENABLE(checks, [ --disable-checks compile with GLIB checks disabled],[checks=${enableval}],checks=yes) if test "x$checks" = "xno"; then CFLAGS="$CFLAGS -DG_DISABLE_CHECKS" fi AC_ARG_ENABLE(coverage, [ --enable-coverage compile with coverage info],[enable_coverage=${enableval}],enable_coverage=no) if test "x$enable_coverage" = "xyes"; then CFLAGS="$CFLAGS -g -fprofile-arcs -ftest-coverage" fi AC_ARG_WITH(profiles_dir, AS_HELP_STRING([--with-profiles-dir=],[Directory for storing profiles])) if test -z "$with_profiles_dir" ; then PROFILES_DIR="mission-control/profiles" else PROFILES_DIR=$with_profiles_dir fi AC_SUBST(PROFILES_DIR) AC_DEFINE_UNQUOTED(PROFILES_DIR,"$PROFILES_DIR", [Directory for storing profiles]) AC_ARG_WITH(managers_dir, AS_HELP_STRING([--with-managers-dir=],[Directory for storing managers])) if test -z "$with_managers_dir" ; then MANAGERS_DIR="telepathy/managers" else MANAGERS_DIR=$with_managers_dir fi AC_SUBST(MANAGERS_DIR) AC_DEFINE_UNQUOTED(MANAGERS_DIR,"$MANAGERS_DIR", [Directory for storing managers]) AC_ARG_WITH(accounts_dir, AS_HELP_STRING([--with-accounts-dir=],[Directory for storing accounts])) if test -z "$with_accounts_dir" ; then ACCOUNTS_DIR="~/.mission-control/accounts" else ACCOUNTS_DIR=$with_accounts_dir fi AC_SUBST(ACCOUNTS_DIR) AC_DEFINE_UNQUOTED(ACCOUNTS_DIR,"$ACCOUNTS_DIR", [Directory for storing accounts]) AC_ARG_WITH(chandlers_dir, AS_HELP_STRING([--with-chandlers-dir=],[Directory for channel handlers])) if test -z "$with_chandlers_dir" ; then CHANDLERS_DIR="telepathy/managers" else CHANDLERS_DIR=$with_chandlers_dir fi AC_SUBST(CHANDLERS_DIR) AC_DEFINE_UNQUOTED(CHANDLERS_DIR,"$CHANDLERS_DIR", [Directory for channel handlers]) test_enabled="yes" AC_MSG_CHECKING(whether to build tests) AC_ARG_ENABLE(tests, [ --disable-tests don't build tests. default: enable them], [ AC_MSG_RESULT(${enableval}) test_enabled="${enableval}" ], [ AC_MSG_RESULT([yes (default)]) test_enabled="yes" ] ) AM_CONDITIONAL(HAVE_TESTS, [test x$test_enabled = xyes]) examples_enabled="yes" AC_MSG_CHECKING(whether to build examples) AC_ARG_ENABLE(examples, [ --disable-examples don't build examples. default: build them], [ AC_MSG_RESULT(${enableval}) examples_enabled="${enableval}" ], [ AC_MSG_RESULT([yes (default)]) examples_enabled="yes" ] ) AM_CONDITIONAL(HAVE_EXAMPLES, [test x$examples_enabled = xyes]) server_enabled="yes" AC_MSG_CHECKING(whether to build the sample server) AC_ARG_ENABLE(server, [ --enable-server build server. default=yes], [ AC_MSG_RESULT(${enableval}) server_enabled="${enableval}" ], [ AC_MSG_RESULT(yes) server_enabled="yes" ] ) AM_CONDITIONAL(HAVE_SERVER, [test x$server_enabled = xyes]) PKG_CHECK_MODULES(DBUS, [dbus-1 >= 0.51, dbus-glib-1 >= 0.51], have_dbus=yes, have_dbus=no) AC_SUBST(DBUS_CFLAGS) AC_SUBST(DBUS_LIBS) PKG_CHECK_MODULES(TELEPATHY, telepathy-glib >= 0.7.26) AC_SUBST(TELEPATHY_LIBS) AC_SUBST(TELEPATHY_CFLAGS) legacy_enabled="yes" AC_MSG_CHECKING(whether to build the old libmissioncontrol-client) AC_ARG_ENABLE(legacy, [ --enable-legacy build libmiccioncontrol-client. default=yes], [ AC_MSG_RESULT(${enableval}) legacy_enabled="${enableval}" ], [ AC_MSG_RESULT(yes) legacy_enabled="yes" ] ) AM_CONDITIONAL(HAVE_LEGACY, [test x$legacy_enabled = xyes]) if test "x$legacy_enabled" = "xyes"; then PKG_CHECK_MODULES(LIBTELEPATHY, libtelepathy >= 0.3.0) AC_SUBST(LIBTELEPATHY_LIBS) AC_SUBST(LIBTELEPATHY_CFLAGS) fi GCONF_REQUIRED_VERSION=2.0.0 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= $GCONF_REQUIRED_VERSION) AC_SUBST(GCONF_CFLAGS) AC_SUBST(GCONF_LIBS) PKG_CHECK_MODULES(GLIB, glib-2.0 gobject-2.0) AC_SUBST(GLIB_LIBS) AC_SUBST(GLIB_CFLAGS) PKG_CHECK_MODULES(GMODULE, gmodule-no-export-2.0) AC_SUBST(GMODULE_LIBS) AC_SUBST(GMODULE_CFLAGS) dnl docs/Makefile.am needs to know whether it's an out of tree build dnl (srcdir != builddir) AM_CONDITIONAL([OUT_OF_TREE_BUILD], [test "z$ac_srcdir" != z.]) dnl *************************************************************************** dnl Check for marshal and enum generators dnl *************************************************************************** GLIB_GENMARSHAL="`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`" AC_SUBST(GLIB_GENMARSHAL) GLIB_MKENUMS="`$PKG_CONFIG --variable=glib_mkenums glib-2.0`" AC_SUBST(GLIB_MKENUMS) GTK_DOC_CHECK([1.3]) pluginlibdir=$libdir/mission-control AC_SUBST(pluginlibdir) AC_OUTPUT([ Makefile \ doc/Makefile \ doc/reference/Makefile \ doc/reference/libmcclient/Makefile \ doc/reference/libmissioncontrol-server/Makefile \ doc/reference/libmissioncontrol/Makefile \ examples/Makefile \ libmcclient.pc \ libmcclient/Makefile \ libmissioncontrol.pc \ libmissioncontrol/Makefile \ m4/Makefile \ mission-control.pc \ server/Makefile \ src/Makefile \ test/Makefile \ test/twisted/Makefile \ test/twisted/tools/Makefile \ tools/Makefile \ util/Makefile \ xml/Makefile \ ])