about summary refs log tree commit diff stats
path: root/aclocal.m4
diff options
context:
space:
mode:
authorThomas E. Dickey <dickey@invisible-island.net>2001-11-08 20:59:59 -0500
committerThomas E. Dickey <dickey@invisible-island.net>2001-11-08 20:59:59 -0500
commit6cb04c09f063188e7dae5d1e5e5c69eb64703626 (patch)
tree46c2950351bf3f2cde1f610eae7bc9cfb52c5221 /aclocal.m4
parentf78e27712a4f44dbdf3c1532c3d1958989bf40a5 (diff)
downloadlynx-snapshots-6cb04c09f063188e7dae5d1e5e5c69eb64703626.tar.gz
snapshot of project "lynx", label v2-8-5dev_4
Diffstat (limited to 'aclocal.m4')
-rw-r--r--aclocal.m4158
1 files changed, 117 insertions, 41 deletions
diff --git a/aclocal.m4 b/aclocal.m4
index 638a8c90..76d1ac7b 100644
--- a/aclocal.m4
+++ b/aclocal.m4
@@ -4,7 +4,7 @@ dnl and Jim Spath <jspath@mail.bcpl.lib.md.us>
 dnl and Philippe De Muyter <phdm@macqel.be>
 dnl
 dnl Created: 1997/1/28
-dnl Updated: 2001/4/15
+dnl Updated: 2001/11/3
 dnl
 dnl The autoconf used in Lynx development is GNU autoconf, patched
 dnl by Tom Dickey.  See your local GNU archives, and this URL:
@@ -1269,7 +1269,7 @@ do
 		;;
 	inria) #(vi
 		dnl http://www.kame.net/
-		AC_EGREP_CPP(yes, [dnl
+		AC_EGREP_CPP(yes, [
 #include <netinet/in.h>
 #ifdef IPV6_INRIA_VERSION
 yes
@@ -1277,7 +1277,7 @@ yes
 		;;
 	kame) #(vi
 		dnl http://www.kame.net/
-		AC_EGREP_CPP(yes, [dnl
+		AC_EGREP_CPP(yes, [
 #include <netinet/in.h>
 #ifdef __KAME__
 yes
@@ -1285,7 +1285,7 @@ yes
 		;;
 	linux-glibc) #(vi
 		dnl http://www.v6.linux.or.jp/
-		AC_EGREP_CPP(yes, [dnl
+		AC_EGREP_CPP(yes, [
 #include <features.h>
 #if defined(__GLIBC__) && __GLIBC__ >= 2 && __GLIBC_MINOR__ >= 1
 yes
@@ -1302,21 +1302,21 @@ yes
 		fi
 		;;
 	toshiba) #(vi
-		AC_EGREP_CPP(yes, [dnl
+		AC_EGREP_CPP(yes, [
 #include <sys/param.h>
 #ifdef _TOSHIBA_INET6
 yes
 #endif],	[cf_cv_ipv6type=$i])
 		;;
 	v6d) #(vi
-		AC_EGREP_CPP(yes, [dnl
+		AC_EGREP_CPP(yes, [
 #include </usr/local/v6/include/sys/v6config.h>
 #ifdef __V6D__
 yes
 #endif],	[cf_cv_ipv6type=$i])
 		;;
 	zeta)
-		AC_EGREP_CPP(yes, [dnl
+		AC_EGREP_CPP(yes, [
 #include <sys/param.h>
 #ifdef _ZETA_MINAMI_INET6
 yes
@@ -1728,6 +1728,10 @@ dnl Construct a search-list for a nonstandard header-file
 AC_DEFUN([CF_HEADER_PATH],
 [$1=""
 
+test "$prefix" != /usr/local && \
+test -d /usr/local && \
+$1="[$]$1 /usr/local/include /usr/local/include/$2 /usr/local/$2/include"
+
 test "$includedir" != NONE && \
 test -d "$includedir" && \
 $1="[$]$1 $includedir $includedir/$2"
@@ -1740,10 +1744,6 @@ test "$prefix" != NONE && \
 test -d "$prefix" && \
 $1="[$]$1 $prefix/include $prefix/include/$2 $prefix/$2/include"
 
-test "$prefix" != /usr/local && \
-test -d /usr/local && \
-$1="[$]$1 /usr/local/include /usr/local/include/$2 /usr/local/$2/include"
-
 test "$prefix" != /usr && \
 $1="[$]$1 /usr/include /usr/include/$2 /usr/$2/include"
 
@@ -1841,6 +1841,10 @@ dnl Construct a search-list for a nonstandard library-file
 AC_DEFUN([CF_LIBRARY_PATH],
 [$1=""
 
+test "$prefix" != /usr/local && \
+test -d /usr/local && \
+$1="[$]$1 /usr/local/lib /usr/local/lib/$2 /usr/local/$2/lib"
+
 test "$libdir" != NONE && \
 test -d $libdir && \
 $1="[$]$1 $libdir $libdir/$2"
@@ -1854,10 +1858,6 @@ test "$prefix" != "$exec_prefix" && \
 test -d $prefix && \
 $1="[$]$1 $prefix/lib $prefix/lib/$2 $prefix/$2/lib"
 
-test "$prefix" != /usr/local && \
-test -d /usr/local && \
-$1="[$]$1 /usr/local/lib /usr/local/lib/$2 /usr/local/$2/lib"
-
 test "$prefix" != /usr && \
 $1="[$]$1 /usr/lib /usr/lib/$2 /usr/$2/lib"
 
@@ -1885,7 +1885,8 @@ AC_MSG_RESULT($cf_cv_locale)
 test $cf_cv_locale = yes && AC_DEFINE(LOCALE)
 ])
 dnl ---------------------------------------------------------------------------
-dnl Check for a working mkstemp
+dnl Check for a working mkstemp.  This creates two files, checks that they are
+dnl successfully created and distinct (AmigaOS apparently fails on the last).
 AC_DEFUN([CF_MKSTEMP],[
 AC_CACHE_CHECK(for working mkstemp, cf_cv_func_mkstemp,[
 rm -f conftest*
@@ -1893,26 +1894,33 @@ AC_TRY_RUN([
 #include <sys/types.h>
 #include <stdlib.h>
 #include <stdio.h>
+#include <string.h>
 #include <sys/stat.h>
 int main()
 {
 	char *tmpl = "conftestXXXXXX";
-	char temp[80];
+	char name[2][80];
+	int n;
 	int result = 0;
 	int fd;
 	struct stat sb;
 
 	umask(077);
-	strcpy(temp, tmpl);
-	if ((fd = mkstemp(temp)) >= 0) {
-		if (!strcmp(temp, tmpl)
-		 || stat(temp, &sb) != 0
-		 || (sb.st_mode & S_IFMT) != S_IFREG
-		 || (sb.st_mode & 077) != 0) {
-			result = 1;
+	for (n = 0; n < 2; ++n) {
+		strcpy(name[n], tmpl);
+		if ((fd = mkstemp(name[n])) >= 0) {
+			if (!strcmp(name[n], tmpl)
+			 || stat(name[n], &sb) != 0
+			 || (sb.st_mode & S_IFMT) != S_IFREG
+			 || (sb.st_mode & 077) != 0) {
+				result = 1;
+			}
+			close(fd);
 		}
-		close(fd);
 	}
+	if (result == 0
+	 && !strcmp(name[0], name[1]))
+		result = 1;
 	exit(result);
 }
 ],[cf_cv_func_mkstemp=yes
@@ -1974,14 +1982,16 @@ dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header
 dnl is already in the include-path, don't even bother with this, since we cannot
 dnl easily determine which file it is.  In this case, it has to be <curses.h>.
 dnl
+dnl The optional parameter gives the root name of the library, in case it is
+dnl not installed as the default curses library.  That is how the
+dnl wide-character version of ncurses is installed.
 AC_DEFUN([CF_NCURSES_CPPFLAGS],
 [
-AC_CACHE_CHECK(for ncurses header in include-path, cf_cv_ncurses_h,[
-	for cf_header in \
-		curses.h \
-		ncurses.h \
-		ncurses/curses.h \
-		ncurses/ncurses.h
+cf_ncuhdr_root=ifelse($1,,ncurses,$1)
+AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[
+	cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h"
+	test "$cf_ncuhdr_root" = ncurses && cf_header_list="curses.h ncurses.h $cf_header_list"
+	for cf_header in $cf_header_list
 	do
 	AC_TRY_COMPILE([#include <$cf_header>],[
 #ifdef NCURSES_VERSION
@@ -2002,8 +2012,8 @@ make an error
 if test "$cf_cv_ncurses_h" != no ; then
 	cf_cv_ncurses_header=$cf_cv_ncurses_h
 else
-AC_CACHE_CHECK(for ncurses include-path, cf_cv_ncurses_h2,[
-	CF_HEADER_PATH(cf_search,ncurses)
+AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[
+	CF_HEADER_PATH(cf_search,$cf_ncuhdr_root)
 	test -n "$verbose" && echo
 	for cf_incdir in $cf_search
 	do
@@ -2028,8 +2038,8 @@ AC_CACHE_CHECK(for ncurses include-path, cf_cv_ncurses_h2,[
 	cf_cv_ncurses_header=`basename $cf_cv_ncurses_h2`
 	echo cf_1st_include=$cf_1st_incdir
 	echo cf_2nd_include=$cf_2nd_incdir
-	if test `basename $cf_1st_incdir` = ncurses ; then
-		cf_cv_ncurses_header=ncurses/$cf_cv_ncurses_header
+	if test `basename $cf_1st_incdir` = $cf_ncuhdr_root ; then
+		cf_cv_ncurses_header=$cf_ncuhdr_root/$cf_cv_ncurses_header
 		CF_ADD_INCDIR($cf_2nd_incdir)
 	fi
 	CF_ADD_INCDIR($cf_1st_incdir)
@@ -2049,6 +2059,9 @@ case $cf_cv_ncurses_header in # (vi
 ncurses/curses.h|ncurses/ncurses.h)
 	AC_DEFINE(HAVE_NCURSES_NCURSES_H)
 	;;
+ncursesw/curses.h|ncursesw/ncurses.h)
+	AC_DEFINE(HAVE_NCURSESW_NCURSES_H)
+	;;
 esac
 
 CF_NCURSES_VERSION
@@ -2060,9 +2073,14 @@ dnl Some distributions have gpm linked with (bsd) curses, which makes it
 dnl unusable with ncurses.  However, we don't want to link with gpm unless
 dnl ncurses has a dependency, since gpm is normally set up as a shared library,
 dnl and the linker will record a dependency.
+dnl
+dnl The optional parameter gives the root name of the library, in case it is
+dnl not installed as the default curses library.  That is how the
+dnl wide-character version of ncurses is installed.
 AC_DEFUN([CF_NCURSES_LIBS],
 [AC_REQUIRE([CF_NCURSES_CPPFLAGS])
 
+cf_nculib_root=ifelse($1,,ncurses,$1)
 	# This works, except for the special case where we find gpm, but
 	# ncurses is in a nonstandard location via $LIBS, and we really want
 	# to link gpm.
@@ -2082,13 +2100,13 @@ freebsd*)
 esac
 
 LIBS="$cf_ncurses_LIBS $LIBS"
-CF_FIND_LIBRARY(ncurses,ncurses,
+CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root,
 	[#include <${cf_cv_ncurses_header-curses.h}>],
 	[initscr()],
 	initscr)
 
 if test -n "$cf_ncurses_LIBS" ; then
-	AC_MSG_CHECKING(if we can link ncurses without $cf_ncurses_LIBS)
+	AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS)
 	cf_ncurses_SAVE="$LIBS"
 	for p in $cf_ncurses_LIBS ; do
 		q=`echo $LIBS | sed -e 's/'$p' //' -e 's/'$p'$//'`
@@ -2924,11 +2942,13 @@ AC_TRY_LINK([],[char *x=(char*)tgoto("",0,0)],
 	CF_VERBOSE(using functions in predefined $cf_cv_termlib LIBS)
 ],[
 ifelse([$1],,,[
-if test "$1" = ncurses; then
-	CF_NCURSES_CPPFLAGS
-	CF_NCURSES_LIBS
+case "$1" in # (vi
+ncurses*)
+	CF_NCURSES_CPPFLAGS($1)
+	CF_NCURSES_LIBS($1)
 	cf_cv_termlib=terminfo
-fi
+	;;
+esac
 ])
 if test "$cf_cv_termlib" = none; then
 	# FreeBSD's linker gives bogus results for AC_CHECK_LIB, saying that
@@ -3070,6 +3090,21 @@ AC_DEFUN([CF_UPPER],
 $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%`
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl Check for multibyte support, and if not found, utf8 compatibility library
+AC_DEFUN([CF_UTF8_LIB],
+[
+AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[
+AC_TRY_LINK([
+#include <stdlib.h>],[putwc(0,0);],cf_cv_utf8_lib=yes,[
+cf_save_LIBS="$LIBS"
+LIBS="-lutf8 $LIBS"
+AC_TRY_LINK([
+#include <libutf8.h>],[putwc(0,0);],
+[cf_cv_utf8_lib=add-on],
+[cf_cv_utf8_lib=no])])
+])
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl Check for UTMP/UTMPX headers
 AC_DEFUN([CF_UTMP],
 [
@@ -3281,6 +3316,47 @@ fi
 fi
 ])dnl
 dnl ---------------------------------------------------------------------------
+dnl Check for curses implementations that can handle wide-characters
+AC_DEFUN([CF_WIDEC_CURSES],
+[
+AC_CACHE_CHECK(if curses supports wide characters,cf_cv_widec_curses,[
+AC_TRY_LINK([
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>],[
+    wchar_t temp[2];
+    wchar_t wch = 'A';
+    temp[0] = wch;
+    waddnwstr(stdscr, temp, 1);
+],
+[cf_cv_widec_curses=yes],
+[cf_cv_widec_curses=no])
+])
+
+if test "$cf_cv_widec_curses" = yes ; then
+	AC_DEFINE(WIDEC_CURSES)
+
+	# This is needed on Tru64 5.0 to declare mbstate_t
+	AC_CACHE_CHECK(if we must include wchar.h to declare mbstate_t,cf_cv_widec_mbstate,[
+	AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <${cf_cv_ncurses_header-curses.h}>],
+[mbstate_t state],
+[cf_cv_widec_mbstate=no],
+[AC_TRY_COMPILE([
+#include <stdlib.h>
+#include <wchar.h>
+#include <${cf_cv_ncurses_header-curses.h}>],
+[mbstate_t state],
+[cf_cv_widec_mbstate=yes],
+[cf_cv_widec_mbstate=unknown])])])
+
+if test "$cf_cv_widec_mbstate" = yes ; then
+	AC_DEFINE(NEED_WCHAR_H)
+fi
+
+fi
+])dnl
+dnl ---------------------------------------------------------------------------
 dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just
 dnl defaulting to yes/no.
 dnl