comparison configure.ac @ 13490:40c5d0508a1a

[gaim-migrate @ 15866] This is a refactoring of the dbus service directory detection stuff. It was originally taken from guifications and that version had problem when a prefix was specificed to configure. Basically it would always try to install into the system directory regardless of --prefix. Anyways, this new code takes that into consideration. Also, I changed the way gaim.service is generated. It's now created from a .in file and has been relocated to the top of the source tree. committer: Tailor Script <tailor@pidgin.im>
author Gary Kramlich <grim@reaperworld.com>
date Sun, 12 Mar 2006 21:09:16 +0000
parents b03f19de58b8
children fc655d25f176
comparison
equal deleted inserted replaced
13489:8b28c8bfb3c0 13490:40c5d0508a1a
669 AC_MSG_WARN([python version >= 2.4 required]) 669 AC_MSG_WARN([python version >= 2.4 required])
670 enable_dbus=no 670 enable_dbus=no
671 fi 671 fi
672 fi 672 fi
673 673
674 dnl Here we locate the directory containing DBus .service files for 674 dnl ###########################################################################
675 dnl the session bus. Adapted from the guifications project. 675 dnl # Find the D-Bus services dir.
676 676 dnl #
677 AC_ARG_WITH(dbus-session-dir, [ --with-dbus-session-dir=<dir> Location of the D-BUS session directory.]) 677 dnl # This is a 3 step process that
678 678 dnl #
679 if test "x$enable_dbus" = "xyes" ; then 679 dnl # 1. checks if --with-dbus-services was set, if so use that.
680 AC_MSG_CHECKING([location of the D-BUS session directory]) 680 dnl # 2. checks if --prefix was given, if so use that.
681 if ! test -z "$with_dbus_session_dir"; then 681 dnl # 3. fallbacks to installing into what should be the correct system
682 if ! test -d "$with_dbus_session_dir"; then 682 dnl # directories.
683 AC_MSG_WARN([$with_dbus_session_dir does not exist, if this is the correct location please make sure that it exists.]) 683 dnl #
684 enable_dbus=no 684 dnl # This is still prone to error if one of the legacy directories exist
685 dnl # although a newer dbus is installed. But I have tried to order the
686 dnl # directory searching to keep this situation at a minimum.
687 dnl ###########################################################################
688 AC_ARG_WITH(dbus-services, [ --with-dbus-services=<dir> Where the D-Bus services directory is located.])
689
690 AC_MSG_CHECKING([location of the D-Bus services directory])
691 if ! test -z "$with_dbus_services" ; then
692 if ! test -d "$with_dbus_services" ; then
693 AC_MSG_ERROR([$with_dbus_services does not exist, if this is the correct location please make sure that it exists.])
694 fi
695
696 DBUS_SERVICES_DIR="$with_dbus_services"
697 else
698 if test x"$prefix" = x"NONE" ; then
699 dnl # no prefix given, so we look for the correct dbus system paths.
700 dnl # if a prefix is given, we use it.
701
702 serviceprefixes="$datadir $libdir /usr/share /usr/local/share"
703 DBUS_SERVICES_DIR=""
704
705 for d in $serviceprefixes ; do
706 dir="$d/dbus-1/services"
707 if test -d $dir ; then
708 DBUS_SERVICES_DIR="$dir"
709 break
710 fi
711 done
712
713 if test -z $DBUS_SERVICES_DIR ; then
714 AC_MSG_ERROR([D-Bus services directory was not found! Please use --with-dbus-services and specify it's location.])
685 fi 715 fi
686 DBUS_SESSION_DIR="$with_dbus_session_dir" 716 else
687 else 717 DBUS_SERVICES_DIR="$datadir/dbus-1/services"
688 dnl # add more to this as needed 718 fi
689 servicesprefixes="$DATADIR $LIBDIR /usr/share /usr/local/share" 719 fi
690 DBUS_SESSION_DIR="" 720 AC_MSG_RESULT([$DBUS_SERVICES_DIR])
691 721 AC_SUBST(DBUS_SERVICES_DIR)
692 for p in $servicesprefixes; do 722
693 dir="$p/dbus-1/services"
694 if test -d $dir; then
695 DBUS_SESSION_DIR="$dir"
696 break
697 fi
698 done
699
700 if test -z $DBUS_SESSION_DIR; then
701 AC_MSG_WARN([D-BUS session directory was not found! Please use --with-dbus-session-dir and specify its location.])
702 enable_dbus=no
703 fi
704 fi
705 fi
706 723
707 if test "x$enable_dbus" = "xyes" ; then 724 if test "x$enable_dbus" = "xyes" ; then
708 AC_MSG_RESULT([$DBUS_SESSION_DIR]) 725 AC_MSG_RESULT([$DBUS_SESSION_DIR])
709 AC_SUBST(DBUS_SESSION_DIR) 726 AC_SUBST(DBUS_SESSION_DIR)
710 AC_DEFINE(HAVE_DBUS, 1, [Define if we are re using DBUS.]) 727 AC_DEFINE(HAVE_DBUS, 1, [Define if we are re using DBUS.])
712 else 729 else
713 echo "Building without DBUS support" 730 echo "Building without DBUS support"
714 fi 731 fi
715 732
716 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes") 733 AM_CONDITIONAL(ENABLE_DBUS, test "x$enable_dbus" = "xyes")
717
718
719
720
721
722 734
723 dnl ####################################################################### 735 dnl #######################################################################
724 dnl # Check for startup notification 736 dnl # Check for startup notification
725 dnl ####################################################################### 737 dnl #######################################################################
726 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification compile without startup notification support],,enable_startup_notification=yes) 738 AC_ARG_ENABLE(startup-notification, [ --disable-startup-notification compile without startup notification support],,enable_startup_notification=yes)
1693 ]) 1705 ])
1694 1706
1695 AC_OUTPUT([Makefile 1707 AC_OUTPUT([Makefile
1696 Doxyfile 1708 Doxyfile
1697 gaim.apspec 1709 gaim.apspec
1710 gaim.service
1698 doc/Makefile 1711 doc/Makefile
1699 doc/gaim.1 1712 doc/gaim.1
1700 m4macros/Makefile 1713 m4macros/Makefile
1701 pixmaps/Makefile 1714 pixmaps/Makefile
1702 pixmaps/smileys/Makefile 1715 pixmaps/smileys/Makefile
1757 echo Build with Tk support......... : $enable_tk 1770 echo Build with Tk support......... : $enable_tk
1758 echo Build with Audio support...... : $enable_audio 1771 echo Build with Audio support...... : $enable_audio
1759 echo Build with GtkSpell support... : $enable_gtkspell 1772 echo Build with GtkSpell support... : $enable_gtkspell
1760 echo Build with DBUS support....... : $enable_dbus 1773 echo Build with DBUS support....... : $enable_dbus
1761 if test x$enable_dbus = xyes ; then 1774 if test x$enable_dbus = xyes ; then
1762 echo DBUS session directory........ : $DBUS_SESSION_DIR 1775 echo DBUS servies directory........ : $DBUS_SERVICES_DIR
1763 fi 1776 fi
1764 echo Build with Cyrus SASL support. : $enable_cyrus_sasl 1777 echo Build with Cyrus SASL support. : $enable_cyrus_sasl
1765 echo Has you....................... : yes 1778 echo Has you....................... : yes
1766 echo 1779 echo
1767 echo 1780 echo