Tk Source Code

Artifact [77761620]
Login

Artifact 777616205335f376d3e4a8a29e90e957b5d087e4:

Attachment "tkxss.diff" to ticket [3602534f] added by stwo 2013-01-29 23:00:11.
--- configure.in
+++ configure.in
@@ -483,60 +483,10 @@
     ], AC_MSG_RESULT([no]))
     CFLAGS=$tk_oldCFlags
     LIBS=$tk_oldLibs
 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.
 #--------------------------------------------------------------------
 
 if test $tk_aqua = no; then
@@ -605,10 +555,63 @@
     fi
     AC_SUBST(XFT_CFLAGS)
     AC_SUBST(XFT_LIBS)
     AC_SUBST(UNIX_FONT_OBJS)
 fi
+
+#--------------------------------------------------------------------
+# 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__.
 #--------------------------------------------------------------------