configure: Merge the libX11 and libXext existence check with the soname check.

This commit is contained in:
Alexandre Julliard 2007-07-09 22:43:45 +02:00
parent 24a55f3862
commit a851854a36
4 changed files with 162 additions and 178 deletions

316
configure vendored
View File

@ -8945,6 +8945,163 @@ then
ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS" 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 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 then
{ echo "$as_me:$LINENO: checking for -lXrender" >&5 { echo "$as_me:$LINENO: checking for -lXrender" >&5
echo $ECHO_N "checking for -lXrender... $ECHO_C" >&6; } echo $ECHO_N "checking for -lXrender... $ECHO_C" >&6; }
@ -15225,163 +15382,6 @@ cat >>confdefs.h <<_ACEOF
_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

View File

@ -481,6 +481,9 @@ then
ac_save_CPPFLAGS="$CPPFLAGS" ac_save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS" 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 dnl *** All of the following tests require X11/Xlib.h
AC_CHECK_HEADERS([X11/Xlib.h \ AC_CHECK_HEADERS([X11/Xlib.h \
X11/XKBlib.h \ X11/XKBlib.h \
@ -547,7 +550,7 @@ then
fi fi
dnl *** Check for Transform functions in Xrender 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 then
WINE_CHECK_SONAME(Xrender,XRenderQueryExtension, WINE_CHECK_SONAME(Xrender,XRenderQueryExtension,
[AC_CHECK_LIB(Xrender,XRenderSetPictureTransform, [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.]) 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 **** dnl **** Check for functions ****

View File

@ -42,14 +42,6 @@ WINE_DEFAULT_DEBUG_CHANNEL(xrandr);
static void *xrandr_handle; 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; #define MAKE_FUNCPTR(f) static typeof(f) * p##f;
MAKE_FUNCPTR(XRRConfigCurrentConfiguration) MAKE_FUNCPTR(XRRConfigCurrentConfiguration)
MAKE_FUNCPTR(XRRConfigCurrentRate) MAKE_FUNCPTR(XRRConfigCurrentRate)

View File

@ -96,14 +96,6 @@ static INT mru = -1;
static int antialias = 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; static void *xrender_handle;
#define MAKE_FUNCPTR(f) static typeof(f) * p##f; #define MAKE_FUNCPTR(f) static typeof(f) * p##f;