diff options
Diffstat (limited to 'unix')
-rwxr-xr-x | unix/configure | 358 | ||||
-rw-r--r-- | unix/configure.in | 41 | ||||
-rw-r--r-- | unix/tcl.m4 | 131 | ||||
-rw-r--r-- | unix/tkUnix.c | 14 |
4 files changed, 424 insertions, 120 deletions
diff --git a/unix/configure b/unix/configure index c97999a..3f444fa 100755 --- a/unix/configure +++ b/unix/configure @@ -845,27 +845,32 @@ if test -n "$ac_init_help"; then Optional Features: --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) --enable-FEATURE[=ARG] include FEATURE [ARG=yes] - --enable-man-symlinks use symlinks for the manpages + --enable-man-symlinks use symlinks for the manpages (default: off) --enable-man-compression=PROG - compress the manpages with PROG + compress the manpages with PROG (default: off) --enable-man-suffix=STRING use STRING as a suffix to manpage file names - (default: tk) - --enable-threads build with threads - --enable-shared build and link with shared libraries --enable-shared - --enable-64bit enable 64bit support (where applicable) - --enable-64bit-vis enable 64bit Sparc VIS support - --enable-corefoundation use CoreFoundation API --enable-corefoundation + (default: no, tk if enabled without + specifying STRING) + --enable-threads build with threads (default: off) + --enable-shared build and link with shared libraries (default: on) + --enable-64bit enable 64bit support (default: off) + --enable-64bit-vis enable 64bit Sparc VIS support (default: off) + --enable-corefoundation use CoreFoundation API on MacOSX (default: yes) --disable-load disallow dynamic loading and "load" command - --enable-symbols build with debugging symbols --disable-symbols - --enable-aqua enable Aqua windowingsystem on Mac OS X --disable-aqua - --enable-xft Use freetype/fontconfig/xft --disable-xft - --enable-framework package shared libraries in MacOSX frameworks --disable-framework + (default: enabled) + --enable-symbols build with debugging symbols (default: off) + --enable-aqua enable Aqua windowingsystem on Mac OS X (default: + off) + --enable-xft Use freetype/fontconfig/xft (default: off) + --enable-framework package shared libraries in MacOSX frameworks + (default: off) Optional Packages: --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) - --with-tcl directory containing tcl configuration (tclConfig.sh) + --with-tcl directory containing tcl configuration + (tclConfig.sh) --with-x use the X Window System Some influential environment variables: @@ -1529,56 +1534,61 @@ TK_SRC_DIR=`cd $srcdir/..; pwd` # Compress and/or soft link the manpages? #------------------------------------------------------------------------ - - echo "$as_me:$LINENO: checking whether to use symlinks for manpages" >&5 + echo "$as_me:$LINENO: checking whether to use symlinks for manpages" >&5 echo $ECHO_N "checking whether to use symlinks for manpages... $ECHO_C" >&6 - # Check whether --enable-man-symlinks or --disable-man-symlinks was given. + # Check whether --enable-man-symlinks or --disable-man-symlinks was given. if test "${enable_man_symlinks+set}" = set; then enableval="$enable_man_symlinks" test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks" else enableval="no" fi; - echo "$as_me:$LINENO: result: $enableval" >&5 + echo "$as_me:$LINENO: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 - echo "$as_me:$LINENO: checking whether to compress the manpages" >&5 + echo "$as_me:$LINENO: checking whether to compress the manpages" >&5 echo $ECHO_N "checking whether to compress the manpages... $ECHO_C" >&6 - # Check whether --enable-man-compression or --disable-man-compression was given. + # Check whether --enable-man-compression or --disable-man-compression was given. if test "${enable_man_compression+set}" = set; then enableval="$enable_man_compression" - test "$enableval" = "yes" && { { echo "$as_me:$LINENO: error: missing argument to --enable-man-compression" >&5 + case $enableval in + yes) { { echo "$as_me:$LINENO: error: missing argument to --enable-man-compression" >&5 echo "$as_me: error: missing argument to --enable-man-compression" >&2;} - { (exit 1); exit 1; }; } - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval" + { (exit 1); exit 1; }; };; + no) ;; + *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; + esac else enableval="no" fi; - echo "$as_me:$LINENO: result: $enableval" >&5 + echo "$as_me:$LINENO: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 - if test "$enableval" != "no"; then - echo "$as_me:$LINENO: checking for compressed file suffix" >&5 + if test "$enableval" != "no"; then + echo "$as_me:$LINENO: checking for compressed file suffix" >&5 echo $ECHO_N "checking for compressed file suffix... $ECHO_C" >&6 - touch TeST - $enableval TeST - Z=`ls TeST* | sed 's/^....//'` - rm -f TeST* - MAN_FLAGS="$MAN_FLAGS --extension $Z" - echo "$as_me:$LINENO: result: $Z" >&5 + touch TeST + $enableval TeST + Z=`ls TeST* | sed 's/^....//'` + rm -f TeST* + MAN_FLAGS="$MAN_FLAGS --extension $Z" + echo "$as_me:$LINENO: result: $Z" >&5 echo "${ECHO_T}$Z" >&6 - fi + fi - echo "$as_me:$LINENO: checking whether to add a package name suffix for the manpages" >&5 + echo "$as_me:$LINENO: checking whether to add a package name suffix for the manpages" >&5 echo $ECHO_N "checking whether to add a package name suffix for the manpages... $ECHO_C" >&6 - # Check whether --enable-man-suffix or --disable-man-suffix was given. + # Check whether --enable-man-suffix or --disable-man-suffix was given. if test "${enable_man_suffix+set}" = set; then enableval="$enable_man_suffix" - test "$enableval" = "yes" && enableval="tk" - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval" + case $enableval in + yes) enableval="tk";; + no) ;; + *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; + esac else enableval="no" fi; - echo "$as_me:$LINENO: result: $enableval" >&5 + echo "$as_me:$LINENO: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 @@ -9281,28 +9291,187 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - echo "$as_me:$LINENO: checking for XScreenSaver support" >&5 -echo $ECHO_N "checking for XScreenSaver support... $ECHO_C" >&6 + tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES" tk_oldLibs=$LIBS - LIBS="$LIBS $XLIBSW -lXss -lXext" - cat >conftest.$ac_ext <<_ACEOF + LIBS="$tk_oldLibs $XLIBSW" + xss_header_found=no + echo "$as_me:$LINENO: checking for X11/extensions/scrnsaver.h" >&5 +echo $ECHO_N "checking for X11/extensions/scrnsaver.h... $ECHO_C" >&6 +if test "${ac_cv_header_X11_extensions_scrnsaver_h+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +/* confdefs.h. */ +_ACEOF +cat confdefs.h >>conftest.$ac_ext +cat >>conftest.$ac_ext <<_ACEOF +/* end confdefs.h. */ +#include <X11/Xlib.h> + +#include <X11/extensions/scrnsaver.h> +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 + (eval $ac_compile) 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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_header_X11_extensions_scrnsaver_h=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 + +ac_cv_header_X11_extensions_scrnsaver_h=no +fi +rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_header_X11_extensions_scrnsaver_h" >&5 +echo "${ECHO_T}$ac_cv_header_X11_extensions_scrnsaver_h" >&6 +if test $ac_cv_header_X11_extensions_scrnsaver_h = yes; then + + xss_header_found=yes + +fi + + + xss_lib_found=no + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo... $ECHO_C" >&6 +if test "${ac_cv_func_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF /* confdefs.h. */ _ACEOF cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ +/* Define XScreenSaverQueryInfo to an innocuous variant, in case <limits.h> declares XScreenSaverQueryInfo. + For example, HP-UX 11i <limits.h> declares gettimeofday. */ +#define XScreenSaverQueryInfo innocuous_XScreenSaverQueryInfo + +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char XScreenSaverQueryInfo (); below. + Prefer <limits.h> to <assert.h> if __STDC__ is defined, since + <limits.h> exists even on freestanding compilers. */ + +#ifdef __STDC__ +# include <limits.h> +#else +# include <assert.h> +#endif + +#undef XScreenSaverQueryInfo - #include <X11/Xlib.h> - #include <X11/extensions/scrnsaver.h> +/* Override any gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +{ +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XScreenSaverQueryInfo (); +/* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ +#if defined (__stub_XScreenSaverQueryInfo) || defined (__stub___XScreenSaverQueryInfo) +choke me +#else +char (*f) () = XScreenSaverQueryInfo; +#endif +#ifdef __cplusplus +} +#endif int main () { +return f != XScreenSaverQueryInfo; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_XScreenSaverQueryInfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - XScreenSaverAllocInfo(); +ac_cv_func_XScreenSaverQueryInfo=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:$LINENO: result: $ac_cv_func_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_func_XScreenSaverQueryInfo" >&6 +if test $ac_cv_func_XScreenSaverQueryInfo = yes; then + : +else + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXext" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXext... $ECHO_C" >&6 +if test "${ac_cv_lib_Xext_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXext $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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XScreenSaverQueryInfo (); +int +main () +{ +XScreenSaverQueryInfo (); ; return 0; } @@ -9329,25 +9498,110 @@ if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 ac_status=$? echo "$as_me:$LINENO: \$? = $ac_status" >&5 (exit $ac_status); }; }; then + ac_cv_lib_Xext_XScreenSaverQueryInfo=yes +else + echo "$as_me: failed program was:" >&5 +sed 's/^/| /' conftest.$ac_ext >&5 - echo "$as_me:$LINENO: result: yes" >&5 -echo "${ECHO_T}yes" >&6 - XLIBSW="$XLIBSW -lXss -lXext" +ac_cv_lib_Xext_XScreenSaverQueryInfo=no +fi +rm -f conftest.err conftest.$ac_objext \ + conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xext_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xext_XScreenSaverQueryInfo" >&6 +if test $ac_cv_lib_Xext_XScreenSaverQueryInfo = yes; then -cat >>confdefs.h <<\_ACEOF -#define HAVE_XSS 1 -_ACEOF + XLIBSW="$XLIBSW -lXext" + xss_lib_found=yes +else + echo "$as_me:$LINENO: checking for XScreenSaverQueryInfo in -lXss" >&5 +echo $ECHO_N "checking for XScreenSaverQueryInfo in -lXss... $ECHO_C" >&6 +if test "${ac_cv_lib_Xss_XScreenSaverQueryInfo+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lXss -lXext $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 gcc2 internal prototype to avoid an error. */ +#ifdef __cplusplus +extern "C" +#endif +/* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ +char XScreenSaverQueryInfo (); +int +main () +{ +XScreenSaverQueryInfo (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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); } && + { ac_try='test -z "$ac_c_werror_flag" + || test ! -s conftest.err' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_Xss_XScreenSaverQueryInfo=yes else echo "$as_me: failed program was:" >&5 sed 's/^/| /' conftest.$ac_ext >&5 -echo "$as_me:$LINENO: result: no" >&5 -echo "${ECHO_T}no" >&6 +ac_cv_lib_Xss_XScreenSaverQueryInfo=no fi rm -f conftest.err conftest.$ac_objext \ conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:$LINENO: result: $ac_cv_lib_Xss_XScreenSaverQueryInfo" >&5 +echo "${ECHO_T}$ac_cv_lib_Xss_XScreenSaverQueryInfo" >&6 +if test $ac_cv_lib_Xss_XScreenSaverQueryInfo = yes; then + + XLIBSW="$XLIBSW -lXss -lXext" + xss_lib_found=yes + +fi + + +fi + + +fi + + if test $xss_lib_found = yes -a $xss_header_found = yes; then + +cat >>confdefs.h <<\_ACEOF +#define HAVE_XSS 1 +_ACEOF + + fi CFLAGS=$tk_oldCFlags LIBS=$tk_oldLibs fi diff --git a/unix/configure.in b/unix/configure.in index 1e18a59..168d3d5 100644 --- a/unix/configure.in +++ b/unix/configure.in @@ -3,7 +3,7 @@ dnl This file is an input file used by the GNU "autoconf" program to dnl generate the file "configure", which is run during Tk installation dnl to configure the system for the local environment. # -# RCS: @(#) $Id: configure.in,v 1.107 2005/05/29 07:53:09 das Exp $ +# RCS: @(#) $Id: configure.in,v 1.108 2005/06/02 10:08:06 rmax Exp $ AC_INIT([tk],[8.5]) AC_PREREQ(2.57) @@ -210,7 +210,9 @@ fi #-------------------------------------------------------------------- if test "`uname -s`" = "Darwin" ; then - AC_ARG_ENABLE(aqua, [ --enable-aqua enable Aqua windowingsystem on Mac OS X [--disable-aqua]], + AC_ARG_ENABLE(aqua, + AC_HELP_STRING([--enable-aqua], + [enable Aqua windowingsystem on Mac OS X (default: off)]), [tk_aqua=$enableval], [tk_aqua=no]) if test $tk_aqua = yes; then if test $tcl_corefoundation = no; then @@ -331,21 +333,30 @@ fi #-------------------------------------------------------------------- if test $tk_aqua = no; then - AC_MSG_CHECKING([for XScreenSaver support]) + tk_oldCFlags=$CFLAGS CFLAGS="$CFLAGS $XINCLUDES" tk_oldLibs=$LIBS - LIBS="$LIBS $XLIBSW -lXss -lXext" - AC_TRY_LINK([ - #include <X11/Xlib.h> - #include <X11/extensions/scrnsaver.h> - ] , [ - XScreenSaverAllocInfo(); - ], [ - AC_MSG_RESULT(yes) - XLIBSW="$XLIBSW -lXss -lXext" - AC_DEFINE(HAVE_XSS, 1, [Is XScreenSaver available?]) - ], AC_MSG_RESULT(no)) + LIBS="$tk_oldLibs $XLIBSW" + xss_header_found=no + AC_CHECK_HEADER(X11/extensions/scrnsaver.h, [ + xss_header_found=yes + ],,[#include <X11/Xlib.h>]) + xss_lib_found=no + AC_CHECK_FUNC(XScreenSaverQueryInfo,,[ + AC_CHECK_LIB(Xext, XScreenSaverQueryInfo, [ + XLIBSW="$XLIBSW -lXext" + xss_lib_found=yes + ], [ + AC_CHECK_LIB(Xss,XScreenSaverQueryInfo, [ + XLIBSW="$XLIBSW -lXss -lXext" + xss_lib_found=yes + ],, -lXext) + ]) + ]) + if test $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 @@ -356,7 +367,7 @@ fi if test $tk_aqua = no; then AC_ARG_ENABLE(xft, - [ --enable-xft Use freetype/fontconfig/xft [--disable-xft]], + AC_HELP_STRING([--enable-xft],[Use freetype/fontconfig/xft (default: off)]), [enable_xft=$enableval], [enable_xft="no"]) diff --git a/unix/tcl.m4 b/unix/tcl.m4 index ee19532..1402309 100644 --- a/unix/tcl.m4 +++ b/unix/tcl.m4 @@ -27,7 +27,10 @@ AC_DEFUN(SC_PATH_TCLCONFIG, [ if test x"${no_tcl}" = x ; then # we reset no_tcl in case something fails here no_tcl=true - AC_ARG_WITH(tcl, [ --with-tcl directory containing tcl configuration (tclConfig.sh)], with_tclconfig=${withval}) + AC_ARG_WITH(tcl, + AC_HELP_STRING([--with-tcl], + [directory containing tcl configuration (tclConfig.sh)]), + with_tclconfig=${withval}) AC_MSG_CHECKING([for Tcl configuration]) AC_CACHE_VAL(ac_cv_c_tclconfig,[ @@ -138,7 +141,10 @@ AC_DEFUN(SC_PATH_TKCONFIG, [ if test x"${no_tk}" = x ; then # we reset no_tk in case something fails here no_tk=true - AC_ARG_WITH(tk, [ --with-tk directory containing tk configuration (tkConfig.sh)], with_tkconfig=${withval}) + AC_ARG_WITH(tk, + AC_HELP_STRING([--with-tk], + [directory containing tk configuration (tkConfig.sh)]), + with_tkconfig=${withval}) AC_MSG_CHECKING([for Tk configuration]) AC_CACHE_VAL(ac_cv_c_tkconfig,[ @@ -345,7 +351,8 @@ AC_DEFUN(SC_LOAD_TKCONFIG, [ AC_DEFUN(SC_ENABLE_SHARED, [ AC_MSG_CHECKING([how to build libraries]) AC_ARG_ENABLE(shared, - [ --enable-shared build and link with shared libraries [--enable-shared]], + AC_HELP_STRING([--enable-shared], + [build and link with shared libraries (default: on)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "${enable_shared+set}" = set; then @@ -385,7 +392,8 @@ AC_DEFUN(SC_ENABLE_SHARED, [ AC_DEFUN(SC_ENABLE_FRAMEWORK, [ AC_MSG_CHECKING([how to package libraries]) AC_ARG_ENABLE(framework, - [ --enable-framework package shared libraries in MacOSX frameworks [--disable-framework]], + AC_HELP_STRING([--enable-framework], + [package shared libraries in MacOSX frameworks (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test "${enable_framework+set}" = set; then @@ -437,7 +445,9 @@ AC_DEFUN(SC_ENABLE_FRAMEWORK, [ AC_DEFUN(SC_ENABLE_THREADS, [ AC_MSG_CHECKING(for building with threads) - AC_ARG_ENABLE(threads, [ --enable-threads build with threads], + AC_ARG_ENABLE(threads, + AC_HELP_STRING([--enable-threads], + [build with threads (default: off)]), [tcl_ok=$enableval], [tcl_ok=no]) if test "$tcl_ok" = "yes" -o "${TCL_THREADS}" = 1; then @@ -573,7 +583,10 @@ AC_DEFUN(SC_ENABLE_THREADS, [ AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_MSG_CHECKING([for build with symbols]) - AC_ARG_ENABLE(symbols, [ --enable-symbols build with debugging symbols [--disable-symbols]], [tcl_ok=$enableval], [tcl_ok=no]) + AC_ARG_ENABLE(symbols, + AC_HELP_STRING([--enable-symbols], + [build with debugging symbols (default: off)]), + [tcl_ok=$enableval], [tcl_ok=no]) # FIXME: Currently, LDFLAGS_DEFAULT is not used, it should work like CFLAGS_DEFAULT. DBGX="" if test "$tcl_ok" = "no"; then @@ -631,8 +644,8 @@ AC_DEFUN(SC_ENABLE_SYMBOLS, [ AC_DEFUN(SC_ENABLE_LANGINFO, [ AC_ARG_ENABLE(langinfo, - [ --enable-langinfo use nl_langinfo if possible to determine - encoding at startup, otherwise use old heuristic], + AC_HELP_STRING([--enable-langinfo], + [use nl_langinfo if possible to determine encoding at startup, otherwise use old heuristic (default: on)]), [langinfo_ok=$enableval], [langinfo_ok=yes]) HAVE_LANGINFO=0 @@ -681,44 +694,50 @@ AC_DEFUN(SC_ENABLE_LANGINFO, [ # according to the user's selection. # #-------------------------------------------------------------------- -AC_DEFUN(SC_CONFIG_MANPAGES, [ - - AC_MSG_CHECKING([whether to use symlinks for manpages]) - AC_ARG_ENABLE(man-symlinks, - AC_HELP_STRING([--enable-man-symlinks], - [use symlinks for the manpages]), - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks", - enableval="no") - AC_MSG_RESULT([$enableval]) - - AC_MSG_CHECKING([whether to compress the manpages]) - AC_ARG_ENABLE(man-compression, - AC_HELP_STRING([--enable-man-compression=PROG], - [compress the manpages with PROG]), - test "$enableval" = "yes" && AC_MSG_ERROR([missing argument to --enable-man-compression]) - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --compress $enableval", - enableval="no") - AC_MSG_RESULT([$enableval]) - if test "$enableval" != "no"; then - AC_MSG_CHECKING([for compressed file suffix]) - touch TeST - $enableval TeST - Z=`ls TeST* | sed 's/^....//'` - rm -f TeST* - MAN_FLAGS="$MAN_FLAGS --extension $Z" - AC_MSG_RESULT([$Z]) - fi - AC_MSG_CHECKING([whether to add a package name suffix for the manpages]) - AC_ARG_ENABLE(man-suffix, - AC_HELP_STRING([--enable-man-suffix=STRING], - [use STRING as a suffix to manpage file names (default: AC_PACKAGE_NAME)]), - test "$enableval" = "yes" && enableval="AC_PACKAGE_NAME" - test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --suffix $enableval", - enableval="no") - AC_MSG_RESULT([$enableval]) +AC_DEFUN(SC_CONFIG_MANPAGES, [ + AC_MSG_CHECKING([whether to use symlinks for manpages]) + AC_ARG_ENABLE(man-symlinks, + AC_HELP_STRING([--enable-man-symlinks], + [use symlinks for the manpages (default: off)]), + test "$enableval" != "no" && MAN_FLAGS="$MAN_FLAGS --symlinks", + enableval="no") + AC_MSG_RESULT([$enableval]) + + AC_MSG_CHECKING([whether to compress the manpages]) + AC_ARG_ENABLE(man-compression, + AC_HELP_STRING([--enable-man-compression=PROG], + [compress the manpages with PROG (default: off)]), + [case $enableval in + yes) AC_MSG_ERROR([missing argument to --enable-man-compression]);; + no) ;; + *) MAN_FLAGS="$MAN_FLAGS --compress $enableval";; + esac], + enableval="no") + AC_MSG_RESULT([$enableval]) + if test "$enableval" != "no"; then + AC_MSG_CHECKING([for compressed file suffix]) + touch TeST + $enableval TeST + Z=`ls TeST* | sed 's/^....//'` + rm -f TeST* + MAN_FLAGS="$MAN_FLAGS --extension $Z" + AC_MSG_RESULT([$Z]) + fi - AC_SUBST(MAN_FLAGS) + AC_MSG_CHECKING([whether to add a package name suffix for the manpages]) + AC_ARG_ENABLE(man-suffix, + AC_HELP_STRING([--enable-man-suffix=STRING], + [use STRING as a suffix to manpage file names (default: no, AC_PACKAGE_NAME if enabled without specifying STRING)]), + [case $enableval in + yes) enableval="AC_PACKAGE_NAME";; + no) ;; + *) MAN_FLAGS="$MAN_FLAGS --suffix $enableval";; + esac], + enableval="no") + AC_MSG_RESULT([$enableval]) + + AC_SUBST(MAN_FLAGS) ]) #-------------------------------------------------------------------- @@ -822,7 +841,10 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ # Step 0.a: Enable 64 bit support? AC_MSG_CHECKING([if 64bit support is requested]) - AC_ARG_ENABLE(64bit,[ --enable-64bit enable 64bit support (where applicable)],,enableval="no") + AC_ARG_ENABLE(64bit, + AC_HELP_STRING([--enable-64bit], + [enable 64bit support (default: off)]), + ,enableval="no") if test "$enableval" = "yes"; then do64bit=yes @@ -834,7 +856,10 @@ AC_DEFUN(SC_CONFIG_CFLAGS, [ # Step 0.b: Enable Solaris 64 bit VIS support? AC_MSG_CHECKING([if 64bit Sparc VIS support is requested]) - AC_ARG_ENABLE(64bit-vis,[ --enable-64bit-vis enable 64bit Sparc VIS support],,enableval="no") + AC_ARG_ENABLE(64bit-vis, + AC_HELP_STRING([--enable-64bit-vis], + [enable 64bit Sparc VIS support (default: off)]), + ,enableval="no") if test "$enableval" = "yes"; then # Force 64bit on with VIS @@ -1413,7 +1438,9 @@ dnl AC_CHECK_TOOL(AR, ar) PLAT_OBJS='${MAC_OSX_OBJS}' PLAT_SRCS='${MAC_OSX_SRCS}' AC_MSG_CHECKING([whether to use CoreFoundation]) - AC_ARG_ENABLE(corefoundation, [ --enable-corefoundation use CoreFoundation API [--enable-corefoundation]], + AC_ARG_ENABLE(corefoundation, + AC_HELP_STRING([--enable-corefoundation], + [use CoreFoundation API on MacOSX (default: yes)]), [tcl_corefoundation=$enableval], [tcl_corefoundation=yes]) AC_MSG_RESULT([$tcl_corefoundation]) if test $tcl_corefoundation = yes; then @@ -1818,7 +1845,9 @@ dnl AC_CHECK_TOOL(AR, ar) # Step 5: disable dynamic loading if requested via a command-line switch. - AC_ARG_ENABLE(load, [ --disable-load disallow dynamic loading and "load" command], + AC_ARG_ENABLE(load, + AC_HELP_STRING([--disable-load], + [disallow dynamic loading and "load" command (default: enabled)]), [tcl_ok=$enableval], [tcl_ok=yes]) if test "$tcl_ok" = "no"; then DL_OBJS="" @@ -2258,6 +2287,7 @@ AC_DEFUN(SC_PATH_X, [ XLIBSW=-lX11 fi ]) + #-------------------------------------------------------------------- # SC_BLOCKING_STYLE # @@ -2670,7 +2700,10 @@ AC_DEFUN(SC_TCL_64BIT_FLAGS, [ #-------------------------------------------------------------------- AC_DEFUN(SC_TCL_CFG_ENCODING, [ - AC_ARG_WITH(encoding, [ --with-encoding encoding for configuration values], with_tcencoding=${withval}) + AC_ARG_WITH(encoding, + AC_HELP_STRING([--with-encoding], + [encoding for configuration values (default: iso8859-1)]), + with_tcencoding=${withval}) if test x"${with_tcencoding}" != x ; then AC_DEFINE_UNQUOTED(TCL_CFGVAL_ENCODING,"${with_tcencoding}", diff --git a/unix/tkUnix.c b/unix/tkUnix.c index 3a28cd3..0f93e93 100644 --- a/unix/tkUnix.c +++ b/unix/tkUnix.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkUnix.c,v 1.9 2005/06/01 18:14:40 rmax Exp $ + * RCS: @(#) $Id: tkUnix.c,v 1.10 2005/06/02 10:08:07 rmax Exp $ */ #include <tkInt.h> @@ -196,11 +196,17 @@ Tk_GetUserInactiveTime(dpy) #ifdef HAVE_XSS int eventBase, errorBase, major, minor; + /* Calling XScreenSaverQueryVersion seems to be needed to prevent + * a crash on some buggy versions of XFree86 */ if (XScreenSaverQueryExtension(dpy, &eventBase, &errorBase) && - XScreenSaverQueryVersion(dpy, &major, &minor) && - major == 1 && minor == 0 ) { - + XScreenSaverQueryVersion(dpy, &major, &minor)) { + XScreenSaverInfo *info = XScreenSaverAllocInfo(); + + if (info == NULL) { + /* we are out of memory */ + Tcl_Panic("Out of memory: XScreenSaverAllocInfo failed in Tk_GetUserInactiveTime"); + } if (XScreenSaverQueryInfo(dpy, DefaultRootWindow(dpy), info)) { inactiveTime = info->idle; } |