configure: Add a check for libdbus independent from the libhal check.

This commit is contained in:
Alexandre Julliard 2011-12-20 10:36:35 +01:00
parent ea75ac8406
commit e45d124c52
3 changed files with 105 additions and 56 deletions

114
configure vendored
View File

@ -644,6 +644,7 @@ SANEINCL
sane_devel sane_devel
GNUTLSINCL GNUTLSINCL
HALINCL HALINCL
DBUSINCL
XSLTINCL XSLTINCL
XML2INCL XML2INCL
XML2LIBS XML2LIBS
@ -782,6 +783,7 @@ with_cms
with_coreaudio with_coreaudio
with_cups with_cups
with_curses with_curses
with_dbus
with_fontconfig with_fontconfig
with_freetype with_freetype
with_gettext with_gettext
@ -1472,6 +1474,7 @@ Optional Packages:
--without-coreaudio do not use the CoreAudio sound support --without-coreaudio do not use the CoreAudio sound support
--without-cups do not use CUPS --without-cups do not use CUPS
--without-curses do not use (n)curses --without-curses do not use (n)curses
--without-dbus do not use DBus (dynamic device support)
--without-fontconfig do not use fontconfig --without-fontconfig do not use fontconfig
--without-freetype do not use the FreeType library --without-freetype do not use the FreeType library
--without-gettext do not use gettext --without-gettext do not use gettext
@ -2551,6 +2554,12 @@ if test "${with_curses+set}" = set; then :
fi fi
# Check whether --with-dbus was given.
if test "${with_dbus+set}" = set; then :
withval=$with_dbus;
fi
# Check whether --with-fontconfig was given. # Check whether --with-fontconfig was given.
if test "${with_fontconfig+set}" = set; then : if test "${with_fontconfig+set}" = set; then :
withval=$with_fontconfig; if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi withval=$with_fontconfig; if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi
@ -9490,40 +9499,25 @@ This is an error since --with-xslt was requested." "$LINENO" 5 ;;
esac esac
fi fi
HALINCL="" if test "x$with_dbus" != "xno"
if test "x$with_hal" != "xno"
then then
ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CPPFLAGS="$CPPFLAGS"
if test "$PKG_CONFIG" != "false" if test "$PKG_CONFIG" != "false"
then then
ac_hal_libs="`$PKG_CONFIG --libs hal 2>/dev/null`" ac_dbus_libs="`$PKG_CONFIG --libs dbus-1 2>/dev/null`"
ac_hal_cflags="`$PKG_CONFIG --cflags hal 2>/dev/null`" ac_dbus_cflags="`$PKG_CONFIG --cflags dbus-1 2>/dev/null`"
CPPFLAGS="$CPPFLAGS $ac_hal_cflags" CPPFLAGS="$CPPFLAGS $ac_dbus_cflags"
fi fi
for ac_header in dbus/dbus.h hal/libhal.h ac_fn_c_check_header_mongrel "$LINENO" "dbus/dbus.h" "ac_cv_header_dbus_dbus_h" "$ac_includes_default"
do : if test "x$ac_cv_header_dbus_dbus_h" = xyes; then :
as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -ldbus-1" >&5
ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" $as_echo_n "checking for -ldbus-1... " >&6; }
if eval test \"x\$"$as_ac_Header"\" = x"yes"; then : if ${ac_cv_lib_soname_dbus_1+:} false; then :
cat >>confdefs.h <<_ACEOF
#define `$as_echo "HAVE_$ac_header" | $as_tr_cpp` 1
_ACEOF
fi
done
if test "$ac_cv_header_dbus_dbus_h" = "yes" -a "$ac_cv_header_hal_libhal_h" = "yes"
then
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for dbus_connection_close in -ldbus-1" >&5
$as_echo_n "checking for dbus_connection_close in -ldbus-1... " >&6; }
if ${ac_cv_lib_dbus_1_dbus_connection_close+:} false; then :
$as_echo_n "(cached) " >&6 $as_echo_n "(cached) " >&6
else else
ac_check_lib_save_LIBS=$LIBS ac_check_soname_save_LIBS=$LIBS
LIBS="-ldbus-1 $ac_hal_libs $LIBS" LIBS="-ldbus-1 $ac_dbus_libs $LIBS"
cat confdefs.h - <<_ACEOF >conftest.$ac_ext cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */ /* end confdefs.h. */
/* Override any GCC internal prototype to avoid an error. /* Override any GCC internal prototype to avoid an error.
@ -9542,17 +9536,57 @@ return dbus_connection_close ();
} }
_ACEOF _ACEOF
if ac_fn_c_try_link "$LINENO"; then : if ac_fn_c_try_link "$LINENO"; then :
ac_cv_lib_dbus_1_dbus_connection_close=yes case "$LIBEXT" in
else dll) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest.exe | grep "dbus-1" | sed -e "s/dll.*/dll/"';2,$d'` ;;
ac_cv_lib_dbus_1_dbus_connection_close=no dylib) ac_cv_lib_soname_dbus_1=`otool -L conftest$ac_exeext | grep "libdbus-1\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libdbus-1\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_dbus_1=`$ac_cv_path_LDD conftest$ac_exeext | grep "libdbus-1\\.$LIBEXT" | sed -e "s/^.*\(libdbus-1\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;;
esac
fi fi
rm -f core conftest.err conftest.$ac_objext \ rm -f core conftest.err conftest.$ac_objext \
conftest$ac_exeext conftest.$ac_ext conftest$ac_exeext conftest.$ac_ext
LIBS=$ac_check_lib_save_LIBS LIBS=$ac_check_soname_save_LIBS
fi fi
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_dbus_1_dbus_connection_close" >&5 if test "x$ac_cv_lib_soname_dbus_1" = "x"; then :
$as_echo "$ac_cv_lib_dbus_1_dbus_connection_close" >&6; } { $as_echo "$as_me:${as_lineno-$LINENO}: result: not found" >&5
if test "x$ac_cv_lib_dbus_1_dbus_connection_close" = xyes; then : $as_echo "not found" >&6; }
else
{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_soname_dbus_1" >&5
$as_echo "$ac_cv_lib_soname_dbus_1" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBDBUS_1 "$ac_cv_lib_soname_dbus_1"
_ACEOF
DBUSINCL="$ac_dbus_cflags"
fi
fi
CPPFLAGS="$ac_save_CPPFLAGS"
fi
if test "x$ac_cv_lib_soname_dbus_1" = "x" -a \
"x$ac_cv_header_DiskArbitration_DiskArbitration_h" != "xyes"; then :
case "x$with_dbus" in
x) as_fn_append wine_notices "|libdbus ${notice_platform}development files not found, no dynamic device support." ;;
xno) ;;
*) as_fn_error $? "libdbus ${notice_platform}development files not found, no dynamic device support.
This is an error since --with-dbus was requested." "$LINENO" 5 ;;
esac
fi
if test "x$with_hal" != "xno" -a "x$ac_cv_lib_soname_dbus_1" != x
then
ac_save_CPPFLAGS="$CPPFLAGS"
if test "$PKG_CONFIG" != "false"
then
ac_hal_libs="`$PKG_CONFIG --libs hal 2>/dev/null`"
ac_hal_cflags="`$PKG_CONFIG --cflags hal 2>/dev/null`"
CPPFLAGS="$CPPFLAGS $ac_hal_cflags"
fi
ac_fn_c_check_header_mongrel "$LINENO" "hal/libhal.h" "ac_cv_header_hal_libhal_h" "$ac_includes_default"
if test "x$ac_cv_header_hal_libhal_h" = xyes; then :
{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lhal" >&5 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for -lhal" >&5
$as_echo_n "checking for -lhal... " >&6; } $as_echo_n "checking for -lhal... " >&6; }
if ${ac_cv_lib_soname_hal+:} false; then : if ${ac_cv_lib_soname_hal+:} false; then :
@ -9602,20 +9636,22 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
HALINCL="$ac_hal_cflags" HALINCL="$ac_hal_cflags"
fi fi
fi fi
fi
CPPFLAGS="$ac_save_CPPFLAGS" CPPFLAGS="$ac_save_CPPFLAGS"
fi if test "x$ac_cv_lib_soname_hal" = "x" -a \
if test "x$ac_cv_lib_soname_hal" = "x" -a "x$ac_cv_header_DiskArbitration_DiskArbitration_h" != "xyes"; then : "x$ac_cv_header_DiskArbitration_DiskArbitration_h" != "xyes"; then :
case "x$with_hal" in case "x$with_hal" in
x) as_fn_append wine_notices "|libhal/libdbus ${notice_platform}development files not found, no dynamic device support." ;; x) as_fn_append wine_notices "|libhal ${notice_platform}development files not found, no legacy dynamic device support." ;;
xno) ;; xno) ;;
*) as_fn_error $? "libhal/libdbus ${notice_platform}development files not found, no dynamic device support. *) as_fn_error $? "libhal ${notice_platform}development files not found, no legacy dynamic device support.
This is an error since --with-hal was requested." "$LINENO" 5 ;; This is an error since --with-hal was requested." "$LINENO" 5 ;;
esac esac
fi fi
fi
if test "x$with_gnutls" != "xno" if test "x$with_gnutls" != "xno"
then then

View File

@ -42,6 +42,7 @@ AC_ARG_WITH(coreaudio, AS_HELP_STRING([--without-coreaudio],[do not use the Core
AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS])) AC_ARG_WITH(cups, AS_HELP_STRING([--without-cups],[do not use CUPS]))
AC_ARG_WITH(curses, AS_HELP_STRING([--without-curses],[do not use (n)curses]), AC_ARG_WITH(curses, AS_HELP_STRING([--without-curses],[do not use (n)curses]),
[if test "x$withval" = "xno"; then ac_cv_header_ncurses_h=no; ac_cv_header_curses_h=no; fi]) [if test "x$withval" = "xno"; then ac_cv_header_ncurses_h=no; ac_cv_header_curses_h=no; fi])
AC_ARG_WITH(dbus, AS_HELP_STRING([--without-dbus],[do not use DBus (dynamic device support)]))
AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]), AC_ARG_WITH(fontconfig,AS_HELP_STRING([--without-fontconfig],[do not use fontconfig]),
[if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi]) [if test "x$withval" = "xno"; then ac_cv_header_fontconfig_fontconfig_h=no; fi])
AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library])) AC_ARG_WITH(freetype, AS_HELP_STRING([--without-freetype],[do not use the FreeType library]))
@ -1211,9 +1212,27 @@ fi
WINE_WARNING_WITH(xslt,[test "x$ac_cv_lib_soname_xslt" = "x"], WINE_WARNING_WITH(xslt,[test "x$ac_cv_lib_soname_xslt" = "x"],
[libxslt ${notice_platform}development files not found, xslt won't be supported.]) [libxslt ${notice_platform}development files not found, xslt won't be supported.])
dnl **** Check for libdbus ****
if test "x$with_dbus" != "xno"
then
ac_save_CPPFLAGS="$CPPFLAGS"
if test "$PKG_CONFIG" != "false"
then
ac_dbus_libs="`$PKG_CONFIG --libs dbus-1 2>/dev/null`"
ac_dbus_cflags="`$PKG_CONFIG --cflags dbus-1 2>/dev/null`"
CPPFLAGS="$CPPFLAGS $ac_dbus_cflags"
fi
AC_CHECK_HEADER([dbus/dbus.h],
[WINE_CHECK_SONAME(dbus-1, dbus_connection_close,
[AC_SUBST(DBUSINCL,"$ac_dbus_cflags")],,[$ac_dbus_libs])])
CPPFLAGS="$ac_save_CPPFLAGS"
fi
WINE_NOTICE_WITH(dbus,[test "x$ac_cv_lib_soname_dbus_1" = "x" -a \
"x$ac_cv_header_DiskArbitration_DiskArbitration_h" != "xyes"],
[libdbus ${notice_platform}development files not found, no dynamic device support.])
dnl **** Check for libhal **** dnl **** Check for libhal ****
AC_SUBST(HALINCL,"") if test "x$with_hal" != "xno" -a "x$ac_cv_lib_soname_dbus_1" != x
if test "x$with_hal" != "xno"
then then
ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CPPFLAGS="$CPPFLAGS"
if test "$PKG_CONFIG" != "false" if test "$PKG_CONFIG" != "false"
@ -1222,17 +1241,14 @@ then
ac_hal_cflags="`$PKG_CONFIG --cflags hal 2>/dev/null`" ac_hal_cflags="`$PKG_CONFIG --cflags hal 2>/dev/null`"
CPPFLAGS="$CPPFLAGS $ac_hal_cflags" CPPFLAGS="$CPPFLAGS $ac_hal_cflags"
fi fi
AC_CHECK_HEADERS([dbus/dbus.h hal/libhal.h]) AC_CHECK_HEADER([hal/libhal.h],
if test "$ac_cv_header_dbus_dbus_h" = "yes" -a "$ac_cv_header_hal_libhal_h" = "yes" [WINE_CHECK_SONAME(hal, libhal_ctx_new,
then [AC_SUBST(HALINCL,"$ac_hal_cflags")],,[$ac_hal_libs])])
AC_CHECK_LIB(dbus-1, dbus_connection_close,
[WINE_CHECK_SONAME(hal, libhal_ctx_new,
[HALINCL="$ac_hal_cflags"],,[$ac_hal_libs])],,[$ac_hal_libs])
fi
CPPFLAGS="$ac_save_CPPFLAGS" CPPFLAGS="$ac_save_CPPFLAGS"
WINE_NOTICE_WITH(hal,[test "x$ac_cv_lib_soname_hal" = "x" -a \
"x$ac_cv_header_DiskArbitration_DiskArbitration_h" != "xyes"],
[libhal ${notice_platform}development files not found, no legacy dynamic device support.])
fi fi
WINE_NOTICE_WITH(hal,[test "x$ac_cv_lib_soname_hal" = "x" -a "x$ac_cv_header_DiskArbitration_DiskArbitration_h" != "xyes"],
[libhal/libdbus ${notice_platform}development files not found, no dynamic device support.])
dnl **** Check for libgnutls **** dnl **** Check for libgnutls ****
if test "x$with_gnutls" != "xno" if test "x$with_gnutls" != "xno"

View File

@ -70,9 +70,6 @@
/* Define if you have the daylight variable */ /* Define if you have the daylight variable */
#undef HAVE_DAYLIGHT #undef HAVE_DAYLIGHT
/* Define to 1 if you have the <dbus/dbus.h> header file. */
#undef HAVE_DBUS_DBUS_H
/* Define to 1 if you have the <direct.h> header file. */ /* Define to 1 if you have the <direct.h> header file. */
#undef HAVE_DIRECT_H #undef HAVE_DIRECT_H
@ -251,9 +248,6 @@
/* Define to 1 if you have the <gsm.h> header file. */ /* Define to 1 if you have the <gsm.h> header file. */
#undef HAVE_GSM_H #undef HAVE_GSM_H
/* Define to 1 if you have the <hal/libhal.h> header file. */
#undef HAVE_HAL_LIBHAL_H
/* Define to 1 if you have the <ieeefp.h> header file. */ /* Define to 1 if you have the <ieeefp.h> header file. */
#undef HAVE_IEEEFP_H #undef HAVE_IEEEFP_H
@ -1208,6 +1202,9 @@
/* Define to the soname of the libcurses library. */ /* Define to the soname of the libcurses library. */
#undef SONAME_LIBCURSES #undef SONAME_LIBCURSES
/* Define to the soname of the libdbus-1 library. */
#undef SONAME_LIBDBUS_1
/* Define to the soname of the libfontconfig library. */ /* Define to the soname of the libfontconfig library. */
#undef SONAME_LIBFONTCONFIG #undef SONAME_LIBFONTCONFIG