From c1099bb759ef3b18e4405833976e656488735b5e Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 2 Jul 2007 17:28:33 +0200 Subject: [PATCH] configure: Merge the libhal existence check with the soname check. --- configure | 218 ++++++++++++++-------------------------- configure.ac | 8 +- include/config.h.in | 3 - programs/explorer/hal.c | 10 +- 4 files changed, 80 insertions(+), 159 deletions(-) diff --git a/configure b/configure index 8eebf24cd34..4463c60a6d5 100755 --- a/configure +++ b/configure @@ -10784,69 +10784,7 @@ done if test "$ac_cv_header_dbus_dbus_h" = "yes" -a "$ac_cv_header_hal_libhal_h" = "yes" then - { echo "$as_me:$LINENO: checking for libhal_ctx_new in -lhal" >&5 -echo $ECHO_N "checking for libhal_ctx_new in -lhal... $ECHO_C" >&6; } -if test "${ac_cv_lib_hal_libhal_ctx_new+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lhal $LIBS" -cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libhal_ctx_new (); -int -main () -{ -return libhal_ctx_new (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - ac_cv_lib_hal_libhal_ctx_new=yes -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - ac_cv_lib_hal_libhal_ctx_new=no -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ echo "$as_me:$LINENO: result: $ac_cv_lib_hal_libhal_ctx_new" >&5 -echo "${ECHO_T}$ac_cv_lib_hal_libhal_ctx_new" >&6; } -if test $ac_cv_lib_hal_libhal_ctx_new = yes; then - { echo "$as_me:$LINENO: checking for dbus_connection_close in -ldbus-1" >&5 + { echo "$as_me:$LINENO: checking for dbus_connection_close in -ldbus-1" >&5 echo $ECHO_N "checking for dbus_connection_close in -ldbus-1... $ECHO_C" >&6; } if test "${ac_cv_lib_dbus_1_dbus_connection_close+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10908,12 +10846,82 @@ fi { echo "$as_me:$LINENO: result: $ac_cv_lib_dbus_1_dbus_connection_close" >&5 echo "${ECHO_T}$ac_cv_lib_dbus_1_dbus_connection_close" >&6; } if test $ac_cv_lib_dbus_1_dbus_connection_close = yes; then + { echo "$as_me:$LINENO: checking for -lhal" >&5 +echo $ECHO_N "checking for -lhal... $ECHO_C" >&6; } +if test "${ac_cv_lib_soname_hal+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_soname_save_LIBS=$LIBS +LIBS="-lhal $ac_hal_libs $LIBS" + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ -cat >>confdefs.h <<\_ACEOF -#define HAVE_LIBHAL 1 +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char libhal_ctx_new (); +int +main () +{ +return libhal_ctx_new (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (ac_try="$ac_link" +case "(($ac_try" in + *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; + *) ac_try_echo=$ac_try;; +esac +eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 + (eval "$ac_link") 2>conftest.er1 + ac_status=$? + grep -v '^ *+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && { + test -z "$ac_c_werror_flag" || + test ! -s conftest.err + } && test -s conftest$ac_exeext && + $as_test_x conftest$ac_exeext; then + case "$LIBEXT" in + dll) ;; + dylib) ac_cv_lib_soname_hal=`otool -L conftest$ac_exeext | grep "libhal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libhal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + *) ac_cv_lib_soname_hal=`$ac_cv_path_LDD conftest$ac_exeext | grep "libhal\\.$LIBEXT" | sed -e "s/^.*\(libhal\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;; + esac +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + + +fi + +rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ + conftest$ac_exeext conftest.$ac_ext + LIBS=$ac_check_soname_save_LIBS +fi +if test "x$ac_cv_lib_soname_hal" = "x"; then + { echo "$as_me:$LINENO: result: not found" >&5 +echo "${ECHO_T}not found" >&6; } + +else + { echo "$as_me:$LINENO: result: $ac_cv_lib_soname_hal" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_hal" >&6; } + +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBHAL "$ac_cv_lib_soname_hal" _ACEOF - HALINCL="$ac_hal_cflags" + HALINCL="$ac_hal_cflags" fi fi @@ -14879,84 +14887,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -fi - -{ echo "$as_me:$LINENO: checking for -lhal" >&5 -echo $ECHO_N "checking for -lhal... $ECHO_C" >&6; } -if test "${ac_cv_lib_soname_hal+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_soname_save_LIBS=$LIBS -LIBS="-lhal $LIBS" - cat >conftest.$ac_ext <<_ACEOF -/* confdefs.h. */ -_ACEOF -cat confdefs.h >>conftest.$ac_ext -cat >>conftest.$ac_ext <<_ACEOF -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char libhal_ctx_new (); -int -main () -{ -return libhal_ctx_new (); - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (ac_try="$ac_link" -case "(($ac_try" in - *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;; - *) ac_try_echo=$ac_try;; -esac -eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5 - (eval "$ac_link") 2>conftest.er1 - ac_status=$? - grep -v '^ *+' conftest.er1 >conftest.err - rm -f conftest.er1 - cat conftest.err >&5 - echo "$as_me:$LINENO: \$? = $ac_status" >&5 - (exit $ac_status); } && { - test -z "$ac_c_werror_flag" || - test ! -s conftest.err - } && test -s conftest$ac_exeext && - $as_test_x conftest$ac_exeext; then - case "$LIBEXT" in - dll) ;; - dylib) ac_cv_lib_soname_hal=`otool -L conftest$ac_exeext | grep "libhal\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libhal\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_hal=`$ac_cv_path_LDD conftest$ac_exeext | grep "libhal\\.$LIBEXT" | sed -e "s/^.*\(libhal\.$LIBEXT[^ ]*\).*$/\1/"';2,$d'` ;; - esac -else - echo "$as_me: failed program was:" >&5 -sed 's/^/| /' conftest.$ac_ext >&5 - - -fi - -rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \ - conftest$ac_exeext conftest.$ac_ext - LIBS=$ac_check_soname_save_LIBS -fi -if test "x$ac_cv_lib_soname_hal" = "x"; then - { echo "$as_me:$LINENO: result: not found" >&5 -echo "${ECHO_T}not found" >&6; } - -else - { echo "$as_me:$LINENO: result: $ac_cv_lib_soname_hal" >&5 -echo "${ECHO_T}$ac_cv_lib_soname_hal" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SONAME_LIBHAL "$ac_cv_lib_soname_hal" -_ACEOF - - fi { echo "$as_me:$LINENO: checking for -ltxc_dxtn" >&5 diff --git a/configure.ac b/configure.ac index 2f0a56901d3..e300937b53c 100644 --- a/configure.ac +++ b/configure.ac @@ -676,10 +676,9 @@ then AC_CHECK_HEADERS([dbus/dbus.h hal/libhal.h]) if test "$ac_cv_header_dbus_dbus_h" = "yes" -a "$ac_cv_header_hal_libhal_h" = "yes" then - AC_CHECK_LIB(hal, libhal_ctx_new, - [AC_CHECK_LIB(dbus-1, dbus_connection_close, - [AC_DEFINE(HAVE_LIBHAL, 1, [Define if you have the hal library]) - 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" fi @@ -1117,7 +1116,6 @@ WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS WINE_CHECK_SONAME(Xcursor,XcursorImageLoadCursor,,,[$X_LIBS -lX11 $X_EXTRA_LIBS]) WINE_CHECK_SONAME(freetype,FT_Init_FreeType,,,[$X_LIBS]) WINE_CHECK_SONAME(GL,glXQueryExtension,,,[$X_LIBS $X_EXTRA_LIBS]) -WINE_CHECK_SONAME(hal,libhal_ctx_new) WINE_CHECK_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1) WINE_CHECK_SONAME(cups,cupsGetDefault) WINE_CHECK_SONAME(jack,jack_client_new) diff --git a/include/config.h.in b/include/config.h.in index dc8b6137954..a466d47521a 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -297,9 +297,6 @@ /* Define to 1 if you have the header file. */ #undef HAVE_LIBAUDIOIO_H -/* Define if you have the hal library */ -#undef HAVE_LIBHAL - /* Define to 1 if you have the `i386' library (-li386). */ #undef HAVE_LIBI386 diff --git a/programs/explorer/hal.c b/programs/explorer/hal.c index 47c6708675f..6b5be469bdb 100644 --- a/programs/explorer/hal.c +++ b/programs/explorer/hal.c @@ -40,7 +40,7 @@ WINE_DEFAULT_DEBUG_CHANNEL(explorer); -#ifdef HAVE_LIBHAL +#ifdef SONAME_LIBHAL #include #include @@ -75,10 +75,6 @@ DBUS_FUNCS; HAL_FUNCS; #undef DO_FUNC -#ifndef SONAME_LIBHAL -#define SONAME_LIBHAL "libhal" SONAME_EXT -#endif - static BOOL load_functions(void) { void *hal_handle; @@ -240,11 +236,11 @@ void initialize_hal(void) CloseHandle( handle ); } -#else /* HAVE_LIBHAL */ +#else /* SONAME_LIBHAL */ void initialize_hal(void) { WINE_TRACE( "Skipping, HAL support not compiled in\n" ); } -#endif /* HAVE_LIBHAL */ +#endif /* SONAME_LIBHAL */