]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - aclocal.m4
ncurses 5.6 - patch 20080906
[ncurses.git] / aclocal.m4
index cc6f03d49a511563f95bed776edbf1c2ff27ae06..994d4aef53e96f6dd76da7c9c366338659970110 100644 (file)
@@ -28,7 +28,7 @@ dnl***************************************************************************
 dnl
 dnl Author: Thomas E. Dickey 1995-on
 dnl
-dnl $Id: aclocal.m4,v 1.452 2008/08/16 23:19:46 tom Exp $
+dnl $Id: aclocal.m4,v 1.457 2008/09/06 21:36:49 tom Exp $
 dnl Macros used in NCURSES auto-configuration script.
 dnl
 dnl These macros are maintained separately from NCURSES.  The copyright on
@@ -331,6 +331,30 @@ You have the following choices:
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl CF_AWK_BIG_PRINTF version: 1 updated: 2008/09/06 17:17:18
+dnl -----------------
+dnl Check if awk can handle big strings using printf.  Some older versions of
+dnl awk choke on large strings passed via "%s".
+dnl
+dnl $1 = desired string size
+dnl $2 = variable to set with result
+AC_DEFUN([CF_AWK_BIG_PRINTF],
+[
+    case x$AWK in #(vi
+    x)
+        eval $2=no
+        ;;
+    *) #(vi
+        if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < $1) { xx = xx "x"; }; printf("%s\n", xx); }' \
+            | $AWK '{ if (length([$]0) != $1) exit 1; }' 2>/dev/null >/dev/null ); then
+            eval $2=yes
+        else
+            eval $2=no
+        fi
+        ;;
+    esac
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl CF_BOOL_DECL version: 8 updated: 2004/01/30 15:51:18
 dnl ------------
 dnl Test if 'bool' is a builtin type in the configured C++ compiler.  Some
@@ -649,13 +673,14 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_CHECK_ERRNO version: 9 updated: 2001/12/30 18:03:23
+dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22
 dnl --------------
 dnl Check for data that is usually declared in <stdio.h> or <errno.h>, e.g.,
 dnl the 'errno' variable.  Define a DECL_xxx symbol if we must declare it
 dnl ourselves.
 dnl
 dnl $1 = the name to check
+dnl $2 = the assumed type
 AC_DEFUN([CF_CHECK_ERRNO],
 [
 AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
@@ -666,7 +691,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[
 #include <stdio.h>
 #include <sys/types.h>
 #include <errno.h> ],
-    [long x = (long) $1],
+    ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1,
     [cf_cv_dcl_$1=yes],
     [cf_cv_dcl_$1=no])
 ])
@@ -677,7 +702,7 @@ if test "$cf_cv_dcl_$1" = no ; then
 fi
 
 # It's possible (for near-UNIX clones) that the data doesn't exist
-CF_CHECK_EXTERN_DATA($1,int)
+CF_CHECK_EXTERN_DATA($1,ifelse($2,,int,$2))
 ])dnl
 dnl ---------------------------------------------------------------------------
 dnl CF_CHECK_EXTERN_DATA version: 3 updated: 2001/12/30 18:03:23
@@ -3930,7 +3955,7 @@ AC_MSG_RESULT(no)
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_SHARED_OPTS version: 48 updated: 2008/06/14 15:08:17
+dnl CF_SHARED_OPTS version: 49 updated: 2008/09/06 17:36:03
 dnl --------------
 dnl --------------
 dnl Attempt to determine the appropriate CC/LD options for creating a shared
@@ -4065,8 +4090,10 @@ CF_EOF
                # tested with IRIX 5.2 and 'cc'.
                if test "$GCC" != yes; then
                        CC_SHARED_OPTS='-KPIC'
+            MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
+        else
+            MK_SHARED_LIB='${CC} -shared -Wl,-soname,`basename $[@]` -o $[@]'
                fi
-               MK_SHARED_LIB='${CC} -shared -rdata_shared -soname `basename $[@]` -o $[@]'
                cf_cv_rm_so_locs=yes
                ;;
        linux*|gnu*|k*bsd*-gnu)
@@ -5165,7 +5192,7 @@ AC_SUBST($3)dnl
 
 ])dnl
 dnl ---------------------------------------------------------------------------
-dnl CF_WITH_PTHREAD version: 1 updated: 2008/03/29 13:42:21
+dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05
 dnl ---------------
 dnl Check for POSIX thread library.
 AC_DEFUN([CF_WITH_PTHREAD],
@@ -5180,13 +5207,24 @@ AC_MSG_RESULT($with_pthread)
 if test "$with_pthread" != no ; then
     AC_CHECK_HEADER(pthread.h,[
         AC_DEFINE(HAVE_PTHREADS_H)
-        AC_CHECK_LIB(pthread,pthread_create,[
+
+        AC_MSG_CHECKING(if we can link with the pthread library)
+        cf_save_LIBS="$LIBS"
+        LIBS="-lpthread $LIBS"
+        AC_TRY_LINK([
+#include <pthread.h>
+],[
+        int rc = pthread_create(0,0,0,0);
+],[with_pthread=yes],[with_pthread=no])
+        LIBS="$cf_save_LIBS"
+        AC_MSG_RESULT($with_pthread)
+
+        if test "$with_pthread" = yes ; then
             LIBS="-lpthread $LIBS"
             AC_DEFINE(HAVE_LIBPTHREADS)
-            with_pthread=yes
-        ],[
+        else
             AC_MSG_ERROR(Cannot link with pthread library)
-        ])
+        fi
     ])
 fi
 ])