diff options
author | stwo <stwo> | 2013-01-31 11:21:04 (GMT) |
---|---|---|
committer | stwo <stwo> | 2013-01-31 11:21:04 (GMT) |
commit | 4682e1fb605d0fff7e8338f10080416e3e342cb9 (patch) | |
tree | 3e1b045f6b3c3d5b208a14975282f4583621d260 /unix/configure.in | |
parent | f5cd036029ec84c3e42c672341d77ca013afbc71 (diff) | |
download | tk-4682e1fb605d0fff7e8338f10080416e3e342cb9.zip tk-4682e1fb605d0fff7e8338f10080416e3e342cb9.tar.gz tk-4682e1fb605d0fff7e8338f10080416e3e342cb9.tar.bz2 |
Bug [3602534]: Test for XScreensaver last.
Diffstat (limited to 'unix/configure.in')
-rw-r--r-- | unix/configure.in | 103 |
1 files changed, 53 insertions, 50 deletions
diff --git a/unix/configure.in b/unix/configure.in index abc8a1d..00a67ed 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -486,56 +486,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. #-------------------------------------------------------------------- @@ -609,6 +559,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__. #-------------------------------------------------------------------- |