]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/aclocal.m4
ncurses 5.7 - patch 20110115
[ncurses.git] / test / aclocal.m4
index 51c7611db7cb598d465cb5ebcdc0769aaabbbba2..41641b507f5a55fb6ee95cb50b8647fc39d254cb 100644 (file)
@@ -1,5 +1,5 @@
 dnl***************************************************************************
-dnl Copyright (c) 2003-2009,2010 Free Software Foundation, Inc.              *
+dnl Copyright (c) 2003-2010,2011 Free Software Foundation, Inc.              *
 dnl                                                                          *
 dnl Permission is hereby granted, free of charge, to any person obtaining a  *
 dnl copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@ dnl sale, use or other dealings in this Software without prior written       *
 dnl authorization.                                                           *
 dnl***************************************************************************
 dnl
-dnl $Id: aclocal.m4,v 1.42 2010/11/06 19:25:57 tom Exp $
+dnl $Id: aclocal.m4,v 1.49 2011/01/15 23:47:10 tom Exp $
 dnl
 dnl Author: Thomas E. Dickey
 dnl
@@ -237,6 +237,19 @@ dnl $1 = libraries to add, with the "-l", etc.
 dnl $2 = variable to update (default $LIBS)
 AC_DEFUN([CF_ADD_LIBS],[ifelse($2,,LIBS,[$2])="$1 [$]ifelse($2,,LIBS,[$2])"])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_ADD_LIB_AFTER version: 2 updated: 2010/11/08 20:33:46
+dnl ----------------
+dnl Add a given library after another, e.g., following the one it satisfies a
+dnl dependency for.
+dnl
+dnl $1 = the first library
+dnl $2 = its dependency
+AC_DEFUN([CF_ADD_LIB_AFTER],[
+CF_VERBOSE(...before $LIBS)
+LIBS=`echo "$LIBS" | sed -e "s/[[      ]][[    ]]*/ /g" -e "s,$1 ,$1 $2 ," -e 's/  / /g'`
+CF_VERBOSE(...after  $LIBS)
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_ADD_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12
 dnl ------------------
 dnl Append to a search-list for a nonstandard header/lib-file
@@ -442,22 +455,34 @@ done
 test "$cf_cv_curses_acs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_ACS_ARRAY,$cf_cv_curses_acs_map)
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_CHECK_DATA version: 3 updated: 2010/10/23 15:54:49
+dnl CF_CURSES_CHECK_DATA version: 4 updated: 2011/01/15 16:39:24
 dnl --------------------
 dnl Check if curses.h defines the given data/variable.
 dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG.
 AC_DEFUN([CF_CURSES_CHECK_DATA],
 [
 AC_MSG_CHECKING(for data $1 declaration in ${cf_cv_ncurses_header:-curses.h})
+
 AC_TRY_COMPILE(CF__CURSES_HEAD,[
 void *foo = &($1)
 ],cf_result=yes,cf_result=no)
 AC_MSG_RESULT($cf_result)
+
 if test $cf_result = yes ; then
        CF_UPPER(cf_result,have_curses_data_$1)
        AC_DEFINE_UNQUOTED($cf_result)
 else
        AC_MSG_CHECKING(for data $1 in library)
+       # BSD linkers insist on making weak linkage, but resolve at runtime.
+       AC_TRY_RUN(CF__CURSES_HEAD
+[
+extern char $1;
+int main(void)
+{
+       void *foo = &($1);
+       ${cf_cv_main_return:-return}(foo == 0);
+}],[cf_result=yes],[cf_result=no],[
+       # cross-compiling
        AC_TRY_LINK(CF__CURSES_HEAD
 [extern char $1;],[
        do {
@@ -465,6 +490,7 @@ else
                ${cf_cv_main_return:-return}(foo == 0);
        } while (0)
 ],[cf_result=yes],[cf_result=no])
+])
        AC_MSG_RESULT($cf_result)
        if test $cf_result = yes ; then
                CF_UPPER(cf_result,decl_curses_data_$1)
@@ -762,25 +788,62 @@ ncursesw/term.h)
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CURSES_WACS_MAP version: 4 updated: 2010/10/23 15:54:49
+dnl CF_CURSES_WACS_MAP version: 5 updated: 2011/01/15 11:28:59
 dnl ------------------
-dnl Check for likely values of wacs_map[]:
+dnl Check for likely values of wacs_map[].
 AC_DEFUN([CF_CURSES_WACS_MAP],
 [
 AC_CACHE_CHECK(for wide alternate character set array, cf_cv_curses_wacs_map,[
        cf_cv_curses_wacs_map=unknown
-       for name in wacs_map _wacs_map __wacs_map _nc_wacs
+       for name in wacs_map _wacs_map __wacs_map _nc_wacs _wacs_char
        do
        AC_TRY_LINK([
 #ifndef _XOPEN_SOURCE_EXTENDED
 #define _XOPEN_SOURCE_EXTENDED
 #endif
 #include <${cf_cv_ncurses_header:-curses.h}>],
-       [$name['k'] = *WACS_PLUS],
+       [void *foo = &($name['k'])],
        [cf_cv_curses_wacs_map=$name
         break])
        done])
+
+test "$cf_cv_curses_wacs_map" != unknown && AC_DEFINE_UNQUOTED(CURSES_WACS_ARRAY,$cf_cv_curses_wacs_map)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_CURSES_WACS_SYMBOLS version: 1 updated: 2011/01/15 11:28:59
+dnl ----------------------
+dnl Do a check to see if the WACS_xxx constants are defined compatibly with
+dnl X/Open Curses.  In particular, NetBSD's implementation of the WACS_xxx
+dnl constants is broken since those constants do not point to cchar_t's.
+AC_DEFUN([CF_CURSES_WACS_SYMBOLS],
+[
+AC_REQUIRE([CF_CURSES_WACS_MAP])
+
+AC_CACHE_CHECK(for wide alternate character constants, cf_cv_curses_wacs_symbols,[
+cf_cv_curses_wacs_symbols=no
+if test "$cf_cv_curses_wacs_map" != unknown
+then
+       AC_TRY_LINK([
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>],
+       [cchar_t *foo = WACS_PLUS;
+        $cf_cv_curses_wacs_map['k'] = *WACS_PLUS],
+       [cf_cv_curses_wacs_symbols=yes])
+else
+       AC_TRY_LINK([
+#ifndef _XOPEN_SOURCE_EXTENDED
+#define _XOPEN_SOURCE_EXTENDED
+#endif
+#include <${cf_cv_ncurses_header:-curses.h}>],
+       [cchar_t *foo = WACS_PLUS],
+       [cf_cv_curses_wacs_symbols=yes])
+fi
 ])
+
+test "$cf_cv_curses_wacs_symbols" != no && AC_DEFINE(CURSES_WACS_SYMBOLS)
+])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_DIRNAME version: 4 updated: 2002/12/21 19:25:52
 dnl ----------
@@ -824,6 +887,29 @@ AC_SUBST(SHOW_CC)
 AC_SUBST(ECHO_CC)
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_DISABLE_LEAKS version: 6 updated: 2010/07/23 04:14:32
+dnl ----------------
+dnl Combine no-leak checks with the libraries or tools that are used for the
+dnl checks.
+AC_DEFUN([CF_DISABLE_LEAKS],[
+
+AC_REQUIRE([CF_WITH_DMALLOC])
+AC_REQUIRE([CF_WITH_DBMALLOC])
+AC_REQUIRE([CF_WITH_VALGRIND])
+
+AC_MSG_CHECKING(if you want to perform memory-leak testing)
+AC_ARG_ENABLE(leaks,
+       [  --disable-leaks         test: free permanent memory, analyze leaks],
+       [if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi],
+       : ${with_no_leaks:=no})
+AC_MSG_RESULT($with_no_leaks)
+
+if test "$with_no_leaks" = yes ; then
+       AC_DEFINE(NO_LEAKS)
+       AC_DEFINE(YY_NO_LEAKS)
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_ENABLE_WARNINGS version: 4 updated: 2009/07/26 17:53:03
 dnl ------------------
 dnl Configure-option to enable gcc warnings
@@ -1632,7 +1718,7 @@ CF_NCURSES_LIBS(ifelse($1,,ncurses,$1))
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_CPPFLAGS version: 19 updated: 2007/07/29 13:35:20
+dnl CF_NCURSES_CPPFLAGS version: 20 updated: 2010/11/20 17:02:38
 dnl -------------------
 dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting
 dnl the CPPFLAGS variable so we can include its header.
@@ -1661,7 +1747,7 @@ cf_ncuhdr_root=ifelse($1,,ncurses,$1)
 
 test -n "$cf_cv_curses_dir" && \
 test "$cf_cv_curses_dir" != "no" && { \
-  CF_ADD_INCDIR($cf_cv_curses_dir/include $cf_cv_curses_dir/include/$cf_ncuhdr_root)
+  CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root)
 }
 
 AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
@@ -1683,7 +1769,7 @@ AC_DEFINE(NCURSES)
 CF_NCURSES_VERSION
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_EXT_FUNCS version: 2 updated: 2010/10/23 15:54:49
+dnl CF_NCURSES_EXT_FUNCS version: 3 updated: 2010/11/13 19:43:23
 dnl --------------------
 dnl Since 2007/11/17, ncurses has defined NCURSES_EXT_FUNCS; earlier versions
 dnl may provide these functions.  Define the symbol if it is not defined, and
@@ -1715,7 +1801,7 @@ AC_TRY_LINK([
        [cf_cv_ncurses_ext_funcs=no])
 ])
 ])
-test "$cf_cv_ncurses_ext_funcs" == yes && AC_DEFINE(NCURSES_EXT_FUNCS)
+test "$cf_cv_ncurses_ext_funcs" = yes && AC_DEFINE(NCURSES_EXT_FUNCS)
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_NCURSES_HEADER version: 2 updated: 2008/03/23 14:48:54
@@ -1784,7 +1870,7 @@ esac
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_NCURSES_LIBS version: 15 updated: 2010/10/23 15:54:49
+dnl CF_NCURSES_LIBS version: 16 updated: 2010/11/20 17:02:38
 dnl ---------------
 dnl Look for the ncurses library.  This is a little complicated on Linux,
 dnl because it may be linked with the gpm (general purpose mouse) library.
@@ -1824,7 +1910,6 @@ CF_ADD_LIBS($cf_ncurses_LIBS)
 
 if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
 then
-       CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
        CF_ADD_LIBS(-l$cf_nculib_root)
 else
        CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
@@ -1931,6 +2016,74 @@ AC_MSG_RESULT($NCURSES_WRAP_PREFIX)
 AC_SUBST(NCURSES_WRAP_PREFIX)
 ])
 dnl ---------------------------------------------------------------------------
+dnl CF_NETBSD_FORM_H version: 1 updated: 2011/01/15 14:59:18
+dnl ----------------
+dnl Check for NetBSD's form.h, which is incompatible with SVr4 and ncurses.
+dnl Some workarounds are needed in client programs to allow them to compile.
+AC_DEFUN([CF_NETBSD_FORM_H],[
+AC_CACHE_CHECK(for NetBSD form.h,cf_cv_netbsd_form_h,[
+AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <form.h>
+],[
+       FORM *form;
+       int y = current_field(form)->cursor_ypos;
+       int x = current_field(form)->cursor_xpos;
+],[cf_cv_netbsd_form_h=yes
+],[cf_cv_netbsd_form_h=no])
+])
+
+test "$cf_cv_netbsd_form_h" = yes && AC_DEFINE(HAVE_NETBSD_FORM_H)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NETBSD_MENU_H version: 1 updated: 2011/01/15 14:59:18
+dnl ----------------
+dnl Check for NetBSD's menu.h, which is incompatible with SVr4 and ncurses.
+dnl Some workarounds are needed in client programs to allow them to compile.
+AC_DEFUN([CF_NETBSD_MENU_H],[
+AC_CACHE_CHECK(for NetBSD menu.h,cf_cv_netbsd_menu_h,[
+AC_TRY_COMPILE([
+#include <${cf_cv_ncurses_header:-curses.h}>
+#include <menu.h>
+],[
+       MENU *menu;
+       int y = menu->max_item_width;
+],[cf_cv_netbsd_menu_h=yes
+],[cf_cv_netbsd_menu_h=no])
+])
+
+test "$cf_cv_netbsd_menu_h" = yes && AC_DEFINE(HAVE_NETBSD_MENU_H)
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_NO_LEAKS_OPTION version: 4 updated: 2006/12/16 14:24:05
+dnl ------------------
+dnl see CF_WITH_NO_LEAKS
+AC_DEFUN([CF_NO_LEAKS_OPTION],[
+AC_MSG_CHECKING(if you want to use $1 for testing)
+AC_ARG_WITH($1,
+       [$2],
+       [AC_DEFINE($3)ifelse([$4],,[
+        $4
+])
+       : ${with_cflags:=-g}
+       : ${with_no_leaks:=yes}
+        with_$1=yes],
+       [with_$1=])
+AC_MSG_RESULT(${with_$1:-no})
+
+case .$with_cflags in #(vi
+.*-g*)
+       case .$CFLAGS in #(vi
+       .*-g*) #(vi
+               ;;
+       *)
+               CF_ADD_CFLAGS([-g])
+               ;;
+       esac
+       ;;
+esac
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_PATH_SYNTAX version: 13 updated: 2010/05/26 05:38:42
 dnl --------------
 dnl Check the argument to see that it looks like a pathname.  Rewrite it if it
@@ -1968,7 +2121,7 @@ case ".[$]$1" in #(vi
 esac
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_PDCURSES_X11 version: 10 updated: 2010/06/20 09:24:28
+dnl CF_PDCURSES_X11 version: 11 updated: 2011/01/15 18:45:38
 dnl ---------------
 dnl Configure for PDCurses' X11 library
 AC_DEFUN([CF_PDCURSES_X11],[
@@ -2005,7 +2158,7 @@ fi
 if test $cf_cv_lib_XCurses = yes ; then
        AC_DEFINE(UNIX)
        AC_DEFINE(XCURSES)
-       AC_DEFINE(HAVE_XCURSES)
+       AC_CHECK_HEADER(xcurses.h, AC_DEFINE(HAVE_XCURSES))
 else
        AC_MSG_ERROR(Cannot link with XCurses)
 fi
@@ -2448,16 +2601,66 @@ fi
 ])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_CURSES_DIR version: 2 updated: 2002/11/10 14:46:59
+dnl CF_WITH_CURSES_DIR version: 3 updated: 2010/11/20 17:02:38
 dnl ------------------
 dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses
 dnl libraries.
 AC_DEFUN([CF_WITH_CURSES_DIR],[
+
+AC_MSG_CHECKING(for specific curses-directory)
 AC_ARG_WITH(curses-dir,
        [  --with-curses-dir=DIR   directory in which (n)curses is installed],
-       [CF_PATH_SYNTAX(withval)
-        cf_cv_curses_dir=$withval],
+       [cf_cv_curses_dir=$withval],
        [cf_cv_curses_dir=no])
+AC_MSG_RESULT($cf_cv_curses_dir)
+
+if ( test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" )
+then
+       CF_PATH_SYNTAX(withval)
+       if test -d "$cf_cv_curses_dir"
+       then
+               CF_ADD_INCDIR($cf_cv_curses_dir/include)
+               CF_ADD_LIBDIR($cf_cv_curses_dir/lib)
+       fi
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47
+dnl ----------------
+dnl Configure-option for dbmalloc.  The optional parameter is used to override
+dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
+AC_DEFUN([CF_WITH_DBMALLOC],[
+CF_NO_LEAKS_OPTION(dbmalloc,
+       [  --with-dbmalloc         test: use Conor Cahill's dbmalloc library],
+       [USE_DBMALLOC])
+
+if test "$with_dbmalloc" = yes ; then
+       AC_CHECK_HEADER(dbmalloc.h,
+               [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47
+dnl ---------------
+dnl Configure-option for dmalloc.  The optional parameter is used to override
+dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests.
+AC_DEFUN([CF_WITH_DMALLOC],[
+CF_NO_LEAKS_OPTION(dmalloc,
+       [  --with-dmalloc          test: use Gray Watson's dmalloc library],
+       [USE_DMALLOC])
+
+if test "$with_dmalloc" = yes ; then
+       AC_CHECK_HEADER(dmalloc.h,
+               [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))])
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
+dnl CF_WITH_VALGRIND version: 1 updated: 2006/12/14 18:00:21
+dnl ----------------
+AC_DEFUN([CF_WITH_VALGRIND],[
+CF_NO_LEAKS_OPTION(valgrind,
+       [  --with-valgrind         test: use valgrind],
+       [USE_VALGRIND])
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_XOPEN_CURSES version: 10 updated: 2010/10/23 15:54:49
@@ -2601,7 +2804,7 @@ if test -n "$cf_xopen_source" ; then
 fi
 ])
 dnl ---------------------------------------------------------------------------
-dnl CF_X_ATHENA version: 17 updated: 2010/10/23 15:52:32
+dnl CF_X_ATHENA version: 20 updated: 2010/11/09 05:18:02
 dnl -----------
 dnl Check for Xaw (Athena) libraries
 dnl
@@ -2659,6 +2862,27 @@ if test "$PKG_CONFIG" != none ; then
                        cf_x_athena_lib="$cf_pkgconfig_libs"
                        CF_UPPER(cf_x_athena_LIBS,HAVE_LIB_$cf_x_athena)
                        AC_DEFINE_UNQUOTED($cf_x_athena_LIBS)
+
+AC_CACHE_CHECK(for usable $cf_x_athena/Xmu package,cf_cv_xaw_compat,[
+AC_TRY_LINK([
+#include <X11/Xmu/CharSet.h>
+],[
+int check = XmuCompareISOLatin1("big", "small")
+],[cf_cv_xaw_compat=yes],[cf_cv_xaw_compat=no])])
+
+                       if test "$cf_cv_xaw_compat" = no
+                       then
+                               # workaround for broken ".pc" files...
+                               case "$cf_x_athena_lib" in #(vi
+                               *-lXmu*) #(vi
+                                       ;;
+                               *)
+                                       CF_VERBOSE(work around broken package)
+                                       CF_TRY_PKG_CONFIG(xmu,,[CF_ADD_LIB_AFTER(-lXt,-lXmu)])
+                                       ;;
+                               esac
+                       fi
+
                        break])
        done
 fi
@@ -2778,7 +3002,7 @@ CF_TRY_PKG_CONFIG(Xext,,[
                [CF_ADD_LIB(Xext)])])
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_X_TOOLKIT version: 15 updated: 2010/06/14 17:42:30
+dnl CF_X_TOOLKIT version: 20 updated: 2010/11/19 05:43:04
 dnl ------------
 dnl Check for X Toolkit libraries
 dnl
@@ -2791,22 +3015,54 @@ cf_have_X_LIBS=no
 
 CF_TRY_PKG_CONFIG(xt,[
 
-       # workaround for broken ".pc" files used for X Toolkit.
-       case "x$X_PRE_LIBS" in #(vi
-       *-lICE*)
-               case "x$LIBS" in #(vi
-               *-lICE*) #(vi
-                       ;;
-               *)
-                       CF_VERBOSE(work around broken package)
-                       CF_VERBOSE(...before $LIBS)
-                       LIBS=`echo "$LIBS" | sed -e "s/[[       ]][[    ]]*/ /g" -e "s,-lXt ,-lXt $X_PRE_LIBS ," -e 's/  / /g'`
-                       CF_VERBOSE(...after  $LIBS)
-                       ;;
-               esac
+       case "x$LIBS" in #(vi
+       *-lX11*) #(vi
+               ;;
+       *)
+# we have an "xt" package, but it may omit Xt's dependency on X11
+AC_CACHE_CHECK(for usable X dependency,cf_cv_xt_x11_compat,[
+AC_TRY_LINK([
+#include <X11/Xlib.h>
+],[
+       int rc1 = XDrawLine((Display*) 0, (Drawable) 0, (GC) 0, 0, 0, 0, 0);
+       int rc2 = XClearWindow((Display*) 0, (Window) 0);
+       int rc3 = XMoveWindow((Display*) 0, (Window) 0, 0, 0);
+       int rc4 = XMoveResizeWindow((Display*)0, (Window)0, 0, 0, 0, 0);
+],[cf_cv_xt_x11_compat=yes],[cf_cv_xt_x11_compat=no])])
+               if test "$cf_cv_xt_x11_compat" = no
+               then
+                       CF_VERBOSE(work around broken X11 dependency)
+                       # 2010/11/19 - good enough until a working Xt on Xcb is delivered.
+                       CF_TRY_PKG_CONFIG(x11,,[CF_ADD_LIB_AFTER(-lXt,-lX11)])
+               fi
                ;;
        esac
 
+AC_CACHE_CHECK(for usable X Toolkit package,cf_cv_xt_ice_compat,[
+AC_TRY_LINK([
+#include <X11/Shell.h>
+],[int num = IceConnectionNumber(0)
+],[cf_cv_xt_ice_compat=yes],[cf_cv_xt_ice_compat=no])])
+
+       if test "$cf_cv_xt_ice_compat" = no
+       then
+               # workaround for broken ".pc" files used for X Toolkit.
+               case "x$X_PRE_LIBS" in #(vi
+               *-lICE*)
+                       case "x$LIBS" in #(vi
+                       *-lICE*) #(vi
+                               ;;
+                       *)
+                               CF_VERBOSE(work around broken ICE dependency)
+                               CF_TRY_PKG_CONFIG(ice,
+                                       [CF_TRY_PKG_CONFIG(sm)],
+                                       [CF_ADD_LIB_AFTER(-lXt,$X_PRE_LIBS)])
+                               ;;
+                       esac
+                       ;;
+               esac
+       fi
+
        cf_have_X_LIBS=yes
 ],[