AC_PREREQ(2.52) AC_INIT(diversity-daemon, 0.1, diversity@openmoko.com) AM_INIT_AUTOMAKE([subdir-objects]) AM_MAINTAINER_MODE AM_CONFIG_HEADER(config.h) dnl dnl Require programs dnl AC_PROG_CC AM_PROG_CC_C_O AC_PROG_INSTALL AC_PROG_LIBTOOL dnl dnl Required headers dnl AC_HEADER_STDC dnl dnl Checks for typedefs, structures, and compiler characteristics. dnl AC_HEADER_TIME dnl dnl Checks for library functions. dnl dnl dnl Make sha1.c happy on big endian systems dnl AC_C_BIGENDIAN PKG_CHECK_MODULES(GLIB, glib-2.0 >= 2.6 gthread-2.0 gobject-2.0) AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal) if test -z "$GLIB_GENMARSHAL"; then AC_MSG_ERROR([glib-genmarshal did not found.]) fi AC_ARG_ENABLE(session-bus, AC_HELP_STRING([--enable-session-bus], [Use the session bus instead of system bus]), [], enable_session_bus=no) if test "x$enable_session_bus" = "xyes"; then AC_DEFINE(DIVERSITY_DBUS_BUS, DBUS_BUS_SESSION, [Use the session bus]) dbus_services_dir="services" else AC_DEFINE(DIVERSITY_DBUS_BUS, DBUS_BUS_SYSTEM, [Use the system bus]) dbus_services_dir="system-services" fi AM_CONDITIONAL(USE_SYSTEM_BUS, test "x$enable_session_bus" != "xyes") AC_ARG_WITH(dbus-sys, AC_HELP_STRING([--with-dbus-sys=DIR], [where D-BUS system.d directory is])) AC_ARG_WITH(dbus-services, AC_HELP_STRING([--with-dbus-services=DIR], [where D-BUS services directory is])) if ! test -z "$with_dbus_sys" ; then DBUS_SYS_DIR="$with_dbus_sys" else DBUS_SYS_DIR="${sysconfdir}/dbus-1/system.d" fi if ! test -z "$with_dbus_services" ; then DBUS_SERVICES_DIR="$with_dbus_services" else DBUS_SERVICES_DIR="${datadir}/dbus-1/${dbus_services_dir}" fi AC_SUBST(DBUS_SYS_DIR) AC_SUBST(DBUS_SERVICES_DIR) AC_ARG_WITH(diversity-user, AC_HELP_STRING([--with-diversity-user=DIR], [user for running diversity-daemon (root)])) if ! test -z "$with_diversity_user" ; then DIVERSITY_USER="$with_diversity_user" else DIVERSITY_USER="root" fi AC_SUBST(DIVERSITY_USER) # backends AC_ARG_ENABLE(control, AC_HELP_STRING([--disable-control], [disable Control backend]), [], enable_control=yes) AC_ARG_ENABLE(ebook, AC_HELP_STRING([--disable-ebook], [disable EBook backend]), [], enable_ebook=yes) AC_ARG_ENABLE(nmea, AC_HELP_STRING([--disable-nmea], [disable NMEA backend]), [], enable_nmea=yes) AC_ARG_ENABLE(geoclue, AC_HELP_STRING([--disable-geoclue], [disable GeoClue backend]), [], enable_geoclue=yes) AC_ARG_ENABLE(gypsy, AC_HELP_STRING([--disable-gypsy], [disable Gypsy backend]), [], enable_gypsy=yes) AC_ARG_ENABLE(nm, AC_HELP_STRING([--disable-nm], [disable NetworkManager backend]), [], enable_nm=yes) AC_ARG_ENABLE(osm, AC_HELP_STRING([--disable-osm], [disable OpenStreetMap backend]), [], enable_osm=yes) AC_ARG_ENABLE(phonekit, AC_HELP_STRING([--disable-phonekit], [disable PhoneKit backend]), [], enable_phonekit=yes) AC_ARG_ENABLE(xmpp, AC_HELP_STRING([--disable-xmpp], [disable XMPP backend]), [], enable_xmpp=yes) PKG_CHECK_MODULES(DBUS, dbus-glib-1 >= 0.60, [have_dbus=yes], [have_dbus=no]) AC_PATH_PROG(DBUS_BINDING_TOOL, dbus-binding-tool) if test -z "$DBUS_BINDING_TOOL"; then have_dbus=no fi if test "x$have_dbus" != "xyes"; then enable_control=no enable_geoclue=no enable_gypsy=no enable_nm=no enable_phonekit=no fi if test "x$enable_control" = "xyes"; then AC_DEFINE(HAVE_CONTROL, 1, [Compile Control backend]) fi AM_CONDITIONAL(HAVE_CONTROL, test "x$enable_control" = "xyes") if test "x$enable_ebook" = "xyes"; then PKG_CHECK_MODULES(EBOOK, libebook-1.2,, [enable_ebook=no]) PKG_CHECK_MODULES(JANA, libjana libjana-ecal,, [enable_ebook=no]) fi if test "x$enable_ebook" = "xyes"; then AC_DEFINE(HAVE_EBOOK, 1, [Compile EBook backend]) fi AM_CONDITIONAL(HAVE_EBOOK, test "x$enable_ebook" = "xyes") if test "x$enable_nmea" = "xyes"; then AC_DEFINE(HAVE_NMEA, 1, [Compile NMEA backend]) enable_geoclue="no (disabled by NMEA backend)" enable_gypsy="no (disabled by NMEA backend)" fi AM_CONDITIONAL(HAVE_NMEA, test "x$enable_nmea" = "xyes") if test "x$enable_geoclue" = "xyes"; then PKG_CHECK_MODULES(GEOCLUE, geoclue,, [enable_geoclue=no]) fi if test "x$enable_geoclue" = "xyes"; then AC_DEFINE(HAVE_GEOCLUE, 1, [Compile GeoClue backend]) fi AM_CONDITIONAL(HAVE_GEOCLUE, test "x$enable_geoclue" = "xyes") if test "x$enable_geoclue" == "xyes"; then enable_gypsy="no (disabled by GeoClue backend)" fi if test "x$enable_gypsy" = "xyes"; then PKG_CHECK_MODULES(GYPSY, gypsy,, [enable_gypsy=no]) fi if test "x$enable_gypsy" = "xyes"; then AC_DEFINE(HAVE_GYPSY, 1, [Compile Gypsy backend]) fi AM_CONDITIONAL(HAVE_GYPSY, test "x$enable_gypsy" = "xyes") if test "x$enable_nm" = "xyes"; then PKG_CHECK_MODULES(NM, NetworkManager = 0.6.5,, [enable_nm=no]) fi if test "x$enable_nm" = "xyes"; then AC_DEFINE(HAVE_NM, 1, [Compile NetworkManager backend]) fi AM_CONDITIONAL(HAVE_NM, test "x$enable_nm" = "xyes") if test "x$enable_osm" = "xyes"; then PKG_CHECK_MODULES(CURL, libcurl,, [enable_osm=no]) fi if test "x$enable_osm" = "xyes"; then AC_DEFINE(HAVE_OSM, 1, [Compile OpenStreetMap backend]) fi AM_CONDITIONAL(HAVE_OSM, test "x$enable_osm" = "xyes") if test "x$enable_phonekit" = "xyes"; then AC_DEFINE(HAVE_PHONEKIT, 1, [Compile PhoneKit backend]) fi AM_CONDITIONAL(HAVE_PHONEKIT, test "x$enable_phonekit" = "xyes") if test "x$enable_xmpp" = "xyes"; then PKG_CHECK_MODULES(LM, loudmouth-1.0,, [enable_xmpp=no]) fi if test "x$enable_xmpp" = "xyes"; then AC_DEFINE(HAVE_XMPP, 1, [Compile XMPP backend]) fi AM_CONDITIONAL(HAVE_XMPP, test "x$enable_xmpp" = "xyes") CFLAGS="-Wall $CFLAGS" AC_ARG_ENABLE(more-warnings, AC_HELP_STRING([--enable-more-warnings], [Maximum compiler warnings]), set_more_warnings="$enableval",[ if test -d "$srcdir/{arch}" || test -d "$srcdir/CVS"; then set_more_warnings=yes else set_more_warnings=no fi ]) AC_MSG_CHECKING(for more warnings, including -Werror) if test "$GCC" = "yes" -a "$set_more_warnings" != "no"; then AC_MSG_RESULT(yes) CFLAGS="-Werror -std=gnu89 $CFLAGS" for option in -Wshadow -Wmissing-declarations -Wmissing-prototypes \ -Wdeclaration-after-statement -Wstrict-prototypes \ -Wfloat-equal -Wno-unused-parameter -Wno-sign-compare; do SAVE_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $option" AC_MSG_CHECKING([whether gcc understands $option]) AC_TRY_COMPILE([], [], has_option=yes, has_option=no,) if test $has_option = no; then CFLAGS="$SAVE_CFLAGS" fi AC_MSG_RESULT($has_option) unset has_option unset SAVE_CFLAGS done unset option else AC_MSG_RESULT(no) fi AC_OUTPUT([ Makefile data/Makefile data/org.openmoko.Diversity.conf include/Makefile diversity-control-backend/Makefile diversity-ebook-backend/Makefile diversity-geoclue-backend/Makefile diversity-gypsy-backend/Makefile diversity-nm-backend/Makefile diversity-nmea-backend/Makefile diversity-osm-backend/Makefile diversity-phonekit-backend/Makefile diversity-xmpp-backend/Makefile src/Makefile tests/Makefile ]) echo echo "Control backend........................ : $enable_control" echo "EBook backend.......................... : $enable_ebook" echo "GeoClue backend........................ : $enable_geoclue" echo "Gypsy backend.......................... : $enable_gypsy" echo "NetworkManager backend................. : $enable_nm" echo "NMEA backend........................... : $enable_nmea" echo "OpenStreetMap backend.................. : $enable_osm" echo "PhoneKit backend....................... : $enable_phonekit" echo "XMPP backend........................... : $enable_xmpp" echo