summaryrefslogtreecommitdiffstats
path: root/unix/configure.in
diff options
context:
space:
mode:
authorstwo <stwo>2013-01-31 11:27:17 (GMT)
committerstwo <stwo>2013-01-31 11:27:17 (GMT)
commitb759e66206f54d4053c05aa250fd24e14809407e (patch)
treecc2086e650fe3da1ad084ba94e681c0bb4547b75 /unix/configure.in
parent7a60939a9fb681c46c9a5db933814ee54e88ba54 (diff)
downloadtk-b759e66206f54d4053c05aa250fd24e14809407e.zip
tk-b759e66206f54d4053c05aa250fd24e14809407e.tar.gz
tk-b759e66206f54d4053c05aa250fd24e14809407e.tar.bz2
Bug [3602534]: Test for XScreensaver last.
Diffstat (limited to 'unix/configure.in')
-rw-r--r--unix/configure.in103
1 files changed, 53 insertions, 50 deletions
diff --git a/unix/configure.in b/unix/configure.in
index d052675..e199eaf 100644
--- a/unix/configure.in
+++ b/unix/configure.in
@@ -457,56 +457,6 @@ if test -d /usr/include/mit -a $tk_aqua = no; then
fi
#--------------------------------------------------------------------
-# Check whether the header and library for the XScreenSaver
-# extension are available, and set HAVE_XSS if so.
-# XScreenSaver is needed for Tk_GetUserInactiveTime().
-#--------------------------------------------------------------------
-
-if test $tk_aqua = no; then
- tk_oldCFlags=$CFLAGS
- CFLAGS="$CFLAGS $XINCLUDES"
- tk_oldLibs=$LIBS
- LIBS="$tk_oldLibs $XLIBSW"
- xss_header_found=no
- xss_lib_found=no
- AC_MSG_CHECKING([whether to try to use XScreenSaver])
- AC_ARG_ENABLE(xss,
- AC_HELP_STRING([--enable-xss],
- [use XScreenSaver for activity timer (default: on)]),
- [enable_xss=$enableval], [enable_xss=yes])
- if test "$enable_xss" = "no" ; then
- AC_MSG_RESULT([$enable_xss])
- else
- AC_MSG_RESULT([$enable_xss])
- AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [
- xss_header_found=yes
- ],,[#include <X11/Xlib.h>])
- AC_CHECK_FUNC(XScreenSaverQueryInfo,,[
- AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [
- XLIBSW="$XLIBSW -lXext"
- xss_lib_found=yes
- ], [
- AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [
- if test "$tcl_cv_ld_weak_l" = yes; then
- # On Darwin, weak link libXss if possible,
- # as it is only available on Tiger or later.
- XLIBSW="$XLIBSW -Wl,-weak-lXss -lXext"
- else
- XLIBSW="$XLIBSW -lXss -lXext"
- fi
- xss_lib_found=yes
- ],, -lXext)
- ])
- ])
- fi
- if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then
- AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?])
- fi
- CFLAGS=$tk_oldCFlags
- LIBS=$tk_oldLibs
-fi
-
-#--------------------------------------------------------------------
# Check for freetype / fontconfig / Xft support.
#--------------------------------------------------------------------
@@ -580,6 +530,59 @@ if test $tk_aqua = no; then
fi
#--------------------------------------------------------------------
+# XXX Do this last.
+# It might modify XLIBSW which could affect other tests.
+#
+# Check whether the header and library for the XScreenSaver
+# extension are available, and set HAVE_XSS if so.
+# XScreenSaver is needed for Tk_GetUserInactiveTime().
+#--------------------------------------------------------------------
+
+if test $tk_aqua = no; then
+ tk_oldCFlags=$CFLAGS
+ CFLAGS="$CFLAGS $XINCLUDES"
+ tk_oldLibs=$LIBS
+ LIBS="$tk_oldLibs $XLIBSW"
+ xss_header_found=no
+ xss_lib_found=no
+ AC_MSG_CHECKING([whether to try to use XScreenSaver])
+ AC_ARG_ENABLE(xss,
+ AC_HELP_STRING([--enable-xss],
+ [use XScreenSaver for activity timer (default: on)]),
+ [enable_xss=$enableval], [enable_xss=yes])
+ if test "$enable_xss" = "no" ; then
+ AC_MSG_RESULT([$enable_xss])
+ else
+ AC_MSG_RESULT([$enable_xss])
+ AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [
+ xss_header_found=yes
+ ],,[#include <X11/Xlib.h>])
+ AC_CHECK_FUNC(XScreenSaverQueryInfo,,[
+ AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [
+ XLIBSW="$XLIBSW -lXext"
+ xss_lib_found=yes
+ ], [
+ AC_CHECK_LIB(Xss, XScreenSaverQueryInfo, [
+ if test "$tcl_cv_ld_weak_l" = yes; then
+ # On Darwin, weak link libXss if possible,
+ # as it is only available on Tiger or later.
+ XLIBSW="$XLIBSW -Wl,-weak-lXss -lXext"
+ else
+ XLIBSW="$XLIBSW -lXss -lXext"
+ fi
+ xss_lib_found=yes
+ ],, -lXext)
+ ])
+ ])
+ fi
+ if test $enable_xss = yes -a $xss_lib_found = yes -a $xss_header_found = yes; then
+ AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?])
+ fi
+ CFLAGS=$tk_oldCFlags
+ LIBS=$tk_oldLibs
+fi
+
+#--------------------------------------------------------------------
# Figure out whether "char" is unsigned. If so, set a
# #define for __CHAR_UNSIGNED__.
#--------------------------------------------------------------------