From a851854a36b979979907f04342dc74dab82ae6ee Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 9 Jul 2007 22:43:45 +0200 Subject: [PATCH] configure: Merge the libX11 and libXext existence check with the soname check. --- configure | 316 ++++++++++++++++++------------------- configure.ac | 8 +- dlls/winex11.drv/xrandr.c | 8 - dlls/winex11.drv/xrender.c | 8 - 4 files changed, 162 insertions(+), 178 deletions(-) diff --git a/configure b/configure index c5f11010de7..3790365766d 100755 --- a/configure +++ b/configure @@ -8945,6 +8945,163 @@ then ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" + { echo "$as_me:$LINENO: checking for -lX11" >&5 +echo $ECHO_N "checking for -lX11... $ECHO_C" >&6; } +if test "${ac_cv_lib_soname_X11+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_soname_save_LIBS=$LIBS +LIBS="-lX11 $X_LIBS $X_EXTRA_LIBS $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 XCreateWindow (); +int +main () +{ +return XCreateWindow (); + ; + 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_X11=`otool -L conftest$ac_exeext | grep "libX11\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + *) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep "libX11\\.$LIBEXT" | sed -e "s/^.*\(libX11\.$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_X11" = "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_X11" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_X11" >&6; } + +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBX11 "$ac_cv_lib_soname_X11" +_ACEOF + + +fi + + { echo "$as_me:$LINENO: checking for -lXext" >&5 +echo $ECHO_N "checking for -lXext... $ECHO_C" >&6; } +if test "${ac_cv_lib_soname_Xext+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_soname_save_LIBS=$LIBS +LIBS="-lXext $X_LIBS -lX11 $X_EXTRA_LIBS $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 XextCreateExtension (); +int +main () +{ +return XextCreateExtension (); + ; + 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_Xext=`otool -L conftest$ac_exeext | grep "libXext\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; + *) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep "libXext\\.$LIBEXT" | sed -e "s/^.*\(libXext\.$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_Xext" = "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_Xext" >&5 +echo "${ECHO_T}$ac_cv_lib_soname_Xext" >&6; } + +cat >>confdefs.h <<_ACEOF +#define SONAME_LIBXEXT "$ac_cv_lib_soname_Xext" +_ACEOF + + +fi + + @@ -9487,7 +9644,7 @@ fi fi - if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" + if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" -a "x$ac_cv_lib_soname_X11" != "x" -a "x$ac_cv_lib_soname_Xext" != "x" then { echo "$as_me:$LINENO: checking for -lXrender" >&5 echo $ECHO_N "checking for -lXrender... $ECHO_C" >&6; } @@ -15225,163 +15382,6 @@ cat >>confdefs.h <<_ACEOF _ACEOF -{ echo "$as_me:$LINENO: checking for -lX11" >&5 -echo $ECHO_N "checking for -lX11... $ECHO_C" >&6; } -if test "${ac_cv_lib_soname_X11+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_soname_save_LIBS=$LIBS -LIBS="-lX11 $X_LIBS $X_EXTRA_LIBS $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 XCreateWindow (); -int -main () -{ -return XCreateWindow (); - ; - 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_X11=`otool -L conftest$ac_exeext | grep "libX11\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libX11\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_X11=`$ac_cv_path_LDD conftest$ac_exeext | grep "libX11\\.$LIBEXT" | sed -e "s/^.*\(libX11\.$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_X11" = "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_X11" >&5 -echo "${ECHO_T}$ac_cv_lib_soname_X11" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SONAME_LIBX11 "$ac_cv_lib_soname_X11" -_ACEOF - - -fi - -{ echo "$as_me:$LINENO: checking for -lXext" >&5 -echo $ECHO_N "checking for -lXext... $ECHO_C" >&6; } -if test "${ac_cv_lib_soname_Xext+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - ac_check_soname_save_LIBS=$LIBS -LIBS="-lXext $X_LIBS -lX11 $X_EXTRA_LIBS $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 XextCreateExtension (); -int -main () -{ -return XextCreateExtension (); - ; - 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_Xext=`otool -L conftest$ac_exeext | grep "libXext\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXext\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;; - *) ac_cv_lib_soname_Xext=`$ac_cv_path_LDD conftest$ac_exeext | grep "libXext\\.$LIBEXT" | sed -e "s/^.*\(libXext\.$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_Xext" = "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_Xext" >&5 -echo "${ECHO_T}$ac_cv_lib_soname_Xext" >&6; } - -cat >>confdefs.h <<_ACEOF -#define SONAME_LIBXEXT "$ac_cv_lib_soname_Xext" -_ACEOF - - -fi - - diff --git a/configure.ac b/configure.ac index 3246f4ad078..0240fee07ba 100644 --- a/configure.ac +++ b/configure.ac @@ -481,6 +481,9 @@ then ac_save_CPPFLAGS="$CPPFLAGS" CPPFLAGS="$CPPFLAGS $X_CFLAGS" + WINE_CHECK_SONAME(X11,XCreateWindow,,,[$X_LIBS $X_EXTRA_LIBS]) + WINE_CHECK_SONAME(Xext,XextCreateExtension,,,[$X_LIBS -lX11 $X_EXTRA_LIBS]) + dnl *** All of the following tests require X11/Xlib.h AC_CHECK_HEADERS([X11/Xlib.h \ X11/XKBlib.h \ @@ -547,7 +550,7 @@ then fi dnl *** Check for Transform functions in Xrender - if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" + if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes" -a "x$ac_cv_lib_soname_X11" != "x" -a "x$ac_cv_lib_soname_Xext" != "x" then WINE_CHECK_SONAME(Xrender,XRenderQueryExtension, [AC_CHECK_LIB(Xrender,XRenderSetPictureTransform, @@ -1139,9 +1142,6 @@ dnl **** Get the soname for libraries that we load dynamically **** AC_DEFINE_UNQUOTED(SONAME_EXT,[".$LIBEXT"],[Define to the file extension of shared libraries.]) -WINE_CHECK_SONAME(X11,XCreateWindow,,,[$X_LIBS $X_EXTRA_LIBS]) -WINE_CHECK_SONAME(Xext,XextCreateExtension,,,[$X_LIBS -lX11 $X_EXTRA_LIBS]) - dnl **** Check for functions **** diff --git a/dlls/winex11.drv/xrandr.c b/dlls/winex11.drv/xrandr.c index 67aa14e935e..8a8d7d922d5 100644 --- a/dlls/winex11.drv/xrandr.c +++ b/dlls/winex11.drv/xrandr.c @@ -42,14 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(xrandr); static void *xrandr_handle; -/* some default values just in case */ -#ifndef SONAME_LIBX11 -#define SONAME_LIBX11 "libX11" SONAME_EXT -#endif -#ifndef SONAME_LIBXEXT -#define SONAME_LIBXEXT "libXext" SONAME_EXT -#endif - #define MAKE_FUNCPTR(f) static typeof(f) * p##f; MAKE_FUNCPTR(XRRConfigCurrentConfiguration) MAKE_FUNCPTR(XRRConfigCurrentRate) diff --git a/dlls/winex11.drv/xrender.c b/dlls/winex11.drv/xrender.c index 77ba9e59e01..8511f456268 100644 --- a/dlls/winex11.drv/xrender.c +++ b/dlls/winex11.drv/xrender.c @@ -96,14 +96,6 @@ static INT mru = -1; static int antialias = 1; -/* some default values just in case */ -#ifndef SONAME_LIBX11 -#define SONAME_LIBX11 "libX11" SONAME_EXT -#endif -#ifndef SONAME_LIBXEXT -#define SONAME_LIBXEXT "libXext" SONAME_EXT -#endif - static void *xrender_handle; #define MAKE_FUNCPTR(f) static typeof(f) * p##f;