configure: Merge the libXrender existence check with the soname check.

This commit is contained in:
Alexandre Julliard 2007-07-04 12:47:57 +02:00
parent af928ecbfa
commit 629639ee60
4 changed files with 167 additions and 172 deletions

304
configure vendored
View File

@ -9324,7 +9324,158 @@ fi
fi fi
if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
then
{ echo "$as_me:$LINENO: checking for -lXrender" >&5
echo $ECHO_N "checking for -lXrender... $ECHO_C" >&6; }
if test "${ac_cv_lib_soname_Xrender+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-lXrender $X_LIBS -lXext -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 XRenderQueryExtension ();
int
main ()
{
return XRenderQueryExtension ();
;
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_Xrender=`otool -L conftest$ac_exeext | grep "libXrender\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep "libXrender\\.$LIBEXT" | sed -e "s/^.*\(libXrender\.$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_Xrender" = "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_Xrender" >&5
echo "${ECHO_T}$ac_cv_lib_soname_Xrender" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBXRENDER "$ac_cv_lib_soname_Xrender"
_ACEOF
{ echo "$as_me:$LINENO: checking for XRenderSetPictureTransform in -lXrender" >&5
echo $ECHO_N "checking for XRenderSetPictureTransform in -lXrender... $ECHO_C" >&6; }
if test "${ac_cv_lib_Xrender_XRenderSetPictureTransform+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXrender $X_LIBS -lXext -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 XRenderSetPictureTransform ();
int
main ()
{
return XRenderSetPictureTransform ();
;
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_Xrender_XRenderSetPictureTransform=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_Xrender_XRenderSetPictureTransform=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_Xrender_XRenderSetPictureTransform" >&5
echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderSetPictureTransform" >&6; }
if test $ac_cv_lib_Xrender_XRenderSetPictureTransform = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_XRENDERSETPICTURETRANSFORM 1
_ACEOF
fi
fi
fi
if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" -a "x$ac_cv_lib_soname_Xrender" != "x"
then then
cat >conftest.$ac_ext <<_ACEOF cat >conftest.$ac_ext <<_ACEOF
/* confdefs.h. */ /* confdefs.h. */
@ -9445,79 +9596,6 @@ sed 's/^/| /' conftest.$ac_ext >&5
fi fi
rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
fi
if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
then
{ echo "$as_me:$LINENO: checking for XRenderSetPictureTransform in -lXrender" >&5
echo $ECHO_N "checking for XRenderSetPictureTransform in -lXrender... $ECHO_C" >&6; }
if test "${ac_cv_lib_Xrender_XRenderSetPictureTransform+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_lib_save_LIBS=$LIBS
LIBS="-lXrender $X_LIBS -lXext -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 XRenderSetPictureTransform ();
int
main ()
{
return XRenderSetPictureTransform ();
;
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_Xrender_XRenderSetPictureTransform=yes
else
echo "$as_me: failed program was:" >&5
sed 's/^/| /' conftest.$ac_ext >&5
ac_cv_lib_Xrender_XRenderSetPictureTransform=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_Xrender_XRenderSetPictureTransform" >&5
echo "${ECHO_T}$ac_cv_lib_Xrender_XRenderSetPictureTransform" >&6; }
if test $ac_cv_lib_Xrender_XRenderSetPictureTransform = yes; then
cat >>confdefs.h <<\_ACEOF
#define HAVE_XRENDERSETPICTURETRANSFORM 1
_ACEOF
fi
fi fi
if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes" if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes"
@ -15260,84 +15338,6 @@ cat >>confdefs.h <<_ACEOF
_ACEOF _ACEOF
fi
{ echo "$as_me:$LINENO: checking for -lXrender" >&5
echo $ECHO_N "checking for -lXrender... $ECHO_C" >&6; }
if test "${ac_cv_lib_soname_Xrender+set}" = set; then
echo $ECHO_N "(cached) $ECHO_C" >&6
else
ac_check_soname_save_LIBS=$LIBS
LIBS="-lXrender $X_LIBS -lXext -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 XRenderQueryExtension ();
int
main ()
{
return XRenderQueryExtension ();
;
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_Xrender=`otool -L conftest$ac_exeext | grep "libXrender\\.[0-9A-Za-z.]*dylib" | sed -e "s/^.*\/\(libXrender\.[0-9A-Za-z.]*dylib\).*$/\1/"';2,$d'` ;;
*) ac_cv_lib_soname_Xrender=`$ac_cv_path_LDD conftest$ac_exeext | grep "libXrender\\.$LIBEXT" | sed -e "s/^.*\(libXrender\.$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_Xrender" = "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_Xrender" >&5
echo "${ECHO_T}$ac_cv_lib_soname_Xrender" >&6; }
cat >>confdefs.h <<_ACEOF
#define SONAME_LIBXRENDER "$ac_cv_lib_soname_Xrender"
_ACEOF
fi fi
{ echo "$as_me:$LINENO: checking for -lXcursor" >&5 { echo "$as_me:$LINENO: checking for -lXcursor" >&5

View File

@ -534,23 +534,25 @@ then
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS) $X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
fi fi
dnl *** Check for Transform functions in Xrender
if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
then
WINE_CHECK_SONAME(Xrender,XRenderQueryExtension,
[AC_CHECK_LIB(Xrender,XRenderSetPictureTransform,
[AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
[Define if Xrender has the XRenderSetPictureTransform function])],,
[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])],,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
fi
dnl *** Check for X RandR extension dnl *** Check for X RandR extension
if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" if test "$ac_cv_header_X11_extensions_Xrandr_h" = "yes" -a "x$ac_cv_lib_soname_Xrender" != "x"
then then
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h> AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <X11/Xlib.h>
#include <X11/extensions/Xrandr.h>]], [[static typeof(XRRSetScreenConfigAndRate) * func;]])], #include <X11/extensions/Xrandr.h>]], [[static typeof(XRRSetScreenConfigAndRate) * func;]])],
[WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])]) [WINE_CHECK_SONAME(Xrandr,XRRQueryExtension,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])])
fi fi
dnl *** Check for Transform functions in Xrender
if test "$ac_cv_header_X11_extensions_Xrender_h" = "yes"
then
AC_CHECK_LIB(Xrender, XRenderSetPictureTransform,
[AC_DEFINE(HAVE_XRENDERSETPICTURETRANSFORM, 1,
[Define if Xrender has the XRenderSetPictureTransform function])],,
$X_LIBS -lXext -lX11 $X_EXTRA_LIBS)
fi
dnl *** Check for Xinerama extension dnl *** Check for Xinerama extension
if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes" if test "$ac_cv_header_X11_extensions_Xinerama_h" = "yes"
then then
@ -1147,7 +1149,6 @@ WINE_CHECK_SONAME(X11,XCreateWindow,,,[$X_LIBS $X_EXTRA_LIBS])
WINE_CHECK_SONAME(Xext,XextCreateExtension,,,[$X_LIBS -lX11 $X_EXTRA_LIBS]) WINE_CHECK_SONAME(Xext,XextCreateExtension,,,[$X_LIBS -lX11 $X_EXTRA_LIBS])
WINE_CHECK_SONAME(Xi,XOpenDevice,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) WINE_CHECK_SONAME(Xi,XOpenDevice,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
WINE_CHECK_SONAME(Xinerama,XineramaQueryScreens,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS]) WINE_CHECK_SONAME(Xinerama,XineramaQueryScreens,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
WINE_CHECK_SONAME(Xrender,XRenderQueryExtension,,,[$X_LIBS -lXext -lX11 $X_EXTRA_LIBS])
WINE_CHECK_SONAME(Xcursor,XcursorImageLoadCursor,,,[$X_LIBS -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(freetype,FT_Init_FreeType,,,[$X_LIBS])
WINE_CHECK_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1) WINE_CHECK_SONAME(txc_dxtn,fetch_2d_texel_rgba_dxt1)

View File

@ -49,9 +49,6 @@ static void *xrandr_handle;
#ifndef SONAME_LIBXEXT #ifndef SONAME_LIBXEXT
#define SONAME_LIBXEXT "libXext" SONAME_EXT #define SONAME_LIBXEXT "libXext" SONAME_EXT
#endif #endif
#ifndef SONAME_LIBXRENDER
#define SONAME_LIBXRENDER "libXrender" SONAME_EXT
#endif
#define MAKE_FUNCPTR(f) static typeof(f) * p##f; #define MAKE_FUNCPTR(f) static typeof(f) * p##f;
MAKE_FUNCPTR(XRRConfigCurrentConfiguration) MAKE_FUNCPTR(XRRConfigCurrentConfiguration)

View File

@ -41,7 +41,7 @@ int using_client_side_fonts = FALSE;
WINE_DEFAULT_DEBUG_CHANNEL(xrender); WINE_DEFAULT_DEBUG_CHANNEL(xrender);
#ifdef HAVE_X11_EXTENSIONS_XRENDER_H #ifdef SONAME_LIBXRENDER
#include <X11/Xlib.h> #include <X11/Xlib.h>
#include <X11/extensions/Xrender.h> #include <X11/extensions/Xrender.h>
@ -103,9 +103,6 @@ static int antialias = 1;
#ifndef SONAME_LIBXEXT #ifndef SONAME_LIBXEXT
#define SONAME_LIBXEXT "libXext" SONAME_EXT #define SONAME_LIBXEXT "libXext" SONAME_EXT
#endif #endif
#ifndef SONAME_LIBXRENDER
#define SONAME_LIBXRENDER "libXrender" SONAME_EXT
#endif
static void *xrender_handle; static void *xrender_handle;
@ -1678,7 +1675,7 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
return TRUE; return TRUE;
} }
#else /* HAVE_X11_EXTENSIONS_XRENDER_H */ #else /* SONAME_LIBXRENDER */
void X11DRV_XRender_Init(void) void X11DRV_XRender_Init(void)
{ {
@ -1727,4 +1724,4 @@ BOOL X11DRV_AlphaBlend(X11DRV_PDEVICE *devDst, INT xDst, INT yDst, INT widthDst,
return FALSE; return FALSE;
} }
#endif /* HAVE_X11_EXTENSIONS_XRENDER_H */ #endif /* SONAME_LIBXRENDER */