diff --git a/contrib/ncurses/ANNOUNCE b/contrib/ncurses/ANNOUNCE index e09e73177a45..11933c5f6d55 100644 --- a/contrib/ncurses/ANNOUNCE +++ b/contrib/ncurses/ANNOUNCE @@ -1,4 +1,4 @@ - Announcing ncurses 5.7 + Announcing ncurses 5.9 The ncurses (new curses) library is a free software emulation of curses in System V Release 4.0, and more. It uses terminfo format, @@ -27,217 +27,30 @@ Release Notes This release is designed to be upward compatible from ncurses 5.0 - through 5.6; very few applications will require recompilation, + through 5.8; very few applications will require recompilation, depending on the platform. These are the highlights from the - change-log since ncurses 5.6 release. + change-log since ncurses 5.8 release. - Interface changes: - * generate linkable stubs for some macros: - getattrs + This is a bug-fix release, correcting a small number of urgent + problems in the ncurses library from the 5.8 release. - New features and improvements: - * library - + new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are reentrant, - but most require either a window-level or screen-level mutex. - (This is API-compatible, but not ABI-compatible with the - normal library). - + add NCURSES_OPAQUE symbol to curses.h, will use to make - structs opaque in selected configurations. - + add NCURSES_EXT_FUNCS and NCURSES_EXT_COLORS symbols to - curses.h to make it simpler to tell if the extended functions - and/or colors are declared. - + add wresize() to C++ binding - + eliminate fixed-buffer vsprintf() calls in C++ binding. - + add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - + adapt mouse-handling code from menu library in form-library - + improve tracing for form library, showing created forms, - fields, etc. - + make $NCURSES_NO_PADDING feature work for termcap interface . - + add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - + several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x - * programs: - + modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - + several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - + add adacurses-config to the Ada95 install. - + modify tic -f option to format spaces as \s to prevent them - from being lost when that is read back in unformatted - strings. - + The tack program is now distributed separately from ncurses. - * terminal database - + added entries: - o Eterm-256color, Eterm-88color and rxvt-88color - o aterm - o konsole-256color - o mrxvt - o screen.mlterm - o screen.rxvt - o teraterm4.59 is now the primary primary teraterm entry, - renamed original to teraterm2.3 - o 9term terminal - o Newbury Data entries - + updated/improved entries: - o gnome to version 2.22.3 - o h19, z100 - o konsole to version 1.6.6 - o mlterm, mlterm+pcfkeys - o xterm, and building-blocks for function-keys to [3]xterm - patch #230. - - Major bug fixes: - * add logic to tic for cancelling strings in user-defined - capabilities (this is needed for current konsole terminfo entry). - * modify mk-1st.awk so the generated makefile rules for linking or - installing shared libraries do not first remove the library, in - case it is in use, e.g., libncurses.so by /bin/sh. - * correct check for notimeout() in wgetch(). - * fix a sign-extension bug in infocmp's repair_acsc() function. - * change winnstr() to stop at the end of the line. - * make Ada95 demo_panels() example work. - * fix for adding a non-spacing character at the beginning of a line. - * fill in extended-color pair to make colors work for - wide-characters using extended-colors. - * improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - * modify win_wchnstr() to ensure that only a base cell is returned - for each multi-column character. - * improve waddch() and winsch() handling of EILSEQ from mbrtowc() by - using unctrl() to display illegal bytes rather than trying to - append further bytes to make up a valid sequence. - * restore curs_set() state after endwin()/refresh() - * modify keyname() to use "^X" form only if meta() has been called, - or if keyname() is called without initializing curses, e.g., via - initscr() or newterm(). - * modify unctrl() to check codes in 128-255 range versus isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - * improve resizeterm() by moving ripped-off lines, and repainting - the soft-keys. - * modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - * use NCURSES_MOUSE_MASK() in definition of BUTTON_RELEASE(), etc., - to make those work properly with the --enable-ext-mouse - configuration - * correct some functions in Ada95 binding which were using return - value from C where none was returned. - * reviewed/fixed issues reported by Coverity and Klocwork tools. - - Portability: - * configure script: - + new options: - - --disable-big-strings - control whether static string tables are generated - as single large strings (to improve startup - performance), or as array of individual strings. - - --disable-relink - control whether shared libraries are relinked - (during install) when rpath is enabled. - - --disable-tic-depends - make explicit whether tic library depends on - ncurses/ncursesw library. - - --enable-mixed-case - override the configure script's check if the - filesystem supports mixed-case filenames. This - allows one to control how the terminal database - maps to the filesystem. For filesystems that do not - support mixed-case, the library uses generate - 2-character (hexadecimal) codes for the lower-level - of the filesystem terminfo database - - --enable-reentrant - builds a different flavor of the ncurses library - (ncursest) which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded - support). - - --enable-weak-symbols - use weak-symbols for linking to the POSIX thread - library, and use the same soname for the ncurses - shared library as the normal library (caveat: the - ABI is for the threaded library, which makes global - data accessed via functions). - - --with-pthread - build with the POSIX thread library (tested with - AIX, Linux, FreeBSD, OpenBSD, HPUX, IRIX64, - Solaris, Tru64). - - --with-ticlib - build/install the tic-support functions in a - separate library - - + improved options: - - --enable-ext-colors - requires the wide-character configuration. - - --with-chtype - ignore option value "unsigned" is always added to - the type in curses.h; do the same for - --with-mmask-t. - - --with-dmalloc - build-fix for redefinition of strndup. - - --with-hashed-db - accepts a parameter which is the install-prefix of - a given Berkeley Database. - - --with-hashed-db - the $LIBS environment variable overrides the search - for the db library. - - --without-hashed-db - assumed when "--disable-database" is used. - - * other configure/build issues: - + build-fixes for LynxOS - + modify shared-library rules to allow FreeBSD 3.x to use - rpath. - + build-fix for FreeBSD "contemporary" TTY interface. - + build-fixes for AIX with libtool. - + build-fixes for Darwin and libtool. - + modify BeOS-specific ifdef's to build on Haiku. - + corrected gcc options for building shared libraries on - Solaris and IRIX64. - + change shared-library configuration for OpenBSD, make rpath - work. - + build-fixes for using libutf8, e.g., on OpenBSD 3.7 - + add "-e" option in ncurses/Makefile.in when generating - source-files to force earlier exit if the build environment - fails unexpectedly. - + add support for shared libraries for QNX. - + change delimiter in MKlib_gen.sh from '%' to '@', to avoid - substitution by IBM xlc to '#' as part of its extensions to - digraphs. - * library: - + rewrite wrapper for wcrtomb(), making it work on Solaris. - This is used in the form library to determine the length of - the buffer needed by field_buffer. - + add/use configure script macro CF_SIG_ATOMIC_T, use the - corresponding type for data manipulated by signal handlers. - + set locale in misc/ncurses-config.in since it uses a range - + disable GPM mouse support when $TERM does not happen to - contain "linux", since Gpm_Open() no longer limits its - assertion to terminals that it might handle, e.g., within - "screen" in xterm. - + reset mouse file-descriptor when unloading GPM library. - * test programs: - + update test programs to build/work with various UNIX curses - for comparisons. + It also improves the Ada95 binding: + * fixes a longstanding portability problem with its use of the + [3]set_field_type function. Because that function uses + variable-length argument lists, its interface with gnat does not + work with certain platforms. + * improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. + Those were a proof of concept. For the 5.9 release, those scripts + are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + [4]here. + * additional improvements were made for portability of the ncurses + examples, adding rpm- and dpkg-scripts for test-builds. See + [5]this page for snapshots and other information. Features of Ncurses @@ -274,15 +87,15 @@ * Support for mouse event reporting with X Window xterm and FreeBSD and OS/2 console windows. * Extended mouse support via Alessandro Rubini's gpm package. - * The function wresize() allows you to resize windows, preserving + * The function wresize allows you to resize windows, preserving their data. - * The function use_default_colors() allows you to use the terminal's + * The function use_default_colors allows you to use the terminal's default colors for the default color pair, achieving the effect of transparent colors. - * The functions keyok() and define_key() allow you to better control - the use of function keys, e.g., disabling the ncurses KEY_MOUSE, - or by defining more than one control sequence to map to a given - key code. + * The functions keyok and define_key allow you to better control the + use of function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code. * Support for 256-color terminals, such as modern xterm, when configured using the --enable-ext-colors option. * Support for 16-color terminals, such as aixterm and modern xterm. @@ -293,7 +106,7 @@ incorporates a novel, simple, and cheap algorithm that enables it to make optimal use of hardware scrolling, line-insertion, and line-deletion for screen-line movements. This algorithm is more - powerful than the 4.4BSD curses quickch() routine. + powerful than the 4.4BSD curses quickch routine. * Real support for terminals with the magic-cookie glitch. The screen-update code will refrain from drawing a highlight if the magic- cookie unattributed spaces required just before the @@ -356,55 +169,55 @@ cdk Curses Development Kit - [4]http://invisible-island.net/cdk/ - [5]http://www.vexus.ca/products/CDK/ + [6]http://invisible-island.net/cdk/ + [7]http://www.vexus.ca/products/CDK/ ded directory-editor - [6]http://invisible-island.net/ded/ + [8]http://invisible-island.net/ded/ dialog the underlying application used in Slackware's setup, and the basis for similar applications on GNU/Linux. - [7]http://invisible-island.net/dialog/ + [9]http://invisible-island.net/dialog/ lynx the character-screen WWW browser - [8]http://lynx.isc.org/release/ + [10]http://lynx.isc.org/release/ Midnight Commander file manager - [9]http://www.ibiblio.org/mc/ + [11]http://www.midnight-commander.org/ mutt mail utility - [10]http://www.mutt.org/ + [12]http://www.mutt.org/ ncftp file-transfer utility - [11]http://www.ncftp.com/ + [13]http://www.ncftp.com/ nvi New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. - [12]http://www.bostic.com/vi/ + [14]https://sites.google.com/a/bostic.com/keithbostic/nvi pinfo Lynx-like info browser. - [13]https://alioth.debian.org/projects/pinfo/ + [15]https://alioth.debian.org/projects/pinfo/ tin - newsreader, supporting color, MIME [14]http://www.tin.org/ + newsreader, supporting color, MIME [16]http://www.tin.org/ as well as some that use ncurses for the terminfo support alone: minicom terminal emulator - [15]http://alioth.debian.org/projects/minicom/ + [17]http://alioth.debian.org/projects/minicom/ vile vi-like-emacs - [16]http://invisible-island.net/vile/ + [18]http://invisible-island.net/vile/ The ncurses distribution includes a selection of test programs (including a few games). @@ -412,11 +225,11 @@ Who's Who and What's What Zeyd Ben-Halim started it from a previous package pcurses, written by - Pavel Curtis. Eric S. Raymond continued development. Jürgen Pfeifer + Pavel Curtis. Eric S. Raymond continued development. Juergen Pfeifer wrote most of the form and menu libraries. Ongoing work is being done - by [17]Thomas Dickey. Thomas Dickey acts as the maintainer for the + by [19]Thomas Dickey. Thomas Dickey acts as the maintainer for the Free Software Foundation, which holds the copyright on ncurses. - Contact the current maintainers at [18]bug-ncurses@gnu.org. + Contact the current maintainers at [20]bug-ncurses@gnu.org. To join the ncurses mailing list, please write email to bug-ncurses-request@gnu.org containing the line: @@ -426,7 +239,7 @@ Who's Who and What's What and testing of this package. Beta versions of ncurses and patches to the current release are made - available at [19]ftp://invisible-island.net/ncurses/ . + available at [21]ftp://invisible-island.net/ncurses/ . Future Plans @@ -440,34 +253,36 @@ Future Plans Other Related Resources The distribution provides a newer version of the terminfo-format - terminal description file once maintained by [20]Eric Raymond . Unlike + terminal description file once maintained by [22]Eric Raymond . Unlike the older version, the termcap and terminfo data are provided in the same file, and provides several user-definable extensions beyond the X/Open specification. You can find lots of information on terminal-related topics not - covered in the terminfo file at [21]Richard Shuford's archive . + covered in the terminfo file at [23]Richard Shuford's archive . References 1. ftp://ftp.gnu.org/gnu/ncurses/ 2. ftp://invisible-island.net/ncurses/ - 3. http://invisible-island.net/xterm/xterm.log.html#xterm_230 - 4. http://invisible-island.net/cdk/ - 5. http://www.vexus.ca/products/CDK/ - 6. http://invisible-island.net/ded/ - 7. http://invisible-island.net/dialog/ - 8. http://lynx.isc.org/release/ - 9. http://www.ibiblio.org/mc/ - 10. http://www.mutt.org/ - 11. http://www.ncftp.com/ - 12. http://www.bostic.com/vi/ - 13. https://alioth.debian.org/projects/pinfo/ - 14. http://www.tin.org/ - 15. http://alioth.debian.org/projects/minicom/ - 16. http://invisible-island.net/vile/ - 17. mailto:dickey@invisible-island.net - 18. mailto:bug-ncurses@gnu.org - 19. ftp://invisible-island.net/ncurses/ - 20. http://www.catb.org/~esr/terminfo/ - 21. http://www.cs.utk.edu/~shuford/terminal_index.html + 3. http://invisible-island.net/ncurses/man/form_fieldtype.3x + 4. http://invisible-island.net/ncurses/ncurses-Ada95.html + 5. http://invisible-island.net/ncurses/ncurses-examples.html + 6. http://invisible-island.net/cdk/ + 7. http://www.vexus.ca/products/CDK/ + 8. http://invisible-island.net/ded/ + 9. http://invisible-island.net/dialog/ + 10. http://lynx.isc.org/release/ + 11. http://www.midnight-commander.org/ + 12. http://www.mutt.org/ + 13. http://www.ncftp.com/ + 14. https://sites.google.com/a/bostic.com/keithbostic/nvi + 15. https://alioth.debian.org/projects/pinfo/ + 16. http://www.tin.org/ + 17. http://alioth.debian.org/projects/minicom/ + 18. http://invisible-island.net/vile/ + 19. mailto:dickey@invisible-island.net + 20. mailto:bug-ncurses@gnu.org + 21. ftp://invisible-island.net/ncurses/ + 22. http://www.catb.org/~esr/terminfo/ + 23. http://web.archive.org/web/*/http://www.cs.utk.edu/~shuford/terminal diff --git a/contrib/ncurses/INSTALL b/contrib/ncurses/INSTALL index ab7dcd829959..eb26ab103ef8 100644 --- a/contrib/ncurses/INSTALL +++ b/contrib/ncurses/INSTALL @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $ +-- $Id: INSTALL,v 1.155 2011/03/31 08:27:24 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -39,9 +39,8 @@ d.d is the current version number. There should be several subdirectories, including `c++', `form', `man', `menu', 'misc', `ncurses', `panel', `progs', and `test'. See the README file for a roadmap to the package. -If you are a Linux or FreeBSD or NetBSD distribution integrator or packager, -please read and act on the section titled IF YOU ARE A SYSTEM INTEGRATOR -below. +If you are a distribution integrator or packager, please read and act on the +section titled IF YOU ARE A SYSTEM INTEGRATOR below. If you are converting from BSD curses and do not have root access, be sure to read the BSD CONVERSION NOTES section below. @@ -58,10 +57,6 @@ CROSS-COMPILER. If you want to build the Ada95 binding, go to the Ada95 directory and follow the instructions there. The Ada95 binding is not covered below. -If you are using anything but (a) Linux, or (b) one of the 4.4BSD-based -i386 Unixes, go read the Portability section in the TO-DO file before you -do anything else. - REQUIREMENTS: ------------ @@ -86,14 +81,14 @@ INSTALLATION PROCEDURE: The --prefix option to configure changes the root directory for installing ncurses. The default is normally in subdirectories of /usr/local, except - for systems where ncurses is normally installed as a system library, e.g., - Linux, the various BSD systems and Cygwin. Use --prefix=/usr to replace - your default curses distribution. + for systems where ncurses is normally installed as a system library (see + "IF YOU ARE A SYSTEM INTEGRATOR"). Use --prefix=/usr to replace your + default curses distribution. The package gets installed beneath the --prefix directory as follows: In $(prefix)/bin: tic, infocmp, captoinfo, tset, - reset, clear, tput, toe + reset, clear, tput, toe, tabs In $(prefix)/lib: libncurses*.* libcurses.a In $(prefix)/share/terminfo: compiled terminal descriptions In $(prefix)/include: C header files @@ -105,12 +100,12 @@ INSTALLATION PROCEDURE: Do not use commands such as - make install prefix=XXX + make install prefix=XXX to change the prefix after configuration, since the prefix value is used for some absolute pathnames such as TERMINFO. Instead do this - make install DESTDIR=XXX + make install DESTDIR=XXX See also the discussion of --with-install-prefix. @@ -147,7 +142,7 @@ INSTALLATION PROCEDURE: library interfaces are not binary-compatible with the non-wide-character version. Building and running the wide-character code relies on a fairly recent implementation of libiconv. We have built this configuration on - Linux using libiconv, sometimes requiring libutf8. + various systems using libiconv, sometimes requiring libutf8. If you configure using the --with-pthread option, a "t" is appended to the library names (e.g., libncursest.a, libncursestw.a). @@ -170,8 +165,8 @@ INSTALLATION PROCEDURE: ./configure --with-shared --without-normal --without-debug Rules for generating shared libraries are highly dependent upon the choice - of host system and compiler. We've been testing shared libraries on Linux - and SunOS with gcc, but more work needs to be done to make shared libraries + of host system and compiler. We've been testing shared libraries on + several systems, but more work needs to be done to make shared libraries work on other systems. If you have libtool installed, you can type @@ -338,6 +333,17 @@ SUMMARY OF CONFIGURE OPTIONS: --disable-largefile Disable compiler flags needed to use large-file interfaces. + --disable-libtool-version + when using --with-libtool, control how the major/minor version numbers + are used for constructing the library name. + + The default uses the -version-number feature of libtool, which makes + the library names compatible (though not identical) with the standard + build using --with-shared. + + Use --disable-libtool-version to use the libtool -version-info feature. + This corresponds to the setting used before patch 20100515. + --disable-leaks For testing, compile-in code that frees memory that normally would not be freed, to simplify analysis of memory-leaks. @@ -389,6 +395,12 @@ SUMMARY OF CONFIGURE OPTIONS: application. These are (for example $TERMINFO) those that allow the search path for the terminfo or termcap entry to be customized. + --disable-rpath-hack + Normally the configure script helps link libraries found in unusual + places by adding an rpath option to the link command. If you are + building packages, this feature may be redundant. Use this option + to suppress the feature. + --disable-scroll-hints Compile without scroll-hints code. This option is ignored when hashmap scrolling is configured, which is the default. @@ -421,7 +433,7 @@ SUMMARY OF CONFIGURE OPTIONS: changes several data references to functions to work around this problem. - NOTE: With ncurses 5.1, this may not be necessary, since we are + NOTE: With ncurses 5.1, this may not be necessary, since we are told that some linkers interpret uninitialized global data as a different type of reference which behaves as described above. We have explicitly initialized all of the global data to work around the @@ -450,7 +462,7 @@ SUMMARY OF CONFIGURE OPTIONS: warning. There will still be warnings due to subtle inconsistencies in the interface, but at a lower level. - NOTE: configuring ncurses with this option may detract from the + NOTE: configuring ncurses with this option may detract from the portability of your applications by encouraging you to use const in places where the XSI curses interface would not allow them. Similar issues arise when porting to SVr4 curses, which uses const in even @@ -471,7 +483,7 @@ SUMMARY OF CONFIGURE OPTIONS: encoded. This applies only to the wide-character (--enable-widec) configuration. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have an array of cchar_t's must be recompiled. @@ -480,7 +492,7 @@ SUMMARY OF CONFIGURE OPTIONS: That allows one to use ncurses with a wheel mouse with xterm or similar X terminal emulators. - NOTE: using this option will make libraries which are not binary- + NOTE: using this option will make libraries which are not binary- compatible with libncursesw 5.4. None of the interfaces change, but applications which have mouse mask mmask_t's must be recompiled. @@ -500,7 +512,7 @@ SUMMARY OF CONFIGURE OPTIONS: --enable-getcap-cache Cache translated termcaps under the directory $HOME/.terminfo - NOTE: this sounds good - it makes ncurses run faster the second time. + NOTE: this sounds good - it makes ncurses run faster the second time. But look where the data comes from - an /etc/termcap containing lots of entries that are not up to date. If you configure with this option and forget to install the terminfo database before running an ncurses @@ -513,6 +525,10 @@ SUMMARY OF CONFIGURE OPTIONS: may not be accurate, or that your stty settings have disabled the use of tabs. + --enable-interop + Compile-in experimental interop bindings. These provide generic types + for the form-library. + --enable-mixed-case Controls whether the filesystem on which the terminfo database resides supports mixed-case filenames (normal for UNIX, but not on other @@ -525,6 +541,15 @@ SUMMARY OF CONFIGURE OPTIONS: terminfo entries. This is the default, unless you have disabled the extended functions. + --enable-pc-files + If pkg-config is found (see --with-pkg-config), generate ".pc" files + for each of the libraries, and install them in pkg-config's library + directory. + + --enable-pthreads-eintr + add logic in threaded configuration to ensure that a read(2) system + call can be interrupted for SIGWINCH. + --enable-reentrant Compile experimental configuration which improves reentrant use of the library by reducing global and static variables. This option is also @@ -565,6 +590,11 @@ SUMMARY OF CONFIGURE OPTIONS: is not strictly compatible. This option allows one to implement this alteration without patching the source code. + --enable-sp-funcs + Compile-in support for extended functions which accept a SCREEN pointer, + reducing the need for juggling the global SP value with set_term() and + delscreen(). + --enable-symlinks If your system supports symbolic links, make tic use symbolic links rather than hard links to save diskspace when writing aliases in the @@ -576,6 +606,11 @@ SUMMARY OF CONFIGURE OPTIONS: capabilities as user-defined strings. This option is the default, unless you have disabled the extended functions. + --enable-term-driver + Enable experimental terminal-driver. This is currently used for the + MinGW port, by providing a way to substitute the low-level terminfo + library with different terminal drivers. + --enable-termcap Compile in support for reading terminal descriptions from termcap if no match is found in the terminfo database. See also the --enable-getcap @@ -630,12 +665,23 @@ SUMMARY OF CONFIGURE OPTIONS: --with-ada-objects=DIR Tell where to install the Ada objects (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib + Build a shared library for Ada95 binding, if the compiler permits. + + NOTE: You must also set the --with-shared option on some platforms + for a successful build. You need not use this option when you set + --with-shared, unless you want to use the Ada shared library. + --with-bool=TYPE If --without-cxx is specified, override the type used for the "bool" declared in curses.h (normally the type is automatically chosen to correspond with that in , or defaults to platform-specific sizes). + --with-build-cpp=XXX + This option is provided by the same macro used for $BUILD_CC, etc., + but is not directly used by ncurses. + --with-build-cc=XXX If cross-compiling, specify a host C compiler, which is needed to compile a few utilities which generate source modules for ncurses. @@ -682,12 +728,17 @@ SUMMARY OF CONFIGURE OPTIONS: to use a terminfo database which is compatible with the native applications. + --with-ccharw-max=XXX + Override the size of the wide-character array in cchar_t structures. + Changing this will alter the binary interface. This defaults to 5. + --with-chtype=TYPE Override type of chtype, which stores the video attributes and (if --enable-widec is not given) a character. Prior to ncurses 5.5, this was always unsigned long, but with ncurses 5.5, it may be unsigned. Use this option if you need to preserve compatibility with 64-bit - executables. + executables, e.g., by setting "--with-chtype=long" (the configure + script supplies "unsigned"). --with-database=XXX Specify the terminfo source file to install. Usually you will wish @@ -719,7 +770,7 @@ SUMMARY OF CONFIGURE OPTIONS: use Alessandro Rubini's GPM library to provide mouse support on the Linux console. Prior to ncurses 5.5, this introduced a dependency on the GPM library. - + Currently ncurses uses the dlsym() function to bind to the library at runtime, so it is only necessary that the library be present when ncurses is built, to obtain the filename (or soname) used in the @@ -736,7 +787,7 @@ SUMMARY OF CONFIGURE OPTIONS: Use a hashed database for storing terminfo data rather than storing each compiled entry in a separate binary file within a directory tree. - + In particular, this uses the Berkeley database 1.8.5 interface, as provided by that and its successors db 2, 3, and 4. The actual interface is slightly different in the successor versions of the @@ -770,7 +821,7 @@ SUMMARY OF CONFIGURE OPTIONS: make install DESTDIR=XXX since the makefiles pass that variable to subordinate makes. - NOTE: a few systems build shared libraries with fixed pathnames; this + NOTE: a few systems build shared libraries with fixed pathnames; this option probably will not work for those configurations. --with-libtool[=XXX] @@ -807,9 +858,9 @@ SUMMARY OF CONFIGURE OPTIONS: --with-manpage-renames=XXX Tell the configure script that you wish to rename the manpages while - installing. Currently the only distribution which does this is - the Linux Debian. The option value specifies the name of a file - that lists the renamed files, e.g., $srcdir/man/man_db.renames + installing. Currently the only distribution which does this is Debian. + The option value specifies the name of a file that lists the renamed + files, e.g., $srcdir/man/man_db.renames --with-manpage-symlinks Tell the configure script that you wish to make symbolic links in the @@ -850,6 +901,9 @@ SUMMARY OF CONFIGURE OPTIONS: those using termcap, do not use the higher speeds. Your application (or system, in general) may or may not. + --with-pkg-config=[DIR] + Check for pkg-config, optionally specifying its path. + --with-profile Generate profile-libraries These are named by adding "_p" to the root, e.g., libncurses_p.a @@ -873,7 +927,7 @@ SUMMARY OF CONFIGURE OPTIONS: which you are building, typically using a ".so" suffix, along with symbolic links that refer to the release version. - NOTE: Unless you override the configure script by setting the $CFLAGS + NOTE: Unless you override the configure script by setting the $CFLAGS environment variable, these will not be built with the -g debugging option. @@ -885,7 +939,11 @@ SUMMARY OF CONFIGURE OPTIONS: loads the system's copy of the ncurses shared libraries. In that case, using the misc/shlib script may be helpful, since it sets $LD_LIBRARY_PATH to point to the build tree, e.g., - ./misc/shlib make install + ./misc/shlib make install + + NOTE: If you use the --with-ada-sharedlib option, you should also + set this option, to ensure that C-language modules needed for the + Ada binding use appropriate compiler options. --with-shlib-version=XXX Specify whether to use the release or ABI version for shared libraries. @@ -946,6 +1004,17 @@ SUMMARY OF CONFIGURE OPTIONS: For testing, compile with debug option. This also sets the --disable-leaks option. + --with-wrap-prefix=XXX + When using the --enable-reentrant option, ncurses redefines variables + that would be global in curses, e.g., LINES, as a macro that calls a + "wrapping" function which fetches the data from the current SCREEN + structure. Normally that function is named by prepending "_nc_" to the + variable's name. The function is technically private (since portable + applications would not refer directly to it). But according to one + line of reasoning, it is not the same type of "private" as functions + which applications should not call even via a macro. This configure + option lets you choose the prefix for these wrapped variables. + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. @@ -975,11 +1044,18 @@ SUMMARY OF CONFIGURE OPTIONS: --without-dlsym Do not use dlsym() to load GPM dynamically. + --without-manpages + Tell the configure script to suppress the install of ncurses' manpages. + --without-progs Tell the configure script to suppress the build of ncurses' application programs (e.g., tic). The test applications will still be built if you type "make", though not if you simply do "make install". + --without-tests + Tell the configure script to suppress the build of ncurses' test + programs. + --without-xterm-new Tell the configure script to use "xterm-old" for the entry used in the terminfo database. This will work with variations such as @@ -1001,6 +1077,60 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: you may encounter when building a system with different versions of ncurses: + 5.8 (Feb 26, 2011) + Interface changes: + + + add an alternate library configuration, i.e., "terminal driver" to + support port to Windows, built with MinGW. There are two drivers + (terminfo and Windows console). The terminfo driver works on other + platforms. + + + add a new set of functions which accept a SCREEN* parameter, in + contrast with the original set which use the global value "sp". + By default, these names end with "_sp", and are otherwise + functionally identical with the originals. + + In addition to the "_sp" functions, there are a few new functions + associated with this feature: ceiling_panel, ground_panel, + new_prescr. + + If the library is not built with the sp-funcs extension, there + are no related interface changes. + + + add tiparm function based on review of X/Open Curses Issue 7. + + + change internal _nc_has_mouse function to public has_mouse function + + Added extensions: + + + add a few more functions to support the NCURSES_OPAQUE feature: + get_escdelay, is_pad, is_subwin + + Added internal functions (other than "_sp" variants): + _nc_curscr_of + _nc_format_slks + _nc_get_alias_table + _nc_get_hash_info + _nc_insert_wch + _nc_newscr_of + _nc_outc_wrapper + _nc_retrace_char + _nc_retrace_int_attr_t + _nc_retrace_mmask_t + _nc_setup_tinfo + _nc_stdscr_of + _nc_tinfo_cmdch + + Removed internal functions: + _nc_makenew (some configurations replace by _nc_makenew_sp) + + Modified internal functions: + _nc_UpdateAttrs + _nc_get_hash_table + _nc_has_mouse + _nc_insert_ch + _nc_wgetch + 5.7 (November 2, 2008) Interface changes: @@ -1011,7 +1141,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: of the ncurses library used for the tic program as well as some others such as tack. There is no API change, but makefiles would be changed to use the tic-library built separately. - + tack, distributed separately from ncurses, uses some of the internal _nc_XXX functions, which are declared in the tic.h header file. @@ -1158,7 +1288,7 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: still used in this release to allow compiling with not-so-old compilers. - + form and menu libraries now work with wide-character data. + + form and menu libraries now work with wide-character data. Applications which bypassed the form library and manipulated the FIELD.buf data directly will not work properly with libformw, since that no longer points to an array of char. The set_field_buffer() @@ -1438,8 +1568,8 @@ COMPATIBILITY WITH OLDER VERSIONS OF NCURSES: 4.0 (December 24, 1996) - We bumped to version 4.0 because the newly released dynamic loader - (ld.so.1.8.5) on Linux did not load shared libraries whose ABI and REL + We bumped to version 4.0 because the newly released Linux dynamic + loader (ld.so.1.8.5) did not load shared libraries whose ABI and REL versions were inconsistent. At that point, ncurses ABI was 3.4 and the REL was 1.9.9g, so we made them consistent. @@ -1496,10 +1626,10 @@ IF YOU ARE A SYSTEM INTEGRATOR: Configuration and Installation: - On platforms where ncurses is assumed to be installed in /usr/lib, + On platforms where ncurses is assumed to be installed in /usr/lib, the configure script uses "/usr" as a default: - Linux, FreeBSD, NetBSD, OpenBSD, Cygwin + GNU/Linux, FreeBSD, NetBSD, OpenBSD, Cygwin For other platforms, the default is "/usr/local". See the discussion of the "--disable-overwrite" option. @@ -1562,7 +1692,7 @@ IF YOU ARE A SYSTEM INTEGRATOR: bsdos -- BSD/OS If you are responsible for integrating ncurses for one of these - distribution, please either use the recommended name or get back + distributions, please either use the recommended name or get back to us explaining why you don't want to, so we can work out nomenclature that will make users' lives easier rather than harder. @@ -1584,7 +1714,8 @@ CONFIGURING FALLBACK ENTRIES: tree is accessible (that is, in single-user mode or at OS installation time) the ncurses library can be compiled to include an array of pre-fetched fallback entries. This must be done on a machine which - has ncurses' infocmp and terminfo database installed. + has ncurses' infocmp and terminfo database installed (as well as + ncurses' tic and infocmp programs). These entries are checked by setupterm() only when the conventional fetches from the terminfo tree and the termcap fallback (if configured) @@ -1689,8 +1820,8 @@ USING NCURSES WITH AFS: with this by making tic use symbolic links. USING NCURSES WITH GPM: - Ncurses 4.1 and up can be configured to use GPM (General Purpose - Mouse) which is used on Linux console. Be aware that GPM is commonly + Ncurses 4.1 and up can be configured to use GPM (General Purpose Mouse) + which is used with Linux console. Be aware that GPM is commonly installed as a shared library which contains a wrapper for the curses wgetch() function (libcurses.o). Some integrators have simplified linking applications by combining all or part of libcurses.so into the @@ -1735,6 +1866,10 @@ BUILDING NCURSES WITH A CROSS-COMPILER option), ncurses uses the development platform's tic to do the "make install.data" portion. + The system's tic program is used to install the terminal database, + even for cross-compiles. For best results, the tic program should + be from the most current version of ncurses. + BUGS: Send any feedback to the ncurses mailing list at bug-ncurses@gnu.org. To subscribe send mail to diff --git a/contrib/ncurses/MANIFEST b/contrib/ncurses/MANIFEST index db3871f2e11e..421cc678cd6b 100644 --- a/contrib/ncurses/MANIFEST +++ b/contrib/ncurses/MANIFEST @@ -3,6 +3,10 @@ ./Ada95/Makefile.in ./Ada95/README ./Ada95/TODO +./Ada95/aclocal.m4 +./Ada95/configure +./Ada95/configure.in +./Ada95/doc/Makefile.in ./Ada95/gen/Makefile.in ./Ada95/gen/adacurses-config.in ./Ada95/gen/gen.c @@ -23,6 +27,21 @@ ./Ada95/gen/terminal_interface-curses-trace.ads.m4 ./Ada95/gen/terminal_interface-curses.adb.m4 ./Ada95/gen/terminal_interface-curses.ads.m4 +./Ada95/include/MKncurses_def.sh +./Ada95/include/Makefile.in +./Ada95/include/ncurses_cfg.hin +./Ada95/include/ncurses_defs +./Ada95/make-tar.sh +./Ada95/mk-1st.awk +./Ada95/package/AdaCurses-doc.spec +./Ada95/package/AdaCurses.spec +./Ada95/package/debian/compat +./Ada95/package/debian/control +./Ada95/package/debian/copyright +./Ada95/package/debian/docs +./Ada95/package/debian/rules +./Ada95/package/debian/source/format +./Ada95/package/debian/watch ./Ada95/samples/Makefile.in ./Ada95/samples/README ./Ada95/samples/explain.txt @@ -109,6 +128,11 @@ ./Ada95/samples/tour.adb ./Ada95/samples/tour.ads ./Ada95/src/Makefile.in +./Ada95/src/c_varargs_to_ada.c +./Ada95/src/c_varargs_to_ada.h +./Ada95/src/library.gpr +./Ada95/src/modules +./Ada95/src/ncurses_compat.c ./Ada95/src/terminal_interface-curses-aux.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.adb ./Ada95/src/terminal_interface-curses-forms-field_types-alpha.ads @@ -172,6 +196,7 @@ ./Makefile.os2 ./NEWS ./README +./README.MinGW ./README.emx ./TO-DO ./aclocal.m4 @@ -311,6 +336,7 @@ ./doc/html/announce.html ./doc/html/hackguide.html ./doc/html/index.html +./doc/html/man/adacurses-config.1.html ./doc/html/man/captoinfo.1m.html ./doc/html/man/clear.1.html ./doc/html/man/curs_add_wch.3x.html @@ -350,6 +376,7 @@ ./doc/html/man/curs_inwstr.3x.html ./doc/html/man/curs_kernel.3x.html ./doc/html/man/curs_legacy.3x.html +./doc/html/man/curs_memleaks.3x.html ./doc/html/man/curs_mouse.3x.html ./doc/html/man/curs_move.3x.html ./doc/html/man/curs_opaque.3x.html @@ -363,6 +390,7 @@ ./doc/html/man/curs_scr_dump.3x.html ./doc/html/man/curs_scroll.3x.html ./doc/html/man/curs_slk.3x.html +./doc/html/man/curs_sp_funcs.3x.html ./doc/html/man/curs_termattrs.3x.html ./doc/html/man/curs_termcap.3x.html ./doc/html/man/curs_terminfo.3x.html @@ -370,6 +398,7 @@ ./doc/html/man/curs_touch.3x.html ./doc/html/man/curs_trace.3x.html ./doc/html/man/curs_util.3x.html +./doc/html/man/curs_variables.3x.html ./doc/html/man/curs_window.3x.html ./doc/html/man/default_colors.3x.html ./doc/html/man/define_key.3x.html @@ -395,6 +424,7 @@ ./doc/html/man/form_post.3x.html ./doc/html/man/form_requestname.3x.html ./doc/html/man/form_userptr.3x.html +./doc/html/man/form_variables.3x.html ./doc/html/man/form_win.3x.html ./doc/html/man/index.html ./doc/html/man/infocmp.1m.html @@ -427,10 +457,13 @@ ./doc/html/man/mitem_value.3x.html ./doc/html/man/mitem_visible.3x.html ./doc/html/man/ncurses.3x.html +./doc/html/man/ncurses5-config.1.html ./doc/html/man/panel.3x.html ./doc/html/man/resizeterm.3x.html +./doc/html/man/tabs.1.html ./doc/html/man/term.5.html ./doc/html/man/term.7.html +./doc/html/man/term_variables.3x.html ./doc/html/man/terminfo.5.html ./doc/html/man/tic.1m.html ./doc/html/man/toe.1m.html @@ -479,12 +512,15 @@ ./form/fty_alnum.c ./form/fty_alpha.c ./form/fty_enum.c +./form/fty_generic.c ./form/fty_int.c ./form/fty_ipv4.c ./form/fty_num.c ./form/fty_regex.c ./form/headers ./form/llib-lform +./form/llib-lformt +./form/llib-lformtw ./form/llib-lformw ./form/modules ./include/Caps @@ -507,16 +543,20 @@ ./include/hashed_db.h ./include/headers ./include/nc_alloc.h +./include/nc_mingw.h ./include/nc_panel.h ./include/nc_tparm.h ./include/ncurses_cfg.hin ./include/ncurses_defs -./include/ncurses_dll.h +./include/ncurses_dll.h.in +./include/ncurses_mingw.h ./include/term_entry.h ./include/termcap.h.in ./include/tic.h ./include/unctrl.h.in ./install-sh +./man/MKada_config.in +./man/MKncu_config.in ./man/MKterminfo.sh ./man/Makefile.in ./man/captoinfo.1m @@ -572,6 +612,7 @@ ./man/curs_scr_dump.3x ./man/curs_scroll.3x ./man/curs_slk.3x +./man/curs_sp_funcs.3x ./man/curs_termattrs.3x ./man/curs_termcap.3x ./man/curs_terminfo.3x @@ -579,6 +620,7 @@ ./man/curs_touch.3x ./man/curs_trace.3x ./man/curs_util.3x +./man/curs_variables.3x ./man/curs_window.3x ./man/default_colors.3x ./man/define_key.3x @@ -604,6 +646,7 @@ ./man/form_post.3x ./man/form_requestname.3x ./man/form_userptr.3x +./man/form_variables.3x ./man/form_win.3x ./man/infocmp.1m ./man/infotocap.1m @@ -640,8 +683,10 @@ ./man/ncurses.3x ./man/panel.3x ./man/resizeterm.3x +./man/tabs.1 ./man/term.5 ./man/term.7 +./man/term_variables.3x ./man/terminfo.head ./man/terminfo.tail ./man/tic.1m @@ -654,6 +699,8 @@ ./menu/eti.h ./menu/headers ./menu/llib-lmenu +./menu/llib-lmenut +./menu/llib-lmenutw ./menu/llib-lmenuw ./menu/m_attribs.c ./menu/m_cursor.c @@ -694,13 +741,12 @@ ./misc/emx.src ./misc/form.def ./misc/form.ref +./misc/gen-pkgconfig.in ./misc/gen_edit.sh -./misc/jpf-indent ./misc/makedef.cmd ./misc/makellib ./misc/menu.def ./misc/menu.ref -./misc/ncu-indent ./misc/ncurses-config.in ./misc/ncurses.def ./misc/ncurses.ref @@ -718,8 +764,8 @@ ./mk-0th.awk ./mk-1st.awk ./mk-2nd.awk +./mk-dlls.sh.in ./mk-hdr.awk -./mkdirs.sh ./ncurses/Makefile.in ./ncurses/README ./ncurses/README.IZ @@ -748,6 +794,7 @@ ./ncurses/base/lib_delch.c ./ncurses/base/lib_delwin.c ./ncurses/base/lib_dft_fgbg.c +./ncurses/base/lib_driver.c ./ncurses/base/lib_echo.c ./ncurses/base/lib_endwin.c ./ncurses/base/lib_erase.c @@ -813,10 +860,12 @@ ./ncurses/base/version.c ./ncurses/base/vsscanf.c ./ncurses/base/wresize.c +./ncurses/build.priv.h ./ncurses/curses.priv.h ./ncurses/fifo_defs.h ./ncurses/llib-lncurses ./ncurses/llib-lncursest +./ncurses/llib-lncursestw ./ncurses/llib-lncursesw ./ncurses/modules ./ncurses/tinfo/MKcaptab.awk @@ -863,6 +912,7 @@ ./ncurses/tinfo/lib_tparm.c ./ncurses/tinfo/lib_tputs.c ./ncurses/tinfo/lib_ttyflags.c +./ncurses/tinfo/make_hash.c ./ncurses/tinfo/make_keys.c ./ncurses/tinfo/name_match.c ./ncurses/tinfo/parse_entry.c @@ -870,6 +920,7 @@ ./ncurses/tinfo/read_termcap.c ./ncurses/tinfo/setbuf.c ./ncurses/tinfo/strings.c +./ncurses/tinfo/tinfo_driver.c ./ncurses/tinfo/trim_sgr0.c ./ncurses/tinfo/use_screen.c ./ncurses/tinfo/write_entry.c @@ -895,6 +946,7 @@ ./ncurses/tty/tty_display.h ./ncurses/tty/tty_input.h ./ncurses/tty/tty_update.c +./ncurses/wcwidth.h ./ncurses/widechar/charable.c ./ncurses/widechar/lib_add_wch.c ./ncurses/widechar/lib_box_set.c @@ -915,9 +967,14 @@ ./ncurses/widechar/lib_vline_set.c ./ncurses/widechar/lib_wacs.c ./ncurses/widechar/lib_wunctrl.c +./ncurses/win32con/gettimeofday.c +./ncurses/win32con/wcwidth.c +./ncurses/win32con/win_driver.c ./panel/Makefile.in ./panel/headers ./panel/llib-lpanel +./panel/llib-lpanelt +./panel/llib-lpaneltw ./panel/llib-lpanelw ./panel/modules ./panel/p_above.c @@ -947,11 +1004,12 @@ ./progs/infocmp.c ./progs/modules ./progs/progs.priv.h +./progs/tabs.c ./progs/tic.c ./progs/toe.c ./progs/tput.c +./progs/transform.c ./progs/tset.c -./tar-copy.sh ./test/Makefile.in ./test/README ./test/aclocal.m4 @@ -963,6 +1021,7 @@ ./test/cardfile.c ./test/cardfile.dat ./test/chgat.c +./test/clip_printw.c ./test/color_set.c ./test/configure ./test/configure.in @@ -973,6 +1032,7 @@ ./test/demo_menus.c ./test/demo_panels.c ./test/demo_termcap.c +./test/demo_terminfo.c ./test/ditto.c ./test/dots.c ./test/dots_mvcur.c @@ -990,19 +1050,30 @@ ./test/inch_wide.c ./test/inchs.c ./test/ins_wide.c +./test/insdelln.c ./test/inserts.c ./test/key_names.c ./test/keynames.c ./test/knight.c +./test/linedata.h ./test/linux-color.dat ./test/listused.sh ./test/lrtest.c +./test/make-tar.sh ./test/mk-test.awk ./test/modules ./test/movewindow.c ./test/ncurses.c ./test/ncurses_tst.hin ./test/newdemo.c +./test/package/debian/compat +./test/package/debian/control +./test/package/debian/copyright +./test/package/debian/docs +./test/package/debian/rules +./test/package/debian/source/format +./test/package/debian/watch +./test/package/ncurses-examples.spec ./test/programs ./test/railroad.c ./test/rain.c @@ -1011,6 +1082,10 @@ ./test/savescreen.sh ./test/tclock.c ./test/test.priv.h +./test/test_add_wchstr.c +./test/test_addchstr.c +./test/test_addstr.c +./test/test_addwstr.c ./test/test_arrays.c ./test/test_get_wstr.c ./test/test_getstr.c @@ -1026,4 +1101,5 @@ ./test/worm.c ./test/xmas.c ./test/xterm-16color.dat +./test/xterm-256color.dat ./test/xterm-88color.dat diff --git a/contrib/ncurses/Makefile.in b/contrib/ncurses/Makefile.in index cb8cd422cc49..d891e002fd83 100644 --- a/contrib/ncurses/Makefile.in +++ b/contrib/ncurses/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.24 2005/01/29 19:30:06 tom Exp $ +# $Id: Makefile.in,v 1.30 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,6 +32,7 @@ # Master Makefile for ncurses library. SHELL = /bin/sh +VPATH = @srcdir@ DESTDIR=@DESTDIR@ CF_MFLAGS = @cf_cv_makeflags@ DESTDIR="$(DESTDIR)" @@ -42,6 +43,9 @@ NCURSES_MAJOR = @NCURSES_MAJOR@ NCURSES_MINOR = @NCURSES_MINOR@ NCURSES_PATCH = @NCURSES_PATCH@ +top_srcdir = @top_srcdir@ +srcdir = @srcdir@ + prefix = @prefix@ exec_prefix = @exec_prefix@ @@ -83,6 +87,13 @@ preinstall : fgrep NCURSES_VERSION $(includedir)/curses.h >/dev/null || \ echo '** Will overwrite non-ncurses curses.h' +dlls: libs + $(SHELL) $(srcdir)/mk-dlls.sh + +distclean \ +realclean :: + -rm -f mk-dlls.sh mingw_arch + # Put the common rules here so that we can easily construct the list of # directories to visit. all \ diff --git a/contrib/ncurses/NEWS b/contrib/ncurses/NEWS index a64450b30228..e8f9cefbabdd 100644 --- a/contrib/ncurses/NEWS +++ b/contrib/ncurses/NEWS @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $ +-- $Id: NEWS,v 1.1682 2011/04/04 00:02:42 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,1076 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20110404 5.9 release for upload to ftp.gnu.org + +20110402 + + various build-fixes for the rpm/dpkg scripts. + + add "--enable-rpath-link" option to Ada95/configure, to allow + packages to suppress the rpath feature which is normally used for + the in-tree build of sample programs. + + corrected definition of libdir variable in Ada95/src/Makefile.in, + needed for rpm script. + + add "--with-shared" option to Ada95/configure script, to allow + making the C-language parts of the binding use appropriate compiler + options if building a shared library with gnat. + +20110329 + > portability fixes for Ada95 binding: + + add configure check to ensure that SIGINT works with gnat. This is + needed for the "rain" sample program. If SIGINT does not work, omit + that sample program. + + correct typo in check of $PKG_CONFIG variable in Ada95/configure + + add ncurses_compat.c, to supply functions used in the Ada95 binding + which were added in 5.7 and later. + + modify sed expression in CF_NCURSES_ADDON to eliminate a dependency + upon GNU sed. + +20110326 + + add special check in Ada95/configure script for ncurses6 reentrant + code. + + regen Ada html documentation. + + build-fix for Ada shared libraries versus the varargs workaround. + + add rpm and dpkg scripts for Ada95 and test directories, for test + builds. + + update test/configure macros CF_CURSES_LIBS, CF_XOPEN_SOURCE and + CF_X_ATHENA_LIBS. + + add configure check to determine if gnat's project feature supports + libraries, i.e., collections of .ali files. + + make all dereferences in Ada95 samples explicit. + + fix typo in comment in lib_add_wch.c (patch by Petr Pavlu). + + add configure check for, ifdef's for math.h which is in a separate + package on Solaris and potentially not installed (report by Petr + Pavlu). + > fixes for Ada95 binding (Nicolas Boulenguez): + + improve type-checking in Ada95 by eliminating a few warning-suppress + pragmas. + + suppress unreferenced warnings. + + make all dereferences in binding explicit. + +20110319 + + regen Ada html documentation. + + change order of -I options from ncurses*-config script when the + --disable-overwrite option was used, so that the subdirectory include + is listed first. + + modify the make-tar.sh scripts to add a MANIFEST and NEWS file. + + modify configure script to provide value for HTML_DIR in + Ada95/gen/Makefile.in, which depends on whether the Ada95 binding is + distributed separately (report by Nicolas Boulenguez). + + modify configure script to add -g and/or -O3 to ADAFLAGS if the + CFLAGS for the build has these options. + + amend change from 20070324, to not add 1 to the result of getmaxx + and getmaxy in the Ada binding (report by Nicolas Boulenguez for + thread in comp.lang.ada). + + build-fix Ada95/samples for gnat 4.5 + + spelling fixes for Ada95/samples/explain.txt + > fixes for Ada95 binding (Nicolas Boulenguez): + + add item in Trace_Attribute_Set corresponding to TRACE_ATTRS. + + add workaround for binding to set_field_type(), which uses varargs. + The original binding from 990220 relied on the prevalent + implementation of varargs which did not support or need va_copy(). + + add dependency on gen/Makefile.in needed for *-panels.ads + + add Library_Options to library.gpr + + add Languages to library.gpr, for gprbuild + +20110307 + + revert changes to limit-checks from 20110122 (Debian #616711). + > minor type-cleanup of Ada95 binding (Nicolas Boulenguez): + + corrected a minor sign error in a field of Low_Level_Field_Type, to + conform to form.h. + + replaced C_Int by Curses_Bool as return type for some callbacks, see + fieldtype(3FORM). + + modify samples/sample-explain.adb to provide explicit message when + explain.txt is not found. + +20110305 + + improve makefiles for Ada95 tree (patch by Nicolas Boulenguez). + + fix an off-by-one error in _nc_slk_initialize() from 20100605 fixes + for compiler warnings (report by Nicolas Boulenguez). + + modify Ada95/gen/gen.c to declare unused bits in generated layouts, + needed to compile when chtype is 64-bits using gnat 4.4.5 + +20110226 5.8 release for upload to ftp.gnu.org + +20110226 + + update release notes, for 5.8. + + regenerated html manpages. + + change open() in _nc_read_file_entry() to fopen() for consistency + with write_file(). + + modify misc/run_tic.in to create parent directory, in case this is + a new install of hashed database. + + fix typo in Ada95/mk-1st.awk which causes error with original awk. + +20110220 + + configure script rpath fixes from xterm #269. + + workaround for cygwin's non-functional features.h, to force ncurses' + configure script to define _XOPEN_SOURCE_EXTENDED when building + wide-character configuration. + + build-fix in run_tic.sh for OS/2 EMX install + + add cons25-debian entry (patch by Brian M Carlson, Debian #607662). + +20110212 + + regenerated html manpages. + + use _tracef() in show_where() function of tic, to work correctly with + special case of trace configuration. + +20110205 + + add xterm-utf8 entry as a demo of the U8 feature -TD + + add U8 feature to denote entries for terminal emulators which do not + support VT100 SI/SO when processing UTF-8 encoding -TD + + improve the NCURSES_NO_UTF8_ACS feature by adding a check for an + extended terminfo capability U8 (prompted by mailing list + discussion). + +20110122 + + start documenting interface changes for upcoming 5.8 release. + + correct limit-checks in derwin(). + + correct limit-checks in newwin(), to ensure that windows have nonzero + size (report by Garrett Cooper). + + fix a missing "weak" declaration for pthread_kill (patch by Nicholas + Alcock). + + improve documentation of KEY_ENTER in curs_getch.3x manpage (prompted + by discussion with Kevin Martin). + +20110115 + + modify Ada95/configure script to make the --with-curses-dir option + work without requiring the --with-ncurses option. + + modify test programs to allow them to be built with NetBSD curses. + + document thick- and double-line symbols in curs_add_wch.3x manpage. + + document WACS_xxx constants in curs_add_wch.3x manpage. + + fix some warnings for clang 2.6 "--analyze" + + modify Ada95 makefiles to make html-documentation with the project + file configuration if that is used. + + update config.guess, config.sub + +20110108 + + regenerated html manpages. + + minor fixes to enable lint when trace is not enabled, e.g., with + clang --analyze. + + fix typo in man/default_colors.3x (patch by Tim van der Molen). + + update ncurses/llib-lncurses* + +20110101 + + fix remaining strict compiler warnings in ncurses library ABI=5, + except those dealing with function pointers, etc. + +20101225 + + modify nc_tparm.h, adding guards against repeated inclusion, and + allowing TPARM_ARG to be overridden. + + fix some strict compiler warnings in ncurses library. + +20101211 + + suppress ncv in screen entry, allowing underline (patch by Alejandro + R Sedeno). + + also suppress ncv in konsole-base -TD + + fixes in wins_nwstr() and related functions to ensure that special + characters, i.e., control characters are handled properly with the + wide-character configuration. + + correct a comparison in wins_nwstr() (Redhat #661506). + + correct help-messages in some of the test-programs, which still + referred to quitting with 'q'. + +20101204 + + add special case to _nc_infotocap() to recognize the setaf/setab + strings from xterm+256color and xterm+88color, and provide a reduced + version which works with termcap. + + remove obsolete emacs "Local Variables" section from documentation + (request by Sven Joachim). + + update doc/html/index.html to include NCURSES-Programming-HOWTO.html + (report by Sven Joachim). + +20101128 + + modify test/configure and test/Makefile.in to handle this special + case of building within a build-tree (Debian #34182): + mkdir -p build && cd build && ../test/configure && make + +20101127 + + miscellaneous build-fixes for Ada95 and test-directories when built + out-of-tree. + + use VPATH in makefiles to simplify out-of-tree builds (Debian #34182). + + fix typo in rmso for tek4106 entry -Goran Weinholt + +20101120 + + improve checks in test/configure for X libraries, from xterm #267 + changes. + + modify test/configure to allow it to use the build-tree's libraries + e.g., when using that to configure the test-programs without the + rpath feature (request by Sven Joachim). + + repurpose "gnome" terminfo entries as "vte", retaining "gnome" items + for compatibility, but generally deprecating those since the VTE + library is what actually defines the behavior of "gnome", etc., + since 2003 -TD + +20101113 + + compiler warning fixes for test programs. + + various build-fixes for test-programs with pdcurses. + + updated configure checks for X packages in test/configure from xterm + #267 changes. + + add configure check to gnatmake, to accommodate cygwin. + +20101106 + + correct list of sub-directories needed in Ada95 tree for building as + a separate package. + + modify scripts in test-directory to improve builds as a separate + package. + +20101023 + + correct parsing of relative tab-stops in tabs program (report by + Philip Ganchev). + + adjust configure script so that "t" is not added to library suffix + when weak-symbols are used, allowing the pthread configuration to + more closely match the non-thread naming (report by Werner Fink). + + modify configure check for tic program, used for fallbacks, to a + warning if not found. This makes it simpler to use additonal + scripts to bootstrap the fallbacks code using tic from the build + tree (report by Werner Fink). + + fix several places in configure script using ${variable-value} form. + + modify configure macro CF_LDFLAGS_STATIC to accommodate some loaders + which do not support selectively linking against static libraries + (report by John P. Hartmann) + + fix an unescaped dash in man/tset.1 (report by Sven Joachim). + +20101009 + + correct comparison used for setting 16-colors in linux-16color + entry (Novell #644831) -TD + + improve linux-16color entry, using "dim" for color-8 which makes it + gray rather than black like color-0 -TD + + drop misc/ncu-indent and misc/jpf-indent; they are provided by an + external package "cindent". + +20101002 + + improve linkages in html manpages, adding references to the newer + pages, e.g., *_variables, curs_sp_funcs, curs_threads. + + add checks in tic for inconsistent cursor-movement controls, and for + inconsistent printer-controls. + + fill in no-parameter forms of cursor-movement where a parameterized + form is available -TD + + fill in missing cursor controls where the form of the controls is + ANSI -TD + + fix inconsistent punctuation in form_variables manpage (patch by + Sven Joachim). + + add parameterized cursor-controls to linux-basic (report by Dae) -TD + > patch by Juergen Pfeifer: + + document how to build 32-bit libraries in README.MinGW + + fixes to filename computation in mk-dlls.sh.in + + use POSIX locale in mk-dlls.sh.in rather than en_US (report by Sven + Joachim). + + add a check in mk-dlls.sh.in to obtain the size of a pointer to + distinguish between 32-bit and 64-bit hosts. The result is stored + in mingw_arch + +20100925 + + add "XT" capability to entries for terminals that support both + xterm-style mouse- and title-controls, for "screen" which + special-cases TERM beginning with "xterm" or "rxvt" -TD + > patch by Juergen Pfeifer: + + use 64-Bit MinGW toolchain (recommended package from TDM, see + README.MinGW). + + support pthreads when using the TDM MinGW toolchain + +20100918 + + regenerated html manpages. + + minor fixes for symlinks to curs_legacy.3x and curs_slk.3x manpages. + + add manpage for sp-funcs. + + add sp-funcs to test/listused.sh, for documentation aids. + +20100911 + + add manpages for summarizing public variables of curses-, terminfo- + and form-libraries. + + minor fixes to manpages for consistency (patch by Jason McIntyre). + + modify tic's -I/-C dump to reformat acsc strings into canonical form + (sorted, unique mapping) (cf: 971004). + + add configure check for pthread_kill(), needed for some old + platforms. + +20100904 + + add configure option --without-tests, to suppress building test + programs (request by Frederic L W Meunier). + +20100828 + + modify nsterm, xnuppc and tek4115 to make sgr/sgr0 consistent -TD + + add check in terminfo source-reader to provide more informative + message when someone attempts to run tic on a compiled terminal + description (prompted by Debian #593920). + + note in infotocap and captoinfo manpages that they read terminal + descriptions from text-files (Debian #593920). + + improve acsc string for vt52, show arrow keys (patch by Benjamin + Sittler). + +20100814 + + document in manpages that "mv" functions first use wmove() to check + the window pointer and whether the position lies within the window + (suggested by Poul-Henning Kamp). + + fixes to curs_color.3x, curs_kernel.3x and wresize.3x manpages (patch + by Tim van der Molen). + + modify configure script to transform library names for tic- and + tinfo-libraries so that those build properly with Mac OS X shared + library configuration. + + modify configure script to ensure that it removes conftest.dSYM + directory leftover on checks with Mac OS X. + + modify configure script to cleanup after check for symbolic links. + +20100807 + + correct a typo in mk-1st.awk (patch by Gabriele Balducci) + (cf: 20100724) + + improve configure checks for location of tic and infocmp programs + used for installing database and for generating fallback data, + e.g., for cross-compiling. + + add Markus Kuhn's wcwidth function for compiling MinGW + + add special case to CF_REGEX for cross-compiling to MinGW target. + +20100731 + + modify initialization check for win32con driver to eliminate need for + special case for TERM "unknown", using terminal database if available + (prompted by discussion with Roumen Petrov). + + for MinGW port, ensure that terminal driver is setup if tgetent() + is called (patch by Roumen Petrov). + + document tabs "-0" and "-8" options in manpage. + + fix Debian "lintian" issues with manpages reported in + http://lintian.debian.org/full/csmall@debian.org.html#ncurses + +20100724 + + add a check in tic for missing set_tab if clear_all_tabs given. + + improve use of symbolic links in makefiles by using "-f" option if + it is supported, to eliminate temporary removal of the target + (prompted by http://www.t2-project.org/packages/ncurses.html) + + minor improvement to test/ncurses.c, reset color pairs in 'd' test + after exit from 'm' main-menu command. + + improved ncu-indent, from mawk changes, allows more than one of + GCC_NORETURN, GCC_PRINTFLIKE and GCC_SCANFLIKE on a single line. + +20100717 + + add hard-reset for rs2 to wsvt25 to help ensure that reset ends + the alternate character set (patch by Nicholas Marriott) + + remove tar-copy.sh and related configure/Makefile chunks, since the + Ada95 binding is now installed using rules in Ada95/src. + +20100703 + + continue integrating changes to use gnatmake project files in Ada95 + + add/use configure check to turn on project rules for Ada95/src. + + revert the vfork change from 20100130, since it does not work. + +20100626 + + continue integrating changes to use gnatmake project files in Ada95 + + old gnatmake (3.15) does not produce libraries using project-file; + work around by adding script to generate alternate makefile. + +20100619 + + continue integrating changes to use gnatmake project files in Ada95 + + add configure --with-ada-sharedlib option, for the test_make rule. + + move Ada95-related logic into aclocal.m4, since additional checks + will be needed to distinguish old/new implementations of gnat. + +20100612 + + start integrating changes to use gnatmake project files in Ada95 tree + + add test_make / test_clean / test_install rules in Ada95/src + + change install-path for adainclude directory to /usr/share/ada (was + /usr/lib/ada). + + update Ada95/configure. + + add mlterm+256color entry, for mlterm 3.0.0 -TD + + modify test/configure to use macros to ensure consistent order + of updating LIBS variable. + +20100605 + + change search order of options for Solaris in CF_SHARED_OPTS, to + work with 64-bit compiles. + + correct quoting of assignment in CF_SHARED_OPTS case for aix + (cf: 20081227) + +20100529 + + regenerated html documentation. + + modify test/configure to support pkg-config for checking X libraries + used by PDCurses. + + add/use configure macro CF_ADD_LIB to force consistency of + assignments to $LIBS, etc. + + fix configure script for combining --with-pthread + and --enable-weak-symbols options. + +20100522 + + correct cross-compiling configure check for CF_MKSTEMP macro, by + adding a check cache variable set by AC_CHECK_FUNC (report by + Pierre Labastie). + + simplify include-dependencies of make_hash and make_keys, to reduce + the need for setting BUILD_CPPFLAGS in cross-compiling when the + build- and target-machines differ. + + repair broken-linker configuration by restoring a definition of SP + variable to curses.priv.h, and adjusting for cases where sp-funcs + are used. + + improve configure macro CF_AR_FLAGS, allowing ARFLAGS environment + variable to override (prompted by report by Pablo Cazallas). + +20100515 + + add configure option --enable-pthreads-eintr to control whether the + new EINTR feature is enabled. + + modify logic in pthread configuration to allow EINTR to interrupt + a read operation in wgetch() (Novell #540571, patch by Werner Fink). + + drop mkdirs.sh, use "mkdir -p". + + add configure option --disable-libtool-version, to use the + "-version-number" feature which was added in libtool 1.5 (report by + Peter Haering). The default value for the option uses the newer + feature, which makes libraries generated using libtool compatible + with the standard builds of ncurses. + + updated test/configure to match configure script macros. + + fixes for configure script from lynx changes: + + improve CF_FIND_LINKAGE logic for the case where a function is + found in predefined libraries. + + revert part of change to CF_HEADER (cf: 20100424) + +20100501 + + correct limit-check in wredrawln, accounting for begy/begx values + (patch by David Benjamin). + + fix most compiler warnings from clang. + + amend build-fix for OpenSolaris, to ensure that a system header is + included in curses.h before testing feature symbols, since they + may be defined by that route. + +20100424 + + fix some strict compiler warnings in ncurses library. + + modify configure macro CF_HEADER_PATH to not look for variations in + the predefined include directories. + + improve configure macros CF_GCC_VERSION and CF_GCC_WARNINGS to work + with gcc 4.x's c89 alias, which gives warning messages for cases + where older versions would produce an error. + +20100417 + + modify _nc_capcmp() to work with cancelled strings. + + correct translation of "^" in _nc_infotocap(), used to transform + terminfo to termcap strings + + add configure --disable-rpath-hack, to allow disabling the feature + which adds rpath options for libraries in unusual places. + + improve CF_RPATH_HACK_2 by checking if the rpath option for a given + directory was already added. + + improve CF_RPATH_HACK_2 by using ldd to provide a standard list of + directories (which will be ignored). + +20100410 + + improve win_driver.c handling of mouse: + + discard motion events + + avoid calling _nc_timed_wait when there is a mouse event + + handle 4th and "rightmost" buttons. + + quote substitutions in CF_RPATH_HACK_2 configure macro, needed for + cases where there are embedded blanks in the rpath option. + +20100403 + + add configure check for exctags vs ctags, to work around pkgsrc. + + simplify logic in _nc_get_screensize() to make it easier to see how + environment variables may override system- and terminfo-values + (prompted by discussion with Igor Bujna). + + make debug-traces for COLOR_PAIR and PAIR_NUMBER less verbose. + + improve handling of color-pairs embedded in attributes for the + extended-colors configuration. + + modify MKlib_gen.sh to build link_test with sp-funcs. + + build-fixes for OpenSolaris aka Solaris 11, for wide-character + configuration as well as for rpath feature in *-config scripts. + +20100327 + + refactor CF_SHARED_OPTS configure macro, making CF_RPATH_HACK more + reusable. + + improve configure CF_REGEX, similar fixes. + + improve configure CF_FIND_LINKAGE, adding add check between system + (default) and explicit paths, where we can find the entrypoint in the + given library. + + add check if Gpm_Open() returns a -2, e.g., for "xterm". This is + normally suppressed but can be overridden using $NCURSES_GPM_TERMS. + Ensure that Gpm_Close() is called in this case. + +20100320 + + rename atari and st52 terminfo entries to atari-old, st52-old, use + newer entries from FreeMiNT by Guido Flohr (from patch/report by Alan + Hourihane). + +20100313 + + modify install-rule for manpages so that *-config manpages will + install when building with --srcdir (report by Sven Joachim). + + modify CF_DISABLE_LEAKS configure macro so that the --enable-leaks + option is not the same as --disable-leaks (GenToo #305889). + + modify #define's for build-compiler to suppress cchar_t symbol from + compile of make_hash and make_keys, improving cross-compilation of + ncursesw (report by Bernhard Rosenkraenzer). + + modify CF_MAN_PAGES configure macro to replace all occurrences of + TPUT in tput.1's manpage (Debian #573597, report/analysis by Anders + Kaseorg). + +20100306 + + generate manpages for the *-config scripts, adapted from help2man + (suggested by Sven Joachim). + + use va_copy() in _nc_printf_string() to avoid conflicting use of + va_list value in _nc_printf_length() (report by Wim Lewis). + +20100227 + + add Ada95/configure script, to use in tar-file created by + Ada95/make-tar.sh + + fix typo in wresize.3x (patch by Tim van der Molen). + + modify screen-bce.XXX entries to exclude ech, since screen's color + model does not clear with color for that feature -TD + +20100220 + + add make-tar.sh scripts to Ada95 and test subdirectories to help with + making those separately distributable. + + build-fix for static libraries without dlsym (Debian #556378). + + fix a syntax error in man/form_field_opts.3x (patch by Ingo + Schwarze). + +20100213 + + add several screen-bce.XXX entries -TD + +20100206 + + update mrxvt terminfo entry -TD + + modify win_driver.c to support mouse single-clicks. + + correct name for termlib in ncurses*-config, e.g., if it is renamed + to provide a single file for ncurses/ncursesw libraries (patch by + Miroslav Lichvar). + +20100130 + + use vfork in test/ditto.c if available (request by Mike Frysinger). + + miscellaneous cleanup of manpages. + + fix typo in curs_bkgd.3x (patch by Tim van der Molen). + + build-fix for --srcdir (patch by Miroslav Lichvar). + +20100123 + + for term-driver configuration, ensure that the driver pointer is + initialized in setupterm so that terminfo/termcap programs work. + + amend fix for Debian #542031 to ensure that wattrset() returns only + OK or ERR, rather than the attribute value (report by Miroslav + Lichvar). + + reorder WINDOWLIST to put WINDOW data after SCREEN pointer, making + _nc_screen_of() compatible between normal/wide libraries again (patch + by Miroslav Lichvar) + + review/fix include-dependencies in modules files (report by Miroslav + Lichvar). + +20100116 + + modify win_driver.c to initialize acs_map for win32 console, so + that line-drawing works. + + modify win_driver.c to initialize TERMINAL struct so that programs + such as test/lrtest.c and test/ncurses.c which test string + capabilities can run. + + modify term-driver modules to eliminate forward-reference + declarations. + +20100109 + + modify configure macro CF_XOPEN_SOURCE, etc., to use CF_ADD_CFLAGS + consistently to add new -D's while removing duplicates. + + modify a few configure macros to consistently put new options + before older in the list. + + add tiparm(), based on review of X/Open Curses Issue 7. + + minor documentation cleanup. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + (caveat - its maintainer put 2010 copyright date on files dated 2009) + +20100102 + + minor improvement to tic's checking of similar SGR's to allow for the + most common case of SGR 0. + + modify getmouse() to act as its documentation implied, returning on + each call the preceding event until none are left. When no more + events remain, it will return ERR. + +20091227 + + change order of lookup in progs/tput.c, looking for terminfo data + first. This fixes a confusion between termcap "sg" and terminfo + "sgr" or "sgr0", originally from 990123 changes, but exposed by + 20091114 fixes for hashing. With this change, only "dl" and "ed" are + ambiguous (Mandriva #56272). + +20091226 + + add bterm terminfo entry, based on bogl 0.1.18 -TD + + minor fix to rxvt+pcfkeys terminfo entry -TD + + build-fixes for Ada95 tree for gnat 4.4 "style". + +20091219 + + remove old check in mvderwin() which prevented moving a derived + window whose origin happened to coincide with its parent's origin + (report by Katarina Machalkova). + + improve test/ncurses.c to put mouse droppings in the proper window. + + update minix terminfo entry -TD + + add bw (auto-left-margin) to nsterm* entries (Benjamin Sittler) + +20091212 + + correct transfer of multicolumn characters in multirow + field_buffer(), which stopped at the end of the first row due to + filling of unused entries in a cchar_t array with nulls. + + updated nsterm* entries (Benjamin Sittler, Emanuele Giaquinta) + + modify _nc_viscbuf2() and _tracecchar_t2() to show wide-character + nulls. + + use strdup() in set_menu_mark(), restore .marklen struct member on + failure. + + eliminate clause 3 from the UCB copyrights in read_termcap.c and + tset.c per + ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change + (patch by Nicholas Marriott). + + replace a malloc in tic.c with strdup, checking for failure (patch by + Nicholas Marriott). + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + +20091205 + + correct layout of working window used to extract data in + wide-character configured by set_field_buffer (patch by Rafael + Garrido Fernandez) + + improve some limit-checks related to filename length in reading and + writing terminfo entries. + + ensure that filename is always filled in when attempting to read + a terminfo entry, so that infocmp can report the filename (patch + by Nicholas Marriott). + +20091128 + + modify mk-1st.awk to allow tinfo library to be built when term-driver + is enabled. + + add error-check to configure script to ensure that sp-funcs is + enabled if term-driver is, since some internal interfaces rely upon + this. + +20091121 + + fix case where progs/tput is used while sp-funcs is configure; this + requires save/restore of out-character function from _nc_prescreen + rather than the SCREEN structure (report by Charles Wilson). + + fix typo in man/curs_trace.3x which caused incorrect symbolic links + + improved configure macros CF_GCC_ATTRIBUTES, CF_PROG_LINT. + +20091114 + + + updated man/curs_trace.3x + + limit hashing for termcap-names to 2-characters (Ubuntu #481740). + + change a variable name in lib_newwin.c to make it clearer which + value is being freed on error (patch by Nicholas Marriott). + +20091107 + + improve test/ncurses.c color-cycling test by reusing attribute- + and color-cycling logic from the video-attributes screen. + + add ifdef'd with NCURSES_INTEROP_FUNCS experimental bindings in form + library which help make it compatible with interop applications + (patch by Juergen Pfeifer). + + add configure option --enable-interop, for integrating changes + for generic/interop support to form-library by Juergen Pfeifer + +20091031 + + modify use of $CC environment variable which is defined by X/Open + as a curses feature, to ignore it if it is not a single character + (prompted by discussion with Benjamin C W Sittler). + + add START_TRACE in slk_init + + fix a regression in _nc_ripoffline which made test/ncurses.c not show + soft-keys, broken in 20090927 merging. + + change initialization of "hidden" flag for soft-keys from true to + false, broken in 20090704 merging (Ubuntu #464274). + + update nsterm entries (patch by Benjamin C W Sittler, prompted by + discussion with Fabian Groffen in GenToo #206201). + + add test/xterm-256color.dat + +20091024 + + quiet some pedantic gcc warnings. + + modify _nc_wgetch() to check for a -1 in the fifo, e.g., after a + SIGWINCH, and discard that value, to avoid confusing application + (patch by Eygene Ryabinkin, FreeBSD bin/136223). + +20091017 + + modify handling of $PKG_CONFIG_LIBDIR to use only the first item in + a possibly colon-separated list (Debian #550716). + +20091010 + + supply a null-terminator to buffer in _nc_viswibuf(). + + fix a sign-extension bug in unget_wch() (report by Mike Gran). + + minor fixes to error-returns in default function for tputs, as well + as in lib_screen.c + +20091003 + + add WACS_xxx definitions to wide-character configuration for thick- + and double-lines (discussion with Slava Zanko). + + remove unnecessary kcan assignment to ^C from putty (Sven Joachim) + + add ccc and initc capabilities to xterm-16color -TD + > patch by Benjamin C W Sittler: + + add linux-16color + + correct initc capability of linux-c-nc end-of-range + + similar change for dg+ccc and dgunix+ccc + +20090927 + + move leak-checking for comp_captab.c into _nc_leaks_tinfo() since + that module since 20090711 is in libtinfo. + + add configure option --enable-term-driver, to allow compiling with + terminal-driver. That is used in MinGW port, and (being somewhat + more complicated) is an experimental alternative to the conventional + termlib internals. Currently, it requires the sp-funcs feature to + be enabled. + + completed integrating "sp-funcs" by Juergen Pfeifer in ncurses + library (some work remains for forms library). + +20090919 + + document return code from define_key (report by Mike Gran). + + make some symbolic links in the terminfo directory-tree shorter + (patch by Daniel Jacobowitz, forwarded by Sven Joachim).). + + fix some groff warnings in terminfo.5, etc., from recent Debian + changes. + + change ncv and op capabilities in sun-color terminfo entry to match + Sun's entry for this (report by Laszlo Peter). + + improve interix smso terminfo capability by using reverse rather than + bold (report by Kristof Zelechovski). + +20090912 + + add some test programs (and make these use the same special keys + by sharing linedata.h functions): + test/test_addstr.c + test/test_addwstr.c + test/test_addchstr.c + test/test_add_wchstr.c + + correct internal _nc_insert_ch() to use _nc_insert_wch() when + inserting wide characters, since the wins_wch() function that it used + did not update the cursor position (report by Ciprian Craciun). + +20090906 + + fix typo s/is_timeout/is_notimeout/ which made "man is_notimeout" not + work. + + add null-pointer checks to other opaque-functions. + + add is_pad() and is_subwin() functions for opaque access to WINDOW + (discussion with Mark Dickinson). + + correct merge to lib_newterm.c, which broke when sp-funcs was + enabled. + +20090905 + + build-fix for building outside source-tree (report by Sven Joachim). + + fix Debian lintian warning for man/tabs.1 by making section number + agree with file-suffix (report by Sven Joachim). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090829 + + workaround for bug in g++ 4.1-4.4 warnings for wattrset() macro on + amd64 (Debian #542031). + + fix typo in curs_mouse.3x (Debian #429198). + +20090822 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090815 + + correct use of terminfo capabilities for initializing soft-keys, + broken in 20090509 merging. + + modify wgetch() to ensure it checks SIGWINCH when it gets an error + in non-blocking mode (patch by Clemens Ladisch). + + use PATH_SEPARATOR symbol when substituting into run_tic.sh, to + help with builds on non-Unix platforms such as OS/2 EMX. + + modify scripting for misc/run_tic.sh to test configure script's + $cross_compiling variable directly rather than comparing host/build + compiler names (prompted by comment in GenToo #249363). + + fix configure script option --with-database, which was coded as an + enable-type switch. + + build-fixes for --srcdir (report by Frederic L W Meunier). + +20090808 + + separate _nc_find_entry() and _nc_find_type_entry() from + implementation details of hash function. + +20090803 + + add tabs.1 to man/man_db.renames + + modify lib_addch.c to compensate for removal of wide-character test + from unctrl() in 20090704 (Debian #539735). + +20090801 + + improve discussion in INSTALL for use of system's tic/infocmp for + cross-compiling and building fallbacks. + + modify test/demo_termcap.c to correspond better to options in + test/demo_terminfo.c + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + fix logic for 'V' in test/ncurses.c tests f/F. + +20090728 + + correct logic in tigetnum(), which caused tput program to treat all + string capabilities as numeric (report by Rajeev V Pillai, + cf: 20090711). + +20090725 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090718 + + fix a null-pointer check in _nc_format_slks() in lib_slk.c, from + 20070704 changes. + + modify _nc_find_type_entry() to use hashing. + + make CCHARW_MAX value configurable, noting that changing this would + change the size of cchar_t, and would be ABI-incompatible. + + modify test-programs, e.g,. test/view.c, to address subtle + differences between Tru64/Solaris and HPUX/AIX getcchar() return + values. + + modify length returned by getcchar() to count the trailing null + which is documented in X/Open (cf: 20020427). + + fixes for test programs to build/work on HPUX and AIX, etc. + +20090711 + + improve performance of tigetstr, etc., by using hashing code from tic. + + minor fixes for memory-leak checking. + + add test/demo_terminfo, for comparison with demo_termcap + +20090704 + + remove wide-character checks from unctrl() (patch by Clemens Ladisch). + + revise wadd_wch() and wecho_wchar() to eliminate dependency on + unctrl(). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090627 + + update llib-lncurses[wt] to use sp-funcs. + + various code-fixes to build/work with --disable-macros configure + option. + + add several new files from Juergen Pfeifer which will be used when + integration of "sp-funcs" is complete. This includes a port to + MinGW. + +20090613 + + move definition for NCURSES_WRAPPED_VAR back to ncurses_dll.h, to + make includes of term.h without curses.h work (report by "Nix"). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090607 + + fix a regression in lib_tputs.c, from ongoing merges. + +20090606 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090530 + + fix an infinite recursion when adding a legacy-coding 8-bit value + using insch() (report by Clemens Ladisch). + + free home-terminfo string in del_curterm() (patch by Dan Weber). + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090523 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090516 + + work around antique BSD game's manipulation of stdscr, etc., versus + SCREEN's copy of the pointer (Debian #528411). + + add a cast to wattrset macro to avoid compiler warning when comparing + its result against ERR (adapted from patch by Matt Kraii, Debian + #528374). + +20090510 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090502 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + add vwmterm terminfo entry (patch by Bryan Christ). + +20090425 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090419 + + build fix for _nc_free_and_exit() change in 20090418 (report by + Christian Ebert). + +20090418 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090411 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + This change finishes merging for menu and panel libraries, does + part of the form library. + +20090404 + + suppress configure check for static/dynamic linker flags for gcc on + Darwin (report by Nelson Beebe). + +20090328 + + extend ansi.sys pfkey capability from kf1-kf10 to kf1-kf48, moving + function key definitions from emx-base for consistency -TD + + correct missing final 'p' in pfkey capability of ansi.sys-old (report + by Kalle Olavi Niemitalo). + + improve test/ncurses.c 'F' test, show combining characters in color. + + quiet a false report by cppcheck in c++/cursesw.cc by eliminating + a temporary variable. + + use _nc_doalloc() rather than realloc() in a few places in ncurses + library to avoid leak in out-of-memory condition (reports by William + Egert and Martin Ettl based on cppcheck tool). + + add --with-ncurses-wrap-prefix option to test/configure (discussion + with Charles Wilson). + + use ncurses*-config scripts if available for test/configure. + + update test/aclocal.m4 and test/configure + > patches by Charles Wilson: + + modify CF_WITH_LIBTOOL configure check to allow unreleased libtool + version numbers (e.g. which include alphabetic chars, as well as + digits, after the final '.'). + + improve use of -no-undefined option for libtool by setting an + intermediate variable LT_UNDEF in the configure script, and then + using that in the libtool link-commands. + + fix an missing use of NCURSES_PUBLIC_VAR() in tinfo/MKcodes.awk + from 2009031 changes. + + improve mk-1st.awk script by writing separate cases for the + LIBTOOL_LINK command, depending on which library (ncurses, ticlib, + termlib) is to be linked. + + modify configure.in to allow broken-linker configurations, not just + enable-reentrant, to set public wrap prefix. + +20090321 + + add TICS_LIST and SHLIB_LIST to allow libtool 2.2.6 on Cygwin to + build with tic and term libraries (patch by Charles Wilson). + + add -no-undefined option to libtool for Cygwin, MinGW, U/Win and AIX + (report by Charles Wilson). + + fix definition for c++/Makefile.in's SHLIB_LIST, which did not list + the form, menu or panel libraries (patch by Charles Wilson). + + add configure option --with-wrap-prefix to allow setting the prefix + for functions used to wrap global variables to something other than + "_nc_" (discussion with Charles Wilson). + +20090314 + + modify scripts to generate ncurses*-config and pc-files to add + dependency for tinfo library (patch by Charles Wilson). + + improve comparison of program-names when checking for linked flavors + such as "reset" by ignoring the executable suffix (reports by Charles + Wilson, Samuel Thibault and Cedric Bretaudeau on Cygwin mailing + list). + + suppress configure check for static/dynamic linker flags for gcc on + Solaris 10, since gcc is confused by absence of static libc, and + does not switch back to dynamic mode before finishing the libraries + (reports by Joel Bertrand, Alan Pae). + + minor fixes to Intel compiler warning checks in configure script. + + modify _nc_leaks_tinfo() so leak-checking in test/railroad.c works. + + modify set_curterm() to make broken-linker configuration work with + changes from 20090228 (report by Charles Wilson). + +20090228 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + + modify declaration of cur_term when broken-linker is used, but + enable-reentrant is not, to match pre-5.7 (report by Charles Wilson). + +20090221 + + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete). + +20090214 + + add configure script --enable-sp-funcs to enable the new set of + extended functions. + + start integrating patches by Juergen Pfeifer: + + add extended functions which specify the SCREEN pointer for several + curses functions which use the global SP (these are incomplete; + some internals work is needed to complete these). + + add special cases to configure script for MinGW port. + +20090207 + + update several configure macros from lynx changes + + append (not prepend) to CFLAGS/CPPFLAGS + + change variable from PATHSEP to PATH_SEPARATOR + + improve install-rules for pc-files (patch by Miroslav Lichvar). + + make it work with $DESTDIR + + create the pkg-config library directory if needed. + +20090124 + + modify init_pair() to allow caller to create extra color pairs beyond + the color_pairs limit, which use default colors (request by Emanuele + Giaquinta). + + add misc/terminfo.tmp and misc/*.pc to "sources" rule. + + fix typo "==" where "=" is needed in ncurses-config.in and + gen-pkgconfig.in files (Debian #512161). + +20090117 + + add -shared option to MK_SHARED_LIB when -Bsharable is used, for + *BSD's, without which "main" might be one of the shared library's + dependencies (report/analysis by Ken Dickey). + + modify waddch_literal(), updating line-pointer after a multicolumn + character is found to not fit on the current row, and wrapping is + done. Since the line-pointer was not updated, the wrapped + multicolumn character was written to the beginning of the current row + (cf: 20041023, reported by "Nick" regarding problem with ncmpc + http://musicpd.org/mantis/bug_view_page.php?bug_id=1930). + +20090110 + + add screen.Eterm terminfo entry (GenToo #124887) -TD + + modify adacurses-config to look for ".ali" files in the adalib + directory. + + correct install for Ada95, which omitted libAdaCurses.a used in + adacurses-config + + change install for adacurses-config to provide additional flavors + such as adacursesw-config, for ncursesw (GenToo #167849). + +20090105 + + remove undeveloped feature in ncurses-config.in for setting + prefix variable. + + recent change to ncurses-config.in did not take into account the + --disable-overwrite option, which sets $includedir to the + subdirectory and using just that for a -I option does not work - fix + (report by Frederic L W Meunier). + +20090104 + + modify gen-pkgconfig.in to eliminate a dependency on rpath when + deciding whether to add $LIBS to --libs output; that should be shown + for the ncurses and tinfo libraries without taking rpath into + account. + + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk, + used in static libraries (report by Marty Jack). + +20090103 + + add a configure-time check to pick a suitable value for + CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen). + + add configure --with-pkg-config and --enable-pc-files options, along + with misc/gen-pkgconfig.in which can be used to generate ".pc" files + for pkg-config (request by Jan Engelhardt). + + use $includedir symbol in misc/ncurses-config.in, add --includedir + option. + + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a + configure check to detect whether a "-" is needed before "ar" + options. + + update config.guess, config.sub from + http://savannah.gnu.org/projects/config + +20081227 + + modify mk-1st.awk to work with extra categories for tinfo library. + + modify configure script to allow building shared libraries with gcc + on AIX 5 or 6 (adapted from patch by Lital Natan). + +20081220 + + modify to omit the opaque-functions from lib_gen.o when + --disable-ext-funcs is used. + + add test/clip_printw.c to illustrate how to use printw without + wrapping. + + modify ncurses 'F' test to demo wborder_set() with colored lines. + + modify ncurses 'f' test to demo wborder() with colored lines. + +20081213 + + add check for failure to open hashed-database needed for db4.6 + (GenToo #245370). + + corrected --without-manpages option; previous change only suppressed + the auxiliary rules install.man and uninstall.man + + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from + GenToo #250454). + + fixes from NetBSD port at + http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches + patch-ac (build-fix for DragonFly) + patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config). + + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH + by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the + search-lists. + + correct title string for keybound manpage (patch by Frederic Culot, + OpenBSD documentation/6019), + +20081206 + + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to + work for progs/clear, progs/tabs, etc. + + correct buffer-size after internal resizing of wide-character + set_field_buffer(), broken in 20081018 changes (report by Mike Gran). + + add "-i" option to test/filter.c to tell it to use initscr() rather + than newterm(), to investigate report on comp.unix.programmer that + ncurses would clear the screen in that case (it does not - the issue + was xterm's alternate screen feature). + + add check in mouse-driver to disable connection if GPM returns a + zero, indicating that the connection is closed (Debian #506717, + adapted from patch by Samuel Thibault). + +20081129 + + improve a workaround in adding wide-characters, when a control + character is found. The library (cf: 20040207) uses unctrl() to + obtain a printable version of the control character, but was not + passing color or video attributes. + + improve test/ncurses.c 'a' test, using unctrl() more consistently to + display meta-characters. + + turn on _XOPEN_CURSES definition in curses.h + + add eterm-color entry (report by Vincent Lefevre) -TD + + correct use of key_name() in test/ncurses.c 'A' test, which only + displays wide-characters, not key-codes since 20070612 (report by + Ricardo Cantu). + +20081122 + + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and + Ada95 (patch by Juergen Pfeifer). + + document in TO-DO an issue with Cygwin's package for GNAT (report + by Mike Dennison). + + improve error-checking of command-line options in "tabs" program. + +20081115 + + change several terminfo entries to make consistent use of ANSI + clear-all-tabs -TD + + add "tabs" program (prompted by Debian #502260). + + add configure --without-manpages option (request by Mike Frysinger). + 20081102 5.7 release for upload to ftp.gnu.org 20081025 @@ -77,7 +1147,7 @@ it is not possible to add this information. overlooked til now. 20081011 - + update html documentation. + + regenerated html documentation. + add -m and -s options to test/keynames.c and test/key_names.c to test the meta() function with keyname() or key_name(), respectively. + correct return value of key_name() on error; it is null. @@ -2204,7 +3274,7 @@ it is not possible to add this information. (request by Mike Aubury). + add symbol to curses.h which can be used to suppress include of stdbool.h, e.g., - #define NCURSES_ENABLE_STDBOOL_H 0 + #define NCURSES_ENABLE_STDBOOL_H 0 #include (discussion on XFree86 mailing list). @@ -2784,7 +3854,7 @@ it is not possible to add this information. 20030208 + add checking in tic for incomplete line-drawing character mapping. - + update configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, + + updated configure script to reflect fix for AC_PROG_GCC_TRADITIONAL, which is broken in autoconf 2.5x for Mac OS X 10.2.3 (report by Gerben Wierda ). + make return value from _nc_printf_string() consistent. Before, @@ -3503,7 +4573,7 @@ it is not possible to add this information. + restore special case from 20010922 changes to omit SA_RESTART when setting up SIGWINCH handler, which is needed to allow wgetch() to be interrupted by that signal. - + update configure macro CF_WITH_PATHLIST, to omit some double quotes + + updated configure macro CF_WITH_PATHLIST, to omit some double quotes not needed with autoconf 2.52 + revert configure script to autoconf 2.13 patched with autoconf-2.13-19990117.patch.gz (or later) diff --git a/contrib/ncurses/README.MinGW b/contrib/ncurses/README.MinGW new file mode 100644 index 000000000000..d111b3877840 --- /dev/null +++ b/contrib/ncurses/README.MinGW @@ -0,0 +1,149 @@ +------------------------------------------------------------------------------- +-- Copyright (c) 2008-2010,2011 Free Software Foundation, Inc. -- +-- -- +-- Permission is hereby granted, free of charge, to any person obtaining a -- +-- copy of this software and associated documentation files (the -- +-- "Software"), to deal in the Software without restriction, including -- +-- without limitation the rights to use, copy, modify, merge, publish, -- +-- distribute, distribute with modifications, sublicense, and/or sell copies -- +-- of the Software, and to permit persons to whom the Software is furnished -- +-- to do so, subject to the following conditions: -- +-- -- +-- The above copyright notice and this permission notice shall be included -- +-- in all copies or substantial portions of the Software. -- +-- -- +-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -- +-- OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -- +-- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN -- +-- NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, -- +-- DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR -- +-- OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE -- +-- USE OR OTHER DEALINGS IN THE SOFTWARE. -- +-- -- +-- Except as contained in this notice, the name(s) of the above copyright -- +-- holders shall not be used in advertising or otherwise to promote the -- +-- sale, use or other dealings in this Software without prior written -- +-- authorization. -- +------------------------------------------------------------------------------- +-- $Id: README.MinGW,v 1.5 2011/02/26 16:57:17 tom Exp $ +-- Author: Juergen Pfeifer +------------------------------------------------------------------------------- + +This is work in progress, but it's in an state where one can see it +works at least on the Windows Console. + +You should install the MSYS package, so that you've a shell environment that +allows you to run the scripts, especially configure etc. You can get that +from http://www.mingw.org + +To build ncurses for native Windows, you need the MinGW toolchain. The +original MinGW toolchain from the above site is only for 32-Bit Windows. As +Windows Server - and also regular workstations - are moving to 64-Bit, it +seems to be reasonable to have a toolchain that supports both architectures. +I recommend to use the TDM gcc toolchain which you can find at +http://tdm-gcc.tdragon.net/download. Go to the download section and select +the bundle installer for tdm64 (MinGW-w64). This installs a multilib version +of the gcc toolchain that can compile for native 32- and 64-Bit Windows +versions. It also comes with a working pthread implementation. + +The latest config and build scripts we use for MinGW have only been tested +for the gcc-4.4 compiler toolchain (or better). + +Using MinGW is a pragmatic decision, it's the easiest way to port this +heavily UNIX based sourcebase to native Windows. The goal is of course +to provide the includes, libraries and DLLs to be used with the more +common traditional development environments on Windows, mainly with +Microsoft Visual Studio. + +If you start a bash from the MSYS environment, please make sure that the +Microsoft Development tools are in your PATH right after the MinGW +tools. The LIB.EXE tool is the only one needed. You need this only if +you want to build DLLs that work with native Windows programs. If you +don't have any Microsoft Development tools on your machine, consider +at least to get the free "Visual C++ 2010 Express Edition". +It contains the LIB.EXE tool. You may also use this compiler to test +writing native Windows programs using the ncurses DLLs without using +MinGW then for writing apps. + +It is necessary to unset the TERM environment variable, to activate the +Windows console-driver. + +Please also make sure that MSYS links to the correct directory containing +your MinGW toolchain. For TDM this is usually C:\MinGW64. In your Windows +CMD.EXE command shell go to the MSYS root directory (most probably +C:\MSYS or C:\MSYS\1.0) and verify, that there is a junction point mingw +that points to the MinGW toolchain directory. If not, delete the mingw +directory and use the mklink command (or the linkd.exe utility on older +Windows) to create the junction point. + +This code requires WindowsNT 5.1 or better, which means on the client +Windows XP or better, on the server Windows Server 2003 or better. + +In order to build ncurses for the planned interop layer with .NET, we +recommend to use these options with configure + + --disable-home-terminfo + --enable-reentrant + --enable-sp-funcs + --enable-term-driver + --enable-interop + --with-pthread (if using TDM toolchain as recommended) + +This is the configuration commandline as I'm using it at the moment: + +./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread + +If you are on a 64-Bit Windows system and want to build a 32-Bit version +of ncurses, you may use this commandline for configuration (when using +the TDM toolchain): + +CC="gcc -m32" LD="ld -m32" ./configure \ + --prefix=/mingw \ + --without-cxx-binding \ + --without-ada \ + --enable-warnings \ + --enable-assertions \ + --enable-reentrant \ + --with-debug \ + --with-normal \ + --disable-home-terminfo \ + --enable-sp-funcs \ + --enable-term-driver \ + --enable-interop \ + --with-pthread + +All the options above are - like the whole Windows support - +experimental. + +In order to build the DLLs, after your regular make you must call + + make dlls + +A lot is still TODO, e.g.: + + - Wide Character support + The Win32Con driver should actually only use Unicode in the + future. + - Thread support (locking). If using TDM toolchain this is done by + configuring pthreads. + - A GUI console driver + - Support for Terminals attached via a serial port (via terminfo) + - Support for networked Terminal connections (via terminfo) + - Workarounds for MinGW's filesystem access are necessary to make infocmp + work (though tic works). + +To support terminfo, we need to have an ioctl() simulation for the +serial and networked Terminals. diff --git a/contrib/ncurses/TO-DO b/contrib/ncurses/TO-DO index ca47d02d0ec8..5df7f47e722e 100644 --- a/contrib/ncurses/TO-DO +++ b/contrib/ncurses/TO-DO @@ -1,5 +1,5 @@ ------------------------------------------------------------------------------- --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. -- +-- Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. -- -- -- -- Permission is hereby granted, free of charge, to any person obtaining a -- -- copy of this software and associated documentation files (the -- @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $ +-- $Id: TO-DO,v 1.57 2011/03/28 00:23:02 tom Exp $ ------------------------------------------------------------------------------- SHORT-TERM TO-DO ITEMS: @@ -45,7 +45,7 @@ Known Problems: + Scrolling optimization has holes: for example, it forces repaints of the screen between calls to refresh(). -+ SVr4 uses slightly different rules for determining when softkeys are shown. ++ SVr4 uses slightly different rules for determining when softkeys are shown. For example, they are initially displayed (before the ncurses 'e' test activates them), and a touchwin can apparently also force them to be displayed. @@ -58,7 +58,7 @@ Known Problems: + The window classes defined in the c++ subdirectory need documentation. Some C++ programmer could earn a lot of good karma by doing this... -+ vid_attr() should support the set_a_attributes (sgr1) string, but does not. ++ vid_attr() should support the set_a_attributes (sgr1) string, but does not. There appear to be no terminals that require that functionality. + the configure --disable-ext-funcs option does not work for Ada95 tree. @@ -72,27 +72,28 @@ Known Problems: Building those with libtool does not work either. (This is a problem with the BSD platforms). ++ more work is needed to make the MinGW port support ordinary terminals. + Portability (or lack thereof): + Users of older System V UNIXes (but not Solaris, and probably not SVr4) may trip over a known problem with the signal-handling code which causes abrupt termination of ncurses applications following resume from a ^Z suspend (this problem was first seen running lynx). You will not see this problem if you - are running Linux or one of the 4.4BSD derivatives like FreeBSD, NetBSD, or - BSDI. For details, see the analysis in the header comment of - ncurses/tty/lib_tstp.c . + are using one of the 4.4BSD derivatives like such as, NetBSD, or BSDI, or + systems using that convention. For details, see the analysis in the header + comment of ncurses/tty/lib_tstp.c . + In theory, vwprintw and vwscanf are supposed to use the older varargs.h interface for handling variadic argument lists (and are deprecated by X/Open - for that reason). Linux doesn't have varargs.h, it has the newer - X/Open-standard stdargs.h equivalent. So these functions use stdargs - instead. This is unlikely to be a problem unless you're building ncurses on - a System V old enough to only have varargs.h. (Solaris 2.5.1 used the - stdarg.h binding as well). + for that reason). Many newer systems do no have varargs.h, instead they have + only the newer X/Open-standard stdargs.h equivalent. So these functions use + stdargs instead. This is unlikely to be a problem unless you're building + ncurses on a System V old enough to only have varargs.h. (Solaris 2.5.1 used + the stdarg.h binding as well). -+ If you're using a BSD earlier than 4.4BSD, or a Linux old enough not to have - a native vsscanf(3) in its library, vwscanw() will not work. You lose. (It - should work on any System V, however). If you want to fix this, add an ++ If you're using a system old enough not to have a native vsscanf(3) in its + library, vwscanw() will not work. If you want to fix this, add an implementation to ncurses/vsscanf.c. + The C++ binding fails to build with a few C++ compilers. @@ -122,7 +123,7 @@ supporting internationalization. 2. DOS port Only a few of the files in the library depend on the terminfo format. -It should be possible to further kernelize the package, then rewrite +It should be possible to further kernelize the package, then rewrite a small number of core files to produce a functionally-compatible port that would do updates to a memory-mapped screen area. The first result of this would be a DOS port. @@ -195,10 +196,10 @@ F. Unused VDT capabilities: move_insert, dest_tabs_magic_smso, transparent_underline, needs_xon_xoff, hard_cursor. Numerics: lines_of_memory, buttons. - Strings: pkey_key, pkey_local, pkey_xmit, underline_char, - enter_xon_mode, exit_xon_mode, xon_character, xoff_character, + Strings: pkey_key, pkey_local, pkey_xmit, underline_char, + enter_xon_mode, exit_xon_mode, xon_character, xoff_character, display_clock, remove_clock, user[0-5], display_pc_char, - enter_scancode_mode, exit_scancode_mode, pc_term_options, + enter_scancode_mode, exit_scancode_mode, pc_term_options, scancode_escape, alt_scancode_esc. These are the potentially important ones for ncurses. Notes: diff --git a/contrib/ncurses/aclocal.m4 b/contrib/ncurses/aclocal.m4 index 4c8e818f2403..9a828559d4ab 100644 --- a/contrib/ncurses/aclocal.m4 +++ b/contrib/ncurses/aclocal.m4 @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-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 * @@ -28,7 +28,7 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: aclocal.m4,v 1.470 2008/10/25 22:15:32 tom Exp $ +dnl $Id: aclocal.m4,v 1.553 2011/03/31 23:35:38 tom Exp $ dnl Macros used in NCURSES auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on @@ -62,13 +62,13 @@ AC_DEFUN([AM_LANGINFO_CODESET], fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADA_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_ADA_INCLUDE_DIRS version: 6 updated: 2010/02/26 19:52:07 dnl ------------------- dnl Construct the list of include-options for the C programs in the Ada95 dnl binding. AC_DEFUN([CF_ADA_INCLUDE_DIRS], [ -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -86,7 +86,15 @@ fi AC_SUBST(ACPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_CFLAGS version: 7 updated: 2004/04/25 17:48:30 +dnl CF_ADD_ADAFLAGS version: 1 updated: 2010/06/19 15:22:18 +dnl --------------- +dnl Add to $ADAFLAGS, which is substituted into makefile and scripts. +AC_DEFUN([CF_ADD_ADAFLAGS],[ + ADAFLAGS="$ADAFLAGS $1" + AC_SUBST(ADAFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_CFLAGS version: 10 updated: 2010/05/26 05:38:42 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl The second parameter if given makes this macro verbose. @@ -112,8 +120,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -128,6 +136,12 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -143,24 +157,24 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[[^"]]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) + ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CFLAGS="$CFLAGS $cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then - ifelse($2,,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) + ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" fi @@ -168,7 +182,7 @@ AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_INCDIR version: 9 updated: 2008/02/09 13:15:34 +dnl CF_ADD_INCDIR version: 13 updated: 2010/05/26 16:44:57 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it's dnl redundant. We don't normally need to add -I/usr/local/include for gcc, @@ -195,7 +209,7 @@ if test -n "$1" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS @@ -211,11 +225,11 @@ if test -n "$1" ; then if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) - ifelse($2,,CPPFLAGS,$2)="-I$cf_add_incdir $ifelse($2,,CPPFLAGS,[$]$2)" + ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" else break fi @@ -225,7 +239,15 @@ if test -n "$1" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_LIBDIR version: 6 updated: 2008/02/09 13:15:34 +dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 +dnl ---------- +dnl Add a library, used to enforce consistency. +dnl +dnl $1 = library to add, without the "-l" +dnl $2 = variable to update (default $LIBS) +AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ADD_LIBDIR version: 9 updated: 2010/05/26 16:44:57 dnl ------------- dnl Adds to the library-path dnl @@ -254,14 +276,22 @@ if test -n "$1" ; then fi if test "$cf_have_libdir" = no ; then CF_VERBOSE(adding $cf_add_libdir to library-path) - ifelse($2,,LDFLAGS,$2)="-L$cf_add_libdir $ifelse($2,,LDFLAGS,[$]$2)" + ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ADD_SUBDIR_PATH version: 2 updated: 2007/07/29 10:12:59 +dnl CF_ADD_LIBS version: 1 updated: 2010/06/02 05:03:05 +dnl ----------- +dnl Add one or more libraries, used to enforce consistency. +dnl +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_SUBDIR_PATH version: 3 updated: 2010/07/03 20:58:12 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result @@ -273,7 +303,7 @@ AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "$4" != "$5" && \ test -d "$4" && \ -ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { +ifelse([$5],NONE,,[(test $5 = NONE || test "$4" != "$5") &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d $4/$3 && $1="[$]$1 $4/$3" test -d $4/$3/$2 && $1="[$]$1 $4/$3/$2" @@ -283,13 +313,13 @@ ifelse([$5],NONE,,[(test $5 = NONE || test -d $5) &&]) { } ])dnl dnl --------------------------------------------------------------------------- -dnl CF_ANSI_CC_CHECK version: 9 updated: 2001/12/30 17:53:34 +dnl CF_ANSI_CC_CHECK version: 10 updated: 2010/10/23 15:52:32 dnl ---------------- dnl This is adapted from the macros 'fp_PROG_CC_STDC' and 'fp_C_PROTOTYPES' dnl in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ -AC_CACHE_CHECK(for ${CC-cc} option to accept ANSI C, cf_cv_ansi_cc,[ +AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -353,7 +383,89 @@ You have the following choices: fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_AWK_BIG_PRINTF version: 2 updated: 2008/10/04 17:16:18 +dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 +dnl -------------- +dnl Allow user to disable a normally-on option. +AC_DEFUN([CF_ARG_DISABLE], +[CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl +dnl --------------------------------------------------------------------------- +dnl CF_ARG_OPTION version: 4 updated: 2010/05/26 05:38:42 +dnl ------------- +dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus +dnl values. +dnl +dnl Parameters: +dnl $1 = option name +dnl $2 = help-string +dnl $3 = action to perform if option is not default +dnl $4 = action if perform if option is default +dnl $5 = default option value (either 'yes' or 'no') +AC_DEFUN([CF_ARG_OPTION], +[AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) + if test "$enableval" != "$5" ; then +ifelse([$3],,[ :]dnl +,[ $3]) ifelse([$4],,,[ + else + $4]) + fi],[enableval=$5 ifelse([$4],,,[ + $4 +])dnl + ])])dnl +dnl --------------------------------------------------------------------------- +dnl CF_AR_FLAGS version: 5 updated: 2010/05/20 20:24:29 +dnl ----------- +dnl Check for suitable "ar" (archiver) options for updating an archive. +AC_DEFUN([CF_AR_FLAGS],[ +AC_REQUIRE([CF_PROG_AR]) + +AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do + + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&AC_FD_CC + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&AC_FD_CC 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + CF_VERBOSE(cannot compile test-program) + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext +]) + +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags +fi + +AC_SUBST(ARFLAGS) +]) +dnl --------------------------------------------------------------------------- +dnl CF_AWK_BIG_PRINTF version: 3 updated: 2008/12/27 12:30:03 dnl ----------------- dnl Check if awk can handle big strings using printf. Some older versions of dnl awk choke on large strings passed via "%s". @@ -362,19 +474,19 @@ 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 '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval $2=yes - else - eval $2=no - fi - ;; - esac + 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 '{ printf "%d\n", length([$]0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ([$]0 == 12000) eqls++; } END { if (recs != 1 || eqls != 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 @@ -695,7 +807,7 @@ if test ".$system_name" != ".$cf_cv_system_name" ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_ERRNO version: 10 updated: 2008/08/22 16:33:22 +dnl CF_CHECK_ERRNO version: 11 updated: 2010/05/26 05:38:42 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it @@ -713,7 +825,7 @@ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ #include #include #include ], - ifelse($2,,int,$2) x = (ifelse($2,,int,$2)) $1, + ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) @@ -724,7 +836,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,ifelse($2,,int,$2)) +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 @@ -752,7 +864,7 @@ fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_CHECK_GPM_WGETCH version: 1 updated: 2007/04/28 14:38:06 +dnl CF_CHECK_GPM_WGETCH version: 2 updated: 2010/08/14 18:25:37 dnl ------------------- dnl Check if GPM is already linked with curses. If so - and if the linkage dnl is not "weak" - warn about this because it can create problems linking @@ -786,7 +898,7 @@ CF_EOF test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -f conftest* + rm -rf conftest* LIBS="$cf_save_LIBS" fi ]) @@ -887,7 +999,7 @@ fi test "$cf_cv_cpp_static_cast" = yes && AC_DEFINE(CPP_HAS_STATIC_CAST) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_C_INLINE version: 2 updated: 2007/08/11 14:09:50 +dnl CF_C_INLINE version: 3 updated: 2010/05/01 15:14:41 dnl ----------- dnl Check if the C compiler supports "inline". dnl $1 is the name of a shell variable to set if inline is supported @@ -902,7 +1014,7 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - AC_CACHE_CHECK(if gcc supports options to tune inlining,cf_cv_gcc_inline,[ + AC_CACHE_CHECK(if $CC supports options to tune inlining,cf_cv_gcc_inline,[ cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=$2" AC_TRY_COMPILE([inline int foo(void) { return 1; }], @@ -945,7 +1057,7 @@ done AC_SUBST(DIRS_TO_MAKE) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_DISABLE_LEAKS version: 4 updated: 2006/12/16 15:10:42 +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. @@ -958,27 +1070,71 @@ 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], - [with_no_leaks=yes], + [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_RPATH version: 1 updated: 2008/09/13 10:22:30 +dnl CF_DISABLE_LIBTOOL_VERSION version: 1 updated: 2010/05/15 15:45:59 +dnl -------------------------- +dnl Check if we should use the libtool 1.5 feature "-version-number" instead of +dnl the older "-version-info" feature. The newer feature allows us to use +dnl version numbering on shared libraries which make them compatible with +dnl various systems. +AC_DEFUN([CF_DISABLE_LIBTOOL_VERSION], +[ +AC_MSG_CHECKING(if libtool -version-number should be used) +CF_ARG_DISABLE(libtool-version, + [ --disable-libtool-version enable to use libtool's incompatible naming scheme], + [cf_libtool_version=no], + [cf_libtool_version=yes]) +AC_MSG_RESULT($cf_libtool_version) + +if test "$cf_libtool_version" = yes ; then + LIBTOOL_VERSION="-version-number" +else + LIBTOOL_VERSION="-version-info" +fi + +AC_SUBST(LIBTOOL_VERSION) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_DISABLE_RPATH_HACK version: 2 updated: 2011/02/13 13:31:33 +dnl --------------------- +dnl The rpath-hack makes it simpler to build programs, particularly with the +dnl *BSD ports which may have essential libraries in unusual places. But it +dnl can interfere with building an executable for the base system. Use this +dnl option in that case. +AC_DEFUN([CF_DISABLE_RPATH_HACK], +[ +AC_MSG_CHECKING(if rpath-hack should be disabled) +CF_ARG_DISABLE(rpath-hack, + [ --disable-rpath-hack don't add rpath options for additional libraries], + [cf_disable_rpath_hack=yes], + [cf_disable_rpath_hack=no]) +AC_MSG_RESULT($cf_disable_rpath_hack) +if test "$cf_disable_rpath_hack" = no ; then + CF_RPATH_HACK +fi +]) +dnl --------------------------------------------------------------------------- +dnl CF_ENABLE_RPATH version: 2 updated: 2010/03/27 18:39:42 dnl --------------- dnl Check if the rpath option should be used, setting cache variable -dnl cf_cv_ld_rpath if so. +dnl cf_cv_enable_rpath if so. AC_DEFUN([CF_ENABLE_RPATH], [ AC_MSG_CHECKING(if rpath option should be used) AC_ARG_ENABLE(rpath, [ --enable-rpath use rpath option when generating shared libraries], -[cf_cv_ld_rpath=$enableval], -[cf_cv_ld_rpath=no]) -AC_MSG_RESULT($cf_cv_ld_rpath) +[cf_cv_enable_rpath=$enableval], +[cf_cv_enable_rpath=no]) +AC_MSG_RESULT($cf_cv_enable_rpath) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ERRNO version: 5 updated: 1997/11/30 12:44:39 @@ -1019,7 +1175,7 @@ AC_MSG_RESULT($cf_result) CXXFLAGS="$cf_save_CXXFLAGS" ]) dnl --------------------------------------------------------------------------- -dnl CF_FIND_LINKAGE version: 12 updated: 2007/07/29 20:13:53 +dnl CF_FIND_LINKAGE version: 19 updated: 2010/05/29 16:31:02 dnl --------------- dnl Find a library (specifically the linkage used in the code fragment), dnl searching for it if it is not already in the library path. @@ -1048,10 +1204,26 @@ cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) -AC_TRY_LINK([$1],[$2], - cf_cv_find_linkage_$3=yes,[ - cf_cv_find_linkage_$3=no +cf_save_LIBS="$LIBS" +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib +],[ + +LIBS="-l$3 $7 $cf_save_LIBS" + +AC_TRY_LINK([$1],[$2],[ + cf_cv_find_linkage_$3=yes + cf_cv_header_path_$3=/usr/include + cf_cv_library_path_$3=/usr/lib + cf_cv_library_file_$3="-l$3" +],[ + cf_cv_find_linkage_$3=no + LIBS="$cf_save_LIBS" + + CF_VERBOSE(find linkage for $3 library) CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)]) cf_save_CPPFLAGS="$CPPFLAGS" @@ -1110,7 +1282,6 @@ AC_TRY_LINK([$1],[$2], ]) fi done - LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -1119,19 +1290,22 @@ AC_TRY_LINK([$1],[$2], cf_cv_find_linkage_$3=no fi ],$7) +]) + +LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ - CF_ADD_INCDIR($cf_cv_header_path_$3) - CF_ADD_LIBDIR($cf_cv_library_path_$3) - LIBS="-l$3 $LIBS" + CF_ADD_INCDIR($cf_cv_header_path_$3) + CF_ADD_LIBDIR($cf_cv_library_path_$3) + CF_ADD_LIB($3) ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_FUNC_DLSYM version: 1 updated: 2004/06/16 20:52:45 +dnl CF_FUNC_DLSYM version: 2 updated: 2010/05/29 16:31:02 dnl ------------- dnl Test for dlsym() and related functions, as well as libdl. dnl @@ -1148,7 +1322,7 @@ AC_CHECK_LIB(dl,dlsym,[ cf_have_libdl=yes])]) if test "$cf_have_dlsym" = yes ; then - test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" + test "$cf_have_libdl" = yes && CF_ADD_LIB(dl) AC_MSG_CHECKING(whether able to link to dl*() functions) AC_TRY_LINK([#include ],[ @@ -1231,7 +1405,7 @@ int main() { test "$cf_cv_func_nanosleep" = "yes" && AC_DEFINE(HAVE_NANOSLEEP) ]) dnl --------------------------------------------------------------------------- -dnl CF_FUNC_OPENPTY version: 2 updated: 2008/04/12 19:49:01 +dnl CF_FUNC_OPENPTY version: 3 updated: 2010/05/29 16:31:02 dnl --------------- dnl Check for openpty() function, along with header. It may need the dnl "util" library as well. @@ -1240,7 +1414,7 @@ AC_DEFUN([CF_FUNC_OPENPTY], AC_CHECK_LIB(util,openpty,cf_cv_lib_util=yes,cf_cv_lib_util=no) AC_CACHE_CHECK(for openpty header,cf_cv_func_openpty,[ cf_save_LIBS="$LIBS" - test $cf_cv_lib_util = yes && LIBS="-lutil $LIBS" + test $cf_cv_lib_util = yes && CF_ADD_LIB(util) for cf_header in pty.h libutil.h util.h do AC_TRY_LINK([ @@ -1362,7 +1536,7 @@ esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GCC_ATTRIBUTES version: 11 updated: 2007/07/29 09:55:12 +dnl CF_GCC_ATTRIBUTES version: 14 updated: 2010/10/23 15:52:32 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary @@ -1389,7 +1563,7 @@ if test "$GCC" = yes then AC_CHECKING([for $CC __attribute__ directives]) cat > conftest.$ac_ext <&AC_FD_CC - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h < conftest.$ac_ext <>library.gpr <>confpackage.ads <>confpackage.adb <&AC_FD_CC 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* + ;; + esac + ;; +esac +AC_MSG_RESULT($cf_gnat_projects) + +if test $cf_gnat_projects = yes +then + AC_MSG_CHECKING(if GNAT supports libraries) + AC_MSG_RESULT($cf_gnat_libraries) +fi + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi + +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + +AC_SUBST(USE_OLD_MAKERULES) +AC_SUBST(USE_GNAT_PROJECTS) +AC_SUBST(USE_GNAT_LIBRARIES) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_SIGINT version: 1 updated: 2011/03/27 20:07:59 +dnl -------------- +dnl Check if gnat supports SIGINT, and presumably tasking. For the latter, it +dnl is noted that gnat may compile a tasking unit even for configurations which +dnl fail at runtime. +AC_DEFUN([CF_GNAT_SIGINT],[ +AC_CACHE_CHECK(if GNAT supports SIGINT,cf_cv_gnat_sigint,[ +CF_GNAT_TRY_LINK([with Ada.Interrupts.Names; + +package ConfTest is + + pragma Warnings (Off); -- the next pragma exists since 3.11p + pragma Unreserve_All_Interrupts; + pragma Warnings (On); + + protected Process is + procedure Stop; + function Continue return Boolean; + pragma Attach_Handler (Stop, Ada.Interrupts.Names.SIGINT); + private + Done : Boolean := False; + end Process; + +end ConfTest;], +[package body ConfTest is + protected body Process is + procedure Stop is + begin + Done := True; + end Stop; + function Continue return Boolean is + begin + return not Done; + end Continue; + end Process; +end ConfTest;], + [cf_cv_gnat_sigint=yes], + [cf_cv_gnat_sigint=no])]) + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi +AC_SUBST(USE_GNAT_SIGINT) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_GNAT_TRY_LINK version: 3 updated: 2011/03/19 14:47:45 dnl ---------------- dnl Verify that a test program compiles/links with GNAT. dnl $cf_ada_make is set to the program that compiles/links @@ -1574,7 +1994,7 @@ dnl $3 is the shell command to execute if successful dnl $4 is the shell command to execute if not successful AC_DEFUN([CF_GNAT_TRY_LINK], [ -rm -f conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <>conftest.ads <&1 | grep '[[0-9]].[[0-9]][[0-9]]*' |\ - sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[[0-9]].[[0-9]][[0-9]]*' |\ + sed -e '2,$d' -e 's/[[^0-9 \.]]//g' -e 's/^[[ ]]*//' -e 's/ .*//'` AC_MSG_RESULT($cf_gnat_version) -case $cf_gnat_version in - 3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; -esac -case $cf_gnat_version in - 3.[[1-9]]*|[[4-9]].*) - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; +case $cf_gnat_version in #(vi +3.1[[1-9]]*|3.[[2-9]]*|[[4-9]].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + AC_MSG_WARN(Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding.) + cf_cv_prog_gnat_correct=no + ;; esac ]) dnl --------------------------------------------------------------------------- @@ -1679,7 +2092,7 @@ make an error test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GPP_LIBRARY version: 8 updated: 2003/02/02 01:41:46 +dnl CF_GPP_LIBRARY version: 10 updated: 2010/05/29 16:31:02 dnl -------------- dnl If we're trying to use g++, test if libg++ is installed (a rather common dnl problem :-). If we have the compiler but no library, we'll be able to @@ -1698,13 +2111,13 @@ esac if test "$GXX" = yes; then AC_MSG_CHECKING([for lib$cf_gpp_libname]) cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname) AC_TRY_LINK([ #include <$cf_gpp_libname/builtin.h> ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname,CXXLIBS) if test "$cf_gpp_libname" = cpp ; then AC_DEFINE(HAVE_GPP_BUILTIN_H) else @@ -1715,7 +2128,7 @@ if test "$GXX" = yes; then ], [two_arg_error_handler_t foo2 = lib_error_handler], [cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CF_ADD_LIB($cf_gpp_libname,CXXLIBS) AC_DEFINE(HAVE_BUILTIN_H)], [cf_cxx_library=no])]) LIBS="$cf_save" @@ -1723,7 +2136,7 @@ if test "$GXX" = yes; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_VERSION version: 5 updated: 2005/08/27 09:53:42 +dnl CF_GXX_VERSION version: 6 updated: 2010/10/23 15:44:18 dnl -------------- dnl Check for version of g++ AC_DEFUN([CF_GXX_VERSION],[ @@ -1731,13 +2144,13 @@ AC_REQUIRE([AC_PROG_CPP]) GXX_VERSION=none if test "$GXX" = yes; then AC_MSG_CHECKING(version of g++) - GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" + GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown AC_MSG_RESULT($GXX_VERSION) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_GXX_WARNINGS version: 5 updated: 2005/08/13 14:54:38 +dnl CF_GXX_WARNINGS version: 6 updated: 2010/08/14 18:25:37 dnl --------------- dnl Check if the compiler supports useful warning options. dnl @@ -1848,12 +2261,12 @@ then CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -f conftest* +rm -rf conftest* AC_LANG_RESTORE AC_SUBST(EXTRA_CXXFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB version: 3 updated: 2007/11/24 17:43:37 +dnl CF_HASHED_DB version: 4 updated: 2010/05/29 16:31:02 dnl ------------ dnl Look for an instance of the Berkeley hashed database. dnl @@ -1880,7 +2293,7 @@ else if test "$cf_cv_hashed_db_libs" = unknown ; then AC_MSG_ERROR(Cannot determine library for db) elif test "$cf_cv_hashed_db_libs" != default ; then - LIBS="-l$cf_cv_hashed_db_libs $LIBS" + CF_ADD_LIB($cf_cv_hashed_db_libs) fi fi ],[ @@ -1888,7 +2301,7 @@ fi ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HASHED_DB_LIBS version: 8 updated: 2008/08/04 06:18:06 +dnl CF_HASHED_DB_LIBS version: 9 updated: 2010/05/29 16:31:02 dnl ----------------- dnl Given that we have the header and version for hashed database, find the dnl library information. @@ -1900,7 +2313,7 @@ for cf_db_libs in "" db$cf_cv_hashed_db_version db-$cf_cv_hashed_db_version db ' do cf_save_libs="$LIBS" if test -n "$cf_db_libs"; then - LIBS="-l$cf_db_libs $LIBS" + CF_ADD_LIB($cf_db_libs) fi CF_MSG_LOG(checking for library "$cf_db_libs") AC_TRY_LINK([ @@ -1998,11 +2411,35 @@ done ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_HEADER_PATH version: 8 updated: 2002/11/10 14:46:59 +dnl CF_HEADER_PATH version: 12 updated: 2010/05/05 05:22:40 dnl -------------- -dnl Construct a search-list for a nonstandard header-file +dnl Construct a search-list of directories for a nonstandard header-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name AC_DEFUN([CF_HEADER_PATH], -[CF_SUBDIR_PATH($1,$2,include) +[ +$1= + +# collect the current set of include-directories from compiler flags +cf_header_path_list="" +if test -n "${CFLAGS}${CPPFLAGS}" ; then + for cf_header_path in $CPPFLAGS $CFLAGS + do + case $cf_header_path in #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) + cf_header_path_list="$cf_header_path_list [$]$1" + ;; + esac + done +fi + +# add the variations for the package we are looking for +CF_SUBDIR_PATH($1,$2,include) + test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { @@ -2017,6 +2454,7 @@ test -d "$oldincludedir" && { test -d $oldincludedir/$2 && $1="[$]$1 $oldincludedir/$2" } +$1="[$]$1 $cf_header_path_list" ])dnl dnl --------------------------------------------------------------------------- dnl CF_HELP_MESSAGE version: 3 updated: 1998/01/14 10:56:23 @@ -2026,7 +2464,7 @@ AC_DEFUN([CF_HELP_MESSAGE], [AC_DIVERT_HELP([$1])dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INCLUDE_DIRS version: 5 updated: 2006/10/14 15:23:15 +dnl CF_INCLUDE_DIRS version: 6 updated: 2009/01/06 19:37:40 dnl --------------- dnl Construct the list of include-options according to whether we're building dnl in the source directory or using '--srcdir=DIR' option. If we're building @@ -2034,9 +2472,9 @@ dnl with gcc, don't append the includedir if it happens to be /usr/include, dnl since that usually breaks gcc's shadow-includes. AC_DEFUN([CF_INCLUDE_DIRS], [ -CPPFLAGS="-I. -I../include $CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then - CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -2052,7 +2490,7 @@ fi AC_SUBST(CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_INTEL_COMPILER version: 3 updated: 2005/08/06 18:37:29 +dnl CF_INTEL_COMPILER version: 4 updated: 2010/05/26 05:38:42 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch @@ -2066,24 +2504,24 @@ dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ -ifelse($2,,INTEL_COMPILER,[$2])=no +ifelse([$2],,INTEL_COMPILER,[$2])=no -if test "$ifelse($1,,[$1],GCC)" = yes ; then +if test "$ifelse([$1],,[$1],GCC)" = yes ; then case $host_os in linux*|gnu*) - AC_MSG_CHECKING(if this is really Intel ifelse($1,GXX,C++,C) compiler) - cf_save_CFLAGS="$ifelse($3,,CFLAGS,[$3])" - ifelse($3,,CFLAGS,[$3])="$ifelse($3,,CFLAGS,[$3]) -no-gcc" + AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) + cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" + ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else make an error #endif -],[ifelse($2,,INTEL_COMPILER,[$2])=yes +],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" ],[]) - ifelse($3,,CFLAGS,[$3])="$cf_save_CFLAGS" - AC_MSG_RESULT($ifelse($2,,INTEL_COMPILER,[$2])) + ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" + AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi @@ -2143,7 +2581,7 @@ ifdef([AC_FUNC_FSEEKO],[ ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LDFLAGS_STATIC version: 4 updated: 2008/10/18 17:58:20 +dnl CF_LDFLAGS_STATIC version: 8 updated: 2010/10/23 14:39:56 dnl ----------------- dnl Check for compiler/linker flags used to temporarily force usage of static dnl libraries. This depends on the compiler and platform. Use this to help @@ -2153,7 +2591,7 @@ AC_DEFUN([CF_LDFLAGS_STATIC],[ if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[[45]]*) #( vi + OS/2*|os2*|aix[[4]]*|solaris2.1[[0-9]]|darwin*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -2164,7 +2602,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[[45]]*) #( from ld manpage + aix[[456]]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -2179,7 +2617,7 @@ else ;; osf[[45]]*) #( from ld manpage osf4.0d, osf5.1 # alternative "-oldstyle_liblookup" (not in cc manpage) - LDFLAGS_STATIC=-noso + LDFLAGS_STATIC=-noso LDFLAGS_SHARED=-so_archive ;; solaris2*) @@ -2189,15 +2627,134 @@ else esac fi +if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" +then + AC_MSG_CHECKING(if linker supports switching between static/dynamic) + + rm -f libconftest.a + cat >conftest.$ac_ext < +int cf_ldflags_static(FILE *fp) { return fflush(fp); } +EOF + if AC_TRY_EVAL(ac_compile) ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&AC_FD_CC 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&AC_FD_CC >/dev/null + fi + rm -f conftest.* + + cf_save_LIBS="$LIBS" + + LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" + AC_TRY_LINK([ +#line __oline__ "configure" +#include +int cf_ldflags_static(FILE *fp); +],[ + return cf_ldflags_static(stdin); +],[cf_ldflags_static=yes],[cf_ldflags_static=no]) + + rm -f libconftest.* + LIBS="$cf_save_LIBS" + + AC_MSG_RESULT($cf_ldflags_static) + + if test $cf_ldflags_static != yes + then + LDFLAGS_STATIC= + LDFLAGS_SHARED= + fi +else + LDFLAGS_STATIC= + LDFLAGS_SHARED= +fi + AC_SUBST(LDFLAGS_STATIC) AC_SUBST(LDFLAGS_SHARED) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIBRARY_PATH version: 7 updated: 2002/11/10 14:46:59 +dnl CF_LD_RPATH_OPT version: 3 updated: 2010/06/02 05:03:05 dnl --------------- -dnl Construct a search-list for a nonstandard library-file +dnl For the given system and compiler, find the compiler flags to pass to the +dnl loader to use the "rpath" feature. +AC_DEFUN([CF_LD_RPATH_OPT], +[ +AC_REQUIRE([CF_CHECK_CACHE]) + +LD_RPATH_OPT= +AC_MSG_CHECKING(for an rpath option) +case $cf_cv_system_name in #(vi +irix*) #(vi + if test "$GCC" = yes; then + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[[2-9]].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +freebsd*) #(vi + LD_RPATH_OPT="-rpath " + ;; +netbsd*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +osf*|mls+*) #(vi + LD_RPATH_OPT="-rpath " + ;; +solaris2*) #(vi + LD_RPATH_OPT="-R" + ;; +*) + ;; +esac +AC_MSG_RESULT($LD_RPATH_OPT) + +case "x$LD_RPATH_OPT" in #(vi +x-R*) + AC_MSG_CHECKING(if we need a space after rpath option) + cf_save_LIBS="$LIBS" + CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) + AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) + LIBS="$cf_save_LIBS" + AC_MSG_RESULT($cf_rpath_space) + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; +esac +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_LIBRARY_PATH version: 9 updated: 2010/03/28 12:52:50 +dnl --------------- +dnl Construct a search-list of directories for a nonstandard library-file +dnl +dnl Parameters +dnl $1 = the variable to return as result +dnl $2 = the package name AC_DEFUN([CF_LIBRARY_PATH], -[CF_SUBDIR_PATH($1,$2,lib)])dnl +[ +$1= +cf_library_path_list="" +if test -n "${LDFLAGS}${LIBS}" ; then + for cf_library_path in $LDFLAGS $LIBS + do + case $cf_library_path in #(vi + -L*) + cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` + CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) + cf_library_path_list="$cf_library_path_list [$]$1" + ;; + esac + done +fi + +CF_SUBDIR_PATH($1,$2,lib) + +$1="$cf_library_path_list [$]$1" +])dnl dnl --------------------------------------------------------------------------- dnl CF_LIB_PREFIX version: 8 updated: 2008/09/13 11:34:16 dnl ------------- @@ -2216,7 +2773,7 @@ ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LIB_RULES version: 53 updated: 2008/09/20 19:51:59 +dnl CF_LIB_RULES version: 61 updated: 2010/10/23 16:10:30 dnl ------------ dnl Append definitions and rules for the given models to the subdirectory dnl Makefiles, and the recursion rule for the top-level Makefile. If the @@ -2239,6 +2796,23 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi +if test -n "$TINFO_SUFFIX" ; then + case $TINFO_SUFFIX in + tw*) + TINFO_NAME="${TINFO_NAME}tw" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` + ;; + t*) + TINFO_NAME="${TINFO_NAME}t" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` + ;; + w*) + TINFO_NAME="${TINFO_NAME}w" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` + ;; + esac +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -2257,6 +2831,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${REL_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -2273,6 +2855,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -2393,6 +2983,16 @@ do if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in + tw*) + cf_libname=`echo $cf_libname | sed 's/tw$//'` + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_dir_suffix=tw + ;; + t*) + cf_libname=`echo $cf_libname | sed 's/t$//'` + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_dir_suffix=t + ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -2410,17 +3010,19 @@ do prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink-no} \ + ReLink=${cf_cv_do_relink:-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ + libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -2504,18 +3106,28 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile </dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep lib$3.` test -z "$cf_cv_$3_soname" && cf_cv_$3_soname=unknown fi fi -rm -f conftest* +rm -rf conftest* LIBS="$cf_save_LIBS" fi ]) ]) dnl --------------------------------------------------------------------------- -dnl CF_LIB_SUFFIX version: 15 updated: 2008/09/13 11:54:48 +dnl CF_LIB_SUFFIX version: 16 updated: 2008/12/27 12:30:03 dnl ------------- dnl Compute the library file-suffix from the given model name dnl $1 = model name @@ -2689,40 +3302,44 @@ dnl The variable $LIB_SUFFIX, if set, prepends the variable to set. AC_DEFUN([CF_LIB_SUFFIX], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) - case $1 in - libtool) + case $1 in #(vi + libtool) #(vi $2='.la' $3=[$]$2 ;; - normal) + normal) #(vi $2='.a' $3=[$]$2 ;; - debug) + debug) #(vi $2='_g.a' $3=[$]$2 ;; - profile) + profile) #(vi $2='_p.a' $3=[$]$2 ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[[56]]*) #(vi + $2='.a' + $3=[$]$2 + ;; + cygwin*) #(vi $2='.dll' $3='.dll.a' ;; - darwin*) + darwin*) #(vi $2='.dylib' $3=[$]$2 ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi $2='.so' $3=[$]$2 ;; - *) + *) #(vi $2='.sl' $3=[$]$2 ;; @@ -2755,7 +3372,7 @@ AC_DEFUN([CF_LIB_TYPE], test -n "$LIB_SUFFIX" && $2="${LIB_SUFFIX}[$]{$2}" ])dnl dnl --------------------------------------------------------------------------- -dnl CF_LINK_DATAONLY version: 8 updated: 2006/12/16 12:33:30 +dnl CF_LINK_DATAONLY version: 9 updated: 2009/01/01 20:21:38 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll @@ -2772,7 +3389,7 @@ int testdata[[3]] = { 123, 456, 789 }; EOF if AC_TRY_EVAL(ac_compile) ; then mv conftest.o data.o && \ - ( $AR $AR_OPTS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null + ( $AR $ARFLAGS conftest.a data.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null + ( $AR $ARFLAGS conftest.a func.o ) 2>&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null @@ -2887,7 +3504,7 @@ AC_DEFUN([CF_MAIN_RETURN], cf_cv_main_return=return ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKEFLAGS version: 12 updated: 2006/10/21 08:27:03 +dnl CF_MAKEFLAGS version: 14 updated: 2011/03/31 19:29:46 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It's very useful for "make -n" -- if we have it. @@ -2904,10 +3521,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[[ ]]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -2927,16 +3544,20 @@ CF_EOF AC_SUBST(cf_cv_makeflags) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAKE_TAGS version: 2 updated: 2000/10/04 09:18:40 +dnl CF_MAKE_TAGS version: 6 updated: 2010/10/23 15:52:32 dnl ------------ dnl Generate tags/TAGS targets for makefiles. Do not generate TAGS if we have dnl a monocase filesystem. AC_DEFUN([CF_MAKE_TAGS],[ AC_REQUIRE([CF_MIXEDCASE_FILENAMES]) -AC_CHECK_PROG(MAKE_LOWER_TAGS, ctags, yes, no) + +AC_CHECK_PROGS(CTAGS, exctags ctags) +AC_CHECK_PROGS(ETAGS, exetags etags) + +AC_CHECK_PROG(MAKE_LOWER_TAGS, ${CTAGS:-ctags}, yes, no) if test "$cf_cv_mixedcase" = yes ; then - AC_CHECK_PROG(MAKE_UPPER_TAGS, etags, yes, no) + AC_CHECK_PROG(MAKE_UPPER_TAGS, ${ETAGS:-etags}, yes, no) else MAKE_UPPER_TAGS=no fi @@ -2946,17 +3567,21 @@ if test "$MAKE_UPPER_TAGS" = yes ; then else MAKE_UPPER_TAGS="#" fi -AC_SUBST(MAKE_UPPER_TAGS) if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi + +AC_SUBST(CTAGS) +AC_SUBST(ETAGS) + +AC_SUBST(MAKE_UPPER_TAGS) AC_SUBST(MAKE_LOWER_TAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_FORMAT version: 7 updated: 2003/12/20 19:30:34 +dnl CF_MANPAGE_FORMAT version: 9 updated: 2010/10/23 16:10:30 dnl ----------------- dnl Option to allow user to override automatic configuration of manpage format. dnl There are several special cases: @@ -2998,7 +3623,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[[01]]* $cf_dir/cat*/$cf_example.[[01]]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -3112,7 +3737,7 @@ AC_MSG_RESULT($MANPAGE_RENAMES) AC_SUBST(MANPAGE_RENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MANPAGE_SYMLINKS version: 4 updated: 2003/12/13 18:01:58 +dnl CF_MANPAGE_SYMLINKS version: 5 updated: 2010/07/24 17:12:40 dnl ------------------- dnl Some people expect each tool to make all aliases for manpages in the dnl man-directory. This accommodates the older, less-capable implementations @@ -3128,11 +3753,14 @@ AC_ARG_WITH(manpage-aliases, AC_MSG_RESULT($MANPAGE_ALIASES) -if test "$LN_S" = "ln -s"; then +case "x$LN_S" in #(vi +xln*) #(vi cf_use_symlinks=yes -else + ;; +*) cf_use_symlinks=no -fi + ;; +esac MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then @@ -3171,7 +3799,7 @@ AC_ARG_WITH(manpage-tbl, AC_MSG_RESULT($MANPAGE_TBL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MAN_PAGES version: 35 updated: 2007/03/31 11:47:29 +dnl CF_MAN_PAGES version: 39 updated: 2010/10/23 15:44:18 dnl ------------ dnl Try to determine if the man-pages on the system are compressed, and if dnl so, what format is used. Use this information to construct a script that @@ -3214,7 +3842,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) #(vi +*gzip*) cf_so_strip="gz" cf_compress=gzip ;; @@ -3237,14 +3865,12 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" - INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR-/tmp}/man\$\$ +TMP=\${TMPDIR:=/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\[$]1 @@ -3282,7 +3908,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([[0-9]]\\)[[xm]]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - \$MKDIRS \$cf_subdir\$section + mkdir -p \$cf_subdir\$section fi fi @@ -3302,7 +3928,7 @@ CF_EOF cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name, + s,@$cf_NAME@,$cf_name,g CF_EOF done ]) @@ -3431,8 +4057,21 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -3491,7 +4130,7 @@ chmod 755 $cf_edit_man ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MATH_LIB version: 5 updated: 2000/05/28 01:39:10 +dnl CF_MATH_LIB version: 8 updated: 2010/05/29 16:31:02 dnl ----------- dnl Checks for libraries. At least one UNIX system, Apple Macintosh dnl Rhapsody 5.5, does not have -lm. We cannot use the simpler @@ -3504,13 +4143,13 @@ AC_CACHE_CHECK(if -lm needed for math functions, #include #include ], - [double x = rand(); printf("result = %g\n", ]ifelse($2,,sin(x),$2)[)], + [double x = rand(); printf("result = %g\n", ]ifelse([$2],,sin(x),$2)[)], [cf_cv_need_libm=no], [cf_cv_need_libm=yes])]) if test "$cf_cv_need_libm" = yes then ifelse($1,,[ - LIBS="$LIBS -lm" + CF_ADD_LIB(m) ],[$1=-lm]) fi ]) @@ -3545,13 +4184,13 @@ fi test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MKSTEMP version: 5 updated: 2006/12/16 12:33:30 +dnl CF_MKSTEMP version: 7 updated: 2010/08/14 18:25:37 dnl ---------- 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* +rm -rf conftest* AC_TRY_RUN([ #include #include @@ -3590,17 +4229,17 @@ int main() ],[AC_CHECK_FUNC(mkstemp) ]) ]) -if test "$cf_cv_func_mkstemp" = yes ; then +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then AC_DEFINE(HAVE_MKSTEMP) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_MSG_LOG version: 4 updated: 2007/07/29 09:55:12 +dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ -echo "${as_me-configure}:__oline__: testing $* ..." 1>&AC_FD_CC +echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_ABI_6 version: 1 updated: 2005/09/17 18:42:49 @@ -3687,20 +4326,20 @@ AC_DEFUN([CF_OBJ_SUBDIR], esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATHSEP version: 3 updated: 2001/01/12 01:23:53 +dnl CF_PATHSEP version: 5 updated: 2010/05/26 05:38:42 dnl ---------- dnl Provide a value for the $PATH and similar separator AC_DEFUN([CF_PATHSEP], [ case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; esac -ifelse($1,,,[$1=$PATHSEP]) - AC_SUBST(PATHSEP) +ifelse([$1],,,[$1=$PATH_SEPARATOR]) + AC_SUBST(PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PATH_SYNTAX version: 12 updated: 2008/03/23 14:45:59 +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 dnl begins with one of the prefix/exec_prefix variables, and then again if the @@ -3732,12 +4371,44 @@ case ".[$]$1" in #(vi $1=`echo [$]$1 | sed -e s%NONE%$cf_path_syntax%` ;; *) - ifelse($2,,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) + ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_POSIX_C_SOURCE version: 6 updated: 2005/07/14 20:25:10 +dnl CF_PKG_CONFIG version: 4 updated: 2011/02/18 20:26:24 +dnl ------------- +dnl Check for the package-config program, unless disabled by command-line. +AC_DEFUN([CF_PKG_CONFIG], +[ +AC_MSG_CHECKING(if you want to use pkg-config) +AC_ARG_WITH(pkg-config, + [ --with-pkg-config{=path} enable/disable use of pkg-config], + [cf_pkg_config=$withval], + [cf_pkg_config=yes]) +AC_MSG_RESULT($cf_pkg_config) + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + AC_PATH_TOOL(PKG_CONFIG, pkg-config, none) + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + CF_PATH_SYNTAX(PKG_CONFIG) +fi + +AC_SUBST(PKG_CONFIG) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_POSIX_C_SOURCE version: 8 updated: 2010/05/26 05:38:42 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl @@ -3753,7 +4424,7 @@ dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [ -cf_POSIX_C_SOURCE=ifelse($1,,199506L,$1) +cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" @@ -3805,17 +4476,12 @@ make an error if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[[^ ]]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + CF_ADD_CFLAGS($cf_cv_posix_c_source) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PREDEFINE version: 1 updated: 2003/07/26 17:53:56 +dnl CF_PREDEFINE version: 2 updated: 2010/05/26 16:44:57 dnl ------------ dnl Add definitions to CPPFLAGS to ensure they're predefined for all compiles. dnl @@ -3832,7 +4498,7 @@ make an error AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then - CPPFLAGS="$CPPFLAGS ifelse($2,,-D$1,[-D$1=$2])" + CPPFLAGS="$CPPFLAGS ifelse([$2],,-D$1,[-D$1=$2])" elif test "x$2" != "x" ; then AC_MSG_CHECKING(checking for compatible value versus $2) AC_TRY_COMPILE([#include @@ -3872,6 +4538,13 @@ done ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_AR version: 1 updated: 2009/01/01 20:15:22 +dnl ---------- +dnl Check for archiver "ar". +AC_DEFUN([CF_PROG_AR],[ +AC_CHECK_TOOL(AR, ar, ar) +]) +dnl --------------------------------------------------------------------------- dnl CF_PROG_AWK version: 1 updated: 2006/09/16 11:40:59 dnl ----------- dnl Check for awk, ensure that the check found something. @@ -3881,7 +4554,7 @@ AC_PROG_AWK test -z "$AWK" && AC_MSG_ERROR(No awk program found) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_CC_C_O version: 2 updated: 2006/12/16 15:55:46 +dnl CF_PROG_CC_C_O version: 3 updated: 2010/08/14 18:25:37 dnl -------------- dnl Analogous to AC_PROG_CC_C_O, but more useful: tests only $CC, ensures that dnl the output file can be renamed, and allows for a shell variable that can @@ -3911,7 +4584,7 @@ then else eval cf_cv_prog_$1_c_o=no fi -rm -f conftest* +rm -rf conftest* ])dnl if test $cf_cv_prog_$1_c_o = yes; then AC_MSG_RESULT([yes]) @@ -3985,6 +4658,39 @@ AC_SUBST(PROG_EXT) test -n "$PROG_EXT" && AC_DEFINE_UNQUOTED(PROG_EXT,"$PROG_EXT") ])dnl dnl --------------------------------------------------------------------------- +dnl CF_PROG_GNAT version: 1 updated: 2010/06/19 15:22:18 +dnl ------------ +dnl Check for gnatmake, ensure that it is complete. +AC_DEFUN([CF_PROG_GNAT],[ +cf_ada_make=gnatmake +AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) +if test "$ac_cv_prog_gnat_exists" = no; then + cf_ada_make= +else + CF_GNAT_VERSION + AC_CHECK_PROG(M4_exists, m4, yes, no) + if test "$ac_cv_prog_M4_exists" = no; then + cf_cv_prog_gnat_correct=no + echo Ada95 binding required program m4 not found. Ada95 binding disabled. + fi + if test "$cf_cv_prog_gnat_correct" = yes; then + AC_MSG_CHECKING(if GNAT works) + CF_GNAT_TRY_RUN([procedure conftest;], +[with Text_IO; +with GNAT.OS_Lib; +procedure conftest is +begin + Text_IO.Put ("Hello World"); + Text_IO.New_Line; + GNAT.OS_Lib.OS_Exit (0); +end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) + AC_MSG_RESULT($cf_cv_prog_gnat_correct) + fi +fi + +AC_SUBST(cf_ada_make) +])dnl +dnl --------------------------------------------------------------------------- dnl CF_PROG_INSTALL version: 5 updated: 2002/12/21 22:46:07 dnl --------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the @@ -4003,7 +4709,7 @@ case $INSTALL in esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LDCONFIG version: 1 updated: 2003/09/20 17:07:55 +dnl CF_PROG_LDCONFIG version: 2 updated: 2008/12/13 14:08:40 dnl ---------------- dnl Check for ldconfig, needed to fixup shared libraries that would be built dnl and then used in the install. @@ -4012,7 +4718,7 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -freebsd*) #(vi +dragonfly*|freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin @@ -4023,49 +4729,117 @@ fi AC_SUBST(LDCONFIG) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_PROG_LINT version: 1 updated: 2006/09/16 11:40:59 +dnl CF_PROG_LINT version: 2 updated: 2009/08/12 04:43:14 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ -AC_CHECK_PROGS(LINT, tdlint lint alint) +AC_CHECK_PROGS(LINT, tdlint lint alint splint lclint) AC_SUBST(LINT_OPTS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REGEX version: 3 updated: 1997/11/01 14:26:01 +dnl CF_PROG_LN_S version: 2 updated: 2010/08/14 18:25:37 +dnl ------------ +dnl Combine checks for "ln -s" and "ln -sf", updating $LN_S to include "-f" +dnl option if it is supported. +AC_DEFUN([CF_PROG_LN_S],[ +AC_PROG_LN_S +AC_MSG_CHECKING(if $LN_S -f options work) + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +AC_MSG_RESULT($cf_prog_ln_sf) + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_REGEX version: 8 updated: 2010/08/07 14:09:44 dnl -------- dnl Attempt to determine if we've got one of the flavors of regular-expression dnl code that we can support. AC_DEFUN([CF_REGEX], [ -AC_MSG_CHECKING([for regular-expression headers]) -AC_CACHE_VAL(cf_cv_regex,[ -AC_TRY_LINK([#include -#include ],[ - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - ],[cf_cv_regex="regex.h"],[ - AC_TRY_LINK([#include ],[ - char *p = compile("", "", "", 0); - int x = step("", ""); - ],[cf_cv_regex="regexp.h"],[ - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" - AC_TRY_LINK([#include ],[ - char *p = compile("", "", ""); - int x = step("", ""); - ],[cf_cv_regex="regexpr.h"],[LIBS="$cf_save_LIBS"])])]) + +cf_regex_func=no + +cf_regex_libs="regex re" +case $host_os in #(vi +mingw*) + cf_regex_libs="regex.dll $cf_regex_libs" + ;; +esac + +AC_CHECK_FUNC(regcomp,[cf_regex_func=regcomp],[ + for cf_regex_lib in $cf_regex_libs + do + AC_CHECK_LIB($cf_regex_lib,regcomp,[ + CF_ADD_LIB($cf_regex_lib) + cf_regex_func=regcomp + break]) + done ]) -AC_MSG_RESULT($cf_cv_regex) -case $cf_cv_regex in - regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; - regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; - regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; + +if test "$cf_regex_func" = no ; then + AC_CHECK_FUNC(compile,[cf_regex_func=compile],[ + AC_CHECK_LIB(gen,compile,[ + CF_ADD_LIB(gen) + cf_regex_func=compile])]) +fi + +if test "$cf_regex_func" = no ; then + AC_MSG_WARN(cannot find regular expression library) +fi + +AC_CACHE_CHECK(for regular-expression headers,cf_cv_regex_hdrs,[ + +cf_cv_regex_hdrs=no +case $cf_regex_func in #(vi +compile) #(vi + for cf_regex_hdr in regexp.h regexpr.h + do + AC_TRY_LINK([#include <$cf_regex_hdr>],[ + char *p = compile("", "", "", 0); + int x = step("", ""); + ],[ + cf_cv_regex_hdrs=$cf_regex_hdr + break + ]) + done + ;; +*) + for cf_regex_hdr in regex.h + do + AC_TRY_LINK([#include +#include <$cf_regex_hdr>],[ + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + ],[ + cf_cv_regex_hdrs=$cf_regex_hdr + break + ]) + done + ;; +esac + +]) + +case $cf_cv_regex_hdrs in #(vi + no) AC_MSG_WARN(no regular expression header found) ;; #(vi + regex.h) AC_DEFINE(HAVE_REGEX_H_FUNCS) ;; #(vi + regexp.h) AC_DEFINE(HAVE_REGEXP_H_FUNCS) ;; #(vi + regexpr.h) AC_DEFINE(HAVE_REGEXPR_H_FUNCS) ;; esac ])dnl dnl --------------------------------------------------------------------------- -dnl CF_REMOVE_DEFINE version: 2 updated: 2005/07/09 16:12:18 +dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all @@ -4077,10 +4851,9 @@ dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ -# remove $3 symbol from $2 $1=`echo "$2" | \ - sed -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[[ ]]/ /g' \ - -e 's/-[[UD]]$3\(=[[^ ]]*\)\?[$]//g'` + sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ + -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_LIB version: 1 updated: 2007/02/17 14:11:52 @@ -4096,58 +4869,122 @@ define([CF_REMOVE_LIB], $1=`echo "$2" | sed -e 's/-l$3[[ ]]//g' -e 's/-l$3[$]//'` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_RPATH_HACK version: 4 updated: 2008/09/13 12:53:26 +dnl CF_RPATH_HACK version: 9 updated: 2011/02/13 13:31:33 dnl ------------- AC_DEFUN([CF_RPATH_HACK], [ -AC_REQUIRE([CF_SHARED_OPTS]) +AC_REQUIRE([CF_LD_RPATH_OPT]) AC_MSG_CHECKING(for updated LDFLAGS) -if test -n "$LDFLAGS" ; then -AC_MSG_RESULT(maybe) -CF_VERBOSE(...checking LDFLAGS $LDFLAGS) -CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) -case "$EXTRA_LDFLAGS" in #(vi --Wl,-rpath,*) #(vi - cf_rpath_hack="-Wl,-rpath," - ;; --R\ *) - cf_rpath_hack="-R " - ;; --R*) - cf_rpath_hack="-R" - ;; -*) - cf_rpath_hack= - ;; -esac -if test -n "$cf_rpath_hack" ; then - cf_rpath_dst= - for cf_rpath_src in $LDFLAGS - do - CF_VERBOSE(Filtering $cf_rpath_src) - case $cf_rpath_src in #(vi - -L*) #(vi - if test "$cf_rpath_hack" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` - fi - CF_VERBOSE(...Filter $cf_rpath_tmp) - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" - done - LDFLAGS=$cf_rpath_dst - CF_VERBOSE(...checked LDFLAGS $LDFLAGS) +if test -n "$LD_RPATH_OPT" ; then + AC_MSG_RESULT(maybe) + + AC_CHECK_PROGS(cf_ldd_prog,ldd,no) + cf_rpath_list="/usr/lib /lib" + if test "$cf_ldd_prog" != no + then + cf_rpath_oops= + +AC_TRY_LINK([#include ], + [printf("Hello");], + [cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` + cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort -u`]) + + # If we passed the link-test, but get a "not found" on a given library, + # this could be due to inept reconfiguration of gcc to make it only + # partly honor /usr/local/lib (or whatever). Sometimes this behavior + # is intentional, e.g., installing gcc in /usr/bin and suppressing the + # /usr/local libraries. + if test -n "$cf_rpath_oops" + then + for cf_rpath_src in $cf_rpath_oops + do + for cf_rpath_dir in \ + /usr/local \ + /usr/pkg \ + /opt/sfw + do + if test -f $cf_rpath_dir/lib/$cf_rpath_src + then + CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src) + LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" + break + fi + done + done + fi + fi + + CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) + + CF_RPATH_HACK_2(LDFLAGS) + CF_RPATH_HACK_2(LIBS) + CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS) fi -else -AC_MSG_RESULT(no) -fi +AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SHARED_OPTS version: 53 updated: 2008/10/25 18:14:20 +dnl CF_RPATH_HACK_2 version: 6 updated: 2010/04/17 16:31:24 +dnl --------------- +dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to +dnl EXTRA_LDFLAGS for each -L option found. +dnl +dnl $cf_rpath_list contains a list of directories to ignore. +dnl +dnl $1 = variable name to update. The LDFLAGS variable should be the only one, +dnl but LIBS often has misplaced -L options. +AC_DEFUN([CF_RPATH_HACK_2], +[ +CF_VERBOSE(...checking $1 [$]$1) + +cf_rpath_dst= +for cf_rpath_src in [$]$1 +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp) + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +$1=$cf_rpath_dst + +CF_VERBOSE(...checked $1 [$]$1) +AC_SUBST(EXTRA_LDFLAGS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_SHARED_OPTS version: 64 updated: 2010/06/05 16:51:16 dnl -------------- dnl -------------- dnl Attempt to determine the appropriate CC/LD options for creating a shared @@ -4174,12 +5011,15 @@ dnl Some loaders leave 'so_locations' lying around. It's nice to clean up. AC_DEFUN([CF_SHARED_OPTS], [ AC_REQUIRE([CF_SUBST_NCURSES_VERSION]) + AC_REQUIRE([CF_LD_RPATH_OPT]) LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" AC_MSG_CHECKING(if release/abi version should be used for shared libs) AC_ARG_WITH(shlib-version, @@ -4218,11 +5058,17 @@ AC_DEFUN([CF_SHARED_OPTS], cf_cv_shlib_version_infix=no - case $cf_cv_system_name in - beos*) + case $cf_cv_system_name in #(vi + aix[[56]]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi MK_SHARED_LIB='${CC} ${CFLAGS} -o $[@] -Xlinker -soname=`basename $[@]` -nostart -e 0' ;; - cygwin*) + cygwin*) #(vi CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh [$]@ [$]{CC} [$]{CFLAGS}' cf_cv_shlib_version=cygdll @@ -4239,9 +5085,9 @@ AC_DEFUN([CF_SHARED_OPTS], EOF exec \[$]* -shared -Wl,--out-implib=../lib/\[$]{IMPORT_LIB} -Wl,--export-all-symbols -o ../lib/\[$]{SHARED_LIB} CF_EOF - chmod +x mk_shared_lib.sh + chmod +x mk_shared_lib.sh ;; - darwin*) + darwin*) #(vi EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $[@]` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $[@]' @@ -4256,7 +5102,7 @@ CF_EOF LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) + hpux*) #(vi # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -4269,15 +5115,9 @@ CF_EOF # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - if test "$GCC" = yes; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" - else - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" - fi + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -4288,54 +5128,50 @@ CF_EOF fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) + linux*|gnu*|k*bsd*-gnu) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - openbsd[[2-9]].*) + openbsd[[2-9]].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" CF_SHARED_SONAME - MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $[@]' ;; - nto-qnx*|openbsd*|freebsd[[12]].*) + nto-qnx*|openbsd*|freebsd[[12]].*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) + freebsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME - MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $[@]` -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $[@]` -o $[@]' ;; - netbsd*) + netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -4346,37 +5182,33 @@ CF_EOF CF_SHARED_SONAME MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $[@]' else - MK_SHARED_LIB='${LD} -Bshareable -o $[@]' + MK_SHARED_LIB='${LD} -shared -Bshareable -o $[@]' fi ;; - osf*|mls+*) + osf*|mls+*) #(vi # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $[@]`' - case $host_os in + case $host_os in #(vi osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $[@]' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $[@] .${REL_VERSION}`.${ABI_VERSION} -o [$]@' - if test "$cf_cv_ld_rpath" = yes ; then + if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -4384,7 +5216,7 @@ CF_EOF LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) + sunos4*) #(vi # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -4392,26 +5224,32 @@ CF_EOF MK_SHARED_LIB='${LD} -assert pure-text -o $[@]' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) + solaris2*) #(vi # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi CF_SHARED_SONAME if test "$GCC" != yes; then - CC_SHARED_OPTS='-xcode=pic32' + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + AC_TRY_COMPILE([#include ],[printf("Hello\n");],[break]) + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $[@]' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $[@]' fi ;; - sysv5uw7*|unix_sv*) + sysv5uw7*|unix_sv*) #(vi # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -4428,7 +5266,7 @@ CF_EOF case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $[@]') + *'-o $[@]') #(vi test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) @@ -4439,17 +5277,11 @@ CF_EOF esac if test -n "$cf_ld_rpath_opt" ; then - AC_MSG_CHECKING(if we need a space after rpath option) - cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" - AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) - LIBS="$cf_save_LIBS" - AC_MSG_RESULT($cf_rpath_space) - test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi AC_SUBST(CC_SHARED_OPTS) + AC_SUBST(LD_RPATH_OPT) AC_SUBST(LD_SHARED_OPTS) AC_SUBST(MK_SHARED_LIB) AC_SUBST(LINK_PROGS) @@ -4642,7 +5474,7 @@ if test "$cf_cv_sizechange" != no ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SRC_MODULES version: 18 updated: 2005/05/28 12:58:54 +dnl CF_SRC_MODULES version: 21 updated: 2010/09/04 17:37:40 dnl -------------- dnl For each parameter, test if the source-directory exists, and if it contains dnl a 'modules' file. If so, add to the list $cf_cv_src_modules which we'll @@ -4717,19 +5549,28 @@ AC_SUBST(TEST_DEPS) AC_SUBST(TEST_ARG2) AC_SUBST(TEST_DEP2) -SRC_SUBDIRS="man include" +SRC_SUBDIRS= +if test "x$cf_with_manpages" != xno ; then + SRC_SUBDIRS="$SRC_SUBDIRS man" +fi +SRC_SUBDIRS="$SRC_SUBDIRS include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS test" +if test "x$cf_with_tests" != "xno" ; then + SRC_SUBDIRS="$SRC_SUBDIRS test" +fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src" + if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" + fi fi SUB_MAKEFILES= @@ -4739,15 +5580,15 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done - AC_SUBST(ADA_SUBDIRS) + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done + AC_SUBST(ADA_SUBDIRS) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_STDCPP_LIBRARY version: 5 updated: 2000/08/12 23:18:52 +dnl CF_STDCPP_LIBRARY version: 7 updated: 2010/05/29 16:31:02 dnl ----------------- dnl Check for -lstdc++, which is GNU's standard C++ library. AC_DEFUN([CF_STDCPP_LIBRARY], @@ -4763,7 +5604,7 @@ os2*) #(vi esac AC_CACHE_CHECK(for library $cf_stdcpp_libname,cf_cv_libstdcpp,[ cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + CF_ADD_LIB($cf_stdcpp_libname) AC_TRY_LINK([ #include ],[ char buf[80]; @@ -4773,7 +5614,7 @@ strstreambuf foo(buf, sizeof(buf)) [cf_cv_libstdcpp=no]) LIBS="$cf_save" ]) -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CF_ADD_LIB($cf_stdcpp_libname,CXXLIBS) fi ])dnl dnl --------------------------------------------------------------------------- @@ -4846,14 +5687,15 @@ if test "$ac_cv_header_termios_h" = yes ; then fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_SUBDIR_PATH version: 5 updated: 2007/07/29 09:55:12 +dnl CF_SUBDIR_PATH version: 6 updated: 2010/04/21 06:20:50 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], -[$1="" +[ +$1= CF_ADD_SUBDIR_PATH($1,$2,$3,/usr,$prefix) CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) @@ -5048,7 +5890,7 @@ AC_DEFUN([CF_UPPER], $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- -dnl CF_UTF8_LIB version: 5 updated: 2008/10/17 19:37:52 +dnl CF_UTF8_LIB version: 7 updated: 2010/06/20 09:24:28 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], @@ -5070,10 +5912,40 @@ if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H) CF_ADD_INCDIR($cf_cv_header_path_utf8) CF_ADD_LIBDIR($cf_cv_library_path_utf8) - LIBS="-lutf8 $LIBS" + CF_ADD_LIBS($cf_cv_library_file_utf8) fi ])dnl dnl --------------------------------------------------------------------------- +dnl CF_VA_COPY version: 2 updated: 2010/03/04 05:37:29 +dnl ---------- +dnl check for va_copy, part of stdarg.h +dnl Also, workaround for glibc's __va_copy, by checking for both. +AC_DEFUN([CF_VA_COPY],[ +AC_CACHE_CHECK(for va_copy, cf_cv_have_va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + va_copy(dst, src)], + cf_cv_have_va_copy=yes, + cf_cv_have_va_copy=no)]) + +test "$cf_cv_have_va_copy" = yes && AC_DEFINE(HAVE_VA_COPY) + +AC_CACHE_CHECK(for __va_copy, cf_cv_have___va_copy,[ +AC_TRY_LINK([ +#include +],[ + static va_list dst; + static va_list src; + __va_copy(dst, src)], + cf_cv_have___va_copy=yes, + cf_cv_have___va_copy=no)]) + +test "$cf_cv_have___va_copy" = yes && AC_DEFINE(HAVE___VA_COPY) +]) +dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings @@ -5082,7 +5954,7 @@ AC_DEFUN([CF_VERBOSE], CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WCHAR_TYPE version: 2 updated: 2004/01/17 19:18:20 +dnl CF_WCHAR_TYPE version: 3 updated: 2010/05/26 16:44:57 dnl ------------- dnl Check if type wide-character type $1 is declared, and if so, which header dnl file is needed. The second parameter is used to set a shell variable when @@ -5118,7 +5990,7 @@ if test "$cf_cv_$1" = yes ; then NEED_WCHAR_H=1 fi -ifelse($2,,,[ +ifelse([$2],,,[ # if we do not find $1 in either place, use substitution to provide a fallback. if test "$cf_cv_$1" = unknown ; then $2=1 @@ -5178,7 +6050,76 @@ $1_ABI=$cf_cv_abi_version ]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DBMALLOC version: 6 updated: 2006/12/16 14:24:05 +dnl CF_WITH_ADA_COMPILER version: 2 updated: 2010/06/26 17:35:58 +dnl -------------------- +dnl Command-line option to specify the Ada95 compiler. +AC_DEFUN([CF_WITH_ADA_COMPILER],[ +AC_MSG_CHECKING(for ada-compiler) +AC_ARG_WITH(ada-compiler, + [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], + [cf_ada_compiler=$withval], + [cf_ada_compiler=gnatmake]) +AC_SUBST(cf_ada_compiler) +AC_MSG_RESULT($cf_ada_compiler) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_INCLUDE version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada includes will install. +AC_DEFUN([CF_WITH_ADA_INCLUDE],[ +AC_MSG_CHECKING(for ada-include) +CF_WITH_PATH(ada-include, + [ --with-ada-include=DIR Ada includes are in DIR], + ADA_INCLUDE, + PREFIX/share/ada/adainclude, + [$]prefix/share/ada/adainclude) +AC_SUBST(ADA_INCLUDE) +AC_MSG_RESULT($ADA_INCLUDE) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_OBJECTS version: 2 updated: 2010/06/26 17:35:58 +dnl ------------------- +dnl Command-line option to specify where Ada objects will install. +AC_DEFUN([CF_WITH_ADA_OBJECTS],[ +AC_MSG_CHECKING(for ada-objects) +CF_WITH_PATH(ada-objects, + [ --with-ada-objects=DIR Ada objects are in DIR], + ADA_OBJECTS, + PREFIX/lib/ada/adalib, + [$]prefix/lib/ada/adalib) +AC_SUBST(ADA_OBJECTS) +AC_MSG_RESULT($ADA_OBJECTS) +])dnl +dnl --------------------------------------------------------------------------- +dnl CF_WITH_ADA_SHAREDLIB version: 2 updated: 2010/06/26 17:35:58 +dnl --------------------- +dnl Command-line option to specify if an Ada95 shared-library should be built, +dnl and optionally what its soname should be. +AC_DEFUN([CF_WITH_ADA_SHAREDLIB],[ +AC_MSG_CHECKING(if an Ada95 shared-library should be built) +AC_ARG_WITH(ada-sharedlib, + [ --with-ada-sharedlib=XX build Ada95 shared-library], + [with_ada_sharedlib=$withval], + [with_ada_sharedlib=no]) +AC_MSG_RESULT($with_ada_sharedlib) + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + +AC_SUBST(ADA_SHAREDLIB) +AC_SUBST(MAKE_ADA_SHAREDLIB) +])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. @@ -5189,11 +6130,11 @@ CF_NO_LEAKS_OPTION(dbmalloc, if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, - [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse($1,,[],[,$1]))]) + [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_DMALLOC version: 6 updated: 2006/12/16 14:24:05 +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. @@ -5204,7 +6145,7 @@ CF_NO_LEAKS_OPTION(dmalloc, if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, - [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse($1,,[],[,$1]))]) + [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- @@ -5241,7 +6182,7 @@ if test "$with_gpm" != no ; then fi ]) dnl --------------------------------------------------------------------------- -dnl CF_WITH_LIBTOOL version: 19 updated: 2008/03/29 15:46:43 +dnl CF_WITH_LIBTOOL version: 26 updated: 2010/10/23 15:55:24 dnl --------------- dnl Provide a configure option to incorporate libtool. Define several useful dnl symbols for the makefile rules. @@ -5261,22 +6202,23 @@ dnl elif test ! -f $ACLOCAL/libtool.m4 ; then dnl echo cannot find libtool.m4 file dnl exit 1 dnl fi -dnl +dnl dnl LOCAL=aclocal.m4 dnl ORIG=aclocal.m4.orig -dnl +dnl dnl trap "mv $ORIG $LOCAL" 0 1 2 5 15 dnl rm -f $ORIG dnl mv $LOCAL $ORIG -dnl +dnl dnl # sed the LIBTOOL= assignment to omit the current directory? -dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL +dnl sed -e 's/^LIBTOOL=.*/LIBTOOL=${LIBTOOL:-libtool}/' $ACLOCAL/libtool.m4 >>$LOCAL dnl cat $ORIG >>$LOCAL -dnl +dnl dnl autoconf-257 $* dnl AC_DEFUN([CF_WITH_LIBTOOL], [ +AC_REQUIRE([CF_DISABLE_LIBTOOL_VERSION]) ifdef([AC_PROG_LIBTOOL],,[ LIBTOOL= ]) @@ -5306,17 +6248,17 @@ ifdef([AC_PROG_LIBTOOL],[ AC_PROG_LIBTOOL # missing_content_AC_PROG_LIBTOOL}} ],[ - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then CF_PATH_SYNTAX(with_libtool) LIBTOOL=$with_libtool else - AC_PATH_PROG(LIBTOOL,libtool) - fi - if test -z "$LIBTOOL" ; then - AC_MSG_ERROR(Cannot find libtool) - fi + AC_PATH_PROG(LIBTOOL,libtool) + fi + if test -z "$LIBTOOL" ; then + AC_MSG_ERROR(Cannot find libtool) + fi ])dnl - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -5331,16 +6273,25 @@ ifdef([AC_PROG_LIBTOOL],[ # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. + # bug reports it might be useful to have the original string. "(" cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([[^)]]*)//g' -e 's/^[[^1-9]]*//' -e 's/[[^0-9.]].*//'` AC_MSG_RESULT($cf_cv_libtool_version) if test -z "$cf_cv_libtool_version" ; then AC_MSG_ERROR(This is not GNU libtool) fi + # special hack to add -no-undefined (which libtool should do for itself) + LT_UNDEF= + case "$cf_cv_system_name" in #(vi + cygwin*|mingw32*|uwin*|aix[[456]]) #(vi + LT_UNDEF=-no-undefined + ;; + esac + AC_SUBST([LT_UNDEF]) + # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[[5-9]]*|[[2-9]]*) + case $cf_cv_libtool_version in #(vi + 1.[[5-9]]*|[[2-9]].[[0-9.a-z]]*) #(vi LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -5372,7 +6323,7 @@ AC_SUBST(LIB_UNINSTALL) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATH version: 8 updated: 2007/05/13 13:16:35 +dnl CF_WITH_PATH version: 10 updated: 2010/10/23 15:44:18 dnl ------------ dnl Wrapper for AC_ARG_WITH to ensure that user supplies a pathname, not just dnl defaulting to yes/no. @@ -5384,16 +6335,16 @@ dnl $4 = default value, shown in the help-message, must be a constant dnl $5 = default value, if it's an expression & cannot be in the help-message dnl AC_DEFUN([CF_WITH_PATH], -[AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval="${$3}"],[withval="${$3-ifelse($5,,$4,$5)}"]))dnl -if ifelse($5,,true,[test -n "$5"]) ; then +[AC_ARG_WITH($1,[$2 ](default: ifelse([$4],,empty,[$4])),, +ifelse([$4],,[withval="${$3}"],[withval="${$3:-ifelse([$5],,[$4],[$5])}"]))dnl +if ifelse([$5],,true,[test -n "$5"]) ; then CF_PATH_SYNTAX(withval) fi $3="$withval" AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PATHLIST version: 5 updated: 2001/12/10 01:28:30 +dnl CF_WITH_PATHLIST version: 7 updated: 2010/10/23 16:10:30 dnl ---------------- dnl Process an option specifying a list of colon-separated paths. dnl @@ -5407,9 +6358,9 @@ dnl AC_DEFUN([CF_WITH_PATHLIST],[ AC_REQUIRE([CF_PATHSEP]) AC_ARG_WITH($1,[$2 ](default: ifelse($4,,empty,$4)),, -ifelse($4,,[withval=${$3}],[withval=${$3-ifelse($5,,$4,$5)}]))dnl +ifelse($4,,[withval=${$3}],[withval=${$3:-ifelse($5,,$4,$5)}]))dnl -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5435,7 +6386,7 @@ AC_SUBST($3)dnl ])dnl dnl --------------------------------------------------------------------------- -dnl CF_WITH_PTHREAD version: 2 updated: 2008/08/23 18:26:05 +dnl CF_WITH_PTHREAD version: 3 updated: 2010/05/29 16:31:02 dnl --------------- dnl Check for POSIX thread library. AC_DEFUN([CF_WITH_PTHREAD], @@ -5453,7 +6404,7 @@ if test "$with_pthread" != no ; then AC_MSG_CHECKING(if we can link with the pthread library) cf_save_LIBS="$LIBS" - LIBS="-lpthread $LIBS" + CF_ADD_LIB(pthread) AC_TRY_LINK([ #include ],[ @@ -5463,7 +6414,7 @@ if test "$with_pthread" != no ; then AC_MSG_RESULT($with_pthread) if test "$with_pthread" = yes ; then - LIBS="-lpthread $LIBS" + CF_ADD_LIB(pthread) AC_DEFINE(HAVE_LIBPTHREADS) else AC_MSG_ERROR(Cannot link with pthread library) @@ -5535,7 +6486,7 @@ CF_NO_LEAKS_OPTION(valgrind, [USE_VALGRIND]) ])dnl dnl --------------------------------------------------------------------------- -dnl CF_XOPEN_SOURCE version: 26 updated: 2008/07/27 11:26:57 +dnl CF_XOPEN_SOURCE version: 35 updated: 2011/02/20 20:37:37 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, @@ -5546,14 +6497,22 @@ dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_XOPEN_SOURCE],[ -AC_REQUIRE([CF_PROG_CC_U_D]) - -cf_XOPEN_SOURCE=ifelse($1,,500,$1) -cf_POSIX_C_SOURCE=ifelse($2,,199506L,$2) +cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) +cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) +cf_xopen_source= case $host_os in #(vi -aix[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" +aix[[456]]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; +darwin[[0-8]].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -5561,15 +6520,18 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +hpux11*) #(vi + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[[56]].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; -linux*|gnu*|k*bsd*-gnu) #(vi +linux*|gnu*|mint*|k*bsd*-gnu) #(vi CF_GNU_SOURCE ;; mirbsd*) #(vi @@ -5582,16 +6544,19 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[[45]]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" +solaris2.1[[0-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[[1-9]]) #(vi + cf_xopen_source="-D__EXTENSIONS__" ;; *) AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ @@ -5614,11 +6579,14 @@ make an error if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + CF_ADD_CFLAGS($cf_temp_xopen_source) fi CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; esac + +if test -n "$cf_xopen_source" ; then + CF_ADD_CFLAGS($cf_xopen_source) +fi ]) diff --git a/contrib/ncurses/announce.html.in b/contrib/ncurses/announce.html.in index 1d4121ee4ff1..e385204de503 100644 --- a/contrib/ncurses/announce.html.in +++ b/contrib/ncurses/announce.html.in @@ -1,8 +1,8 @@ - + - - -Announcing ncurses @VERSION@ - - - - - -

Announcing ncurses @VERSION@

- -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

- -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and encouraged the keepers of -Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to -ncurses.

- -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

- -The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

- -The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . - -

Release Notes

- -This release is designed to be upward compatible from ncurses 5.0 through 5.6; -very few applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.6 release. -

-Interface changes: -

    -
  • generate linkable stubs for some macros: -
    - getattrs - -
-New features and improvements: -
    -
  • library -
      -
    • new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are - reentrant, but most require either a window-level or - screen-level mutex.
      - (This is API-compatible, - but not ABI-compatible with the normal library). - -
    • add NCURSES_OPAQUE symbol to curses.h, will - use to make structs opaque in selected configurations. - -
    • add NCURSES_EXT_FUNCS and - NCURSES_EXT_COLORS symbols to curses.h to make - it simpler to tell if the extended functions and/or colors - are declared. - -
    • add wresize() to C++ binding - -
    • eliminate fixed-buffer vsprintf() calls in C++ binding. - -
    • add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - -
    • adapt mouse-handling code from menu library in form-library - -
    • improve tracing for form library, showing created forms, - fields, etc. - -
    • make $NCURSES_NO_PADDING feature work for termcap interface . - -
    • add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - -
    • several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x -
    - -
  • programs: -
      -
    • modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - -
    • several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - -
    • add adacurses-config to the Ada95 install. - -
    • modify tic -f option to format spaces as - \s to prevent them from being lost when that - is read back in unformatted strings. - -
    • The tack program is now distributed separately - from ncurses. -
    - -
  • terminal database -
      -
    • added entries: -
        -
      • Eterm-256color, - Eterm-88color and - rxvt-88color -
      • aterm -
      • konsole-256color -
      • mrxvt -
      • screen.mlterm -
      • screen.rxvt -
      • teraterm4.59 is now the primary primary - teraterm entry, renamed original to - teraterm2.3 -
      • 9term terminal -
      • Newbury Data entries -
      -
    • updated/improved entries: -
        -
      • gnome to version 2.22.3 -
      • h19, z100 -
      • konsole to version 1.6.6 -
      • mlterm, mlterm+pcfkeys -
      • xterm, and building-blocks for function-keys - to xterm patch #230. -
      -
    -
-Major bug fixes: -
    -
  • add logic to tic for cancelling strings in user-defined - capabilities - (this is needed for - current konsole terminfo entry). - -
  • modify mk-1st.awk so the generated makefile rules for - linking or installing shared libraries do not first remove the - library, in case it is in use, e.g., libncurses.so by - /bin/sh. - -
  • correct check for notimeout() in wgetch(). - -
  • fix a sign-extension bug in infocmp's repair_acsc() function. - -
  • change winnstr() to stop at the end of the line. - -
  • make Ada95 demo_panels() example work. - -
  • fix for adding a non-spacing character at the beginning of a line. - -
  • fill in extended-color pair to make colors work - for wide-characters using extended-colors. - -
  • improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - -
  • modify win_wchnstr() to ensure that only a base cell - is returned for each multi-column character. - -
  • improve waddch() and winsch() handling of - EILSEQ from mbrtowc() by using unctrl() - to display illegal bytes rather than trying to append further bytes - to make up a valid sequence. - -
  • restore curs_set() state after - endwin()/refresh() - -
  • modify keyname() to use "^X" form only if - meta() has been called, or if keyname() - is called without initializing curses, e.g., via - initscr() or newterm(). - -
  • modify unctrl() to check codes in 128-255 range versus - isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - -
  • improve resizeterm() by moving ripped-off lines, and - repainting the soft-keys. - -
  • modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - -
  • use NCURSES_MOUSE_MASK() in definition of - BUTTON_RELEASE(), etc., to make those work properly - with the --enable-ext-mouse configuration - -
  • correct some functions in Ada95 binding which were using return - value from C where none was returned. - -
  • reviewed/fixed issues reported by Coverity and Klocwork tools. -
- -Portability: -
    -
  • configure script: -
      -
    • new options: -
      - -
      --disable-big-strings -
      control whether static string tables are generated as single - large strings (to improve startup performance), or as array - of individual strings. - -
      --disable-relink -
      control whether shared libraries are relinked (during install) - when rpath is enabled. - -
      --disable-tic-depends -
      make explicit whether tic library depends on ncurses/ncursesw - library. - -
      --enable-mixed-case -
      override the configure script's check if the filesystem - supports mixed-case filenames. - This allows one to control how the terminal database - maps to the filesystem. - For filesystems that do not support mixed-case, the library - uses generate 2-character (hexadecimal) codes for the - lower-level of the filesystem terminfo database - -
      --enable-reentrant -
      builds a different flavor of the ncurses library (ncursest) - which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded support). - -
      --enable-weak-symbols -
      use weak-symbols for linking to the POSIX thread library, - and use the same soname for the ncurses shared library - as the normal library (caveat: the ABI is for the threaded - library, which makes global data accessed via functions). - -
      --with-pthread -
      build with the POSIX thread library (tested with AIX, - Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). - -
      --with-ticlib -
      build/install the tic-support functions in a separate library - -
      - -
    • improved options: -
      - -
      --enable-ext-colors -
      requires the wide-character configuration. - -
      --with-chtype -
      ignore option value "unsigned" is always added to - the type in curses.h; do the same for --with-mmask-t. - -
      --with-dmalloc -
      build-fix for redefinition of strndup. - -
      --with-hashed-db -
      accepts a parameter which is the install-prefix of a given - Berkeley Database. - -
      --with-hashed-db -
      the $LIBS environment variable overrides the search for the db - library. - -
      --without-hashed-db -
      assumed when "--disable-database" is used. - -
      - -
    - -
  • other configure/build issues: -
      -
    • build-fixes for LynxOS -
    • modify shared-library rules to allow FreeBSD 3.x to use rpath. -
    • build-fix for FreeBSD "contemporary" TTY interface. -
    • build-fixes for AIX with libtool. -
    • build-fixes for Darwin and libtool. -
    • modify BeOS-specific ifdef's to build on Haiku. -
    • corrected gcc options for building shared libraries on Solaris - and IRIX64. -
    • change shared-library configuration for OpenBSD, make rpath work. -
    • build-fixes for using libutf8, e.g., on OpenBSD 3.7 -
    • add "-e" option in ncurses/Makefile.in when generating source-files - to force earlier exit if the build environment fails unexpectedly. -
    • add support for shared libraries for QNX. -
    • change delimiter in MKlib_gen.sh from '%' to '@', to - avoid substitution by IBM xlc to '#' as part of its extensions to - digraphs. -
    - -
  • library: -
      -
    • rewrite wrapper for wcrtomb(), making it work on - Solaris. This is used in the form library to determine the length - of the buffer needed by field_buffer. -
    • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding - type for data manipulated by signal handlers. -
    • set locale in misc/ncurses-config.in since it uses a range -
    • disable GPM mouse support when $TERM does not happen to contain - "linux", since Gpm_Open() no longer limits its assertion to terminals - that it might handle, e.g., within "screen" in xterm. -
    • reset mouse file-descriptor when unloading GPM library. -
    - -
  • test programs: -
      -
    • update test programs to build/work with various UNIX curses for - comparisons. -
    -
- -

Features of Ncurses

- -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
- -The ncurses package also has many useful extensions over SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -and most EXTENDED features). -It includes many function calls not supported under SVr4 curses -(but portability of all -calls is documented so you can use the SVr4 subset only). -
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
  • Ada95 and C++ bindings. -
  • Support for mouse event reporting with X Window xterm -and FreeBSD and OS/2 console windows. -
  • Extended mouse support via Alessandro Rubini's gpm package. -
  • The function wresize() allows you to resize windows, preserving -their data. -
  • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
  • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
  • Support for 256-color terminals, such as modern xterm, when configured -using the --enable-ext-colors option. -
  • Support for 16-color terminals, such as aixterm and modern xterm. -
  • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
  • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
  • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
  • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
  • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
  • A BSD-like tset(1) utility is provided. -
  • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
  • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
  • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
  • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
  • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
  • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
  • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
  • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
- -

State of the Package

- -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

- -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -

-
cdk -
Curses Development Kit -
-http://invisible-island.net/cdk/ -
-http://www.vexus.ca/products/CDK/ -
ded -
directory-editor -
-http://invisible-island.net/ded/ -
dialog -
the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
-http://invisible-island.net/dialog/ -
lynx -
the character-screen WWW browser -
-http://lynx.isc.org/release/ -
Midnight Commander -
file manager -
-http://www.ibiblio.org/mc/ -
mutt -
mail utility -
-http://www.mutt.org/ -
ncftp -
file-transfer utility -
-http://www.ncftp.com/ -
nvi -
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
-http://www.bostic.com/vi/ -
-
pinfo -
Lynx-like info browser. -https://alioth.debian.org/projects/pinfo/ -
tin -
newsreader, supporting color, MIME -http://www.tin.org/ -
-as well as some that use ncurses for the terminfo support alone: -
-
minicom -
terminal emulator -
- -http://alioth.debian.org/projects/minicom/ -
vile -
vi-like-emacs -
-http://invisible-island.net/vile/ -
-

- -The ncurses distribution includes a selection of test programs (including -a few games). - -

Who's Who and What's What

- -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

- -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -

+
+
+
+  
+
+  Announcing ncurses @VERSION@
+  
+  
+
+
+
+  

Announcing ncurses @VERSION@

The ncurses (new curses) + library is a free software emulation of curses in System V + Release 4.0, and more. It uses terminfo format, supports pads and + color and multiple highlights and forms characters and + function-key mapping, and has all the other SYSV-curses + enhancements over BSD curses. + +

In mid-June 1995, the maintainer of 4.4BSD curses declared + that he considered 4.4BSD curses obsolete, and encouraged the + keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to + switch over to ncurses.

+ +

The ncurses code was developed under GNU/Linux. It has been in + use for some time with OpenBSD as the system curses library, and + on FreeBSD and NetBSD as an external package. It should port + easily to any ANSI/POSIX-conforming UNIX. It has even been ported + to OS/2 Warp!

+ +

The distribution includes the library and support utilities, + including a terminfo compiler tic(1), a decompiler infocmp(1), + clear(1), tput(1), tset(1), and a termcap conversion tool + captoinfo(1). Full manual pages are provided for the library and + tools.

+ +

The ncurses distribution is available via anonymous FTP at the + GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
+ + It is also available at ftp://invisible-island.net/ncurses/ .

+ +

Release Notes

This release is designed to be upward + compatible from ncurses 5.0 through 5.8; very few applications + will require recompilation, depending on the platform. These are + the highlights from the change-log since ncurses 5.8 release. +

+ This is a bug-fix release, correcting a small number of urgent problems + in the ncurses library from the 5.8 release. +

+ It also improves the Ada95 binding: +

    +
  • fixes a longstanding portability problem with its use of the + set_field_type + function. Because that function uses variable-length argument lists, + its interface with gnat does not work with certain platforms. +
  • improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. +

    Those were a proof of concept. For the 5.9 release, those + scripts are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + here. +

  • additional improvements were made for portability of the + ncurses examples, adding rpm- and dpkg-scripts for test-builds. + See + this page + for snapshots and other information. +
+ +

Features of Ncurses

The ncurses package is fully + compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are + documented).
  • + +
  • Full support for SVr4 curses features including keyboard + mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys.
  • + +
  • An emulation of the SVr4 panels library, supporting a stack + of windows with backing store, is included.
  • + +
  • An emulation of the SVr4 menus library, supporting a + uniform but flexible interface for menu programming, is + included.
  • + +
  • An emulation of the SVr4 form library, supporting data + collection through on-screen forms, is included.
  • + +
  • Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses.
  • + +
  • The utilities have options to allow you to filter terminfo + entries for use with less capable + curses/terminfo versions such + as the HP/UX and AIX ports.
  • +
The ncurses package also has many useful extensions over + SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the + X/OPEN curses specification, XSI curses (that is, it implements + all BASE level features, and most EXTENDED features). It + includes many function calls not supported under SVr4 curses + (but portability of all calls is documented so you can use the + SVr4 subset only).
  • + +
  • Unlike SVr3 curses, ncurses can write to the + rightmost-bottommost corner of the screen if your terminal has + an insert-character capability.
  • + +
  • Ada95 and C++ bindings.
  • + +
  • Support for mouse event reporting with X Window xterm and + FreeBSD and OS/2 console windows.
  • + +
  • Extended mouse support via Alessandro Rubini's gpm + package.
  • + +
  • The function wresize allows you to resize + windows, preserving their data.
  • + +
  • The function use_default_colors allows you to + use the terminal's default colors for the default color pair, + achieving the effect of transparent colors.
  • + +
  • The functions keyok and + define_key allow you to better control the use of + function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code.
  • + +
  • Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors + option.
  • + +
  • Support for 16-color terminals, such as aixterm + and modern xterm.
  • + +
  • Better cursor-movement optimization. The package now + features a cursor-local-movement computation more efficient + than either BSD's or System V's.
  • + +
  • Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables + it to make optimal use of hardware scrolling, line-insertion, + and line-deletion for screen-line movements. This algorithm is + more powerful than the 4.4BSD curses quickch + routine.
  • + +
  • Real support for terminals with the magic-cookie glitch. + The screen-update code will refrain from drawing a highlight if + the magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space + character. It will automatically shift highlight boundaries + when doing so would make it possible to draw the highlight + without changing the visual appearance of the screen.
  • + +
  • It is possible to generate the library with a list of + pre-loaded fallback entries linked to it so that it can serve + those terminal types even when no terminfo tree or termcap file + is accessible (this may be useful for support of + screen-oriented programs that must run in single-user + mode).
  • + +
  • The tic(1)/captoinfo utility provided with ncurses has the + ability to translate many termcaps from the XENIX, IBM and + AT&T extension sets.
  • + +
  • A BSD-like tset(1) utility is provided.
  • + +
  • The ncurses library and utilities will automatically read + terminfo entries from $HOME/.terminfo if it exists, and compile + to that directory if it exists and the user has no write access + to the system directory. This feature makes it easier for users + to have personal terminfo entries without giving up access to + the system terminfo directory.
  • + +
  • You may specify a path of directories to search for + compiled descriptions with the environment variable + TERMINFO_DIRS (this generalizes the feature provided by + TERMINFO under stock System V.)
  • + +
  • In terminfo source files, use capabilities may refer not + just to other entries in the same source file (as in System V) + but also to compiled entries in either the system terminfo + directory or the user's $HOME/.terminfo directory.
  • + +
  • A script (capconvert) is provided to help + BSD users transition from termcap to terminfo. It gathers the + information in a TERMCAP environment variable and/or a + ~/.termcap local entries file and converts it to an equivalent + local terminfo tree under $HOME/.terminfo.
  • + +
  • Automatic fallback to the /etc/termcap file can be compiled + in when it is not possible to build a terminfo tree. This + feature is neither fast nor cheap, you don't want to use it + unless you have to, but it's there.
  • + +
  • The table-of-entries utility toe makes it + easy for users to see exactly what terminal types are available + on the system.
  • + +
  • The library meets the XSI requirement that every macro + entry point have a corresponding function which may be linked + (and will be prototype-checked) if the macro definition is + disabled with #undef.
  • + +
  • An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface.
  • +
+ +

State of the Package

Numerous bugs present in earlier + versions have been fixed; the library is far more reliable than + it used to be. Bounds checking in many `dangerous' entry points + has been improved. The code is now type-safe according to gcc + -Wall. The library has been checked for malloc leaks and arena + corruption by the Purify memory-allocation tester. + +

The ncurses code has been tested with a wide variety of + applications including (versions starting with those noted):

+ +
+
cdk
+ +
Curses Development Kit
+ http://invisible-island.net/cdk/
+ + http://www.vexus.ca/products/CDK/
+ +
ded
+ +
directory-editor
+ http://invisible-island.net/ded/
+ +
dialog
+ +
the underlying application used in Slackware's setup, and + the basis for similar applications on GNU/Linux.
+ http://invisible-island.net/dialog/
+ +
lynx
+ +
the character-screen WWW browser
+ http://lynx.isc.org/release/
+ +
Midnight Commander
+ +
file manager
+ http://www.midnight-commander.org/
+ +
mutt
+ +
mail utility
+ http://www.mutt.org/
+ +
ncftp
+ +
file-transfer utility
+ http://www.ncftp.com/
+ +
nvi
+ +
New vi versions 1.50 are able to use ncurses versions 1.9.7 + and later.
+ https://sites.google.com/a/bostic.com/keithbostic/nvi
+
+ +
pinfo
+ +
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
+ +
tin
+ +
newsreader, supporting color, MIME http://www.tin.org/
+
as well as some that use ncurses for the terminfo support + alone: + +
+
minicom
+ +
terminal emulator
+ http://alioth.debian.org/projects/minicom/
+ +
vile
+ +
vi-like-emacs
+ http://invisible-island.net/vile/
+
+ +

The ncurses distribution includes a selection of test programs + (including a few games).

+ +

Who's Who and What's What

Zeyd Ben-Halim started it from + a previous package pcurses, written by Pavel Curtis. Eric S. + Raymond continued development. Jürgen Pfeifer wrote most of + the form and menu libraries. Ongoing work is being done by + Thomas Dickey. + Thomas Dickey acts as the maintainer for the Free Software + Foundation, which holds the copyright on ncurses. Contact the + current maintainers at bug-ncurses@gnu.org. + +

To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line:

+
              subscribe <name>@<host.domain>
-
+
-This list is open to anyone interested in helping with the development and -testing of this package.

+

This list is open to anyone interested in helping with the + development and testing of this package.

-Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . +

Beta versions of ncurses and patches to the current release + are made available at ftp://invisible-island.net/ncurses/ .

-

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. +

Future Plans

-

Other Related Resources

+
    +
  • Extended-level XPG4 conformance, with internationalization + support.
  • -The distribution provides a newer version of the terminfo-format -terminal description file once maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file, and provides several user-definable extensions -beyond the X/Open specification.

    +

  • Ports to more systems, including DOS and Windows.
  • +
We need people to help with these projects. If you are + interested in working on them, please join the ncurses list. -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - +

Other Related Resources

The distribution provides a newer + version of the terminfo-format terminal description file once + maintained by Eric + Raymond . Unlike the older version, the termcap and + terminfo data are provided in the same file, and provides several + user-definable extensions beyond the X/Open specification. + +

You can find lots of information on terminal-related topics + not covered in the terminfo file at + Richard Shuford's archive .

+ + diff --git a/contrib/ncurses/config.guess b/contrib/ncurses/config.guess index c7607c74f1b8..bec935b96fca 100755 --- a/contrib/ncurses/config.guess +++ b/contrib/ncurses/config.guess @@ -1,10 +1,10 @@ #! /bin/sh # Attempt to guess a canonical system name. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-04-14' +timestamp='2010-09-24' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by @@ -27,16 +27,16 @@ timestamp='2008-04-14' # the same distribution terms that you use for the rest of that program. -# Originally written by Per Bothner . -# Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# Originally written by Per Bothner. Please send patches (context +# diff format) to and include a ChangeLog +# entry. # # This script attempts to guess a canonical system name similar to # config.sub. If it succeeds, it prints the system name on stdout, and # exits with 0. Otherwise, it exits with 1. # -# The plan is that this can be called by configure scripts if you -# don't specify an explicit build system type. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD me=`echo "$0" | sed -e 's,.*/,,'` @@ -56,8 +56,9 @@ version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -91,7 +92,7 @@ if test $# != 0; then exit 1 fi -trap 'exit 1' 1 2 15 +trap 'exit 1' HUP INT TERM # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires @@ -105,7 +106,7 @@ trap 'exit 1' 1 2 15 set_cc_for_build=' trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ; -trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ; +trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" HUP INT PIPE TERM ; : ${TMPDIR=/tmp} ; { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } || @@ -170,7 +171,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in arm*|i386|m68k|ns32k|sh3*|sparc|vax) eval $set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep __ELF__ >/dev/null + | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? @@ -180,7 +181,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in fi ;; *) - os=netbsd + os=netbsd ;; esac # The OS release @@ -219,11 +220,11 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in exit ;; alpha:OSF1:*:*) case $UNAME_RELEASE in - *4.0) + *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; - *5.*) - UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` + *5.*) + UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on @@ -295,7 +296,7 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in echo s390-ibm-zvmoe exit ;; *:OS400:*:*) - echo powerpc-ibm-os400 + echo powerpc-ibm-os400 exit ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) echo arm-acorn-riscix${UNAME_RELEASE} @@ -324,14 +325,33 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in case `/usr/bin/uname -p` in sparc) echo sparc-icl-nx7; exit ;; esac ;; + s390x:SunOS:*:*) + echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + exit ;; sun4H:SunOS:5.*:*) echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; + i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) + echo i386-pc-auroraux${UNAME_RELEASE} + exit ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) - echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` + eval $set_cc_for_build + SUN_ARCH="i386" + # If there is a compiler, see if it is configured for 64-bit objects. + # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. + # This test works for both compilers. + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + SUN_ARCH="x86_64" + fi + fi + echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'` exit ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize @@ -375,23 +395,23 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) echo m68k-atari-mint${UNAME_RELEASE} - exit ;; + exit ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) - echo m68k-atari-mint${UNAME_RELEASE} + echo m68k-atari-mint${UNAME_RELEASE} exit ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) - echo m68k-milan-mint${UNAME_RELEASE} - exit ;; + echo m68k-milan-mint${UNAME_RELEASE} + exit ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) - echo m68k-hades-mint${UNAME_RELEASE} - exit ;; + echo m68k-hades-mint${UNAME_RELEASE} + exit ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) - echo m68k-unknown-mint${UNAME_RELEASE} - exit ;; + echo m68k-unknown-mint${UNAME_RELEASE} + exit ;; m68k:machten:*:*) echo m68k-apple-machten${UNAME_RELEASE} exit ;; @@ -461,8 +481,8 @@ EOF echo m88k-motorola-sysv3 exit ;; AViiON:dgux:*:*) - # DG/UX returns AViiON for all architectures - UNAME_PROCESSOR=`/usr/bin/uname -p` + # DG/UX returns AViiON for all architectures + UNAME_PROCESSOR=`/usr/bin/uname -p` if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ] then if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \ @@ -532,7 +552,7 @@ EOF echo rs6000-ibm-aix3.2 fi exit ;; - *:AIX:*:[456]) + *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 @@ -575,8 +595,8 @@ EOF 9000/[678][0-9][0-9]) if [ -x /usr/bin/getconf ]; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` - sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` - case "${sc_cpu_version}" in + sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` + case "${sc_cpu_version}" in 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 @@ -640,7 +660,7 @@ EOF # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | - grep __LP64__ >/dev/null + grep -q __LP64__ then HP_ARCH="hppa2.0w" else @@ -711,22 +731,22 @@ EOF exit ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) echo c1-convex-bsd - exit ;; + exit ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi - exit ;; + exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) echo c34-convex-bsd - exit ;; + exit ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) echo c38-convex-bsd - exit ;; + exit ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) echo c4-convex-bsd - exit ;; + exit ;; CRAY*Y-MP:*:*:*) echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/' exit ;; @@ -750,14 +770,14 @@ EOF exit ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'` - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` - echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" - exit ;; + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'` + echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + exit ;; 5000:UNIX_System_V:4.*:*) - FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` - FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` - echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" + FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'` + FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'` + echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}" exit ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE} @@ -785,27 +805,30 @@ EOF echo ${UNAME_MACHINE}-pc-mingw32 exit ;; i*:windows32*:*) - # uname -m includes "-pc" on this system. - echo ${UNAME_MACHINE}-mingw32 + # uname -m includes "-pc" on this system. + echo ${UNAME_MACHINE}-mingw32 exit ;; i*:PW*:*) echo ${UNAME_MACHINE}-pc-pw32 exit ;; - *:Interix*:[3456]*) - case ${UNAME_MACHINE} in + *:Interix*:*) + case ${UNAME_MACHINE} in x86) echo i586-pc-interix${UNAME_RELEASE} exit ;; - EM64T | authenticamd) + authenticamd | genuineintel | EM64T) echo x86_64-unknown-interix${UNAME_RELEASE} exit ;; IA64) - echo ia64-unknown-interix${UNAME_RELEASE} - exit ;; + echo ia64-unknown-interix${UNAME_RELEASE} + exit ;; esac ;; [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*) echo i${UNAME_MACHINE}-pc-mks exit ;; + 8664:Windows_NT:*) + echo x86_64-pc-mks + exit ;; i*:Windows_NT*:* | Pentium*:Windows_NT*:*) # How do we know it's Interix rather than the generic POSIX subsystem? # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we @@ -835,10 +858,24 @@ EOF i*86:Minix:*:*) echo ${UNAME_MACHINE}-pc-minix exit ;; + alpha:Linux:*:*) + case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in + EV5) UNAME_MACHINE=alphaev5 ;; + EV56) UNAME_MACHINE=alphaev56 ;; + PCA56) UNAME_MACHINE=alphapca56 ;; + PCA57) UNAME_MACHINE=alphapca56 ;; + EV6) UNAME_MACHINE=alphaev6 ;; + EV67) UNAME_MACHINE=alphaev67 ;; + EV68*) UNAME_MACHINE=alphaev68 ;; + esac + objdump --private-headers /bin/sh | grep -q ld.so.1 + if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi + echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + exit ;; arm*:Linux:*:*) eval $set_cc_for_build - if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ - | grep -q __ARM_EABI__ + if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null | \ + grep -q __ARM_EABI__ then echo ${UNAME_MACHINE}-unknown-linux-gnu else @@ -855,7 +892,18 @@ EOF echo crisv32-axis-linux-gnu exit ;; frv:Linux:*:*) - echo frv-unknown-linux-gnu + echo frv-unknown-linux-gnu + exit ;; + i*86:Linux:*:*) + LIBC=gnu + eval $set_cc_for_build + sed 's/^ //' << EOF >$dummy.c + #ifdef __dietlibc__ + LIBC=dietlibc + #endif +EOF + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'` + echo "${UNAME_MACHINE}-pc-linux-${LIBC}" exit ;; ia64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -866,75 +914,34 @@ EOF m68*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - mips:Linux:*:*) + mips:Linux:*:* | mips64:Linux:*:*) eval $set_cc_for_build sed 's/^ //' << EOF >$dummy.c #undef CPU - #undef mips - #undef mipsel + #undef ${UNAME_MACHINE} + #undef ${UNAME_MACHINE}el #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mipsel + CPU=${UNAME_MACHINE}el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips + CPU=${UNAME_MACHINE} #else CPU= #endif #endif EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" - test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } - ;; - mips64:Linux:*:*) - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #undef CPU - #undef mips64 - #undef mips64el - #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) - CPU=mips64el - #else - #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) - CPU=mips64 - #else - CPU= - #endif - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^CPU/{ - s: ::g - p - }'`" + eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'` test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; } ;; or32:Linux:*:*) - echo or32-unknown-linux-gnu - exit ;; - ppc:Linux:*:*) - echo powerpc-unknown-linux-gnu - exit ;; - ppc64:Linux:*:*) - echo powerpc64-unknown-linux-gnu - exit ;; - alpha:Linux:*:*) - case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in - EV5) UNAME_MACHINE=alphaev5 ;; - EV56) UNAME_MACHINE=alphaev56 ;; - PCA56) UNAME_MACHINE=alphapca56 ;; - PCA57) UNAME_MACHINE=alphapca56 ;; - EV6) UNAME_MACHINE=alphaev6 ;; - EV67) UNAME_MACHINE=alphaev67 ;; - EV68*) UNAME_MACHINE=alphaev68 ;; - esac - objdump --private-headers /bin/sh | grep ld.so.1 >/dev/null - if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi - echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC} + echo or32-unknown-linux-gnu + exit ;; + padre:Linux:*:*) + echo sparc-unknown-linux-gnu exit ;; + parisc64:Linux:*:* | hppa64:Linux:*:*) + echo hppa64-unknown-linux-gnu + exit ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in @@ -943,14 +950,17 @@ EOF *) echo hppa-unknown-linux-gnu ;; esac exit ;; - parisc64:Linux:*:* | hppa64:Linux:*:*) - echo hppa64-unknown-linux-gnu + ppc64:Linux:*:*) + echo powerpc64-unknown-linux-gnu + exit ;; + ppc:Linux:*:*) + echo powerpc-unknown-linux-gnu exit ;; s390:Linux:*:* | s390x:Linux:*:*) echo ${UNAME_MACHINE}-ibm-linux exit ;; sh64*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; sh*:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu @@ -958,6 +968,9 @@ EOF sparc:Linux:*:* | sparc64:Linux:*:*) echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; + tile*:Linux:*:*) + echo ${UNAME_MACHINE}-tilera-linux-gnu + exit ;; vax:Linux:*:*) echo ${UNAME_MACHINE}-dec-linux-gnu exit ;; @@ -965,68 +978,8 @@ EOF echo x86_64-unknown-linux-gnu exit ;; xtensa*:Linux:*:*) - echo ${UNAME_MACHINE}-unknown-linux-gnu + echo ${UNAME_MACHINE}-unknown-linux-gnu exit ;; - i*86:Linux:*:*) - # The BFD linker knows what the default object file format is, so - # first see if it will tell us. cd to the root directory to prevent - # problems with other programs or directories called `ld' in the path. - # Set LC_ALL=C to ensure ld outputs messages in English. - ld_supported_targets=`cd /; LC_ALL=C ld --help 2>&1 \ - | sed -ne '/supported targets:/!d - s/[ ][ ]*/ /g - s/.*supported targets: *// - s/ .*// - p'` - case "$ld_supported_targets" in - elf32-i386) - TENTATIVE="${UNAME_MACHINE}-pc-linux-gnu" - ;; - a.out-i386-linux) - echo "${UNAME_MACHINE}-pc-linux-gnuaout" - exit ;; - "") - # Either a pre-BFD a.out linker (linux-gnuoldld) or - # one that does not give us useful --help. - echo "${UNAME_MACHINE}-pc-linux-gnuoldld" - exit ;; - esac - # Determine whether the default compiler is a.out or elf - eval $set_cc_for_build - sed 's/^ //' << EOF >$dummy.c - #include - #ifdef __ELF__ - # ifdef __GLIBC__ - # if __GLIBC__ >= 2 - LIBC=gnu - # else - LIBC=gnulibc1 - # endif - # else - LIBC=gnulibc1 - # endif - #else - #if defined(__INTEL_COMPILER) || defined(__PGI) || defined(__SUNPRO_C) || defined(__SUNPRO_CC) - LIBC=gnu - #else - LIBC=gnuaout - #endif - #endif - #ifdef __dietlibc__ - LIBC=dietlibc - #endif -EOF - eval "`$CC_FOR_BUILD -E $dummy.c 2>/dev/null | sed -n ' - /^LIBC/{ - s: ::g - p - }'`" - test x"${LIBC}" != x && { - echo "${UNAME_MACHINE}-pc-linux-${LIBC}" - exit - } - test x"${TENTATIVE}" != x && { echo "${TENTATIVE}"; exit; } - ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both @@ -1034,11 +987,11 @@ EOF echo i386-sequent-sysv4 exit ;; i*86:UNIX_SV:4.2MP:2.*) - # Unixware is an offshoot of SVR4, but it has its own version - # number series starting with 2... - # I am not positive that other SVR4 systems won't match this, + # Unixware is an offshoot of SVR4, but it has its own version + # number series starting with 2... + # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. - # Use sysv4.2uw... so that sysv4* matches it. + # Use sysv4.2uw... so that sysv4* matches it. echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION} exit ;; i*86:OS/2:*:*) @@ -1055,7 +1008,7 @@ EOF i*86:syllable:*:*) echo ${UNAME_MACHINE}-pc-syllable exit ;; - i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*) + i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) echo i386-unknown-lynxos${UNAME_RELEASE} exit ;; i*86:*DOS:*:*) @@ -1070,7 +1023,7 @@ EOF fi exit ;; i*86:*:5:[678]*) - # UnixWare 7.x, OpenUNIX and OpenServer 6. + # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; @@ -1098,10 +1051,13 @@ EOF exit ;; pc:*:*:*) # Left here for compatibility: - # uname -m prints for DJGPP always 'pc', but it prints nothing about - # the processor, so we play safe by assuming i386. - echo i386-pc-msdosdjgpp - exit ;; + # uname -m prints for DJGPP always 'pc', but it prints nothing about + # the processor, so we play safe by assuming i586. + # Note: whatever this is, it MUST be the same as what config.sub + # prints for the "djgpp" host, or else GDB configury will decide that + # this is a cross-build. + echo i586-pc-msdosdjgpp + exit ;; Intel:Mach:3*:*) echo i386-pc-mach3 exit ;; @@ -1136,8 +1092,18 @@ EOF /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) - /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ - && { echo i486-ncr-sysv4; exit; } ;; + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4; exit; } ;; + NCR*:*:4.2:* | MPRAS*:*:4.2:*) + OS_REL='.3' + test -r /etc/.relid \ + && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` + /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ + && { echo i486-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } + /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ + && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) echo m68k-unknown-lynxos${UNAME_RELEASE} exit ;; @@ -1150,7 +1116,7 @@ EOF rs6000:LynxOS:2.*:*) echo rs6000-unknown-lynxos${UNAME_RELEASE} exit ;; - PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*) + PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) echo powerpc-unknown-lynxos${UNAME_RELEASE} exit ;; SM[BE]S:UNIX_SV:*:*) @@ -1171,9 +1137,9 @@ EOF fi exit ;; PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort - # says - echo i586-unisys-sysv4 - exit ;; + # says + echo i586-unisys-sysv4 + exit ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm @@ -1203,7 +1169,7 @@ EOF else echo mips-unknown-sysv${UNAME_RELEASE} fi - exit ;; + exit ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. echo powerpc-be-beos exit ;; @@ -1243,6 +1209,16 @@ EOF *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown case $UNAME_PROCESSOR in + i386) + eval $set_cc_for_build + if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then + if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ + (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \ + grep IS_64BIT_ARCH >/dev/null + then + UNAME_PROCESSOR="x86_64" + fi + fi ;; unknown) UNAME_PROCESSOR=powerpc ;; esac echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE} @@ -1250,14 +1226,17 @@ EOF *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = "x86"; then - UNAME_PROCESSOR=i386 - UNAME_MACHINE=pc + UNAME_PROCESSOR=i386 + UNAME_MACHINE=pc fi echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE} exit ;; *:QNX:*:4*) echo i386-pc-qnx exit ;; + NEO-?:NONSTOP_KERNEL:*:*) + echo neo-tandem-nsk${UNAME_RELEASE} + exit ;; NSE-?:NONSTOP_KERNEL:*:*) echo nse-tandem-nsk${UNAME_RELEASE} exit ;; @@ -1303,13 +1282,13 @@ EOF echo pdp10-unknown-its exit ;; SEI:*:*:SEIUX) - echo mips-sei-seiux${UNAME_RELEASE} + echo mips-sei-seiux${UNAME_RELEASE} exit ;; *:DragonFly:*:*) echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` exit ;; *:*VMS:*:*) - UNAME_MACHINE=`(uname -p) 2>/dev/null` + UNAME_MACHINE=`(uname -p) 2>/dev/null` case "${UNAME_MACHINE}" in A*) echo alpha-dec-vms ; exit ;; I*) echo ia64-dec-vms ; exit ;; @@ -1324,6 +1303,9 @@ EOF i*86:rdos:*:*) echo ${UNAME_MACHINE}-pc-rdos exit ;; + i*86:AROS:*:*) + echo ${UNAME_MACHINE}-pc-aros + exit ;; esac #echo '(No uname command or uname output not recognized.)' 1>&2 diff --git a/contrib/ncurses/config.sub b/contrib/ncurses/config.sub index a649350a6ca7..de11910f0b15 100755 --- a/contrib/ncurses/config.sub +++ b/contrib/ncurses/config.sub @@ -1,10 +1,10 @@ #! /bin/sh # Configuration validation subroutine script. # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008 +# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 # Free Software Foundation, Inc. -timestamp='2008-06-16' +timestamp='2010-09-11' # This file is (in principle) common to ALL GNU software. # The presence of a machine in this file suggests that SOME GNU software @@ -32,13 +32,16 @@ timestamp='2008-06-16' # Please send patches to . Submit a context -# diff and a properly formatted ChangeLog entry. +# diff and a properly formatted GNU ChangeLog entry. # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. +# You can get the latest version of this script from: +# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD + # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. @@ -72,8 +75,9 @@ Report bugs and patches to ." version="\ GNU config.sub ($timestamp) -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, -2002, 2003, 2004, 2005, 2006, 2007, 2008 Free Software Foundation, Inc. +Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, +2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010 Free +Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." @@ -120,8 +124,10 @@ esac # Here we must recognize all the valid KERNEL-OS combinations. maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` case $maybe_os in - nto-qnx* | linux-gnu* | linux-dietlibc | linux-newlib* | linux-uclibc* | \ - uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* | \ + nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ + linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ + knetbsd*-gnu* | netbsd*-gnu* | \ + kopensolaris*-gnu* | \ storm-chaos* | os2-emx* | rtmk-nova*) os=-$maybe_os basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` @@ -148,10 +154,13 @@ case $os in -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray) + -apple | -axis | -knuth | -cray | -microblaze) os= basic_machine=$1 ;; + -bluegene*) + os=-cnk + ;; -sim | -cisco | -oki | -wec | -winbond) os= basic_machine=$1 @@ -249,6 +258,7 @@ case $basic_machine in | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ | i370 | i860 | i960 | ia64 \ | ip2k | iq2000 \ + | lm32 \ | m32c | m32r | m32rle | m68000 | m68k | m88k \ | maxq | mb | microblaze | mcore | mep | metag \ | mips | mipsbe | mipseb | mipsel | mipsle \ @@ -270,28 +280,41 @@ case $basic_machine in | mipsisa64sr71k | mipsisa64sr71kel \ | mipstx39 | mipstx39el \ | mn10200 | mn10300 \ + | moxie \ | mt \ | msp430 \ + | nds32 | nds32le | nds32be\ | nios | nios2 \ | ns16k | ns32k \ | or32 \ | pdp10 | pdp11 | pj | pjl \ | powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \ | pyramid \ + | rx \ | score \ - | sh | sh[1234] | sh[24]a | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ + | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ | sh64 | sh64le \ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ | spu | strongarm \ - | tahoe | thumb | tic4x | tic80 | tron \ + | tahoe | thumb | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ + | ubicom32 \ | v850 | v850e \ | we32k \ | x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \ - | z8k) + | z8k | z80) basic_machine=$basic_machine-unknown ;; - m6811 | m68hc11 | m6812 | m68hc12) + c54x) + basic_machine=tic54x-unknown + ;; + c55x) + basic_machine=tic55x-unknown + ;; + c6x) + basic_machine=tic6x-unknown + ;; + m6811 | m68hc11 | m6812 | m68hc12 | picochip) # Motorola 68HC11/12. basic_machine=$basic_machine-unknown os=-none @@ -306,8 +329,8 @@ case $basic_machine in # because (1) that's what they normally are, and # (2) the word "unknown" tends to confuse beginning users. i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; + basic_machine=$basic_machine-pc + ;; # Object if more than one company name word. *-*-*) echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 @@ -322,7 +345,7 @@ case $basic_machine in | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ | avr-* | avr32-* \ | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \ + | c[123]* | c30-* | [cjt]90-* | c4x-* \ | clipper-* | craynv-* | cydra-* \ | d10v-* | d30v-* | dlx-* \ | elxsi-* \ @@ -331,9 +354,10 @@ case $basic_machine in | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ | i*86-* | i860-* | i960-* | ia64-* \ | ip2k-* | iq2000-* \ + | lm32-* \ | m32c-* | m32r-* | m32rle-* \ | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* \ + | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ | mips16-* \ | mips64-* | mips64el-* \ @@ -355,27 +379,30 @@ case $basic_machine in | mmix-* \ | mt-* \ | msp430-* \ + | nds32-* | nds32le-* | nds32be-* \ | nios-* | nios2-* \ | none-* | np1-* | ns16k-* | ns32k-* \ | orion-* \ | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* | ppcbe-* \ | pyramid-* \ - | romp-* | rs6000-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ + | romp-* | rs6000-* | rx-* \ + | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ | sparclite-* \ | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | strongarm-* | sv1-* | sx?-* \ | tahoe-* | thumb-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* | tile-* \ + | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ + | tile-* | tilegx-* \ | tron-* \ + | ubicom32-* \ | v850-* | v850e-* | vax-* \ | we32k-* \ | x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \ | xstormy16-* | xtensa*-* \ | ymp-* \ - | z8k-*) + | z8k-* | z80-*) ;; # Recognize the basic CPU types without company name, with glob match. xtensa*) @@ -397,7 +424,7 @@ case $basic_machine in basic_machine=a29k-amd os=-udi ;; - abacus) + abacus) basic_machine=abacus-unknown ;; adobe68k) @@ -443,6 +470,10 @@ case $basic_machine in basic_machine=m68k-apollo os=-bsd ;; + aros) + basic_machine=i386-pc + os=-aros + ;; aux) basic_machine=m68k-apple os=-aux @@ -459,11 +490,24 @@ case $basic_machine in basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` os=-linux ;; + bluegene*) + basic_machine=powerpc-ibm + os=-cnk + ;; + c54x-*) + basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c55x-*) + basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; + c6x-*) + basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` + ;; c90) basic_machine=c90-cray os=-unicos ;; - cegcc) + cegcc) basic_machine=arm-unknown os=-cegcc ;; @@ -711,6 +755,9 @@ case $basic_machine in basic_machine=ns32k-utek os=-sysv ;; + microblaze) + basic_machine=microblaze-xilinx + ;; mingw32) basic_machine=i386-pc os=-mingw32 @@ -815,6 +862,12 @@ case $basic_machine in np1) basic_machine=np1-gould ;; + neo-tandem) + basic_machine=neo-tandem + ;; + nse-tandem) + basic_machine=nse-tandem + ;; nsr-tandem) basic_machine=nsr-tandem ;; @@ -1049,17 +1102,10 @@ case $basic_machine in basic_machine=t90-cray os=-unicos ;; - tic54x | c54x*) - basic_machine=tic54x-unknown - os=-coff - ;; - tic55x | c55x*) - basic_machine=tic55x-unknown - os=-coff - ;; - tic6x | c6x*) - basic_machine=tic6x-unknown - os=-coff + # This must be matched before tile*. + tilegx*) + basic_machine=tilegx-unknown + os=-linux-gnu ;; tile*) basic_machine=tile-unknown @@ -1140,6 +1186,10 @@ case $basic_machine in basic_machine=z8k-unknown os=-sim ;; + z80-*-coff) + basic_machine=z80-unknown + os=-sim + ;; none) basic_machine=none-none os=-none @@ -1178,7 +1228,7 @@ case $basic_machine in we32k) basic_machine=we32k-att ;; - sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele) + sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) basic_machine=sh-unknown ;; sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) @@ -1225,9 +1275,12 @@ esac if [ x"$os" != x"" ] then case $os in - # First match some system type aliases - # that might get confused with valid system types. + # First match some system type aliases + # that might get confused with valid system types. # -solaris* is a basic system type, with this one exception. + -auroraux) + os=-auroraux + ;; -solaris1 | -solaris1.*) os=`echo $os | sed -e 's|solaris1|sunos4|'` ;; @@ -1248,10 +1301,11 @@ case $os in # Each alternative MUST END IN A *, to match a version number. # -sysv* is not here because it comes later, after sysvr4. -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \ + | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ + | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ + | -sym* | -kopensolaris* \ | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* \ + | -aos* | -aros* \ | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ @@ -1262,7 +1316,8 @@ case $os in | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -chorusos* | -chorusrdb* | -cegcc* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \ + | -mingw32* | -linux-gnu* | -linux-android* \ + | -linux-newlib* | -linux-uclibc* \ | -uxpv* | -beos* | -mpeix* | -udk* \ | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ @@ -1270,7 +1325,7 @@ case $os in | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops*) + | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es*) # Remember, each alternative MUST END IN *, to match a version number. ;; -qnx*) @@ -1309,7 +1364,7 @@ case $os in -opened*) os=-openedition ;; - -os400*) + -os400*) os=-os400 ;; -wince*) @@ -1358,7 +1413,7 @@ case $os in -sinix*) os=-sysv4 ;; - -tpf*) + -tpf*) os=-tpf ;; -triton*) @@ -1403,6 +1458,8 @@ case $os in -dicos*) os=-dicos ;; + -nacl*) + ;; -none) ;; *) @@ -1425,10 +1482,10 @@ else # system, and we'll never get to this point. case $basic_machine in - score-*) + score-*) os=-elf ;; - spu-*) + spu-*) os=-elf ;; *-acorn) @@ -1440,8 +1497,17 @@ case $basic_machine in arm*-semi) os=-aout ;; - c4x-* | tic4x-*) - os=-coff + c4x-* | tic4x-*) + os=-coff + ;; + tic54x-*) + os=-coff + ;; + tic55x-*) + os=-coff + ;; + tic6x-*) + os=-coff ;; # This must come before the *-dec entry. pdp10-*) @@ -1468,7 +1534,7 @@ case $basic_machine in m68*-cisco) os=-aout ;; - mep-*) + mep-*) os=-elf ;; mips*-cisco) @@ -1495,7 +1561,7 @@ case $basic_machine in *-ibm) os=-aix ;; - *-knuth) + *-knuth) os=-mmixware ;; *-wec) @@ -1600,7 +1666,7 @@ case $basic_machine in -sunos*) vendor=sun ;; - -aix*) + -cnk*|-aix*) vendor=ibm ;; -beos*) diff --git a/contrib/ncurses/configure b/contrib/ncurses/configure index 1342387ce63e..639b790dc3ac 100755 --- a/contrib/ncurses/configure +++ b/contrib/ncurses/configure @@ -1,7 +1,7 @@ #! /bin/sh -# From configure.in Revision: 1.454 . +# From configure.in Revision: 1.520 . # Guess values for system-dependent variables and create Makefiles. -# Generated by Autoconf 2.52.20080325. +# Generated by Autoconf 2.52.20101002. # # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. @@ -697,8 +697,12 @@ Optional Features: --without-cxx do not adjust ncurses bool to match C++ --without-cxx-binding do not build C++ binding and demo --without-ada suppress check for Ada95, don't build demo + --without-manpages suppress install of manpages --without-progs suppress build with programs (e.g., tic) + --without-tests suppress build with test-programs --without-curses-h install curses.h as ncurses.h only + --with-pkg-config{=path} enable/disable use of pkg-config + --enable-pc-files generate and install .pc files for pkg-config --enable-mixed-case tic should assume mixed-case filenames --with-install-prefix prefixes actual install-location ($DESTDIR) Build-Tools Needed to Compile Temporary Applications for Cross-compiling: @@ -709,6 +713,7 @@ Build-Tools Needed to Compile Temporary Applications for Cross-compiling: --with-build-ldflags=XXX the build linker-flags ($BUILD_LDFLAGS) --with-build-libs=XXX the build libraries (${BUILD_LIBS}) Options to Specify the Libraries Built/Used: + --disable-libtool-version enable to use libtool's incompatible naming scheme --with-libtool generate libraries with libtool --with-shared generate shared-libraries --with-normal generate normal-libraries (default) @@ -722,6 +727,7 @@ Options to Specify the Libraries Built/Used: --enable-rpath use rpath option when generating shared libraries --disable-relink relink shared libraries during install --with-shlib-version=X Specify rel or abi version for shared libs + --disable-rpath-hack don't add rpath options for additional libraries Fine-Tuning Your Configuration: --disable-overwrite leave out the link to -lcurses --disable-database do not use terminfo, only fallbacks/termcap @@ -752,6 +758,7 @@ Fine-Tuning Your Configuration: --with-chtype=TYPE override type of chtype --with-ospeed=TYPE override type of ospeed variable --with-mmask-t=TYPE override type of mmask_t + --with-ccharw-max=XXX override size CCHARW_MAX --with-rcs-ids compile-in RCS identifiers Options to Specify How Manpages are Installed: --with-manpage-format specify manpage-format: gzip/compress/BSDI/normal and @@ -762,6 +769,8 @@ Options to Specify How Manpages are Installed: --with-manpage-tbl specify manpage processing with tbl Extensions: --disable-ext-funcs disable function-extensions + --enable-sp-funcs enable experimental SCREEN-extensions + --enable-term-driver enable experimental terminal-driver --enable-const compile with extra/non-standard const --enable-ext-colors compile for 256-color support --enable-ext-mouse compile for extended mouse-encoding @@ -776,10 +785,13 @@ Development Code: Experimental Code: --disable-assumed-color do not assume anything about default-colors --disable-hashmap compile without hashmap scrolling-optimization - --enable-colorfgbg compile with $COLORFGBG code + --enable-colorfgbg compile-in experimental $COLORFGBG code + --enable-interop compile-in experimental interop bindings --with-pthread use POSIX thread library + --enable-pthreads-eintr enable EINTR in wgetch with pthreads --enable-weak-symbols enable weak-symbols for pthreads --enable-reentrant compile with experimental reentrant code + --with-wrap-prefix=XXX override prefix used for public variables --enable-safe-sprintf compile with experimental safe-sprintf code --disable-scroll-hints compile without scroll-hints code --enable-wgetch-events compile with experimental wgetch-events code @@ -796,8 +808,9 @@ Testing/development Options: --with-trace test: add trace() function to all models of ncurses Ada95 Binding Options: --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake) - --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/lib/ada/adainclude) + --with-ada-include=DIR Ada includes are in DIR (default: PREFIX/share/ada/adainclude) --with-ada-objects=DIR Ada objects are in DIR (default: PREFIX/lib/ada/adalib) + --with-ada-sharedlib=XX build Ada95 shared-library Some influential environment variables: CC C compiler command @@ -870,7 +883,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. It was created by $as_me, which was -generated by GNU Autoconf 2.52.20080325. Invocation command line was +generated by GNU Autoconf 2.52.20101002. Invocation command line was $ $0 $@ @@ -994,7 +1007,7 @@ if test -z "$CONFIG_SITE"; then fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then - { echo "$as_me:997: loading site script $ac_site_file" >&5 + { echo "$as_me:1010: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" @@ -1005,7 +1018,7 @@ if test -r "$cache_file"; then # Some versions of bash will fail to source /dev/null (special # files actually), so we avoid doing that. if test -f "$cache_file"; then - { echo "$as_me:1008: loading cache $cache_file" >&5 + { echo "$as_me:1021: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; @@ -1013,7 +1026,7 @@ echo "$as_me: loading cache $cache_file" >&6;} esac fi else - { echo "$as_me:1016: creating cache $cache_file" >&5 + { echo "$as_me:1029: creating cache $cache_file" >&5 echo "$as_me: creating cache $cache_file" >&6;} >$cache_file fi @@ -1029,21 +1042,21 @@ for ac_var in `(set) 2>&1 | eval ac_new_val="\$ac_env_${ac_var}_value" case $ac_old_set,$ac_new_set in set,) - { echo "$as_me:1032: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 + { echo "$as_me:1045: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} ac_cache_corrupted=: ;; ,set) - { echo "$as_me:1036: error: \`$ac_var' was not set in the previous run" >&5 + { echo "$as_me:1049: error: \`$ac_var' was not set in the previous run" >&5 echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} ac_cache_corrupted=: ;; ,);; *) if test "x$ac_old_val" != "x$ac_new_val"; then - { echo "$as_me:1042: error: \`$ac_var' has changed since the previous run:" >&5 + { echo "$as_me:1055: error: \`$ac_var' has changed since the previous run:" >&5 echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} - { echo "$as_me:1044: former value: $ac_old_val" >&5 + { echo "$as_me:1057: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} - { echo "$as_me:1046: current value: $ac_new_val" >&5 + { echo "$as_me:1059: current value: $ac_new_val" >&5 echo "$as_me: current value: $ac_new_val" >&2;} ac_cache_corrupted=: fi;; @@ -1062,9 +1075,9 @@ echo "$as_me: current value: $ac_new_val" >&2;} fi done if $ac_cache_corrupted; then - { echo "$as_me:1065: error: changes in the environment can compromise the build" >&5 + { echo "$as_me:1078: error: changes in the environment can compromise the build" >&5 echo "$as_me: error: changes in the environment can compromise the build" >&2;} - { { echo "$as_me:1067: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 + { { echo "$as_me:1080: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi @@ -1085,10 +1098,10 @@ esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh -if { (echo "$as_me:1088: PATH=\".;.\"; conftest.sh") >&5 +if { (echo "$as_me:1101: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? - echo "$as_me:1091: \$? = $ac_status" >&5 + echo "$as_me:1104: \$? = $ac_status" >&5 (exit $ac_status); }; then ac_path_separator=';' else @@ -1101,7 +1114,7 @@ ac_config_headers="$ac_config_headers include/ncurses_cfg.h:include/ncurses_cfg. top_builddir=`pwd` -echo "$as_me:1104: checking for egrep" >&5 +echo "$as_me:1117: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1111,11 +1124,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:1114: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:1127: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:1118: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:1131: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -1125,7 +1138,7 @@ NCURSES_PATCH="`$ac_cv_prog_egrep '^NCURSES_PATCH[ ]*=' $srcdir/dist.mk | sed - cf_cv_abi_version=${NCURSES_MAJOR} cf_cv_rel_version=${NCURSES_MAJOR}.${NCURSES_MINOR} cf_cv_timestamp=`date` -echo "$as_me:1128: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 +echo "$as_me:1141: result: Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&5 echo "${ECHO_T}Configuring NCURSES $cf_cv_rel_version ABI $cf_cv_abi_version ($cf_cv_timestamp)" >&6 test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 @@ -1133,7 +1146,7 @@ test -z "$cf_cv_rel_version" && cf_cv_rel_version=0.0 # Check whether --with-rel-version or --without-rel-version was given. if test "${with_rel_version+set}" = set; then withval="$with_rel_version" - { echo "$as_me:1136: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 + { echo "$as_me:1149: WARNING: overriding release version $cf_cv_rel_version to $withval" >&5 echo "$as_me: WARNING: overriding release version $cf_cv_rel_version to $withval" >&2;} cf_cv_rel_version=$withval fi; @@ -1146,13 +1159,13 @@ if test -n "$NCURSES_MAJOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1149: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 + { { echo "$as_me:1162: error: Release major-version is not a number: $NCURSES_MAJOR" >&5 echo "$as_me: error: Release major-version is not a number: $NCURSES_MAJOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1155: error: Release major-version value is empty" >&5 + { { echo "$as_me:1168: error: Release major-version value is empty" >&5 echo "$as_me: error: Release major-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1162,13 +1175,13 @@ if test -n "$NCURSES_MINOR" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1165: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 + { { echo "$as_me:1178: error: Release minor-version is not a number: $NCURSES_MINOR" >&5 echo "$as_me: error: Release minor-version is not a number: $NCURSES_MINOR" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1171: error: Release minor-version value is empty" >&5 + { { echo "$as_me:1184: error: Release minor-version value is empty" >&5 echo "$as_me: error: Release minor-version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1178,7 +1191,7 @@ test -z "$cf_cv_abi_version" && cf_cv_abi_version=0 # Check whether --with-abi-version or --without-abi-version was given. if test "${with_abi_version+set}" = set; then withval="$with_abi_version" - { echo "$as_me:1181: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 + { echo "$as_me:1194: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&5 echo "$as_me: WARNING: overriding ABI version $cf_cv_abi_version to $withval" >&2;} cf_cv_abi_version=$withval fi; @@ -1188,13 +1201,13 @@ if test -n "$cf_cv_abi_version" ; then [0-9]*) #(vi ;; *) - { { echo "$as_me:1191: error: ABI version is not a number: $cf_cv_abi_version" >&5 + { { echo "$as_me:1204: error: ABI version is not a number: $cf_cv_abi_version" >&5 echo "$as_me: error: ABI version is not a number: $cf_cv_abi_version" >&2;} { (exit 1); exit 1; }; } ;; esac else - { { echo "$as_me:1197: error: ABI version value is empty" >&5 + { { echo "$as_me:1210: error: ABI version value is empty" >&5 echo "$as_me: error: ABI version value is empty" >&2;} { (exit 1); exit 1; }; } fi @@ -1216,7 +1229,7 @@ for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do fi done if test -z "$ac_aux_dir"; then - { { echo "$as_me:1219: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 + { { echo "$as_me:1232: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&5 echo "$as_me: error: cannot find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." >&2;} { (exit 1); exit 1; }; } fi @@ -1226,11 +1239,11 @@ ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || - { { echo "$as_me:1229: error: cannot run $ac_config_sub" >&5 + { { echo "$as_me:1242: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:1233: checking build system type" >&5 +echo "$as_me:1246: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1239,23 +1252,23 @@ else test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && - { { echo "$as_me:1242: error: cannot guess build type; you must specify one" >&5 + { { echo "$as_me:1255: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub $ac_cv_build_alias` || - { { echo "$as_me:1246: error: $ac_config_sub $ac_cv_build_alias failed." >&5 + { { echo "$as_me:1259: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1251: result: $ac_cv_build" >&5 +echo "$as_me:1264: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo $ac_cv_build | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` -echo "$as_me:1258: checking host system type" >&5 +echo "$as_me:1271: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1264,12 +1277,12 @@ else test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub $ac_cv_host_alias` || - { { echo "$as_me:1267: error: $ac_config_sub $ac_cv_host_alias failed" >&5 + { { echo "$as_me:1280: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1272: result: $ac_cv_host" >&5 +echo "$as_me:1285: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1277,7 +1290,7 @@ host_vendor=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo $ac_cv_host | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f $srcdir/config.guess || test -f $ac_aux_dir/config.guess ; then - echo "$as_me:1280: checking target system type" >&5 + echo "$as_me:1293: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1286,12 +1299,12 @@ else test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub $ac_cv_target_alias` || - { { echo "$as_me:1289: error: $ac_config_sub $ac_cv_target_alias failed" >&5 + { { echo "$as_me:1302: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi -echo "$as_me:1294: result: $ac_cv_target" >&5 +echo "$as_me:1307: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo $ac_cv_target | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` @@ -1322,13 +1335,13 @@ else fi test -z "$system_name" && system_name="$cf_cv_system_name" -test -n "$cf_cv_system_name" && echo "$as_me:1325: result: Configuring for $cf_cv_system_name" >&5 +test -n "$cf_cv_system_name" && echo "$as_me:1338: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then - echo "$as_me:1329: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 + echo "$as_me:1342: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 - { { echo "$as_me:1331: error: \"Please remove config.cache and try again.\"" >&5 + { { echo "$as_me:1344: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi @@ -1336,7 +1349,7 @@ fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" - { echo "$as_me:1339: WARNING: overriding system type to $withval" >&5 + { echo "$as_me:1352: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval fi; @@ -1346,7 +1359,7 @@ cf_user_CFLAGS="$CFLAGS" ### Default install-location -echo "$as_me:1349: checking for prefix" >&5 +echo "$as_me:1362: checking for prefix" >&5 echo $ECHO_N "checking for prefix... $ECHO_C" >&6 if test "x$prefix" = "xNONE" ; then case "$cf_cv_system_name" in @@ -1358,11 +1371,11 @@ if test "x$prefix" = "xNONE" ; then ;; esac fi -echo "$as_me:1361: result: $prefix" >&5 +echo "$as_me:1374: result: $prefix" >&5 echo "${ECHO_T}$prefix" >&6 if test "x$prefix" = "xNONE" ; then -echo "$as_me:1365: checking for default include-directory" >&5 +echo "$as_me:1378: checking for default include-directory" >&5 echo $ECHO_N "checking for default include-directory... $ECHO_C" >&6 test -n "$verbose" && echo 1>&6 for cf_symbol in \ @@ -1385,7 +1398,7 @@ do fi test -n "$verbose" && echo " tested $cf_dir" 1>&6 done -echo "$as_me:1388: result: $includedir" >&5 +echo "$as_me:1401: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 fi @@ -1399,7 +1412,7 @@ ac_main_return=return if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 -echo "$as_me:1402: checking for $ac_word" >&5 +echo "$as_me:1415: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1414,7 +1427,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" -echo "$as_me:1417: found $ac_dir/$ac_word" >&5 +echo "$as_me:1430: found $ac_dir/$ac_word" >&5 break done @@ -1422,10 +1435,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1425: result: $CC" >&5 + echo "$as_me:1438: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1428: result: no" >&5 + echo "$as_me:1441: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1434,7 +1447,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 -echo "$as_me:1437: checking for $ac_word" >&5 +echo "$as_me:1450: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1449,7 +1462,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" -echo "$as_me:1452: found $ac_dir/$ac_word" >&5 +echo "$as_me:1465: found $ac_dir/$ac_word" >&5 break done @@ -1457,10 +1470,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1460: result: $ac_ct_CC" >&5 + echo "$as_me:1473: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1463: result: no" >&5 + echo "$as_me:1476: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1473,7 +1486,7 @@ if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 -echo "$as_me:1476: checking for $ac_word" >&5 +echo "$as_me:1489: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1488,7 +1501,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" -echo "$as_me:1491: found $ac_dir/$ac_word" >&5 +echo "$as_me:1504: found $ac_dir/$ac_word" >&5 break done @@ -1496,10 +1509,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1499: result: $CC" >&5 + echo "$as_me:1512: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1502: result: no" >&5 + echo "$as_me:1515: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1508,7 +1521,7 @@ if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:1511: checking for $ac_word" >&5 +echo "$as_me:1524: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1523,7 +1536,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" -echo "$as_me:1526: found $ac_dir/$ac_word" >&5 +echo "$as_me:1539: found $ac_dir/$ac_word" >&5 break done @@ -1531,10 +1544,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1534: result: $ac_ct_CC" >&5 + echo "$as_me:1547: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1537: result: no" >&5 + echo "$as_me:1550: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1547,7 +1560,7 @@ fi if test -z "$CC"; then # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 -echo "$as_me:1550: checking for $ac_word" >&5 +echo "$as_me:1563: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1567,7 +1580,7 @@ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then continue fi ac_cv_prog_CC="cc" -echo "$as_me:1570: found $ac_dir/$ac_word" >&5 +echo "$as_me:1583: found $ac_dir/$ac_word" >&5 break done @@ -1589,10 +1602,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1592: result: $CC" >&5 + echo "$as_me:1605: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1595: result: no" >&5 + echo "$as_me:1608: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1603,7 +1616,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:1606: checking for $ac_word" >&5 +echo "$as_me:1619: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1618,7 +1631,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" -echo "$as_me:1621: found $ac_dir/$ac_word" >&5 +echo "$as_me:1634: found $ac_dir/$ac_word" >&5 break done @@ -1626,10 +1639,10 @@ fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then - echo "$as_me:1629: result: $CC" >&5 + echo "$as_me:1642: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else - echo "$as_me:1632: result: no" >&5 + echo "$as_me:1645: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1642,7 +1655,7 @@ if test -z "$CC"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:1645: checking for $ac_word" >&5 +echo "$as_me:1658: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -1657,7 +1670,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" -echo "$as_me:1660: found $ac_dir/$ac_word" >&5 +echo "$as_me:1673: found $ac_dir/$ac_word" >&5 break done @@ -1665,10 +1678,10 @@ fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then - echo "$as_me:1668: result: $ac_ct_CC" >&5 + echo "$as_me:1681: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else - echo "$as_me:1671: result: no" >&5 + echo "$as_me:1684: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -1680,32 +1693,32 @@ fi fi -test -z "$CC" && { { echo "$as_me:1683: error: no acceptable cc found in \$PATH" >&5 +test -z "$CC" && { { echo "$as_me:1696: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. -echo "$as_me:1688:" \ +echo "$as_me:1701:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:1691: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:1704: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:1694: \$? = $ac_status" >&5 + echo "$as_me:1707: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1696: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:1709: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:1699: \$? = $ac_status" >&5 + echo "$as_me:1712: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:1701: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:1714: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:1704: \$? = $ac_status" >&5 + echo "$as_me:1717: \$? = $ac_status" >&5 (exit $ac_status); } cat >conftest.$ac_ext <<_ACEOF -#line 1708 "configure" +#line 1721 "configure" #include "confdefs.h" int @@ -1721,13 +1734,13 @@ ac_clean_files="$ac_clean_files a.out a.exe" # Try to create an executable without -o first, disregard a.out. # It will help us diagnose broken compilers, and finding out an intuition # of exeext. -echo "$as_me:1724: checking for C compiler default output" >&5 +echo "$as_me:1737: checking for C compiler default output" >&5 echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` -if { (eval echo "$as_me:1727: \"$ac_link_default\"") >&5 +if { (eval echo "$as_me:1740: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? - echo "$as_me:1730: \$? = $ac_status" >&5 + echo "$as_me:1743: \$? = $ac_status" >&5 (exit $ac_status); }; then # Find the output, starting from the most likely. This scheme is # not robust to junk in `.', hence go to wildcards (a.*) only as a last @@ -1736,7 +1749,7 @@ for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; @@ -1750,34 +1763,34 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1753: error: C compiler cannot create executables" >&5 +{ { echo "$as_me:1766: error: C compiler cannot create executables" >&5 echo "$as_me: error: C compiler cannot create executables" >&2;} { (exit 77); exit 77; }; } fi ac_exeext=$ac_cv_exeext -echo "$as_me:1759: result: $ac_file" >&5 +echo "$as_me:1772: result: $ac_file" >&5 echo "${ECHO_T}$ac_file" >&6 # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:1764: checking whether the C compiler works" >&5 +echo "$as_me:1777: checking whether the C compiler works" >&5 echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 # FIXME: These cross compiler hacks should be removed for Autoconf 3.0 # If not cross compiling, check that we can run a simple program. if test "$cross_compiling" != yes; then if { ac_try='./$ac_file' - { (eval echo "$as_me:1770: \"$ac_try\"") >&5 + { (eval echo "$as_me:1783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1773: \$? = $ac_status" >&5 + echo "$as_me:1786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else - { { echo "$as_me:1780: error: cannot run C compiled programs. + { { echo "$as_me:1793: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&5 echo "$as_me: error: cannot run C compiled programs. If you meant to cross compile, use \`--host'." >&2;} @@ -1785,24 +1798,24 @@ If you meant to cross compile, use \`--host'." >&2;} fi fi fi -echo "$as_me:1788: result: yes" >&5 +echo "$as_me:1801: result: yes" >&5 echo "${ECHO_T}yes" >&6 rm -f a.out a.exe conftest$ac_cv_exeext ac_clean_files=$ac_clean_files_save # Check the compiler produces executables we can run. If not, either # the compiler is broken, or we cross compile. -echo "$as_me:1795: checking whether we are cross compiling" >&5 +echo "$as_me:1808: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 -echo "$as_me:1797: result: $cross_compiling" >&5 +echo "$as_me:1810: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 -echo "$as_me:1800: checking for executable suffix" >&5 +echo "$as_me:1813: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 -if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 +if { (eval echo "$as_me:1815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:1805: \$? = $ac_status" >&5 + echo "$as_me:1818: \$? = $ac_status" >&5 (exit $ac_status); }; then # If both `conftest.exe' and `conftest' are `present' (well, observable) # catch `conftest.exe'. For instance with Cygwin, `ls conftest' will @@ -1810,7 +1823,7 @@ if { (eval echo "$as_me:1802: \"$ac_link\"") >&5 # `rm'. for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; @@ -1818,25 +1831,25 @@ for ac_file in `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do esac done else - { { echo "$as_me:1821: error: cannot compute EXEEXT: cannot compile and link" >&5 + { { echo "$as_me:1834: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest$ac_cv_exeext -echo "$as_me:1827: result: $ac_cv_exeext" >&5 +echo "$as_me:1840: result: $ac_cv_exeext" >&5 echo "${ECHO_T}$ac_cv_exeext" >&6 rm -f conftest.$ac_ext EXEEXT=$ac_cv_exeext ac_exeext=$EXEEXT -echo "$as_me:1833: checking for object suffix" >&5 +echo "$as_me:1846: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 1839 "configure" +#line 1852 "configure" #include "confdefs.h" int @@ -1848,14 +1861,14 @@ main () } _ACEOF rm -f conftest.o conftest.obj -if { (eval echo "$as_me:1851: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1854: \$? = $ac_status" >&5 + echo "$as_me:1867: \$? = $ac_status" >&5 (exit $ac_status); }; then for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do case $ac_file in - *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; + *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` break;; esac @@ -1863,24 +1876,24 @@ done else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -{ { echo "$as_me:1866: error: cannot compute OBJEXT: cannot compile" >&5 +{ { echo "$as_me:1879: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_cv_objext conftest.$ac_ext fi -echo "$as_me:1873: result: $ac_cv_objext" >&5 +echo "$as_me:1886: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT -echo "$as_me:1877: checking whether we are using the GNU C compiler" >&5 +echo "$as_me:1890: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 1883 "configure" +#line 1896 "configure" #include "confdefs.h" int @@ -1895,16 +1908,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1898: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1911: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1901: \$? = $ac_status" >&5 + echo "$as_me:1914: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1904: \"$ac_try\"") >&5 + { (eval echo "$as_me:1917: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1907: \$? = $ac_status" >&5 + echo "$as_me:1920: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -1916,19 +1929,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_c_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:1919: result: $ac_cv_c_compiler_gnu" >&5 +echo "$as_me:1932: result: $ac_cv_c_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 GCC=`test $ac_compiler_gnu = yes && echo yes` ac_test_CFLAGS=${CFLAGS+set} ac_save_CFLAGS=$CFLAGS CFLAGS="-g" -echo "$as_me:1925: checking whether $CC accepts -g" >&5 +echo "$as_me:1938: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 1931 "configure" +#line 1944 "configure" #include "confdefs.h" int @@ -1940,16 +1953,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1943: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:1956: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1946: \$? = $ac_status" >&5 + echo "$as_me:1959: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1949: \"$ac_try\"") >&5 + { (eval echo "$as_me:1962: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1952: \$? = $ac_status" >&5 + echo "$as_me:1965: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_g=yes else @@ -1959,7 +1972,7 @@ ac_cv_prog_cc_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:1962: result: $ac_cv_prog_cc_g" >&5 +echo "$as_me:1975: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS @@ -1986,16 +1999,16 @@ cat >conftest.$ac_ext <<_ACEOF #endif _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2002: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:1992: \$? = $ac_status" >&5 + echo "$as_me:2005: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:1995: \"$ac_try\"") >&5 + { (eval echo "$as_me:2008: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:1998: \$? = $ac_status" >&5 + echo "$as_me:2011: \$? = $ac_status" >&5 (exit $ac_status); }; }; then for ac_declaration in \ ''\ @@ -2007,7 +2020,7 @@ if { (eval echo "$as_me:1989: \"$ac_compile\"") >&5 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2010 "configure" +#line 2023 "configure" #include "confdefs.h" #include $ac_declaration @@ -2020,16 +2033,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2023: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2036: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2026: \$? = $ac_status" >&5 + echo "$as_me:2039: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2029: \"$ac_try\"") >&5 + { (eval echo "$as_me:2042: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2032: \$? = $ac_status" >&5 + echo "$as_me:2045: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2039,7 +2052,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2042 "configure" +#line 2055 "configure" #include "confdefs.h" $ac_declaration int @@ -2051,16 +2064,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2054: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2067: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2057: \$? = $ac_status" >&5 + echo "$as_me:2070: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2060: \"$ac_try\"") >&5 + { (eval echo "$as_me:2073: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2063: \$? = $ac_status" >&5 + echo "$as_me:2076: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -2069,7 +2082,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -f conftest* +rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -2090,11 +2103,11 @@ ac_main_return=return GCC_VERSION=none if test "$GCC" = yes ; then - echo "$as_me:2093: checking version of $CC" >&5 + echo "$as_me:2106: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 - GCC_VERSION="`${CC} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown - echo "$as_me:2097: result: $GCC_VERSION" >&5 + echo "$as_me:2110: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi @@ -2104,7 +2117,7 @@ ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:2107: checking how to run the C preprocessor" >&5 +echo "$as_me:2120: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then @@ -2125,18 +2138,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 2128 "configure" +#line 2141 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2133: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2146: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2139: \$? = $ac_status" >&5 + echo "$as_me:2152: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2159,17 +2172,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 2162 "configure" +#line 2175 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2166: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2179: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2172: \$? = $ac_status" >&5 + echo "$as_me:2185: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2206,7 +2219,7 @@ fi else ac_cv_prog_CPP=$CPP fi -echo "$as_me:2209: result: $CPP" >&5 +echo "$as_me:2222: result: $CPP" >&5 echo "${ECHO_T}$CPP" >&6 ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes @@ -2216,18 +2229,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 2219 "configure" +#line 2232 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:2224: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2237: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2230: \$? = $ac_status" >&5 + echo "$as_me:2243: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2250,17 +2263,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 2253 "configure" +#line 2266 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:2257: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:2270: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:2263: \$? = $ac_status" >&5 + echo "$as_me:2276: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -2288,7 +2301,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:2291: error: C preprocessor \"$CPP\" fails sanity check" >&5 + { { echo "$as_me:2304: error: C preprocessor \"$CPP\" fails sanity check" >&5 echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -2301,14 +2314,14 @@ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return if test $ac_cv_c_compiler_gnu = yes; then - echo "$as_me:2304: checking whether $CC needs -traditional" >&5 + echo "$as_me:2317: checking whether $CC needs -traditional" >&5 echo $ECHO_N "checking whether $CC needs -traditional... $ECHO_C" >&6 if test "${ac_cv_prog_gcc_traditional+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_pattern="Autoconf.*'x'" cat >conftest.$ac_ext <<_ACEOF -#line 2311 "configure" +#line 2324 "configure" #include "confdefs.h" #include int Autoconf = TIOCGETP; @@ -2319,11 +2332,11 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_prog_gcc_traditional=no fi -rm -f conftest* +rm -rf conftest* if test $ac_cv_prog_gcc_traditional = no; then cat >conftest.$ac_ext <<_ACEOF -#line 2326 "configure" +#line 2339 "configure" #include "confdefs.h" #include int Autoconf = TCGETA; @@ -2332,18 +2345,18 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | egrep "$ac_pattern" >/dev/null 2>&1; then ac_cv_prog_gcc_traditional=yes fi -rm -f conftest* +rm -rf conftest* fi fi -echo "$as_me:2339: result: $ac_cv_prog_gcc_traditional" >&5 +echo "$as_me:2352: result: $ac_cv_prog_gcc_traditional" >&5 echo "${ECHO_T}$ac_cv_prog_gcc_traditional" >&6 if test $ac_cv_prog_gcc_traditional = yes; then CC="$CC -traditional" fi fi -echo "$as_me:2346: checking whether $CC understands -c and -o together" >&5 +echo "$as_me:2359: checking whether $CC understands -c and -o together" >&5 echo $ECHO_N "checking whether $CC understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CC_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2359,38 +2372,38 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CC -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:2362: \"$ac_try\"") >&5 +if { (eval echo "$as_me:2375: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2365: \$? = $ac_status" >&5 + echo "$as_me:2378: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:2367: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:2380: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2370: \$? = $ac_status" >&5 + echo "$as_me:2383: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CC_c_o=yes else eval cf_cv_prog_CC_c_o=no fi -rm -f conftest* +rm -rf conftest* fi if test $cf_cv_prog_CC_c_o = yes; then - echo "$as_me:2381: result: yes" >&5 + echo "$as_me:2394: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:2384: result: no" >&5 + echo "$as_me:2397: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:2388: checking for POSIXized ISC" >&5 +echo "$as_me:2401: checking for POSIXized ISC" >&5 echo $ECHO_N "checking for POSIXized ISC... $ECHO_C" >&6 if test -d /etc/conf/kconfig.d && grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1 then - echo "$as_me:2393: result: yes" >&5 + echo "$as_me:2406: result: yes" >&5 echo "${ECHO_T}yes" >&6 ISC=yes # If later tests want to check for ISC. @@ -2404,13 +2417,13 @@ EOF CC="$CC -Xp" fi else - echo "$as_me:2407: result: no" >&5 + echo "$as_me:2420: result: no" >&5 echo "${ECHO_T}no" >&6 ISC= fi -echo "$as_me:2412: checking for ${CC-cc} option to accept ANSI C" >&5 -echo $ECHO_N "checking for ${CC-cc} option to accept ANSI C... $ECHO_C" >&6 +echo "$as_me:2425: checking for ${CC:-cc} option to accept ANSI C" >&5 +echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -2450,8 +2463,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2466,6 +2479,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2481,8 +2504,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2494,7 +2517,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2503,7 +2526,7 @@ if test -n "$cf_new_extra_cppflags" ; then fi cat >conftest.$ac_ext <<_ACEOF -#line 2506 "configure" +#line 2529 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS @@ -2524,16 +2547,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2527: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2550: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2530: \$? = $ac_status" >&5 + echo "$as_me:2553: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2533: \"$ac_try\"") >&5 + { (eval echo "$as_me:2556: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2536: \$? = $ac_status" >&5 + echo "$as_me:2559: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ansi_cc="$cf_arg"; break else @@ -2546,7 +2569,7 @@ CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi -echo "$as_me:2549: result: $cf_cv_ansi_cc" >&5 +echo "$as_me:2572: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then @@ -2568,8 +2591,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -2584,6 +2607,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -2599,8 +2632,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -2612,7 +2645,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -2629,7 +2662,7 @@ fi fi if test "$cf_cv_ansi_cc" = "no"; then - { { echo "$as_me:2632: error: Your compiler does not appear to recognize prototypes. + { { echo "$as_me:2665: error: Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler @@ -2663,13 +2696,13 @@ if test "$cross_compiling" = yes ; then LDCONFIG=: else case "$cf_cv_system_name" in #(vi -freebsd*) #(vi +dragonfly*|freebsd*) #(vi test -z "$LDCONFIG" && LDCONFIG="/sbin/ldconfig -R" ;; *) LDPATH=$PATH:/sbin:/usr/sbin # Extract the first word of "ldconfig", so it can be a program name with args. set dummy ldconfig; ac_word=$2 -echo "$as_me:2672: checking for $ac_word" >&5 +echo "$as_me:2705: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LDCONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2686,7 +2719,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_LDCONFIG="$ac_dir/$ac_word" - echo "$as_me:2689: found $ac_dir/$ac_word" >&5 + echo "$as_me:2722: found $ac_dir/$ac_word" >&5 break fi done @@ -2697,10 +2730,10 @@ fi LDCONFIG=$ac_cv_path_LDCONFIG if test -n "$LDCONFIG"; then - echo "$as_me:2700: result: $LDCONFIG" >&5 + echo "$as_me:2733: result: $LDCONFIG" >&5 echo "${ECHO_T}$LDCONFIG" >&6 else - echo "$as_me:2703: result: no" >&5 + echo "$as_me:2736: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2708,7 +2741,7 @@ fi esac fi -echo "$as_me:2711: checking if you want to ensure bool is consistent with C++" >&5 +echo "$as_me:2744: checking if you want to ensure bool is consistent with C++" >&5 echo $ECHO_N "checking if you want to ensure bool is consistent with C++... $ECHO_C" >&6 # Check whether --with-cxx or --without-cxx was given. @@ -2718,7 +2751,7 @@ if test "${with_cxx+set}" = set; then else cf_with_cxx=yes fi; -echo "$as_me:2721: result: $cf_with_cxx" >&5 +echo "$as_me:2754: result: $cf_with_cxx" >&5 echo "${ECHO_T}$cf_with_cxx" >&6 if test "X$cf_with_cxx" = Xno ; then CXX="" @@ -2736,7 +2769,7 @@ if test -n "$ac_tool_prefix"; then do # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. set dummy $ac_tool_prefix$ac_prog; ac_word=$2 -echo "$as_me:2739: checking for $ac_word" >&5 +echo "$as_me:2772: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2751,7 +2784,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CXX="$ac_tool_prefix$ac_prog" -echo "$as_me:2754: found $ac_dir/$ac_word" >&5 +echo "$as_me:2787: found $ac_dir/$ac_word" >&5 break done @@ -2759,10 +2792,10 @@ fi fi CXX=$ac_cv_prog_CXX if test -n "$CXX"; then - echo "$as_me:2762: result: $CXX" >&5 + echo "$as_me:2795: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:2765: result: no" >&5 + echo "$as_me:2798: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2775,7 +2808,7 @@ if test -z "$CXX"; then do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:2778: checking for $ac_word" >&5 +echo "$as_me:2811: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -2790,7 +2823,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CXX="$ac_prog" -echo "$as_me:2793: found $ac_dir/$ac_word" >&5 +echo "$as_me:2826: found $ac_dir/$ac_word" >&5 break done @@ -2798,10 +2831,10 @@ fi fi ac_ct_CXX=$ac_cv_prog_ac_ct_CXX if test -n "$ac_ct_CXX"; then - echo "$as_me:2801: result: $ac_ct_CXX" >&5 + echo "$as_me:2834: result: $ac_ct_CXX" >&5 echo "${ECHO_T}$ac_ct_CXX" >&6 else - echo "$as_me:2804: result: no" >&5 + echo "$as_me:2837: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -2813,32 +2846,32 @@ test -n "$ac_ct_CXX" || ac_ct_CXX="g++" fi # Provide some information about the compiler. -echo "$as_me:2816:" \ +echo "$as_me:2849:" \ "checking for C++ compiler version" >&5 ac_compiler=`set X $ac_compile; echo $2` -{ (eval echo "$as_me:2819: \"$ac_compiler --version &5\"") >&5 +{ (eval echo "$as_me:2852: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? - echo "$as_me:2822: \$? = $ac_status" >&5 + echo "$as_me:2855: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2824: \"$ac_compiler -v &5\"") >&5 +{ (eval echo "$as_me:2857: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? - echo "$as_me:2827: \$? = $ac_status" >&5 + echo "$as_me:2860: \$? = $ac_status" >&5 (exit $ac_status); } -{ (eval echo "$as_me:2829: \"$ac_compiler -V &5\"") >&5 +{ (eval echo "$as_me:2862: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? - echo "$as_me:2832: \$? = $ac_status" >&5 + echo "$as_me:2865: \$? = $ac_status" >&5 (exit $ac_status); } -echo "$as_me:2835: checking whether we are using the GNU C++ compiler" >&5 +echo "$as_me:2868: checking whether we are using the GNU C++ compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C++ compiler... $ECHO_C" >&6 if test "${ac_cv_cxx_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2841 "configure" +#line 2874 "configure" #include "confdefs.h" int @@ -2853,16 +2886,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2856: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2889: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2859: \$? = $ac_status" >&5 + echo "$as_me:2892: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2862: \"$ac_try\"") >&5 + { (eval echo "$as_me:2895: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2865: \$? = $ac_status" >&5 + echo "$as_me:2898: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_compiler_gnu=yes else @@ -2874,19 +2907,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext ac_cv_cxx_compiler_gnu=$ac_compiler_gnu fi -echo "$as_me:2877: result: $ac_cv_cxx_compiler_gnu" >&5 +echo "$as_me:2910: result: $ac_cv_cxx_compiler_gnu" >&5 echo "${ECHO_T}$ac_cv_cxx_compiler_gnu" >&6 GXX=`test $ac_compiler_gnu = yes && echo yes` ac_test_CXXFLAGS=${CXXFLAGS+set} ac_save_CXXFLAGS=$CXXFLAGS CXXFLAGS="-g" -echo "$as_me:2883: checking whether $CXX accepts -g" >&5 +echo "$as_me:2916: checking whether $CXX accepts -g" >&5 echo $ECHO_N "checking whether $CXX accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cxx_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 2889 "configure" +#line 2922 "configure" #include "confdefs.h" int @@ -2898,16 +2931,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2901: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2934: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2904: \$? = $ac_status" >&5 + echo "$as_me:2937: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2907: \"$ac_try\"") >&5 + { (eval echo "$as_me:2940: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2910: \$? = $ac_status" >&5 + echo "$as_me:2943: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cxx_g=yes else @@ -2917,7 +2950,7 @@ ac_cv_prog_cxx_g=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:2920: result: $ac_cv_prog_cxx_g" >&5 +echo "$as_me:2953: result: $ac_cv_prog_cxx_g" >&5 echo "${ECHO_T}$ac_cv_prog_cxx_g" >&6 if test "$ac_test_CXXFLAGS" = set; then CXXFLAGS=$ac_save_CXXFLAGS @@ -2944,7 +2977,7 @@ for ac_declaration in \ 'void exit (int);' do cat >conftest.$ac_ext <<_ACEOF -#line 2947 "configure" +#line 2980 "configure" #include "confdefs.h" #include $ac_declaration @@ -2957,16 +2990,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2960: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:2993: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2963: \$? = $ac_status" >&5 + echo "$as_me:2996: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2966: \"$ac_try\"") >&5 + { (eval echo "$as_me:2999: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:2969: \$? = $ac_status" >&5 + echo "$as_me:3002: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -2976,7 +3009,7 @@ continue fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 2979 "configure" +#line 3012 "configure" #include "confdefs.h" $ac_declaration int @@ -2988,16 +3021,16 @@ exit (42); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:2991: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:3024: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:2994: \$? = $ac_status" >&5 + echo "$as_me:3027: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:2997: \"$ac_try\"") >&5 + { (eval echo "$as_me:3030: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:3000: \$? = $ac_status" >&5 + echo "$as_me:3033: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -3006,7 +3039,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done -rm -f conftest* +rm -rf conftest* if test -n "$ac_declaration"; then echo '#ifdef __cplusplus' >>confdefs.h echo $ac_declaration >>confdefs.h @@ -3024,7 +3057,7 @@ ac_main_return=return if test "$CXX" = "g++" ; then # Extract the first word of "g++", so it can be a program name with args. set dummy g++; ac_word=$2 -echo "$as_me:3027: checking for $ac_word" >&5 +echo "$as_me:3060: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_CXX+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3041,7 +3074,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_CXX="$ac_dir/$ac_word" - echo "$as_me:3044: found $ac_dir/$ac_word" >&5 + echo "$as_me:3077: found $ac_dir/$ac_word" >&5 break fi done @@ -3052,16 +3085,16 @@ fi CXX=$ac_cv_path_CXX if test -n "$CXX"; then - echo "$as_me:3055: result: $CXX" >&5 + echo "$as_me:3088: result: $CXX" >&5 echo "${ECHO_T}$CXX" >&6 else - echo "$as_me:3058: result: no" >&5 + echo "$as_me:3091: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test "$CXX" = "g++" ; then - { echo "$as_me:3064: WARNING: ignoring hardcoded g++" >&5 + { echo "$as_me:3097: WARNING: ignoring hardcoded g++" >&5 echo "$as_me: WARNING: ignoring hardcoded g++" >&2;} cf_with_cxx=no; CXX=""; GXX=""; fi @@ -3069,11 +3102,11 @@ fi GXX_VERSION=none if test "$GXX" = yes; then - echo "$as_me:3072: checking version of g++" >&5 + echo "$as_me:3105: checking version of g++" >&5 echo $ECHO_N "checking version of g++... $ECHO_C" >&6 - GXX_VERSION="`${CXX-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" + GXX_VERSION="`${CXX:-g++} --version| sed -e '2,$d' -e 's/^.*(GCC) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GXX_VERSION" && GXX_VERSION=unknown - echo "$as_me:3076: result: $GXX_VERSION" >&5 + echo "$as_me:3109: result: $GXX_VERSION" >&5 echo "${ECHO_T}$GXX_VERSION" >&6 fi @@ -3081,12 +3114,12 @@ case $GXX_VERSION in 1*|2.[0-6]*) # GXX=""; CXX=""; ac_cv_prog_gxx=no # cf_cxx_library=no - { echo "$as_me:3084: WARNING: templates do not work" >&5 + { echo "$as_me:3117: WARNING: templates do not work" >&5 echo "$as_me: WARNING: templates do not work" >&2;} ;; esac -echo "$as_me:3089: checking if you want to build C++ binding and demo" >&5 +echo "$as_me:3122: checking if you want to build C++ binding and demo" >&5 echo $ECHO_N "checking if you want to build C++ binding and demo... $ECHO_C" >&6 # Check whether --with-cxx-binding or --without-cxx-binding was given. @@ -3096,10 +3129,10 @@ if test "${with_cxx_binding+set}" = set; then else cf_with_cxx_binding=$cf_with_cxx fi; -echo "$as_me:3099: result: $cf_with_cxx_binding" >&5 +echo "$as_me:3132: result: $cf_with_cxx_binding" >&5 echo "${ECHO_T}$cf_with_cxx_binding" >&6 -echo "$as_me:3102: checking if you want to build with Ada95" >&5 +echo "$as_me:3135: checking if you want to build with Ada95" >&5 echo $ECHO_N "checking if you want to build with Ada95... $ECHO_C" >&6 # Check whether --with-ada or --without-ada was given. @@ -3109,10 +3142,23 @@ if test "${with_ada+set}" = set; then else cf_with_ada=yes fi; -echo "$as_me:3112: result: $cf_with_ada" >&5 +echo "$as_me:3145: result: $cf_with_ada" >&5 echo "${ECHO_T}$cf_with_ada" >&6 -echo "$as_me:3115: checking if you want to build programs such as tic" >&5 +echo "$as_me:3148: checking if you want to install manpages" >&5 +echo $ECHO_N "checking if you want to install manpages... $ECHO_C" >&6 + +# Check whether --with-manpages or --without-manpages was given. +if test "${with_manpages+set}" = set; then + withval="$with_manpages" + cf_with_manpages=$withval +else + cf_with_manpages=yes +fi; +echo "$as_me:3158: result: $cf_with_manpages" >&5 +echo "${ECHO_T}$cf_with_manpages" >&6 + +echo "$as_me:3161: checking if you want to build programs such as tic" >&5 echo $ECHO_N "checking if you want to build programs such as tic... $ECHO_C" >&6 # Check whether --with-progs or --without-progs was given. @@ -3122,10 +3168,23 @@ if test "${with_progs+set}" = set; then else cf_with_progs=yes fi; -echo "$as_me:3125: result: $cf_with_progs" >&5 +echo "$as_me:3171: result: $cf_with_progs" >&5 echo "${ECHO_T}$cf_with_progs" >&6 -echo "$as_me:3128: checking if you wish to install curses.h" >&5 +echo "$as_me:3174: checking if you want to build test-programs" >&5 +echo $ECHO_N "checking if you want to build test-programs... $ECHO_C" >&6 + +# Check whether --with-tests or --without-tests was given. +if test "${with_tests+set}" = set; then + withval="$with_tests" + cf_with_tests=$withval +else + cf_with_tests=yes +fi; +echo "$as_me:3184: result: $cf_with_tests" >&5 +echo "${ECHO_T}$cf_with_tests" >&6 + +echo "$as_me:3187: checking if you wish to install curses.h" >&5 echo $ECHO_N "checking if you wish to install curses.h... $ECHO_C" >&6 # Check whether --with-curses-h or --without-curses-h was given. @@ -3135,7 +3194,7 @@ if test "${with_curses_h+set}" = set; then else with_curses_h=yes fi; -echo "$as_me:3138: result: $with_curses_h" >&5 +echo "$as_me:3197: result: $with_curses_h" >&5 echo "${ECHO_T}$with_curses_h" >&6 modules_to_build="ncurses" @@ -3161,7 +3220,7 @@ for ac_prog in mawk gawk nawk awk do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:3164: checking for $ac_word" >&5 +echo "$as_me:3223: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AWK+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3176,7 +3235,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AWK="$ac_prog" -echo "$as_me:3179: found $ac_dir/$ac_word" >&5 +echo "$as_me:3238: found $ac_dir/$ac_word" >&5 break done @@ -3184,21 +3243,21 @@ fi fi AWK=$ac_cv_prog_AWK if test -n "$AWK"; then - echo "$as_me:3187: result: $AWK" >&5 + echo "$as_me:3246: result: $AWK" >&5 echo "${ECHO_T}$AWK" >&6 else - echo "$as_me:3190: result: no" >&5 + echo "$as_me:3249: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$AWK" && break done -test -z "$AWK" && { { echo "$as_me:3197: error: No awk program found" >&5 +test -z "$AWK" && { { echo "$as_me:3256: error: No awk program found" >&5 echo "$as_me: error: No awk program found" >&2;} { (exit 1); exit 1; }; } -echo "$as_me:3201: checking for egrep" >&5 +echo "$as_me:3260: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_prog_egrep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3208,11 +3267,11 @@ else else ac_cv_prog_egrep='egrep' fi fi -echo "$as_me:3211: result: $ac_cv_prog_egrep" >&5 +echo "$as_me:3270: result: $ac_cv_prog_egrep" >&5 echo "${ECHO_T}$ac_cv_prog_egrep" >&6 EGREP=$ac_cv_prog_egrep -test -z "$EGREP" && { { echo "$as_me:3215: error: No egrep program found" >&5 +test -z "$EGREP" && { { echo "$as_me:3274: error: No egrep program found" >&5 echo "$as_me: error: No egrep program found" >&2;} { (exit 1); exit 1; }; } @@ -3228,7 +3287,7 @@ echo "$as_me: error: No egrep program found" >&2;} # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. -echo "$as_me:3231: checking for a BSD compatible install" >&5 +echo "$as_me:3290: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then @@ -3277,7 +3336,7 @@ fi INSTALL=$ac_install_sh fi fi -echo "$as_me:3280: result: $INSTALL" >&5 +echo "$as_me:3339: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. @@ -3298,11 +3357,11 @@ case $INSTALL in ;; esac -for ac_prog in tdlint lint alint +for ac_prog in tdlint lint alint splint lclint do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:3305: checking for $ac_word" >&5 +echo "$as_me:3364: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3317,7 +3376,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LINT="$ac_prog" -echo "$as_me:3320: found $ac_dir/$ac_word" >&5 +echo "$as_me:3379: found $ac_dir/$ac_word" >&5 break done @@ -3325,28 +3384,45 @@ fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then - echo "$as_me:3328: result: $LINT" >&5 + echo "$as_me:3387: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else - echo "$as_me:3331: result: no" >&5 + echo "$as_me:3390: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done -echo "$as_me:3338: checking whether ln -s works" >&5 +echo "$as_me:3397: checking whether ln -s works" >&5 echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 LN_S=$as_ln_s if test "$LN_S" = "ln -s"; then - echo "$as_me:3342: result: yes" >&5 + echo "$as_me:3401: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:3345: result: no, using $LN_S" >&5 + echo "$as_me:3404: result: no, using $LN_S" >&5 echo "${ECHO_T}no, using $LN_S" >&6 fi -echo "$as_me:3349: checking for long file names" >&5 +echo "$as_me:3408: checking if $LN_S -f options work" >&5 +echo $ECHO_N "checking if $LN_S -f options work... $ECHO_C" >&6 + +rm -f conf$$.src conf$$dst +echo >conf$$.dst +echo first >conf$$.src +if $LN_S -f conf$$.src conf$$.dst 2>/dev/null; then + cf_prog_ln_sf=yes +else + cf_prog_ln_sf=no +fi +rm -f conf$$.dst conf$$src +echo "$as_me:3420: result: $cf_prog_ln_sf" >&5 +echo "${ECHO_T}$cf_prog_ln_sf" >&6 + +test "$cf_prog_ln_sf" = yes && LN_S="$LN_S -f" + +echo "$as_me:3425: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3385,7 +3461,7 @@ for ac_dir in . $ac_tmpdirs `eval echo $prefix/lib $exec_prefix/lib` ; do rm -rf $ac_xdir 2>/dev/null done fi -echo "$as_me:3388: result: $ac_cv_sys_long_file_names" >&5 +echo "$as_me:3464: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test $ac_cv_sys_long_file_names = yes; then @@ -3395,7 +3471,182 @@ EOF fi -echo "$as_me:3398: checking if we should assume mixed-case filenames" >&5 +# if we find pkg-config, check if we should install the ".pc" files. + +echo "$as_me:3476: checking if you want to use pkg-config" >&5 +echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6 + +# Check whether --with-pkg-config or --without-pkg-config was given. +if test "${with_pkg_config+set}" = set; then + withval="$with_pkg_config" + cf_pkg_config=$withval +else + cf_pkg_config=yes +fi; +echo "$as_me:3486: result: $cf_pkg_config" >&5 +echo "${ECHO_T}$cf_pkg_config" >&6 + +case $cf_pkg_config in #(vi +no) #(vi + PKG_CONFIG=none + ;; +yes) #(vi + if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. +set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 +echo "$as_me:3497: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" + echo "$as_me:3514: found $ac_dir/$ac_word" >&5 + break +fi +done + + ;; +esac +fi +PKG_CONFIG=$ac_cv_path_PKG_CONFIG + +if test -n "$PKG_CONFIG"; then + echo "$as_me:3525: result: $PKG_CONFIG" >&5 +echo "${ECHO_T}$PKG_CONFIG" >&6 +else + echo "$as_me:3528: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_path_PKG_CONFIG"; then + ac_pt_PKG_CONFIG=$PKG_CONFIG + # Extract the first word of "pkg-config", so it can be a program name with args. +set dummy pkg-config; ac_word=$2 +echo "$as_me:3537: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $ac_pt_PKG_CONFIG in + [\\/]* | ?:[\\/]*) + ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word" + echo "$as_me:3554: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" + ;; +esac +fi +ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG + +if test -n "$ac_pt_PKG_CONFIG"; then + echo "$as_me:3566: result: $ac_pt_PKG_CONFIG" >&5 +echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 +else + echo "$as_me:3569: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + PKG_CONFIG=$ac_pt_PKG_CONFIG +else + PKG_CONFIG="$ac_cv_path_PKG_CONFIG" +fi + + ;; +*) + PKG_CONFIG=$withval + ;; +esac + +test -z "$PKG_CONFIG" && PKG_CONFIG=none +if test "$PKG_CONFIG" != none ; then + +if test "x$prefix" != xNONE; then + cf_path_syntax="$prefix" +else + cf_path_syntax="$ac_default_prefix" +fi + +case ".$PKG_CONFIG" in #(vi +.\$\(*\)*|.\'*\'*) #(vi + ;; +..|./*|.\\*) #(vi + ;; +.[a-zA-Z]:[\\/]*) #(vi OS/2 EMX + ;; +.\${*prefix}*) #(vi + eval PKG_CONFIG="$PKG_CONFIG" + case ".$PKG_CONFIG" in #(vi + .NONE/*) + PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` + ;; + esac + ;; #(vi +.no|.NONE/*) + PKG_CONFIG=`echo $PKG_CONFIG | sed -e s%NONE%$cf_path_syntax%` + ;; +*) + { { echo "$as_me:3612: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 +echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} + { (exit 1); exit 1; }; } + ;; +esac + +fi + +if test "$PKG_CONFIG" != no ; then + echo "$as_me:3621: checking if we should install .pc files for $PKG_CONFIG" >&5 +echo $ECHO_N "checking if we should install .pc files for $PKG_CONFIG... $ECHO_C" >&6 + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[^/]*/[^/]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + +# Check whether --enable-pc-files or --disable-pc-files was given. +if test "${enable_pc_files+set}" = set; then + enableval="$enable_pc_files" + enable_pc_files=$enableval +else + enable_pc_files=no +fi; + echo "$as_me:3638: result: $enable_pc_files" >&5 +echo "${ECHO_T}$enable_pc_files" >&6 + else + echo "$as_me:3641: result: no" >&5 +echo "${ECHO_T}no" >&6 + { echo "$as_me:3643: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&5 +echo "$as_me: WARNING: did not find library $PKG_CONFIG_LIBDIR" >&2;} + enable_pc_files=no + fi +fi + +echo "$as_me:3649: checking if we should assume mixed-case filenames" >&5 echo $ECHO_N "checking if we should assume mixed-case filenames... $ECHO_C" >&6 # Check whether --enable-mixed-case or --disable-mixed-case was given. @@ -3405,11 +3656,11 @@ if test "${enable_mixed_case+set}" = set; then else enable_mixedcase=auto fi; -echo "$as_me:3408: result: $enable_mixedcase" >&5 +echo "$as_me:3659: result: $enable_mixedcase" >&5 echo "${ECHO_T}$enable_mixedcase" >&6 if test "$enable_mixedcase" = "auto" ; then -echo "$as_me:3412: checking if filesystem supports mixed-case filenames" >&5 +echo "$as_me:3663: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3436,7 +3687,7 @@ else fi fi -echo "$as_me:3439: result: $cf_cv_mixedcase" >&5 +echo "$as_me:3690: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 @@ -3453,7 +3704,7 @@ EOF fi # do this after mixed-case option (tags/TAGS is not as important as tic). -echo "$as_me:3456: checking whether ${MAKE-make} sets \${MAKE}" >&5 +echo "$as_me:3707: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then @@ -3473,18 +3724,92 @@ fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then - echo "$as_me:3476: result: yes" >&5 + echo "$as_me:3727: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else - echo "$as_me:3480: result: no" >&5 + echo "$as_me:3731: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi -# Extract the first word of "ctags", so it can be a program name with args. -set dummy ctags; ac_word=$2 -echo "$as_me:3487: checking for $ac_word" >&5 +for ac_prog in exctags ctags +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:3740: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_CTAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$CTAGS"; then + ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_CTAGS="$ac_prog" +echo "$as_me:3755: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +CTAGS=$ac_cv_prog_CTAGS +if test -n "$CTAGS"; then + echo "$as_me:3763: result: $CTAGS" >&5 +echo "${ECHO_T}$CTAGS" >&6 +else + echo "$as_me:3766: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$CTAGS" && break +done + +for ac_prog in exetags etags +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:3777: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ETAGS+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ETAGS"; then + ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ETAGS="$ac_prog" +echo "$as_me:3792: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +ETAGS=$ac_cv_prog_ETAGS +if test -n "$ETAGS"; then + echo "$as_me:3800: result: $ETAGS" >&5 +echo "${ECHO_T}$ETAGS" >&6 +else + echo "$as_me:3803: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$ETAGS" && break +done + +# Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. +set dummy ${CTAGS:-ctags}; ac_word=$2 +echo "$as_me:3812: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3499,7 +3824,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" -echo "$as_me:3502: found $ac_dir/$ac_word" >&5 +echo "$as_me:3827: found $ac_dir/$ac_word" >&5 break done @@ -3508,17 +3833,17 @@ fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then - echo "$as_me:3511: result: $MAKE_LOWER_TAGS" >&5 + echo "$as_me:3836: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else - echo "$as_me:3514: result: no" >&5 + echo "$as_me:3839: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then - # Extract the first word of "etags", so it can be a program name with args. -set dummy etags; ac_word=$2 -echo "$as_me:3521: checking for $ac_word" >&5 + # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. +set dummy ${ETAGS:-etags}; ac_word=$2 +echo "$as_me:3846: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3533,7 +3858,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" -echo "$as_me:3536: found $ac_dir/$ac_word" >&5 +echo "$as_me:3861: found $ac_dir/$ac_word" >&5 break done @@ -3542,10 +3867,10 @@ fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then - echo "$as_me:3545: result: $MAKE_UPPER_TAGS" >&5 + echo "$as_me:3870: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else - echo "$as_me:3548: result: no" >&5 + echo "$as_me:3873: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3565,7 +3890,7 @@ else MAKE_LOWER_TAGS="#" fi -echo "$as_me:3568: checking for makeflags variable" >&5 +echo "$as_me:3893: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3579,10 +3904,10 @@ SHELL = /bin/sh all : @ echo '.$cf_option' CF_EOF - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp 2>/dev/null | sed -e 's,[ ]*$,,'` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp 2>/dev/null | fgrep -v "ing directory" | sed -e 's,[ ]*$,,'` case "$cf_result" in .*k) - cf_result=`${MAKE-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` + cf_result=`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null` case "$cf_result" in .*CC=*) cf_cv_makeflags= ;; @@ -3599,13 +3924,13 @@ CF_EOF rm -f cf_makeflags.tmp fi -echo "$as_me:3602: result: $cf_cv_makeflags" >&5 +echo "$as_me:3927: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 -echo "$as_me:3608: checking for $ac_word" >&5 +echo "$as_me:3933: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3620,7 +3945,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib" -echo "$as_me:3623: found $ac_dir/$ac_word" >&5 +echo "$as_me:3948: found $ac_dir/$ac_word" >&5 break done @@ -3628,10 +3953,10 @@ fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then - echo "$as_me:3631: result: $RANLIB" >&5 + echo "$as_me:3956: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else - echo "$as_me:3634: result: no" >&5 + echo "$as_me:3959: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3640,7 +3965,7 @@ if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 -echo "$as_me:3643: checking for $ac_word" >&5 +echo "$as_me:3968: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3655,7 +3980,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_RANLIB="ranlib" -echo "$as_me:3658: found $ac_dir/$ac_word" >&5 +echo "$as_me:3983: found $ac_dir/$ac_word" >&5 break done @@ -3664,10 +3989,10 @@ fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then - echo "$as_me:3667: result: $ac_ct_RANLIB" >&5 + echo "$as_me:3992: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else - echo "$as_me:3670: result: no" >&5 + echo "$as_me:3995: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3679,7 +4004,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 -echo "$as_me:3682: checking for $ac_word" >&5 +echo "$as_me:4007: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3694,7 +4019,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LD="${ac_tool_prefix}ld" -echo "$as_me:3697: found $ac_dir/$ac_word" >&5 +echo "$as_me:4022: found $ac_dir/$ac_word" >&5 break done @@ -3702,10 +4027,10 @@ fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then - echo "$as_me:3705: result: $LD" >&5 + echo "$as_me:4030: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else - echo "$as_me:3708: result: no" >&5 + echo "$as_me:4033: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3714,7 +4039,7 @@ if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 -echo "$as_me:3717: checking for $ac_word" >&5 +echo "$as_me:4042: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3729,7 +4054,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_LD="ld" -echo "$as_me:3732: found $ac_dir/$ac_word" >&5 +echo "$as_me:4057: found $ac_dir/$ac_word" >&5 break done @@ -3738,10 +4063,10 @@ fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then - echo "$as_me:3741: result: $ac_ct_LD" >&5 + echo "$as_me:4066: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else - echo "$as_me:3744: result: no" >&5 + echo "$as_me:4069: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3753,7 +4078,7 @@ fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 -echo "$as_me:3756: checking for $ac_word" >&5 +echo "$as_me:4081: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3768,7 +4093,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AR="${ac_tool_prefix}ar" -echo "$as_me:3771: found $ac_dir/$ac_word" >&5 +echo "$as_me:4096: found $ac_dir/$ac_word" >&5 break done @@ -3776,10 +4101,10 @@ fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then - echo "$as_me:3779: result: $AR" >&5 + echo "$as_me:4104: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else - echo "$as_me:3782: result: no" >&5 + echo "$as_me:4107: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3788,7 +4113,7 @@ if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 -echo "$as_me:3791: checking for $ac_word" >&5 +echo "$as_me:4116: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3803,7 +4128,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_AR="ar" -echo "$as_me:3806: found $ac_dir/$ac_word" >&5 +echo "$as_me:4131: found $ac_dir/$ac_word" >&5 break done @@ -3812,10 +4137,10 @@ fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then - echo "$as_me:3815: result: $ac_ct_AR" >&5 + echo "$as_me:4140: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else - echo "$as_me:3818: result: no" >&5 + echo "$as_me:4143: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3824,25 +4149,140 @@ else AR="$ac_cv_prog_AR" fi -if test "${cf_cv_subst_AR_OPTS+set}" = set; then +if test -n "$ac_tool_prefix"; then + # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. +set dummy ${ac_tool_prefix}ar; ac_word=$2 +echo "$as_me:4155: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$AR"; then + ac_cv_prog_AR="$AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_AR="${ac_tool_prefix}ar" +echo "$as_me:4170: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +AR=$ac_cv_prog_AR +if test -n "$AR"; then + echo "$as_me:4178: result: $AR" >&5 +echo "${ECHO_T}$AR" >&6 +else + echo "$as_me:4181: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +fi +if test -z "$ac_cv_prog_AR"; then + ac_ct_AR=$AR + # Extract the first word of "ar", so it can be a program name with args. +set dummy ar; ac_word=$2 +echo "$as_me:4190: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_ac_ct_AR+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$ac_ct_AR"; then + ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_ac_ct_AR="ar" +echo "$as_me:4205: found $ac_dir/$ac_word" >&5 +break +done + + test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" +fi +fi +ac_ct_AR=$ac_cv_prog_ac_ct_AR +if test -n "$ac_ct_AR"; then + echo "$as_me:4214: result: $ac_ct_AR" >&5 +echo "${ECHO_T}$ac_ct_AR" >&6 +else + echo "$as_me:4217: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + AR=$ac_ct_AR +else + AR="$ac_cv_prog_AR" +fi + +echo "$as_me:4226: checking for options to update archives" >&5 +echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 +if test "${cf_cv_ar_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "$as_me:3831: checking for archiver options (symbol AR_OPTS)" >&5 -echo $ECHO_N "checking for archiver options (symbol AR_OPTS)... $ECHO_C" >&6 + cf_cv_ar_flags=unknown + for cf_ar_flags in -curv curv -crv crv -cqv cqv -rv rv + do -if test -z "$AR_OPTS" ; then - AR_OPTS=rv + # check if $ARFLAGS already contains this choice + if test "x$ARFLAGS" != "x" ; then + cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` + if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then + cf_cv_ar_flags= + break + fi + fi + + rm -f conftest.$ac_cv_objext + rm -f conftest.a + + cat >conftest.$ac_ext <&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:4255: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 + $AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext 2>&5 1>/dev/null + if test -f conftest.a ; then + cf_cv_ar_flags=$cf_ar_flags + break + fi + else + test -n "$verbose" && echo " cannot compile test-program" 1>&6 + +echo "${as_me:-configure}:4266: testing cannot compile test-program ..." 1>&5 + + break + fi + done + rm -f conftest.a conftest.$ac_ext conftest.$ac_cv_objext fi +echo "$as_me:4274: result: $cf_cv_ar_flags" >&5 +echo "${ECHO_T}$cf_cv_ar_flags" >&6 -cf_cv_subst_AR_OPTS=$AR_OPTS -echo "$as_me:3840: result: $AR_OPTS" >&5 -echo "${ECHO_T}$AR_OPTS" >&6 - +if test -n "$ARFLAGS" ; then + if test -n "$cf_cv_ar_flags" ; then + ARFLAGS="$ARFLAGS $cf_cv_ar_flags" + fi +else + ARFLAGS=$cf_cv_ar_flags fi -echo "$as_me:3845: checking if you have specified an install-prefix" >&5 +echo "$as_me:4285: checking if you have specified an install-prefix" >&5 echo $ECHO_N "checking if you have specified an install-prefix... $ECHO_C" >&6 # Check whether --with-install-prefix or --without-install-prefix was given. @@ -3855,7 +4295,7 @@ if test "${with_install_prefix+set}" = set; then ;; esac fi; -echo "$as_me:3858: result: $DESTDIR" >&5 +echo "$as_me:4298: result: $DESTDIR" >&5 echo "${ECHO_T}$DESTDIR" >&6 ############################################################################### @@ -3883,7 +4323,7 @@ else do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 -echo "$as_me:3886: checking for $ac_word" >&5 +echo "$as_me:4326: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_BUILD_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -3898,7 +4338,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_BUILD_CC="$ac_prog" -echo "$as_me:3901: found $ac_dir/$ac_word" >&5 +echo "$as_me:4341: found $ac_dir/$ac_word" >&5 break done @@ -3906,10 +4346,10 @@ fi fi BUILD_CC=$ac_cv_prog_BUILD_CC if test -n "$BUILD_CC"; then - echo "$as_me:3909: result: $BUILD_CC" >&5 + echo "$as_me:4349: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 else - echo "$as_me:3912: result: no" >&5 + echo "$as_me:4352: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -3917,12 +4357,12 @@ fi done fi; - echo "$as_me:3920: checking for native build C compiler" >&5 + echo "$as_me:4360: checking for native build C compiler" >&5 echo $ECHO_N "checking for native build C compiler... $ECHO_C" >&6 - echo "$as_me:3922: result: $BUILD_CC" >&5 + echo "$as_me:4362: result: $BUILD_CC" >&5 echo "${ECHO_T}$BUILD_CC" >&6 - echo "$as_me:3925: checking for native build C preprocessor" >&5 + echo "$as_me:4365: checking for native build C preprocessor" >&5 echo $ECHO_N "checking for native build C preprocessor... $ECHO_C" >&6 # Check whether --with-build-cpp or --without-build-cpp was given. @@ -3932,10 +4372,10 @@ if test "${with_build_cpp+set}" = set; then else BUILD_CPP='${BUILD_CC} -E' fi; - echo "$as_me:3935: result: $BUILD_CPP" >&5 + echo "$as_me:4375: result: $BUILD_CPP" >&5 echo "${ECHO_T}$BUILD_CPP" >&6 - echo "$as_me:3938: checking for native build C flags" >&5 + echo "$as_me:4378: checking for native build C flags" >&5 echo $ECHO_N "checking for native build C flags... $ECHO_C" >&6 # Check whether --with-build-cflags or --without-build-cflags was given. @@ -3943,10 +4383,10 @@ if test "${with_build_cflags+set}" = set; then withval="$with_build_cflags" BUILD_CFLAGS="$withval" fi; - echo "$as_me:3946: result: $BUILD_CFLAGS" >&5 + echo "$as_me:4386: result: $BUILD_CFLAGS" >&5 echo "${ECHO_T}$BUILD_CFLAGS" >&6 - echo "$as_me:3949: checking for native build C preprocessor-flags" >&5 + echo "$as_me:4389: checking for native build C preprocessor-flags" >&5 echo $ECHO_N "checking for native build C preprocessor-flags... $ECHO_C" >&6 # Check whether --with-build-cppflags or --without-build-cppflags was given. @@ -3954,10 +4394,10 @@ if test "${with_build_cppflags+set}" = set; then withval="$with_build_cppflags" BUILD_CPPFLAGS="$withval" fi; - echo "$as_me:3957: result: $BUILD_CPPFLAGS" >&5 + echo "$as_me:4397: result: $BUILD_CPPFLAGS" >&5 echo "${ECHO_T}$BUILD_CPPFLAGS" >&6 - echo "$as_me:3960: checking for native build linker-flags" >&5 + echo "$as_me:4400: checking for native build linker-flags" >&5 echo $ECHO_N "checking for native build linker-flags... $ECHO_C" >&6 # Check whether --with-build-ldflags or --without-build-ldflags was given. @@ -3965,10 +4405,10 @@ if test "${with_build_ldflags+set}" = set; then withval="$with_build_ldflags" BUILD_LDFLAGS="$withval" fi; - echo "$as_me:3968: result: $BUILD_LDFLAGS" >&5 + echo "$as_me:4408: result: $BUILD_LDFLAGS" >&5 echo "${ECHO_T}$BUILD_LDFLAGS" >&6 - echo "$as_me:3971: checking for native build linker-libraries" >&5 + echo "$as_me:4411: checking for native build linker-libraries" >&5 echo $ECHO_N "checking for native build linker-libraries... $ECHO_C" >&6 # Check whether --with-build-libs or --without-build-libs was given. @@ -3976,7 +4416,7 @@ if test "${with_build_libs+set}" = set; then withval="$with_build_libs" BUILD_LIBS="$withval" fi; - echo "$as_me:3979: result: $BUILD_LIBS" >&5 + echo "$as_me:4419: result: $BUILD_LIBS" >&5 echo "${ECHO_T}$BUILD_LIBS" >&6 # this assumes we're on Unix. @@ -3986,7 +4426,7 @@ echo "${ECHO_T}$BUILD_LIBS" >&6 : ${BUILD_CC:='${CC}'} if ( test "$BUILD_CC" = "$CC" || test "$BUILD_CC" = '${CC}' ) ; then - { { echo "$as_me:3989: error: Cross-build requires two compilers. + { { echo "$as_me:4429: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&5 echo "$as_me: error: Cross-build requires two compilers. Use --with-build-cc to specify the native compiler." >&2;} @@ -4011,6 +4451,32 @@ fi ### shared, for example. cf_list_models="" +echo "$as_me:4454: checking if libtool -version-number should be used" >&5 +echo $ECHO_N "checking if libtool -version-number should be used... $ECHO_C" >&6 + +# Check whether --enable-libtool-version or --disable-libtool-version was given. +if test "${enable_libtool_version+set}" = set; then + enableval="$enable_libtool_version" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + cf_libtool_version=no + else + cf_libtool_version=yes + fi +else + enableval=yes + cf_libtool_version=yes + +fi; +echo "$as_me:4471: result: $cf_libtool_version" >&5 +echo "${ECHO_T}$cf_libtool_version" >&6 + +if test "$cf_libtool_version" = yes ; then + LIBTOOL_VERSION="-version-number" +else + LIBTOOL_VERSION="-version-info" +fi + LIBTOOL= # common library maintenance symbols that are convenient for libtool scripts: @@ -4027,7 +4493,7 @@ LIB_LINK='${CC}' LIB_INSTALL= LIB_UNINSTALL= -echo "$as_me:4030: checking if you want to build libraries with libtool" >&5 +echo "$as_me:4496: checking if you want to build libraries with libtool" >&5 echo $ECHO_N "checking if you want to build libraries with libtool... $ECHO_C" >&6 # Check whether --with-libtool or --without-libtool was given. @@ -4037,11 +4503,11 @@ if test "${with_libtool+set}" = set; then else with_libtool=no fi; -echo "$as_me:4040: result: $with_libtool" >&5 +echo "$as_me:4506: result: $with_libtool" >&5 echo "${ECHO_T}$with_libtool" >&6 if test "$with_libtool" != "no"; then - if test "$with_libtool" != "yes" ; then + if test "$with_libtool" != "yes" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -4068,7 +4534,7 @@ case ".$with_libtool" in #(vi with_libtool=`echo $with_libtool | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:4071: error: expected a pathname, not \"$with_libtool\"" >&5 + { { echo "$as_me:4537: error: expected a pathname, not \"$with_libtool\"" >&5 echo "$as_me: error: expected a pathname, not \"$with_libtool\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -4076,9 +4542,9 @@ esac LIBTOOL=$with_libtool else - # Extract the first word of "libtool", so it can be a program name with args. + # Extract the first word of "libtool", so it can be a program name with args. set dummy libtool; ac_word=$2 -echo "$as_me:4081: checking for $ac_word" >&5 +echo "$as_me:4547: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_LIBTOOL+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4095,7 +4561,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_LIBTOOL="$ac_dir/$ac_word" - echo "$as_me:4098: found $ac_dir/$ac_word" >&5 + echo "$as_me:4564: found $ac_dir/$ac_word" >&5 break fi done @@ -4106,20 +4572,20 @@ fi LIBTOOL=$ac_cv_path_LIBTOOL if test -n "$LIBTOOL"; then - echo "$as_me:4109: result: $LIBTOOL" >&5 + echo "$as_me:4575: result: $LIBTOOL" >&5 echo "${ECHO_T}$LIBTOOL" >&6 else - echo "$as_me:4112: result: no" >&5 + echo "$as_me:4578: result: no" >&5 echo "${ECHO_T}no" >&6 fi - fi - if test -z "$LIBTOOL" ; then - { { echo "$as_me:4118: error: Cannot find libtool" >&5 + fi + if test -z "$LIBTOOL" ; then + { { echo "$as_me:4584: error: Cannot find libtool" >&5 echo "$as_me: error: Cannot find libtool" >&2;} { (exit 1); exit 1; }; } - fi - LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} -version-info `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} -o' + fi + LIB_CREATE='${LIBTOOL} --mode=link ${CC} -rpath ${DESTDIR}${libdir} ${LIBTOOL_VERSION} `cut -f1 ${srcdir}/VERSION` ${LIBTOOL_OPTS} ${LT_UNDEF} -o' LIB_OBJECT='${OBJECTS:.o=.lo}' LIB_SUFFIX=.la LIB_CLEAN='${LIBTOOL} --mode=clean' @@ -4130,24 +4596,32 @@ echo "$as_me: error: Cannot find libtool" >&2;} LIB_PREP=: # Show the version of libtool - echo "$as_me:4133: checking version of libtool" >&5 + echo "$as_me:4599: checking version of libtool" >&5 echo $ECHO_N "checking version of libtool... $ECHO_C" >&6 # Save the version in a cache variable - this is not entirely a good # thing, but the version string from libtool is very ugly, and for - # bug reports it might be useful to have the original string. + # bug reports it might be useful to have the original string. "(" cf_cv_libtool_version=`$LIBTOOL --version 2>&1 | sed -e '/^$/d' |sed -e '2,$d' -e 's/([^)]*)//g' -e 's/^[^1-9]*//' -e 's/[^0-9.].*//'` - echo "$as_me:4140: result: $cf_cv_libtool_version" >&5 + echo "$as_me:4606: result: $cf_cv_libtool_version" >&5 echo "${ECHO_T}$cf_cv_libtool_version" >&6 if test -z "$cf_cv_libtool_version" ; then - { { echo "$as_me:4143: error: This is not GNU libtool" >&5 + { { echo "$as_me:4609: error: This is not GNU libtool" >&5 echo "$as_me: error: This is not GNU libtool" >&2;} { (exit 1); exit 1; }; } fi + # special hack to add -no-undefined (which libtool should do for itself) + LT_UNDEF= + case "$cf_cv_system_name" in #(vi + cygwin*|mingw32*|uwin*|aix[456]) #(vi + LT_UNDEF=-no-undefined + ;; + esac + # special hack to add --tag option for C++ compiler - case $cf_cv_libtool_version in - 1.[5-9]*|[2-9]*) + case $cf_cv_libtool_version in #(vi + 1.[5-9]*|[2-9].[0-9.a-z]*) #(vi LIBTOOL_CXX="$LIBTOOL --tag=CXX" LIBTOOL="$LIBTOOL --tag=CC" ;; @@ -4168,7 +4642,7 @@ cf_list_models="$cf_list_models libtool" else -echo "$as_me:4171: checking if you want to build shared libraries" >&5 +echo "$as_me:4645: checking if you want to build shared libraries" >&5 echo $ECHO_N "checking if you want to build shared libraries... $ECHO_C" >&6 # Check whether --with-shared or --without-shared was given. @@ -4178,11 +4652,11 @@ if test "${with_shared+set}" = set; then else with_shared=no fi; -echo "$as_me:4181: result: $with_shared" >&5 +echo "$as_me:4655: result: $with_shared" >&5 echo "${ECHO_T}$with_shared" >&6 test "$with_shared" = "yes" && cf_list_models="$cf_list_models shared" -echo "$as_me:4185: checking if you want to build static libraries" >&5 +echo "$as_me:4659: checking if you want to build static libraries" >&5 echo $ECHO_N "checking if you want to build static libraries... $ECHO_C" >&6 # Check whether --with-normal or --without-normal was given. @@ -4192,11 +4666,11 @@ if test "${with_normal+set}" = set; then else with_normal=yes fi; -echo "$as_me:4195: result: $with_normal" >&5 +echo "$as_me:4669: result: $with_normal" >&5 echo "${ECHO_T}$with_normal" >&6 test "$with_normal" = "yes" && cf_list_models="$cf_list_models normal" -echo "$as_me:4199: checking if you want to build debug libraries" >&5 +echo "$as_me:4673: checking if you want to build debug libraries" >&5 echo $ECHO_N "checking if you want to build debug libraries... $ECHO_C" >&6 # Check whether --with-debug or --without-debug was given. @@ -4206,11 +4680,11 @@ if test "${with_debug+set}" = set; then else with_debug=yes fi; -echo "$as_me:4209: result: $with_debug" >&5 +echo "$as_me:4683: result: $with_debug" >&5 echo "${ECHO_T}$with_debug" >&6 test "$with_debug" = "yes" && cf_list_models="$cf_list_models debug" -echo "$as_me:4213: checking if you want to build profiling libraries" >&5 +echo "$as_me:4687: checking if you want to build profiling libraries" >&5 echo $ECHO_N "checking if you want to build profiling libraries... $ECHO_C" >&6 # Check whether --with-profile or --without-profile was given. @@ -4220,7 +4694,7 @@ if test "${with_profile+set}" = set; then else with_profile=no fi; -echo "$as_me:4223: result: $with_profile" >&5 +echo "$as_me:4697: result: $with_profile" >&5 echo "${ECHO_T}$with_profile" >&6 test "$with_profile" = "yes" && cf_list_models="$cf_list_models profile" @@ -4228,19 +4702,19 @@ fi ############################################################################### -echo "$as_me:4231: checking for specified models" >&5 +echo "$as_me:4705: checking for specified models" >&5 echo $ECHO_N "checking for specified models... $ECHO_C" >&6 test -z "$cf_list_models" && cf_list_models=normal test "$with_libtool" != "no" && cf_list_models=libtool -echo "$as_me:4235: result: $cf_list_models" >&5 +echo "$as_me:4709: result: $cf_list_models" >&5 echo "${ECHO_T}$cf_list_models" >&6 ### Use the first model as the default, and save its suffix for use in building ### up test-applications. -echo "$as_me:4240: checking for default model" >&5 +echo "$as_me:4714: checking for default model" >&5 echo $ECHO_N "checking for default model... $ECHO_C" >&6 DFT_LWR_MODEL=`echo "$cf_list_models" | $AWK '{print $1}'` -echo "$as_me:4243: result: $DFT_LWR_MODEL" >&5 +echo "$as_me:4717: result: $DFT_LWR_MODEL" >&5 echo "${ECHO_T}$DFT_LWR_MODEL" >&6 DFT_UPR_MODEL=`echo "$DFT_LWR_MODEL" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` @@ -4269,7 +4743,7 @@ LIB_SUFFIX= ############################################################################### -echo "$as_me:4272: checking if you want to build a separate terminfo library" >&5 +echo "$as_me:4746: checking if you want to build a separate terminfo library" >&5 echo $ECHO_N "checking if you want to build a separate terminfo library... $ECHO_C" >&6 # Check whether --with-termlib or --without-termlib was given. @@ -4279,10 +4753,10 @@ if test "${with_termlib+set}" = set; then else with_termlib=no fi; -echo "$as_me:4282: result: $with_termlib" >&5 +echo "$as_me:4756: result: $with_termlib" >&5 echo "${ECHO_T}$with_termlib" >&6 -echo "$as_me:4285: checking if you want to build a separate tic library" >&5 +echo "$as_me:4759: checking if you want to build a separate tic library" >&5 echo $ECHO_N "checking if you want to build a separate tic library... $ECHO_C" >&6 # Check whether --with-ticlib or --without-ticlib was given. @@ -4292,13 +4766,13 @@ if test "${with_ticlib+set}" = set; then else with_ticlib=no fi; -echo "$as_me:4295: result: $with_ticlib" >&5 +echo "$as_me:4769: result: $with_ticlib" >&5 echo "${ECHO_T}$with_ticlib" >&6 ### Checks for special libraries, must be done up-front. SHLIB_LIST="" -echo "$as_me:4301: checking if you want to link with the GPM mouse library" >&5 +echo "$as_me:4775: checking if you want to link with the GPM mouse library" >&5 echo $ECHO_N "checking if you want to link with the GPM mouse library... $ECHO_C" >&6 # Check whether --with-gpm or --without-gpm was given. @@ -4308,27 +4782,27 @@ if test "${with_gpm+set}" = set; then else with_gpm=maybe fi; -echo "$as_me:4311: result: $with_gpm" >&5 +echo "$as_me:4785: result: $with_gpm" >&5 echo "${ECHO_T}$with_gpm" >&6 if test "$with_gpm" != no ; then - echo "$as_me:4315: checking for gpm.h" >&5 + echo "$as_me:4789: checking for gpm.h" >&5 echo $ECHO_N "checking for gpm.h... $ECHO_C" >&6 if test "${ac_cv_header_gpm_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4321 "configure" +#line 4795 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:4325: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:4799: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:4331: \$? = $ac_status" >&5 + echo "$as_me:4805: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -4347,7 +4821,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:4350: result: $ac_cv_header_gpm_h" >&5 +echo "$as_me:4824: result: $ac_cv_header_gpm_h" >&5 echo "${ECHO_T}$ac_cv_header_gpm_h" >&6 if test $ac_cv_header_gpm_h = yes; then @@ -4358,14 +4832,14 @@ EOF if test "$with_gpm" != yes && test "$with_gpm" != maybe ; then test -n "$verbose" && echo " assuming we really have GPM library" 1>&6 -echo "${as_me-configure}:4361: testing assuming we really have GPM library ..." 1>&5 +echo "${as_me:-configure}:4835: testing assuming we really have GPM library ..." 1>&5 cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF else - echo "$as_me:4368: checking for Gpm_Open in -lgpm" >&5 + echo "$as_me:4842: checking for Gpm_Open in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4373,7 +4847,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4376 "configure" +#line 4850 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4392,16 +4866,16 @@ Gpm_Open (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4395: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4869: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4398: \$? = $ac_status" >&5 + echo "$as_me:4872: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4401: \"$ac_try\"") >&5 + { (eval echo "$as_me:4875: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4404: \$? = $ac_status" >&5 + echo "$as_me:4878: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else @@ -4412,13 +4886,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4415: result: $ac_cv_lib_gpm_Gpm_Open" >&5 +echo "$as_me:4889: result: $ac_cv_lib_gpm_Gpm_Open" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 if test $ac_cv_lib_gpm_Gpm_Open = yes; then : else - { { echo "$as_me:4421: error: Cannot link with GPM library" >&5 + { { echo "$as_me:4895: error: Cannot link with GPM library" >&5 echo "$as_me: error: Cannot link with GPM library" >&2;} { (exit 1); exit 1; }; } fi @@ -4428,7 +4902,7 @@ fi else - test "$with_gpm" != maybe && { echo "$as_me:4431: WARNING: Cannot find GPM header" >&5 + test "$with_gpm" != maybe && { echo "$as_me:4905: WARNING: Cannot find GPM header" >&5 echo "$as_me: WARNING: Cannot find GPM header" >&2;} with_gpm=no @@ -4437,7 +4911,7 @@ fi fi if test "$with_gpm" != no ; then - echo "$as_me:4440: checking if you want to load GPM dynamically" >&5 + echo "$as_me:4914: checking if you want to load GPM dynamically" >&5 echo $ECHO_N "checking if you want to load GPM dynamically... $ECHO_C" >&6 # Check whether --with-dlsym or --without-dlsym was given. @@ -4447,18 +4921,18 @@ if test "${with_dlsym+set}" = set; then else with_dlsym=yes fi; - echo "$as_me:4450: result: $with_dlsym" >&5 + echo "$as_me:4924: result: $with_dlsym" >&5 echo "${ECHO_T}$with_dlsym" >&6 if test "$with_dlsym" = yes ; then cf_have_dlsym=no -echo "$as_me:4455: checking for dlsym" >&5 +echo "$as_me:4929: checking for dlsym" >&5 echo $ECHO_N "checking for dlsym... $ECHO_C" >&6 if test "${ac_cv_func_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 4461 "configure" +#line 4935 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char dlsym (); below. */ @@ -4489,16 +4963,16 @@ f = dlsym; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4492: \"$ac_link\"") >&5 +if { (eval echo "$as_me:4966: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4495: \$? = $ac_status" >&5 + echo "$as_me:4969: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4498: \"$ac_try\"") >&5 + { (eval echo "$as_me:4972: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4501: \$? = $ac_status" >&5 + echo "$as_me:4975: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_dlsym=yes else @@ -4508,14 +4982,14 @@ ac_cv_func_dlsym=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:4511: result: $ac_cv_func_dlsym" >&5 +echo "$as_me:4985: result: $ac_cv_func_dlsym" >&5 echo "${ECHO_T}$ac_cv_func_dlsym" >&6 if test $ac_cv_func_dlsym = yes; then cf_have_dlsym=yes else cf_have_libdl=no -echo "$as_me:4518: checking for dlsym in -ldl" >&5 +echo "$as_me:4992: checking for dlsym in -ldl" >&5 echo $ECHO_N "checking for dlsym in -ldl... $ECHO_C" >&6 if test "${ac_cv_lib_dl_dlsym+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4523,7 +4997,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldl $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4526 "configure" +#line 5000 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4542,16 +5016,16 @@ dlsym (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4545: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5019: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4548: \$? = $ac_status" >&5 + echo "$as_me:5022: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4551: \"$ac_try\"") >&5 + { (eval echo "$as_me:5025: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4554: \$? = $ac_status" >&5 + echo "$as_me:5028: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dl_dlsym=yes else @@ -4562,7 +5036,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4565: result: $ac_cv_lib_dl_dlsym" >&5 +echo "$as_me:5039: result: $ac_cv_lib_dl_dlsym" >&5 echo "${ECHO_T}$ac_cv_lib_dl_dlsym" >&6 if test $ac_cv_lib_dl_dlsym = yes; then @@ -4575,10 +5049,10 @@ fi if test "$cf_have_dlsym" = yes ; then test "$cf_have_libdl" = yes && LIBS="-ldl $LIBS" - echo "$as_me:4578: checking whether able to link to dl*() functions" >&5 + echo "$as_me:5052: checking whether able to link to dl*() functions" >&5 echo $ECHO_N "checking whether able to link to dl*() functions... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 4581 "configure" +#line 5055 "configure" #include "confdefs.h" #include int @@ -4596,16 +5070,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4599: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5073: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4602: \$? = $ac_status" >&5 + echo "$as_me:5076: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4605: \"$ac_try\"") >&5 + { (eval echo "$as_me:5079: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4608: \$? = $ac_status" >&5 + echo "$as_me:5082: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cat >>confdefs.h <<\EOF @@ -4616,15 +5090,15 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - { { echo "$as_me:4619: error: Cannot link test program for libdl" >&5 + { { echo "$as_me:5093: error: Cannot link test program for libdl" >&5 echo "$as_me: error: Cannot link test program for libdl" >&2;} { (exit 1); exit 1; }; } fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - echo "$as_me:4624: result: ok" >&5 + echo "$as_me:5098: result: ok" >&5 echo "${ECHO_T}ok" >&6 else - { { echo "$as_me:4627: error: Cannot find dlsym function" >&5 + { { echo "$as_me:5101: error: Cannot find dlsym function" >&5 echo "$as_me: error: Cannot find dlsym function" >&2;} { (exit 1); exit 1; }; } fi @@ -4632,12 +5106,12 @@ fi if test "$with_gpm" != yes ; then test -n "$verbose" && echo " assuming soname for gpm is $with_gpm" 1>&6 -echo "${as_me-configure}:4635: testing assuming soname for gpm is $with_gpm ..." 1>&5 +echo "${as_me:-configure}:5109: testing assuming soname for gpm is $with_gpm ..." 1>&5 cf_cv_gpm_soname="$with_gpm" else -echo "$as_me:4640: checking for soname of gpm library" >&5 +echo "$as_me:5114: checking for soname of gpm library" >&5 echo $ECHO_N "checking for soname of gpm library... $ECHO_C" >&6 if test "${cf_cv_gpm_soname+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4655,26 +5129,26 @@ if (Gpm_Open(0,0)) Gpm_Close(); CF_EOF cf_save_LIBS="$LIBS" LIBS="-lgpm $LIBS" - if { (eval echo "$as_me:4658: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5132: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4661: \$? = $ac_status" >&5 + echo "$as_me:5135: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:4663: \"$ac_link\"") >&5 + if { (eval echo "$as_me:5137: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4666: \$? = $ac_status" >&5 + echo "$as_me:5140: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_gpm_soname=`ldd conftest$ac_exeext 2>/dev/null | sed -e 's,^.*/,,' -e 's, .*$,,' | fgrep libgpm.` test -z "$cf_cv_gpm_soname" && cf_cv_gpm_soname=unknown fi fi -rm -f conftest* +rm -rf conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:4677: result: $cf_cv_gpm_soname" >&5 +echo "$as_me:5151: result: $cf_cv_gpm_soname" >&5 echo "${ECHO_T}$cf_cv_gpm_soname" >&6 fi @@ -4685,12 +5159,13 @@ EOF SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" + TEST_LIBS="-lgpm $TEST_LIBS" fi cat >>confdefs.h <<\EOF #define HAVE_LIBGPM 1 EOF -echo "$as_me:4693: checking for Gpm_Wgetch in -lgpm" >&5 +echo "$as_me:5168: checking for Gpm_Wgetch in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Wgetch in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4698,7 +5173,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 4701 "configure" +#line 5176 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -4717,16 +5192,16 @@ Gpm_Wgetch (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:4720: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5195: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4723: \$? = $ac_status" >&5 + echo "$as_me:5198: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:4726: \"$ac_try\"") >&5 + { (eval echo "$as_me:5201: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4729: \$? = $ac_status" >&5 + echo "$as_me:5204: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_gpm_Gpm_Wgetch=yes else @@ -4737,11 +5212,11 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:4740: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 +echo "$as_me:5215: result: $ac_cv_lib_gpm_Gpm_Wgetch" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Wgetch" >&6 if test $ac_cv_lib_gpm_Gpm_Wgetch = yes; then -echo "$as_me:4744: checking if GPM is weakly bound to curses library" >&5 +echo "$as_me:5219: checking if GPM is weakly bound to curses library" >&5 echo $ECHO_N "checking if GPM is weakly bound to curses library... $ECHO_C" >&6 if test "${cf_cv_check_gpm_wgetch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -4765,31 +5240,31 @@ CF_EOF # to rely on the static library, noting that some packagers may not # include it. LIBS="-static -lgpm -dynamic $LIBS" - if { (eval echo "$as_me:4768: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:5243: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4771: \$? = $ac_status" >&5 + echo "$as_me:5246: \$? = $ac_status" >&5 (exit $ac_status); } ; then - if { (eval echo "$as_me:4773: \"$ac_link\"") >&5 + if { (eval echo "$as_me:5248: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:4776: \$? = $ac_status" >&5 + echo "$as_me:5251: \$? = $ac_status" >&5 (exit $ac_status); } ; then cf_cv_check_gpm_wgetch=`nm conftest$ac_exeext | egrep '\' | egrep '\<[vVwW]\>'` test -n "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=yes test -z "$cf_cv_check_gpm_wgetch" && cf_cv_check_gpm_wgetch=no fi fi - rm -f conftest* + rm -rf conftest* LIBS="$cf_save_LIBS" fi fi -echo "$as_me:4788: result: $cf_cv_check_gpm_wgetch" >&5 +echo "$as_me:5263: result: $cf_cv_check_gpm_wgetch" >&5 echo "${ECHO_T}$cf_cv_check_gpm_wgetch" >&6 if test "$cf_cv_check_gpm_wgetch" != yes ; then - { echo "$as_me:4792: WARNING: GPM library is already linked with curses - read the FAQ" >&5 + { echo "$as_me:5267: WARNING: GPM library is already linked with curses - read the FAQ" >&5 echo "$as_me: WARNING: GPM library is already linked with curses - read the FAQ" >&2;} fi @@ -4799,7 +5274,7 @@ fi # not everyone has "test -c" if test -c /dev/sysmouse 2>/dev/null ; then -echo "$as_me:4802: checking if you want to use sysmouse" >&5 +echo "$as_me:5277: checking if you want to use sysmouse" >&5 echo $ECHO_N "checking if you want to use sysmouse... $ECHO_C" >&6 # Check whether --with-sysmouse or --without-sysmouse was given. @@ -4811,7 +5286,7 @@ else fi; if test "$cf_with_sysmouse" != no ; then cat >conftest.$ac_ext <<_ACEOF -#line 4814 "configure" +#line 5289 "configure" #include "confdefs.h" #include @@ -4834,16 +5309,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4837: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5312: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4840: \$? = $ac_status" >&5 + echo "$as_me:5315: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4843: \"$ac_try\"") >&5 + { (eval echo "$as_me:5318: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4846: \$? = $ac_status" >&5 + echo "$as_me:5321: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_with_sysmouse=yes else @@ -4853,7 +5328,7 @@ cf_with_sysmouse=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:4856: result: $cf_with_sysmouse" >&5 +echo "$as_me:5331: result: $cf_with_sysmouse" >&5 echo "${ECHO_T}$cf_with_sysmouse" >&6 test "$cf_with_sysmouse" = yes && cat >>confdefs.h <<\EOF #define USE_SYSMOUSE 1 @@ -4871,7 +5346,7 @@ if test X"$CXX_G_OPT" = X"" ; then test -n "$GXX" && test "${ac_cv_prog_cxx_g}" != yes && CXX_G_OPT='' fi -echo "$as_me:4874: checking for default loader flags" >&5 +echo "$as_me:5349: checking for default loader flags" >&5 echo $ECHO_N "checking for default loader flags... $ECHO_C" >&6 case $DFT_LWR_MODEL in libtool) LD_MODEL='' ;; @@ -4880,26 +5355,26 @@ debug) LD_MODEL=$CC_G_OPT ;; profile) LD_MODEL='-pg';; shared) LD_MODEL='' ;; esac -echo "$as_me:4883: result: $LD_MODEL" >&5 +echo "$as_me:5358: result: $LD_MODEL" >&5 echo "${ECHO_T}$LD_MODEL" >&6 case $DFT_LWR_MODEL in shared) -echo "$as_me:4889: checking if rpath option should be used" >&5 +echo "$as_me:5364: checking if rpath option should be used" >&5 echo $ECHO_N "checking if rpath option should be used... $ECHO_C" >&6 # Check whether --enable-rpath or --disable-rpath was given. if test "${enable_rpath+set}" = set; then enableval="$enable_rpath" - cf_cv_ld_rpath=$enableval + cf_cv_enable_rpath=$enableval else - cf_cv_ld_rpath=no + cf_cv_enable_rpath=no fi; -echo "$as_me:4899: result: $cf_cv_ld_rpath" >&5 -echo "${ECHO_T}$cf_cv_ld_rpath" >&6 +echo "$as_me:5374: result: $cf_cv_enable_rpath" >&5 +echo "${ECHO_T}$cf_cv_enable_rpath" >&6 -echo "$as_me:4902: checking if shared libraries should be relinked during install" >&5 +echo "$as_me:5377: checking if shared libraries should be relinked during install" >&5 echo $ECHO_N "checking if shared libraries should be relinked during install... $ECHO_C" >&6 # Check whether --enable-relink or --disable-relink was given. @@ -4909,19 +5384,100 @@ if test "${enable_relink+set}" = set; then else cf_cv_do_relink=yes fi; -echo "$as_me:4912: result: $cf_cv_do_relink" >&5 +echo "$as_me:5387: result: $cf_cv_do_relink" >&5 echo "${ECHO_T}$cf_cv_do_relink" >&6 ;; esac +LD_RPATH_OPT= +echo "$as_me:5393: checking for an rpath option" >&5 +echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6 +case $cf_cv_system_name in #(vi +irix*) #(vi + if test "$GCC" = yes; then + LD_RPATH_OPT="-Wl,-rpath," + else + LD_RPATH_OPT="-rpath " + fi + ;; +linux*|gnu*|k*bsd*-gnu) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +openbsd[2-9].*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +freebsd*) #(vi + LD_RPATH_OPT="-rpath " + ;; +netbsd*) #(vi + LD_RPATH_OPT="-Wl,-rpath," + ;; +osf*|mls+*) #(vi + LD_RPATH_OPT="-rpath " + ;; +solaris2*) #(vi + LD_RPATH_OPT="-R" + ;; +*) + ;; +esac +echo "$as_me:5424: result: $LD_RPATH_OPT" >&5 +echo "${ECHO_T}$LD_RPATH_OPT" >&6 + +case "x$LD_RPATH_OPT" in #(vi +x-R*) + echo "$as_me:5429: checking if we need a space after rpath option" >&5 +echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6 + cf_save_LIBS="$LIBS" + LIBS="${LD_RPATH_OPT}$libdir $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 5434 "configure" +#include "confdefs.h" + +int +main () +{ + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5446: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5449: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5452: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5455: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_space=no +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_rpath_space=yes +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + LIBS="$cf_save_LIBS" + echo "$as_me:5465: result: $cf_rpath_space" >&5 +echo "${ECHO_T}$cf_rpath_space" >&6 + test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " + ;; +esac + LOCAL_LDFLAGS= LOCAL_LDFLAGS2= LD_SHARED_OPTS= INSTALL_LIB="-m 644" cf_cv_do_symlinks=no + cf_ld_rpath_opt= + test "$cf_cv_enable_rpath" = yes && cf_ld_rpath_opt="$LD_RPATH_OPT" - echo "$as_me:4924: checking if release/abi version should be used for shared libs" >&5 + echo "$as_me:5480: checking if release/abi version should be used for shared libs" >&5 echo $ECHO_N "checking if release/abi version should be used for shared libs... $ECHO_C" >&6 # Check whether --with-shlib-version or --without-shlib-version was given. @@ -4936,7 +5492,7 @@ if test "${with_shlib_version+set}" = set; then cf_cv_shlib_version=$withval ;; *) - { { echo "$as_me:4939: error: option value must be one of: rel, abi, auto or no" >&5 + { { echo "$as_me:5495: error: option value must be one of: rel, abi, auto or no" >&5 echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} { (exit 1); exit 1; }; } ;; @@ -4945,7 +5501,7 @@ echo "$as_me: error: option value must be one of: rel, abi, auto or no" >&2;} else cf_cv_shlib_version=auto fi; - echo "$as_me:4948: result: $cf_cv_shlib_version" >&5 + echo "$as_me:5504: result: $cf_cv_shlib_version" >&5 echo "${ECHO_T}$cf_cv_shlib_version" >&6 cf_cv_rm_so_locs=no @@ -4954,14 +5510,14 @@ echo "${ECHO_T}$cf_cv_shlib_version" >&6 CC_SHARED_OPTS= if test "$GCC" = yes then - echo "$as_me:4957: checking which $CC option to use" >&5 + echo "$as_me:5513: checking which $CC option to use" >&5 echo $ECHO_N "checking which $CC option to use... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" for CC_SHARED_OPTS in -fPIC -fpic '' do CFLAGS="$cf_save_CFLAGS $CC_SHARED_OPTS" cat >conftest.$ac_ext <<_ACEOF -#line 4964 "configure" +#line 5520 "configure" #include "confdefs.h" #include int @@ -4973,16 +5529,16 @@ int x = 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:4976: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:5532: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:4979: \$? = $ac_status" >&5 + echo "$as_me:5535: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:4982: \"$ac_try\"") >&5 + { (eval echo "$as_me:5538: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:4985: \$? = $ac_status" >&5 + echo "$as_me:5541: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -4991,18 +5547,24 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext done - echo "$as_me:4994: result: $CC_SHARED_OPTS" >&5 + echo "$as_me:5550: result: $CC_SHARED_OPTS" >&5 echo "${ECHO_T}$CC_SHARED_OPTS" >&6 CFLAGS="$cf_save_CFLAGS" fi cf_cv_shlib_version_infix=no - case $cf_cv_system_name in - beos*) + case $cf_cv_system_name in #(vi + aix[56]*) #(vi + if test "$GCC" = yes; then + CC_SHARED_OPTS= + MK_SHARED_LIB='$(CC) -shared' + fi + ;; + beos*) #(vi MK_SHARED_LIB='${CC} ${CFLAGS} -o $@ -Xlinker -soname=`basename $@` -nostart -e 0' ;; - cygwin*) + cygwin*) #(vi CC_SHARED_OPTS= MK_SHARED_LIB='sh ../mk_shared_lib.sh $@ ${CC} ${CFLAGS}' cf_cv_shlib_version=cygdll @@ -5021,13 +5583,13 @@ EOF CF_EOF chmod +x mk_shared_lib.sh ;; - darwin*) + darwin*) #(vi EXTRA_CFLAGS="-no-cpp-precomp" CC_SHARED_OPTS="-dynamic" MK_SHARED_LIB='${CC} ${CFLAGS} -dynamiclib -install_name ${libdir}/`basename $@` -compatibility_version ${ABI_VERSION} -current_version ${ABI_VERSION} -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=abi cf_cv_shlib_version_infix=yes - echo "$as_me:5030: checking if ld -search_paths_first works" >&5 + echo "$as_me:5592: checking if ld -search_paths_first works" >&5 echo $ECHO_N "checking if ld -search_paths_first works... $ECHO_C" >&6 if test "${cf_cv_ldflags_search_paths_first+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5036,7 +5598,7 @@ else cf_save_LDFLAGS=$LDFLAGS LDFLAGS="$LDFLAGS -Wl,-search_paths_first" cat >conftest.$ac_ext <<_ACEOF -#line 5039 "configure" +#line 5601 "configure" #include "confdefs.h" int @@ -5048,16 +5610,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5051: \"$ac_link\"") >&5 +if { (eval echo "$as_me:5613: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5054: \$? = $ac_status" >&5 + echo "$as_me:5616: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5057: \"$ac_try\"") >&5 + { (eval echo "$as_me:5619: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5060: \$? = $ac_status" >&5 + echo "$as_me:5622: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_ldflags_search_paths_first=yes else @@ -5068,13 +5630,13 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LDFLAGS=$cf_save_LDFLAGS fi -echo "$as_me:5071: result: $cf_cv_ldflags_search_paths_first" >&5 +echo "$as_me:5633: result: $cf_cv_ldflags_search_paths_first" >&5 echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 if test $cf_cv_ldflags_search_paths_first = yes; then LDFLAGS="$LDFLAGS -Wl,-search_paths_first" fi ;; - hpux*) + hpux*) #(vi # (tested with gcc 2.7.2 -- I don't have c89) if test "$GCC" = yes; then LD_SHARED_OPTS='-Xlinker +b -Xlinker ${libdir}' @@ -5087,15 +5649,9 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 # readonly to exploit a quirk in the memory manager. INSTALL_LIB="-m 555" ;; - irix*) - if test "$cf_cv_ld_rpath" = yes ; then - if test "$GCC" = yes; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" - else - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" - fi + irix*) #(vi + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi # tested with IRIX 5.2 and 'cc'. if test "$GCC" != yes; then @@ -5106,14 +5662,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi cf_cv_rm_so_locs=yes ;; - linux*|gnu*|k*bsd*-gnu) + linux*|gnu*|k*bsd*-gnu) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5125,14 +5680,13 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - openbsd[2-9].*) + openbsd[2-9].*) #(vi if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-Wl,-rpath," - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" @@ -5143,20 +5697,19 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${CC} ${CFLAGS} -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' + MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-Bshareable,-soname,'$cf_cv_shared_soname',-stats,-lc -o $@' ;; - nto-qnx*|openbsd*|freebsd[12].*) + nto-qnx*|openbsd*|freebsd[12].*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" MK_SHARED_LIB='${LD} -Bshareable -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - freebsd*) + freebsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-rpath \$(LOCAL_LIBDIR)" - LOCAL_LDFLAGS2="-rpath \${libdir} $LOCAL_LDFLAGS" - cf_ld_rpath_opt="-rpath " - EXTRA_LDFLAGS="-rpath \${libdir} $EXTRA_LDFLAGS" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS2="${cf_ld_rpath_opt}\${libdir} $LOCAL_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5166,15 +5719,14 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 cf_cv_shared_soname='`basename $@`' fi - MK_SHARED_LIB='${LD} -Bshareable -soname=`basename $@` -o $@' + MK_SHARED_LIB='${LD} -shared -Bshareable -soname=`basename $@` -o $@' ;; - netbsd*) + netbsd*) #(vi CC_SHARED_OPTS="$CC_SHARED_OPTS -DPIC" - test "$cf_cv_ld_rpath" = yes && cf_ld_rpath_opt="-Wl,-rpath," - if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_ld_rpath" = yes ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + if test "$DFT_LWR_MODEL" = "shared" && test "$cf_cv_enable_rpath" = yes ; then + LOCAL_LDFLAGS="${cf_ld_rpath_opt}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" - EXTRA_LDFLAGS="-Wl,-rpath,\${libdir} $EXTRA_LDFLAGS" + EXTRA_LDFLAGS="${cf_ld_rpath_opt}\${libdir} $EXTRA_LDFLAGS" if test "$cf_cv_shlib_version" = auto; then if test -f /usr/libexec/ld.elf_so; then cf_cv_shlib_version=abi @@ -5192,37 +5744,33 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${CC} ${CFLAGS} -shared -Wl,-soname,'$cf_cv_shared_soname' -o $@' else - MK_SHARED_LIB='${LD} -Bshareable -o $@' + MK_SHARED_LIB='${LD} -shared -Bshareable -o $@' fi ;; - osf*|mls+*) + osf*|mls+*) #(vi # tested with OSF/1 V3.2 and 'cc' # tested with OSF/1 V3.2 and gcc 2.6.3 (but the c++ demo didn't # link with shared libs). MK_SHARED_LIB='${LD} -set_version ${REL_VERSION}:${ABI_VERSION} -expect_unresolved "*" -shared -soname `basename $@`' - case $host_os in + case $host_os in #(vi osf4*) MK_SHARED_LIB="${MK_SHARED_LIB} -msym" ;; esac MK_SHARED_LIB="${MK_SHARED_LIB}"' -o $@' if test "$DFT_LWR_MODEL" = "shared" ; then - LOCAL_LDFLAGS="-Wl,-rpath,\$(LOCAL_LIBDIR)" + LOCAL_LDFLAGS="${LD_RPATH_OPT}\$(LOCAL_LIBDIR)" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-rpath" - # EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" - fi cf_cv_rm_so_locs=yes ;; - sco3.2v5*) # (also uw2* and UW7) hops 13-Apr-98 + sco3.2v5*) # (also uw2* and UW7: hops 13-Apr-98 # tested with osr5.0.5 if test "$GCC" != yes; then CC_SHARED_OPTS='-belf -KPIC' fi MK_SHARED_LIB='${LD} -dy -G -h `basename $@ .${REL_VERSION}`.${ABI_VERSION} -o $@' - if test "$cf_cv_ld_rpath" = yes ; then + if test "$cf_cv_enable_rpath" = yes ; then # only way is to set LD_RUN_PATH but no switch for it RUN_PATH=$libdir fi @@ -5230,7 +5778,7 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 LINK_PROGS='LD_RUN_PATH=${libdir}' LINK_TESTS='Pwd=`pwd`;LD_RUN_PATH=`dirname $${Pwd}`/lib' ;; - sunos4*) + sunos4*) #(vi # tested with SunOS 4.1.1 and gcc 2.7.0 if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5238,16 +5786,15 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 MK_SHARED_LIB='${LD} -assert pure-text -o $@' test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel ;; - solaris2*) + solaris2*) #(vi # tested with SunOS 5.5.1 (solaris 2.5.1) and gcc 2.7.2 # tested with SunOS 5.10 (solaris 10) and gcc 3.4.3 if test "$DFT_LWR_MODEL" = "shared" ; then LOCAL_LDFLAGS="-R \$(LOCAL_LIBDIR):\${libdir}" LOCAL_LDFLAGS2="$LOCAL_LDFLAGS" fi - if test "$cf_cv_ld_rpath" = yes ; then - cf_ld_rpath_opt="-R" - EXTRA_LDFLAGS="$LOCAL_LDFLAGS $EXTRA_LDFLAGS" + if test "$cf_cv_enable_rpath" = yes ; then + EXTRA_LDFLAGS="-R \${libdir} $EXTRA_LDFLAGS" fi test "$cf_cv_shlib_version" = auto && cf_cv_shlib_version=rel @@ -5258,13 +5805,49 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 fi if test "$GCC" != yes; then - CC_SHARED_OPTS='-xcode=pic32' + cf_save_CFLAGS="$CFLAGS" + for cf_shared_opts in -xcode=pic32 -xcode=pic13 -KPIC -Kpic -O + do + CFLAGS="$cf_shared_opts $cf_save_CFLAGS" + cat >conftest.$ac_ext <<_ACEOF +#line 5813 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello\n"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:5825: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:5828: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:5831: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5834: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + break +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest.$ac_ext + done + CFLAGS="$cf_save_CFLAGS" + CC_SHARED_OPTS=$cf_shared_opts MK_SHARED_LIB='${CC} -dy -G -h '$cf_cv_shared_soname' -o $@' else MK_SHARED_LIB='${CC} -shared -dy -G -h '$cf_cv_shared_soname' -o $@' fi ;; - sysv5uw7*|unix_sv*) + sysv5uw7*|unix_sv*) #(vi # tested with UnixWare 7.1.0 (gcc 2.95.2 and cc) if test "$GCC" != yes; then CC_SHARED_OPTS='-KPIC' @@ -5281,11 +5864,11 @@ echo "${ECHO_T}$cf_cv_ldflags_search_paths_first" >&6 case "$cf_cv_shlib_version" in #(vi rel|abi) case "$MK_SHARED_LIB" in #(vi - *'-o $@') + *'-o $@') #(vi test "$cf_cv_do_symlinks" = no && cf_cv_do_symlinks=yes ;; *) - { echo "$as_me:5288: WARNING: ignored --with-shlib-version" >&5 + { echo "$as_me:5871: WARNING: ignored --with-shlib-version" >&5 echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} ;; esac @@ -5293,62 +5876,278 @@ echo "$as_me: WARNING: ignored --with-shlib-version" >&2;} esac if test -n "$cf_ld_rpath_opt" ; then - echo "$as_me:5296: checking if we need a space after rpath option" >&5 -echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6 - cf_save_LIBS="$LIBS" - LIBS="$LIBS ${cf_ld_rpath_opt}$libdir" - cat >conftest.$ac_ext <<_ACEOF -#line 5301 "configure" -#include "confdefs.h" - -int -main () -{ - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5313: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:5316: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5319: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:5322: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_rpath_space=no -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 -cf_rpath_space=yes -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext - LIBS="$cf_save_LIBS" - echo "$as_me:5332: result: $cf_rpath_space" >&5 -echo "${ECHO_T}$cf_rpath_space" >&6 - test "$cf_rpath_space" = yes && cf_ld_rpath_opt="$cf_ld_rpath_opt " MK_SHARED_LIB="$MK_SHARED_LIB $cf_ld_rpath_opt\${libdir}" fi if test "$CC_SHARED_OPTS" = "unknown"; then for model in $cf_list_models; do if test "$model" = "shared"; then - { { echo "$as_me:5341: error: Shared libraries are not supported in this version" >&5 + { { echo "$as_me:5885: error: Shared libraries are not supported in this version" >&5 echo "$as_me: error: Shared libraries are not supported in this version" >&2;} { (exit 1); exit 1; }; } fi done fi +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + +echo "$as_me:5895: checking if rpath-hack should be disabled" >&5 +echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6 + +# Check whether --enable-rpath-hack or --disable-rpath-hack was given. +if test "${enable_rpath_hack+set}" = set; then + enableval="$enable_rpath_hack" + test "$enableval" != no && enableval=yes + if test "$enableval" != "yes" ; then + cf_disable_rpath_hack=yes + else + cf_disable_rpath_hack=no + fi +else + enableval=yes + cf_disable_rpath_hack=no + +fi; +echo "$as_me:5912: result: $cf_disable_rpath_hack" >&5 +echo "${ECHO_T}$cf_disable_rpath_hack" >&6 +if test "$cf_disable_rpath_hack" = no ; then + +echo "$as_me:5916: checking for updated LDFLAGS" >&5 +echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 +if test -n "$LD_RPATH_OPT" ; then + echo "$as_me:5919: result: maybe" >&5 +echo "${ECHO_T}maybe" >&6 + + for ac_prog in ldd +do + # Extract the first word of "$ac_prog", so it can be a program name with args. +set dummy $ac_prog; ac_word=$2 +echo "$as_me:5926: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test -n "$cf_ldd_prog"; then + ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test. +else + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + $as_executable_p "$ac_dir/$ac_word" || continue +ac_cv_prog_cf_ldd_prog="$ac_prog" +echo "$as_me:5941: found $ac_dir/$ac_word" >&5 +break +done + +fi +fi +cf_ldd_prog=$ac_cv_prog_cf_ldd_prog +if test -n "$cf_ldd_prog"; then + echo "$as_me:5949: result: $cf_ldd_prog" >&5 +echo "${ECHO_T}$cf_ldd_prog" >&6 +else + echo "$as_me:5952: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + + test -n "$cf_ldd_prog" && break +done +test -n "$cf_ldd_prog" || cf_ldd_prog="no" + + cf_rpath_list="/usr/lib /lib" + if test "$cf_ldd_prog" != no + then + cf_rpath_oops= + +cat >conftest.$ac_ext <<_ACEOF +#line 5966 "configure" +#include "confdefs.h" +#include +int +main () +{ +printf("Hello"); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:5978: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:5981: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:5984: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:5987: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_rpath_oops=`$cf_ldd_prog conftest$ac_exeext | fgrep ' not found' | sed -e 's% =>.*$%%' |sort -u` + cf_rpath_list=`$cf_ldd_prog conftest$ac_exeext | fgrep / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort -u` +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + # If we passed the link-test, but get a "not found" on a given library, + # this could be due to inept reconfiguration of gcc to make it only + # partly honor /usr/local/lib (or whatever). Sometimes this behavior + # is intentional, e.g., installing gcc in /usr/bin and suppressing the + # /usr/local libraries. + if test -n "$cf_rpath_oops" + then + for cf_rpath_src in $cf_rpath_oops + do + for cf_rpath_dir in \ + /usr/local \ + /usr/pkg \ + /opt/sfw + do + if test -f $cf_rpath_dir/lib/$cf_rpath_src + then + test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 + +echo "${as_me:-configure}:6015: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 + + LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" + break + fi + done + done + fi + fi + + test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6027: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6031: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 + +cf_rpath_dst= +for cf_rpath_src in $LDFLAGS +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 + +echo "${as_me:-configure}:6068: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +LDFLAGS=$cf_rpath_dst + +test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6081: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 + +test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 + +echo "${as_me:-configure}:6085: testing ...checking LIBS $LIBS ..." 1>&5 + +cf_rpath_dst= +for cf_rpath_src in $LIBS +do + case $cf_rpath_src in #(vi + -L*) #(vi + + # check if this refers to a directory which we will ignore + cf_rpath_skip=no + if test -n "$cf_rpath_list" + then + for cf_rpath_item in $cf_rpath_list + do + if test "x$cf_rpath_src" = "x-L$cf_rpath_item" + then + cf_rpath_skip=yes + break + fi + done + fi + + if test "$cf_rpath_skip" = no + then + # transform the option + if test "$LD_RPATH_OPT" = "-R " ; then + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` + else + cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` + fi + + # if we have not already added this, add it now + cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` + if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" + then + test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 + +echo "${as_me:-configure}:6122: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 + + EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" + fi + fi + ;; + esac + cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" +done +LIBS=$cf_rpath_dst + +test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 + +echo "${as_me:-configure}:6135: testing ...checked LIBS $LIBS ..." 1>&5 + + test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 + +echo "${as_me:-configure}:6139: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 + +fi + +fi + +fi + ############################################################################### ### use option --disable-overwrite to leave out the link to -lcurses -echo "$as_me:5351: checking if you wish to install ncurses overwriting curses" >&5 +echo "$as_me:6150: checking if you wish to install ncurses overwriting curses" >&5 echo $ECHO_N "checking if you wish to install ncurses overwriting curses... $ECHO_C" >&6 # Check whether --enable-overwrite or --disable-overwrite was given. @@ -5358,10 +6157,10 @@ if test "${enable_overwrite+set}" = set; then else if test "$prefix" = "/usr" ; then with_overwrite=yes; else with_overwrite=no; fi fi; -echo "$as_me:5361: result: $with_overwrite" >&5 +echo "$as_me:6160: result: $with_overwrite" >&5 echo "${ECHO_T}$with_overwrite" >&6 -echo "$as_me:5364: checking if external terminfo-database is used" >&5 +echo "$as_me:6163: checking if external terminfo-database is used" >&5 echo $ECHO_N "checking if external terminfo-database is used... $ECHO_C" >&6 # Check whether --enable-database or --disable-database was given. @@ -5371,7 +6170,7 @@ if test "${enable_database+set}" = set; then else use_database=yes fi; -echo "$as_me:5374: result: $use_database" >&5 +echo "$as_me:6173: result: $use_database" >&5 echo "${ECHO_T}$use_database" >&6 case $host_os in #(vi @@ -5384,8 +6183,8 @@ os2*) #(vi esac case $cf_cv_system_name in - os2*) PATHSEP=';' ;; - *) PATHSEP=':' ;; + os2*) PATH_SEPARATOR=';' ;; + *) PATH_SEPARATOR=':' ;; esac if test "$use_database" != no ; then @@ -5393,18 +6192,18 @@ if test "$use_database" != no ; then #define USE_DATABASE 1 EOF - echo "$as_me:5396: checking which terminfo source-file will be installed" >&5 + echo "$as_me:6195: checking which terminfo source-file will be installed" >&5 echo $ECHO_N "checking which terminfo source-file will be installed... $ECHO_C" >&6 -# Check whether --enable-database or --disable-database was given. -if test "${enable_database+set}" = set; then - enableval="$enable_database" +# Check whether --with-database or --without-database was given. +if test "${with_database+set}" = set; then + withval="$with_database" TERMINFO_SRC=$withval fi; - echo "$as_me:5404: result: $TERMINFO_SRC" >&5 + echo "$as_me:6203: result: $TERMINFO_SRC" >&5 echo "${ECHO_T}$TERMINFO_SRC" >&6 - echo "$as_me:5407: checking whether to use hashed database instead of directory/tree" >&5 + echo "$as_me:6206: checking whether to use hashed database instead of directory/tree" >&5 echo $ECHO_N "checking whether to use hashed database instead of directory/tree... $ECHO_C" >&6 # Check whether --with-hashed-db or --without-hashed-db was given. @@ -5414,13 +6213,13 @@ if test "${with_hashed_db+set}" = set; then else with_hashed_db=no fi; - echo "$as_me:5417: result: $with_hashed_db" >&5 + echo "$as_me:6216: result: $with_hashed_db" >&5 echo "${ECHO_T}$with_hashed_db" >&6 else with_hashed_db=no fi -echo "$as_me:5423: checking for list of fallback descriptions" >&5 +echo "$as_me:6222: checking for list of fallback descriptions" >&5 echo $ECHO_N "checking for list of fallback descriptions... $ECHO_C" >&6 # Check whether --with-fallbacks or --without-fallbacks was given. @@ -5430,11 +6229,11 @@ if test "${with_fallbacks+set}" = set; then else with_fallback= fi; -echo "$as_me:5433: result: $with_fallback" >&5 +echo "$as_me:6232: result: $with_fallback" >&5 echo "${ECHO_T}$with_fallback" >&6 FALLBACK_LIST=`echo "$with_fallback" | sed -e 's/,/ /g'` -echo "$as_me:5437: checking if you want modern xterm or antique" >&5 +echo "$as_me:6236: checking if you want modern xterm or antique" >&5 echo $ECHO_N "checking if you want modern xterm or antique... $ECHO_C" >&6 # Check whether --with-xterm-new or --without-xterm-new was given. @@ -5448,7 +6247,7 @@ case $with_xterm_new in no) with_xterm_new=xterm-old;; *) with_xterm_new=xterm-new;; esac -echo "$as_me:5451: result: $with_xterm_new" >&5 +echo "$as_me:6250: result: $with_xterm_new" >&5 echo "${ECHO_T}$with_xterm_new" >&6 WHICH_XTERM=$with_xterm_new @@ -5458,7 +6257,7 @@ if test "$use_database" = no ; then MAKE_TERMINFO="#" else -echo "$as_me:5461: checking for list of terminfo directories" >&5 +echo "$as_me:6260: checking for list of terminfo directories" >&5 echo $ECHO_N "checking for list of terminfo directories... $ECHO_C" >&6 # Check whether --with-terminfo-dirs or --without-terminfo-dirs was given. @@ -5466,9 +6265,9 @@ if test "${with_terminfo_dirs+set}" = set; then withval="$with_terminfo_dirs" else - withval=${TERMINFO_DIRS-${datadir}/terminfo} + withval=${TERMINFO_DIRS:-${datadir}/terminfo} fi; -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5498,7 +6297,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5501: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:6300: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5511,13 +6310,13 @@ IFS="$ac_save_ifs" eval 'TERMINFO_DIRS="$cf_dst_path"' -echo "$as_me:5514: result: $TERMINFO_DIRS" >&5 +echo "$as_me:6313: result: $TERMINFO_DIRS" >&5 echo "${ECHO_T}$TERMINFO_DIRS" >&6 test -n "$TERMINFO_DIRS" && cat >>confdefs.h <&5 +echo "$as_me:6319: checking for default terminfo directory" >&5 echo $ECHO_N "checking for default terminfo directory... $ECHO_C" >&6 # Check whether --with-default-terminfo-dir or --without-default-terminfo-dir was given. @@ -5525,7 +6324,7 @@ if test "${with_default_terminfo_dir+set}" = set; then withval="$with_default_terminfo_dir" else - withval="${TERMINFO-${datadir}/terminfo}" + withval="${TERMINFO:-${datadir}/terminfo}" fi; if test -n "${datadir}/terminfo" ; then if test "x$prefix" != xNONE; then @@ -5553,7 +6352,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5556: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:6355: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5562,7 +6361,7 @@ esac fi TERMINFO="$withval" -echo "$as_me:5565: result: $TERMINFO" >&5 +echo "$as_me:6364: result: $TERMINFO" >&5 echo "${ECHO_T}$TERMINFO" >&6 cat >>confdefs.h <&5 +echo "$as_me:6374: checking if big-core option selected" >&5 echo $ECHO_N "checking if big-core option selected... $ECHO_C" >&6 # Check whether --enable-big-core or --disable-big-core was given. @@ -5584,7 +6383,7 @@ else with_big_core=no else cat >conftest.$ac_ext <<_ACEOF -#line 5587 "configure" +#line 6386 "configure" #include "confdefs.h" #include @@ -5598,15 +6397,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:5601: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6400: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5604: \$? = $ac_status" >&5 + echo "$as_me:6403: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:5606: \"$ac_try\"") >&5 + { (eval echo "$as_me:6405: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5609: \$? = $ac_status" >&5 + echo "$as_me:6408: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_big_core=yes else @@ -5618,7 +6417,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi; -echo "$as_me:5621: result: $with_big_core" >&5 +echo "$as_me:6420: result: $with_big_core" >&5 echo "${ECHO_T}$with_big_core" >&6 test "$with_big_core" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_BIG_CORE 1 @@ -5627,7 +6426,7 @@ EOF ### ISO C only guarantees 512-char strings, we have tables which load faster ### when constructed using "big" strings. More than the C compiler, the awk ### program is a limit on most vendor UNIX systems. Check that we can build. -echo "$as_me:5630: checking if big-strings option selected" >&5 +echo "$as_me:6429: checking if big-strings option selected" >&5 echo $ECHO_N "checking if big-strings option selected... $ECHO_C" >&6 # Check whether --enable-big-strings or --disable-big-strings was given. @@ -5636,29 +6435,29 @@ if test "${enable_big_strings+set}" = set; then with_big_strings=$enableval else - case x$AWK in #(vi - x) - eval with_big_strings=no - ;; - *) #(vi - if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ - | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then - eval with_big_strings=yes - else - eval with_big_strings=no - fi - ;; - esac + case x$AWK in #(vi + x) + eval with_big_strings=no + ;; + *) #(vi + if ( ${AWK} 'BEGIN { xx = "x"; while (length(xx) < 12000) { xx = xx "x"; }; printf("%s\n", xx); }' \ + | $AWK '{ printf "%d\n", length($0); }' | $AWK 'BEGIN { eqls=0; recs=0; } { recs++; if ($0 == 12000) eqls++; } END { if (recs != 1 || eqls != 1) exit 1; }' 2>/dev/null >/dev/null ) ; then + eval with_big_strings=yes + else + eval with_big_strings=no + fi + ;; + esac fi; -echo "$as_me:5654: result: $with_big_strings" >&5 +echo "$as_me:6453: result: $with_big_strings" >&5 echo "${ECHO_T}$with_big_strings" >&6 USE_BIG_STRINGS=0 test "$with_big_strings" = "yes" && USE_BIG_STRINGS=1 ### use option --enable-termcap to compile in the termcap fallback support -echo "$as_me:5661: checking if you want termcap-fallback support" >&5 +echo "$as_me:6460: checking if you want termcap-fallback support" >&5 echo $ECHO_N "checking if you want termcap-fallback support... $ECHO_C" >&6 # Check whether --enable-termcap or --disable-termcap was given. @@ -5668,13 +6467,13 @@ if test "${enable_termcap+set}" = set; then else with_termcap=no fi; -echo "$as_me:5671: result: $with_termcap" >&5 +echo "$as_me:6470: result: $with_termcap" >&5 echo "${ECHO_T}$with_termcap" >&6 if test "$with_termcap" != "yes" ; then if test "$use_database" = no ; then if test -z "$with_fallback" ; then - { { echo "$as_me:5677: error: You have disabled the database w/o specifying fallbacks" >&5 + { { echo "$as_me:6476: error: You have disabled the database w/o specifying fallbacks" >&5 echo "$as_me: error: You have disabled the database w/o specifying fallbacks" >&2;} { (exit 1); exit 1; }; } fi @@ -5686,7 +6485,7 @@ EOF else if test "$with_ticlib" != no ; then - { { echo "$as_me:5689: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 + { { echo "$as_me:6488: error: Options --with-ticlib and --enable-termcap cannot be combined" >&5 echo "$as_me: error: Options --with-ticlib and --enable-termcap cannot be combined" >&2;} { (exit 1); exit 1; }; } fi @@ -5695,7 +6494,7 @@ cat >>confdefs.h <<\EOF #define USE_TERMCAP 1 EOF -echo "$as_me:5698: checking for list of termcap files" >&5 +echo "$as_me:6497: checking for list of termcap files" >&5 echo $ECHO_N "checking for list of termcap files... $ECHO_C" >&6 # Check whether --with-termpath or --without-termpath was given. @@ -5703,9 +6502,9 @@ if test "${with_termpath+set}" = set; then withval="$with_termpath" else - withval=${TERMPATH-/etc/termcap:/usr/share/misc/termcap} + withval=${TERMPATH:-/etc/termcap:/usr/share/misc/termcap} fi; -IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${PATHSEP}" +IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${PATH_SEPARATOR}" cf_dst_path= for cf_src_path in $withval do @@ -5735,7 +6534,7 @@ case ".$cf_src_path" in #(vi cf_src_path=`echo $cf_src_path | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:5738: error: expected a pathname, not \"$cf_src_path\"" >&5 + { { echo "$as_me:6537: error: expected a pathname, not \"$cf_src_path\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_src_path\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -5748,14 +6547,14 @@ IFS="$ac_save_ifs" eval 'TERMPATH="$cf_dst_path"' -echo "$as_me:5751: result: $TERMPATH" >&5 +echo "$as_me:6550: result: $TERMPATH" >&5 echo "${ECHO_T}$TERMPATH" >&6 test -n "$TERMPATH" && cat >>confdefs.h <&5 +echo "$as_me:6557: checking if fast termcap-loader is needed" >&5 echo $ECHO_N "checking if fast termcap-loader is needed... $ECHO_C" >&6 # Check whether --enable-getcap or --disable-getcap was given. @@ -5765,13 +6564,13 @@ if test "${enable_getcap+set}" = set; then else with_getcap=no fi; -echo "$as_me:5768: result: $with_getcap" >&5 +echo "$as_me:6567: result: $with_getcap" >&5 echo "${ECHO_T}$with_getcap" >&6 test "$with_getcap" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP 1 EOF -echo "$as_me:5774: checking if translated termcaps will be cached in ~/.terminfo" >&5 +echo "$as_me:6573: checking if translated termcaps will be cached in ~/.terminfo" >&5 echo $ECHO_N "checking if translated termcaps will be cached in ~/.terminfo... $ECHO_C" >&6 # Check whether --enable-getcap-cache or --disable-getcap-cache was given. @@ -5781,7 +6580,7 @@ if test "${enable_getcap_cache+set}" = set; then else with_getcap_cache=no fi; -echo "$as_me:5784: result: $with_getcap_cache" >&5 +echo "$as_me:6583: result: $with_getcap_cache" >&5 echo "${ECHO_T}$with_getcap_cache" >&6 test "$with_getcap_cache" = "yes" && cat >>confdefs.h <<\EOF #define USE_GETCAP_CACHE 1 @@ -5790,7 +6589,7 @@ EOF fi ### Use option --disable-home-terminfo to completely remove ~/.terminfo -echo "$as_me:5793: checking if ~/.terminfo is wanted" >&5 +echo "$as_me:6592: checking if ~/.terminfo is wanted" >&5 echo $ECHO_N "checking if ~/.terminfo is wanted... $ECHO_C" >&6 # Check whether --enable-home-terminfo or --disable-home-terminfo was given. @@ -5800,13 +6599,13 @@ if test "${enable_home_terminfo+set}" = set; then else with_home_terminfo=yes fi; -echo "$as_me:5803: result: $with_home_terminfo" >&5 +echo "$as_me:6602: result: $with_home_terminfo" >&5 echo "${ECHO_T}$with_home_terminfo" >&6 test "$with_home_terminfo" = "yes" && cat >>confdefs.h <<\EOF #define USE_HOME_TERMINFO 1 EOF -echo "$as_me:5809: checking if you want to use restricted environment when running as root" >&5 +echo "$as_me:6608: checking if you want to use restricted environment when running as root" >&5 echo $ECHO_N "checking if you want to use restricted environment when running as root... $ECHO_C" >&6 # Check whether --enable-root-environ or --disable-root-environ was given. @@ -5816,7 +6615,7 @@ if test "${enable_root_environ+set}" = set; then else with_root_environ=yes fi; -echo "$as_me:5819: result: $with_root_environ" >&5 +echo "$as_me:6618: result: $with_root_environ" >&5 echo "${ECHO_T}$with_root_environ" >&6 test "$with_root_environ" = yes && cat >>confdefs.h <<\EOF #define USE_ROOT_ENVIRON 1 @@ -5830,13 +6629,13 @@ for ac_func in \ unlink do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:5833: checking for $ac_func" >&5 +echo "$as_me:6632: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5839 "configure" +#line 6638 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -5867,16 +6666,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5870: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6669: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5873: \$? = $ac_status" >&5 + echo "$as_me:6672: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5876: \"$ac_try\"") >&5 + { (eval echo "$as_me:6675: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5879: \$? = $ac_status" >&5 + echo "$as_me:6678: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -5886,7 +6685,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5889: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6688: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:6705: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 5912 "configure" +#line 6711 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -5940,16 +6739,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:5943: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6742: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:5946: \$? = $ac_status" >&5 + echo "$as_me:6745: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:5949: \"$ac_try\"") >&5 + { (eval echo "$as_me:6748: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:5952: \$? = $ac_status" >&5 + echo "$as_me:6751: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -5959,7 +6758,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:5962: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:6761: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 + echo "$as_me:6772: checking if link/symlink functions work" >&5 echo $ECHO_N "checking if link/symlink functions work... $ECHO_C" >&6 if test "${cf_cv_link_funcs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -5983,7 +6782,7 @@ else eval 'ac_cv_func_'$cf_func'=error' else cat >conftest.$ac_ext <<_ACEOF -#line 5986 "configure" +#line 6785 "configure" #include "confdefs.h" #include @@ -6013,15 +6812,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:6016: \"$ac_link\"") >&5 +if { (eval echo "$as_me:6815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6019: \$? = $ac_status" >&5 + echo "$as_me:6818: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:6021: \"$ac_try\"") >&5 + { (eval echo "$as_me:6820: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6024: \$? = $ac_status" >&5 + echo "$as_me:6823: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_funcs="$cf_cv_link_funcs $cf_func" @@ -6039,7 +6838,7 @@ fi test -z "$cf_cv_link_funcs" && cf_cv_link_funcs=no fi -echo "$as_me:6042: result: $cf_cv_link_funcs" >&5 +echo "$as_me:6841: result: $cf_cv_link_funcs" >&5 echo "${ECHO_T}$cf_cv_link_funcs" >&6 test "$ac_cv_func_link" = yes && cat >>confdefs.h <<\EOF #define HAVE_LINK 1 @@ -6057,7 +6856,7 @@ with_symlinks=no # soft links (symbolic links) are useful for some systems where hard links do # not work, or to make it simpler to copy terminfo trees around. if test "$ac_cv_func_symlink" = yes ; then - echo "$as_me:6060: checking if tic should use symbolic links" >&5 + echo "$as_me:6859: checking if tic should use symbolic links" >&5 echo $ECHO_N "checking if tic should use symbolic links... $ECHO_C" >&6 # Check whether --enable-symlinks or --disable-symlinks was given. @@ -6067,21 +6866,21 @@ if test "${enable_symlinks+set}" = set; then else with_symlinks=no fi; - echo "$as_me:6070: result: $with_symlinks" >&5 + echo "$as_me:6869: result: $with_symlinks" >&5 echo "${ECHO_T}$with_symlinks" >&6 fi # If we have hard links and did not choose to use soft links instead, there is # no reason to make this choice optional - use the hard links. if test "$with_symlinks" = no ; then - echo "$as_me:6077: checking if tic should use hard links" >&5 + echo "$as_me:6876: checking if tic should use hard links" >&5 echo $ECHO_N "checking if tic should use hard links... $ECHO_C" >&6 if test "$ac_cv_func_link" = yes ; then with_links=yes else with_links=no fi - echo "$as_me:6084: result: $with_links" >&5 + echo "$as_me:6883: result: $with_links" >&5 echo "${ECHO_T}$with_links" >&6 fi @@ -6094,7 +6893,7 @@ test "$with_symlinks" = yes && cat >>confdefs.h <<\EOF EOF ### use option --enable-broken-linker to force on use of broken-linker support -echo "$as_me:6097: checking if you want broken-linker support code" >&5 +echo "$as_me:6896: checking if you want broken-linker support code" >&5 echo $ECHO_N "checking if you want broken-linker support code... $ECHO_C" >&6 # Check whether --enable-broken_linker or --disable-broken_linker was given. @@ -6102,9 +6901,9 @@ if test "${enable_broken_linker+set}" = set; then enableval="$enable_broken_linker" with_broken_linker=$enableval else - with_broken_linker=${BROKEN_LINKER-no} + with_broken_linker=${BROKEN_LINKER:-no} fi; -echo "$as_me:6107: result: $with_broken_linker" >&5 +echo "$as_me:6906: result: $with_broken_linker" >&5 echo "${ECHO_T}$with_broken_linker" >&6 BROKEN_LINKER=0 @@ -6124,14 +6923,14 @@ EOF BROKEN_LINKER=1 test -n "$verbose" && echo " cygwin linker is broken anyway" 1>&6 -echo "${as_me-configure}:6127: testing cygwin linker is broken anyway ..." 1>&5 +echo "${as_me:-configure}:6926: testing cygwin linker is broken anyway ..." 1>&5 ;; esac fi ### use option --enable-bsdpad to have tputs process BSD-style prefix padding -echo "$as_me:6134: checking if tputs should process BSD-style prefix padding" >&5 +echo "$as_me:6933: checking if tputs should process BSD-style prefix padding" >&5 echo $ECHO_N "checking if tputs should process BSD-style prefix padding... $ECHO_C" >&6 # Check whether --enable-bsdpad or --disable-bsdpad was given. @@ -6141,7 +6940,7 @@ if test "${enable_bsdpad+set}" = set; then else with_bsdpad=no fi; -echo "$as_me:6144: result: $with_bsdpad" >&5 +echo "$as_me:6943: result: $with_bsdpad" >&5 echo "${ECHO_T}$with_bsdpad" >&6 test "$with_bsdpad" = yes && cat >>confdefs.h <<\EOF #define BSD_TPUTS 1 @@ -6158,66 +6957,22 @@ NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -echo "$as_me:6161: checking if $CC -U and -D options work together" >&5 -echo $ECHO_N "checking if $CC -U and -D options work together... $ECHO_C" >&6 -if test "${cf_cv_cc_u_d_options+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -else - - cf_save_CPPFLAGS="$CPPFLAGS" - CPPFLAGS="-UU_D_OPTIONS -DU_D_OPTIONS -DD_U_OPTIONS -UD_U_OPTIONS" - cat >conftest.$ac_ext <<_ACEOF -#line 6170 "configure" -#include "confdefs.h" - -int -main () -{ - -#ifndef U_D_OPTIONS -make an undefined-error -#endif -#ifdef D_U_OPTIONS -make a defined-error -#endif - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext -if { (eval echo "$as_me:6189: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? - echo "$as_me:6192: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6195: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:6198: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - - cf_cv_cc_u_d_options=yes -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cf_cv_cc_u_d_options=no -fi -rm -f conftest.$ac_objext conftest.$ac_ext - CPPFLAGS="$cf_save_CPPFLAGS" - -fi -echo "$as_me:6212: result: $cf_cv_cc_u_d_options" >&5 -echo "${ECHO_T}$cf_cv_cc_u_d_options" >&6 - cf_XOPEN_SOURCE=500 cf_POSIX_C_SOURCE=199506L +cf_xopen_source= case $host_os in #(vi -aix[45]*) #(vi - CPPFLAGS="$CPPFLAGS -D_ALL_SOURCE" +aix[456]*) #(vi + cf_xopen_source="-D_ALL_SOURCE" + ;; +cygwin) #(vi + cf_XOPEN_SOURCE=600 + ;; +darwin[0-8].*) #(vi + cf_xopen_source="-D_APPLE_C_SOURCE" + ;; +darwin*) #(vi + cf_xopen_source="-D_DARWIN_C_SOURCE" ;; freebsd*|dragonfly*) #(vi # 5.x headers associate @@ -6225,24 +6980,27 @@ freebsd*|dragonfly*) #(vi # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 - CPPFLAGS="$CPPFLAGS -D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +hpux11*) #(vi + cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; hpux*) #(vi - CPPFLAGS="$CPPFLAGS -D_HPUX_SOURCE" + cf_xopen_source="-D_HPUX_SOURCE" ;; irix[56].*) #(vi - CPPFLAGS="$CPPFLAGS -D_SGI_SOURCE" + cf_xopen_source="-D_SGI_SOURCE" ;; -linux*|gnu*|k*bsd*-gnu) #(vi +linux*|gnu*|mint*|k*bsd*-gnu) #(vi -echo "$as_me:6238: checking if we must define _GNU_SOURCE" >&5 +echo "$as_me:6996: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 6245 "configure" +#line 7003 "configure" #include "confdefs.h" #include int @@ -6257,16 +7015,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6260: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7018: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6263: \$? = $ac_status" >&5 + echo "$as_me:7021: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6266: \"$ac_try\"") >&5 + { (eval echo "$as_me:7024: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6269: \$? = $ac_status" >&5 + echo "$as_me:7027: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -6275,7 +7033,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 6278 "configure" +#line 7036 "configure" #include "confdefs.h" #include int @@ -6290,16 +7048,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6293: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7051: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6296: \$? = $ac_status" >&5 + echo "$as_me:7054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6299: \"$ac_try\"") >&5 + { (eval echo "$as_me:7057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6302: \$? = $ac_status" >&5 + echo "$as_me:7060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gnu_source=no else @@ -6314,7 +7072,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6317: result: $cf_cv_gnu_source" >&5 +echo "$as_me:7075: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 test "$cf_cv_gnu_source" = yes && CPPFLAGS="$CPPFLAGS -D_GNU_SOURCE" @@ -6329,26 +7087,29 @@ openbsd*) #(vi # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; osf[45]*) #(vi - CPPFLAGS="$CPPFLAGS -D_OSF_SOURCE" + cf_xopen_source="-D_OSF_SOURCE" ;; nto-qnx*) #(vi - CPPFLAGS="$CPPFLAGS -D_QNX_SOURCE" + cf_xopen_source="-D_QNX_SOURCE" ;; sco*) #(vi # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; -solaris*) #(vi - CPPFLAGS="$CPPFLAGS -D__EXTENSIONS__" +solaris2.1[0-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__ -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" + ;; +solaris2.[1-9]) #(vi + cf_xopen_source="-D__EXTENSIONS__" ;; *) - echo "$as_me:6344: checking if we should define _XOPEN_SOURCE" >&5 + echo "$as_me:7105: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 6351 "configure" +#line 7112 "configure" #include "confdefs.h" #include int @@ -6363,16 +7124,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6366: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7127: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6369: \$? = $ac_status" >&5 + echo "$as_me:7130: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6372: \"$ac_try\"") >&5 + { (eval echo "$as_me:7133: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6375: \$? = $ac_status" >&5 + echo "$as_me:7136: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -6381,7 +7142,7 @@ cat conftest.$ac_ext >&5 cf_save="$CPPFLAGS" CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >conftest.$ac_ext <<_ACEOF -#line 6384 "configure" +#line 7145 "configure" #include "confdefs.h" #include int @@ -6396,16 +7157,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6399: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7160: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6402: \$? = $ac_status" >&5 + echo "$as_me:7163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6405: \"$ac_try\"") >&5 + { (eval echo "$as_me:7166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6408: \$? = $ac_status" >&5 + echo "$as_me:7169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_xopen_source=no else @@ -6420,23 +7181,98 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6423: result: $cf_cv_xopen_source" >&5 +echo "$as_me:7184: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then -# remove _XOPEN_SOURCE symbol from $CFLAGS CFLAGS=`echo "$CFLAGS" | \ - sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` -# remove _XOPEN_SOURCE symbol from $CPPFLAGS CPPFLAGS=`echo "$CPPFLAGS" | \ - sed -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_XOPEN_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` + + cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_temp_xopen_source +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi - test "$cf_cv_cc_u_d_options" = yes && \ - CPPFLAGS="$CPPFLAGS -U_XOPEN_SOURCE" - CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE=$cf_cv_xopen_source" fi cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE @@ -6444,26 +7280,24 @@ cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" -# remove _POSIX_C_SOURCE symbol from $cf_save_CFLAGS cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ - sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -# remove _POSIX_C_SOURCE symbol from $cf_save_CPPFLAGS cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ - sed -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?[ ]/ /g' \ - -e 's/-[UD]_POSIX_C_SOURCE\(=[^ ]*\)\?$//g'` + sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` -echo "$as_me:6457: checking if we should define _POSIX_C_SOURCE" >&5 +echo "$as_me:7291: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -echo "${as_me-configure}:6463: testing if the symbol is already defined go no further ..." 1>&5 +echo "${as_me:-configure}:7297: testing if the symbol is already defined go no further ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 6466 "configure" +#line 7300 "configure" #include "confdefs.h" #include int @@ -6478,16 +7312,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6481: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7315: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6484: \$? = $ac_status" >&5 + echo "$as_me:7318: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6487: \"$ac_try\"") >&5 + { (eval echo "$as_me:7321: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6490: \$? = $ac_status" >&5 + echo "$as_me:7324: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_posix_c_source=no else @@ -6508,7 +7342,7 @@ cf_want_posix_source=no esac if test "$cf_want_posix_source" = yes ; then cat >conftest.$ac_ext <<_ACEOF -#line 6511 "configure" +#line 7345 "configure" #include "confdefs.h" #include int @@ -6523,16 +7357,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6526: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7360: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6529: \$? = $ac_status" >&5 + echo "$as_me:7363: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6532: \"$ac_try\"") >&5 + { (eval echo "$as_me:7366: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6535: \$? = $ac_status" >&5 + echo "$as_me:7369: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6543,15 +7377,15 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "${as_me-configure}:6546: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 +echo "${as_me:-configure}:7380: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS $cf_cv_posix_c_source" -echo "${as_me-configure}:6551: testing if the second compile does not leave our definition intact error ..." 1>&5 +echo "${as_me:-configure}:7385: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 6554 "configure" +#line 7388 "configure" #include "confdefs.h" #include int @@ -6566,16 +7400,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6569: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7403: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6572: \$? = $ac_status" >&5 + echo "$as_me:7406: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6575: \"$ac_try\"") >&5 + { (eval echo "$as_me:7409: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6578: \$? = $ac_status" >&5 + echo "$as_me:7412: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -6591,33 +7425,188 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6594: result: $cf_cv_posix_c_source" >&5 +echo "$as_me:7428: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" - if test "$cf_cv_cc_u_d_options" = yes ; then - cf_temp_posix_c_source=`echo "$cf_cv_posix_c_source" | \ - sed -e 's/-D/-U/g' -e 's/=[^ ]*//g'` - CPPFLAGS="$CPPFLAGS $cf_temp_posix_c_source" - fi - CPPFLAGS="$CPPFLAGS $cf_cv_posix_c_source" + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_cv_posix_c_source +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + fi ;; esac +if test -n "$cf_xopen_source" ; then + +cf_fix_cppflags=no +cf_new_cflags= +cf_new_cppflags= +cf_new_extra_cppflags= + +for cf_add_cflags in $cf_xopen_source +do +case $cf_fix_cppflags in +no) + case $cf_add_cflags in #(vi + -undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) #(vi + case $cf_add_cflags in + -D*) + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes + + if test $cf_fix_cppflags = yes ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + elif test "${cf_tst_cflags}" = "\"'" ; then + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + continue + fi + ;; + esac + case "$CPPFLAGS" in + *$cf_add_cflags) #(vi + ;; + *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac + cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" + ;; + esac + ;; + *) + cf_new_cflags="$cf_new_cflags $cf_add_cflags" + ;; + esac + ;; +yes) + cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" + + cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` + + test "${cf_add_cflags}" != "${cf_tst_cflags}" \ + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no + ;; +esac +done + +if test -n "$cf_new_cflags" ; then + + CFLAGS="$CFLAGS $cf_new_cflags" +fi + +if test -n "$cf_new_cppflags" ; then + + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" +fi + +if test -n "$cf_new_extra_cppflags" ; then + + EXTRA_CPPFLAGS="$cf_new_extra_cppflags $EXTRA_CPPFLAGS" +fi + +fi + # Work around breakage on OS X -echo "$as_me:6613: checking if SIGWINCH is defined" >&5 +echo "$as_me:7602: checking if SIGWINCH is defined" >&5 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6 if test "${cf_cv_define_sigwinch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 6620 "configure" +#line 7609 "configure" #include "confdefs.h" #include @@ -6632,23 +7621,23 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6635: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7624: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6638: \$? = $ac_status" >&5 + echo "$as_me:7627: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6641: \"$ac_try\"") >&5 + { (eval echo "$as_me:7630: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6644: \$? = $ac_status" >&5 + echo "$as_me:7633: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_define_sigwinch=yes else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 6651 "configure" +#line 7640 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -6666,16 +7655,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6669: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7658: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6672: \$? = $ac_status" >&5 + echo "$as_me:7661: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6675: \"$ac_try\"") >&5 + { (eval echo "$as_me:7664: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6678: \$? = $ac_status" >&5 + echo "$as_me:7667: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_define_sigwinch=maybe else @@ -6689,11 +7678,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:6692: result: $cf_cv_define_sigwinch" >&5 +echo "$as_me:7681: result: $cf_cv_define_sigwinch" >&5 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6 if test "$cf_cv_define_sigwinch" = maybe ; then -echo "$as_me:6696: checking for actual SIGWINCH definition" >&5 +echo "$as_me:7685: checking for actual SIGWINCH definition" >&5 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6 if test "${cf_cv_fixup_sigwinch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6704,7 +7693,7 @@ cf_sigwinch=32 while test $cf_sigwinch != 1 do cat >conftest.$ac_ext <<_ACEOF -#line 6707 "configure" +#line 7696 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE @@ -6726,16 +7715,16 @@ int x = SIGWINCH } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6729: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7718: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6732: \$? = $ac_status" >&5 + echo "$as_me:7721: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6735: \"$ac_try\"") >&5 + { (eval echo "$as_me:7724: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6738: \$? = $ac_status" >&5 + echo "$as_me:7727: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_fixup_sigwinch=$cf_sigwinch break @@ -6749,7 +7738,7 @@ cf_sigwinch=`expr $cf_sigwinch - 1` done fi -echo "$as_me:6752: result: $cf_cv_fixup_sigwinch" >&5 +echo "$as_me:7741: result: $cf_cv_fixup_sigwinch" >&5 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6 if test "$cf_cv_fixup_sigwinch" != unknown ; then @@ -6759,13 +7748,13 @@ fi # Checks for CODESET support. - echo "$as_me:6762: checking for nl_langinfo and CODESET" >&5 + echo "$as_me:7751: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 6768 "configure" +#line 7757 "configure" #include "confdefs.h" #include int @@ -6777,16 +7766,16 @@ char* cs = nl_langinfo(CODESET); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6780: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7769: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6783: \$? = $ac_status" >&5 + echo "$as_me:7772: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6786: \"$ac_try\"") >&5 + { (eval echo "$as_me:7775: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6789: \$? = $ac_status" >&5 + echo "$as_me:7778: \$? = $ac_status" >&5 (exit $ac_status); }; }; then am_cv_langinfo_codeset=yes else @@ -6797,7 +7786,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6800: result: $am_cv_langinfo_codeset" >&5 +echo "$as_me:7789: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test $am_cv_langinfo_codeset = yes; then @@ -6811,7 +7800,7 @@ EOF NCURSES_OK_WCHAR_T= NCURSES_OK_WINT_T= -echo "$as_me:6814: checking if you want wide-character code" >&5 +echo "$as_me:7803: checking if you want wide-character code" >&5 echo $ECHO_N "checking if you want wide-character code... $ECHO_C" >&6 # Check whether --enable-widec or --disable-widec was given. @@ -6821,7 +7810,7 @@ if test "${enable_widec+set}" = set; then else with_widec=no fi; -echo "$as_me:6824: result: $with_widec" >&5 +echo "$as_me:7813: result: $with_widec" >&5 echo "${ECHO_T}$with_widec" >&6 if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" @@ -6829,10 +7818,15 @@ if test "$with_widec" = yes ; then #define USE_WIDEC_SUPPORT 1 EOF -echo "$as_me:6832: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 + case "$CFLAGS $CPPFLAGS" in #(vi + *-D_XOPEN_SOURCE=500) #(vi + ;; + *) + +echo "$as_me:7826: checking if we must define _XOPEN_SOURCE_EXTENDED" >&5 echo $ECHO_N "checking if we must define _XOPEN_SOURCE_EXTENDED... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 6835 "configure" +#line 7829 "configure" #include "confdefs.h" #include @@ -6848,16 +7842,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6851: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7845: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6854: \$? = $ac_status" >&5 + echo "$as_me:7848: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6857: \"$ac_try\"") >&5 + { (eval echo "$as_me:7851: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6860: \$? = $ac_status" >&5 + echo "$as_me:7854: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=no else @@ -6866,16 +7860,16 @@ cat conftest.$ac_ext >&5 cf_result=yes fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:6869: result: $cf_result" >&5 +echo "$as_me:7863: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then CPPFLAGS="$CPPFLAGS -D_XOPEN_SOURCE_EXTENDED" elif test "x" != "x" ; then - echo "$as_me:6875: checking checking for compatible value versus " >&5 + echo "$as_me:7869: checking checking for compatible value versus " >&5 echo $ECHO_N "checking checking for compatible value versus ... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 6878 "configure" +#line 7872 "configure" #include "confdefs.h" #include @@ -6891,16 +7885,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:6894: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:7888: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:6897: \$? = $ac_status" >&5 + echo "$as_me:7891: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:6900: \"$ac_try\"") >&5 + { (eval echo "$as_me:7894: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6903: \$? = $ac_status" >&5 + echo "$as_me:7897: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_result=yes else @@ -6909,7 +7903,7 @@ cat conftest.$ac_ext >&5 cf_result=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:6912: result: $cf_result" >&5 + echo "$as_me:7906: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = no ; then # perhaps we can override it - try... @@ -6917,19 +7911,22 @@ echo "${ECHO_T}$cf_result" >&6 fi fi + ;; + esac + # with_overwrite=no NCURSES_CH_T=cchar_t for ac_func in putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:6926: checking for $ac_func" >&5 +echo "$as_me:7923: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 6932 "configure" +#line 7929 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -6960,16 +7957,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:6963: \"$ac_link\"") >&5 +if { (eval echo "$as_me:7960: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:6966: \$? = $ac_status" >&5 + echo "$as_me:7963: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:6969: \"$ac_try\"") >&5 + { (eval echo "$as_me:7966: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:6972: \$? = $ac_status" >&5 + echo "$as_me:7969: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -6979,7 +7976,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:6982: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:7979: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:7991: checking for multibyte character support" >&5 echo $ECHO_N "checking for multibyte character support... $ECHO_C" >&6 if test "${cf_cv_utf8_lib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -6999,7 +7996,7 @@ else cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7002 "configure" +#line 7999 "configure" #include "confdefs.h" #include @@ -7012,16 +8009,16 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7015: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8012: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7018: \$? = $ac_status" >&5 + echo "$as_me:8015: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7021: \"$ac_try\"") >&5 + { (eval echo "$as_me:8018: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7024: \$? = $ac_status" >&5 + echo "$as_me:8021: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_utf8_lib=yes else @@ -7033,10 +8030,12 @@ cat conftest.$ac_ext >&5 cf_cv_header_path_utf8= cf_cv_library_path_utf8= -echo "${as_me-configure}:7036: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:8033: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 + +cf_save_LIBS="$LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 7039 "configure" +#line 8038 "configure" #include "confdefs.h" #include @@ -7049,34 +8048,110 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7052: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8051: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7055: \$? = $ac_status" >&5 + echo "$as_me:8054: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7058: \"$ac_try\"") >&5 + { (eval echo "$as_me:8057: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7061: \$? = $ac_status" >&5 + echo "$as_me:8060: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cf_cv_find_linkage_utf8=yes + + cf_cv_find_linkage_utf8=yes + cf_cv_header_path_utf8=/usr/include + cf_cv_library_path_utf8=/usr/lib + else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 - cf_cv_find_linkage_utf8=no +LIBS="-lutf8 $cf_save_LIBS" -echo "${as_me-configure}:7070: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 +cat >conftest.$ac_ext <<_ACEOF +#line 8074 "configure" +#include "confdefs.h" + +#include +int +main () +{ +putwc(0,0); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:8087: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:8090: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:8093: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:8096: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_find_linkage_utf8=yes + cf_cv_header_path_utf8=/usr/include + cf_cv_library_path_utf8=/usr/lib + cf_cv_library_file_utf8="-lutf8" + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 + + cf_cv_find_linkage_utf8=no + LIBS="$cf_save_LIBS" + + test -n "$verbose" && echo " find linkage for utf8 library" 1>&6 + +echo "${as_me:-configure}:8113: testing find linkage for utf8 library ..." 1>&5 + +echo "${as_me:-configure}:8115: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" - cf_search="" +cf_search= + +# collect the current set of include-directories from compiler flags +cf_header_path_list="" +if test -n "${CFLAGS}${CPPFLAGS}" ; then + for cf_header_path in $CPPFLAGS $CFLAGS + do + case $cf_header_path in #(vi + -I*) + cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` + +test "$cf_header_path" != "NONE" && \ +test -d "$cf_header_path" && \ + { + test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" + test -d $cf_header_path/include && cf_search="$cf_search $cf_header_path/include" + test -d $cf_header_path/include/utf8 && cf_search="$cf_search $cf_header_path/include/utf8" + test -d $cf_header_path/include/utf8/include && cf_search="$cf_search $cf_header_path/include/utf8/include" + test -d $cf_header_path/utf8/include && cf_search="$cf_search $cf_header_path/utf8/include" + test -d $cf_header_path/utf8/include/utf8 && cf_search="$cf_search $cf_header_path/utf8/include/utf8" +} + + cf_header_path_list="$cf_header_path_list $cf_search" + ;; + esac + done +fi + +# add the variations for the package we are looking for + +cf_search= test "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /usr" test -d /usr/include && cf_search="$cf_search /usr/include" test -d /usr/include/utf8 && cf_search="$cf_search /usr/include/utf8" @@ -7098,7 +8173,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr/local" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /usr/local" test -d /usr/local/include && cf_search="$cf_search /usr/local/include" test -d /usr/local/include/utf8 && cf_search="$cf_search /usr/local/include/utf8" @@ -7109,7 +8184,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/opt" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under /opt" test -d /opt/include && cf_search="$cf_search /opt/include" test -d /opt/include/utf8 && cf_search="$cf_search /opt/include/utf8" @@ -7120,7 +8195,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "$HOME" != "$prefix") && { test -n "$verbose" && echo " ... testing for include-directories under $HOME" test -d $HOME/include && cf_search="$cf_search $HOME/include" test -d $HOME/include/utf8 && cf_search="$cf_search $HOME/include/utf8" @@ -7143,16 +8218,18 @@ test -d "$oldincludedir" && { test -d $oldincludedir/utf8 && cf_search="$cf_search $oldincludedir/utf8" } +cf_search="$cf_search $cf_header_path_list" + for cf_cv_header_path_utf8 in $cf_search do if test -d $cf_cv_header_path_utf8 ; then test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6 -echo "${as_me-configure}:7151: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8228: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 CPPFLAGS="$cf_save_CPPFLAGS -I$cf_cv_header_path_utf8" cat >conftest.$ac_ext <<_ACEOF -#line 7155 "configure" +#line 8232 "configure" #include "confdefs.h" #include @@ -7165,21 +8242,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7168: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8245: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7171: \$? = $ac_status" >&5 + echo "$as_me:8248: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7174: \"$ac_try\"") >&5 + { (eval echo "$as_me:8251: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7177: \$? = $ac_status" >&5 + echo "$as_me:8254: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6 -echo "${as_me-configure}:7182: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8259: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=maybe cf_test_CPPFLAGS="$CPPFLAGS" @@ -7197,17 +8274,44 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_cv_find_linkage_utf8" = maybe ; then -echo "${as_me-configure}:7200: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 +echo "${as_me:-configure}:8277: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" if test "$cf_cv_find_linkage_utf8" != yes ; then - cf_search="" + +cf_search= +cf_library_path_list="" +if test -n "${LDFLAGS}${LIBS}" ; then + for cf_library_path in $LDFLAGS $LIBS + do + case $cf_library_path in #(vi + -L*) + cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` + +test "$cf_library_path" != "NONE" && \ +test -d "$cf_library_path" && \ + { + test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" + test -d $cf_library_path/lib && cf_search="$cf_search $cf_library_path/lib" + test -d $cf_library_path/lib/utf8 && cf_search="$cf_search $cf_library_path/lib/utf8" + test -d $cf_library_path/lib/utf8/lib && cf_search="$cf_search $cf_library_path/lib/utf8/lib" + test -d $cf_library_path/utf8/lib && cf_search="$cf_search $cf_library_path/utf8/lib" + test -d $cf_library_path/utf8/lib/utf8 && cf_search="$cf_search $cf_library_path/utf8/lib/utf8" +} + + cf_library_path_list="$cf_library_path_list $cf_search" + ;; + esac + done +fi + +cf_search= test "/usr" != "$prefix" && \ test -d "/usr" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /usr" test -d /usr/lib && cf_search="$cf_search /usr/lib" test -d /usr/lib/utf8 && cf_search="$cf_search /usr/lib/utf8" @@ -7229,7 +8333,7 @@ test -d "$prefix" && \ test "/usr/local" != "$prefix" && \ test -d "/usr/local" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/usr/local" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /usr/local" test -d /usr/local/lib && cf_search="$cf_search /usr/local/lib" test -d /usr/local/lib/utf8 && cf_search="$cf_search /usr/local/lib/utf8" @@ -7240,7 +8344,7 @@ test -d "/usr/local" && \ test "/opt" != "$prefix" && \ test -d "/opt" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "/opt" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under /opt" test -d /opt/lib && cf_search="$cf_search /opt/lib" test -d /opt/lib/utf8 && cf_search="$cf_search /opt/lib/utf8" @@ -7251,7 +8355,7 @@ test -d "/opt" && \ test "$HOME" != "$prefix" && \ test -d "$HOME" && \ -(test $prefix = NONE || test -d $prefix) && { +(test $prefix = NONE || test "$HOME" != "$prefix") && { test -n "$verbose" && echo " ... testing for lib-directories under $HOME" test -d $HOME/lib && cf_search="$cf_search $HOME/lib" test -d $HOME/lib/utf8 && cf_search="$cf_search $HOME/lib/utf8" @@ -7260,18 +8364,20 @@ test -d "$HOME" && \ test -d $HOME/utf8/lib/utf8 && cf_search="$cf_search $HOME/utf8/lib/utf8" } +cf_search="$cf_library_path_list $cf_search" + for cf_cv_library_path_utf8 in $cf_search do if test -d $cf_cv_library_path_utf8 ; then test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6 -echo "${as_me-configure}:7268: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8374: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-lutf8 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8" cat >conftest.$ac_ext <<_ACEOF -#line 7274 "configure" +#line 8380 "configure" #include "confdefs.h" #include @@ -7284,21 +8390,21 @@ putwc(0,0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:7287: \"$ac_link\"") >&5 +if { (eval echo "$as_me:8393: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:7290: \$? = $ac_status" >&5 + echo "$as_me:8396: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:7293: \"$ac_try\"") >&5 + { (eval echo "$as_me:8399: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7296: \$? = $ac_status" >&5 + echo "$as_me:8402: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6 -echo "${as_me-configure}:7301: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 +echo "${as_me:-configure}:8407: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" @@ -7315,7 +8421,6 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi done - LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi @@ -7327,6 +8432,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + +LIBS="$cf_save_LIBS" + if test "$cf_cv_find_linkage_utf8" = yes ; then cf_cv_utf8_lib=add-on else @@ -7336,7 +8446,7 @@ fi fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:7339: result: $cf_cv_utf8_lib" >&5 +echo "$as_me:8449: result: $cf_cv_utf8_lib" >&5 echo "${ECHO_T}$cf_cv_utf8_lib" >&6 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between @@ -7364,13 +8474,13 @@ if test -n "$cf_cv_header_path_utf8" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 7373 "configure" +#line 8483 "configure" #include "confdefs.h" #include int @@ -7382,16 +8492,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7385: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8495: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7388: \$? = $ac_status" >&5 + echo "$as_me:8498: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7391: \"$ac_try\"") >&5 + { (eval echo "$as_me:8501: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7394: \$? = $ac_status" >&5 + echo "$as_me:8504: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -7408,13 +8518,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 -echo "${as_me-configure}:7411: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:8521: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" else break fi @@ -7442,7 +8552,7 @@ if test -n "$cf_cv_library_path_utf8" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:8555: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -7450,7 +8560,7 @@ echo "${as_me-configure}:7445: testing adding $cf_add_libdir to library-path ... done fi - LIBS="-lutf8 $LIBS" + LIBS="$cf_cv_library_file_utf8 $LIBS" fi if test "$cf_cv_utf8_lib" != no ; then @@ -7459,14 +8569,14 @@ fi fi # This is needed on Tru64 5.0 to declare mbstate_t -echo "$as_me:7462: checking if we must include wchar.h to declare mbstate_t" >&5 +echo "$as_me:8572: checking if we must include wchar.h to declare mbstate_t" >&5 echo $ECHO_N "checking if we must include wchar.h to declare mbstate_t... $ECHO_C" >&6 if test "${cf_cv_mbstate_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 7469 "configure" +#line 8579 "configure" #include "confdefs.h" #include @@ -7484,23 +8594,23 @@ mbstate_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7487: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8597: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7490: \$? = $ac_status" >&5 + echo "$as_me:8600: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7493: \"$ac_try\"") >&5 + { (eval echo "$as_me:8603: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7496: \$? = $ac_status" >&5 + echo "$as_me:8606: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_mbstate_t=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 7503 "configure" +#line 8613 "configure" #include "confdefs.h" #include @@ -7519,16 +8629,16 @@ mbstate_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7522: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8632: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7525: \$? = $ac_status" >&5 + echo "$as_me:8635: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7528: \"$ac_try\"") >&5 + { (eval echo "$as_me:8638: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7531: \$? = $ac_status" >&5 + echo "$as_me:8641: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_mbstate_t=yes else @@ -7540,7 +8650,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7543: result: $cf_cv_mbstate_t" >&5 +echo "$as_me:8653: result: $cf_cv_mbstate_t" >&5 echo "${ECHO_T}$cf_cv_mbstate_t" >&6 if test "$cf_cv_mbstate_t" = yes ; then @@ -7557,14 +8667,14 @@ if test "$cf_cv_mbstate_t" = unknown ; then fi # This is needed on Tru64 5.0 to declare wchar_t -echo "$as_me:7560: checking if we must include wchar.h to declare wchar_t" >&5 +echo "$as_me:8670: checking if we must include wchar.h to declare wchar_t" >&5 echo $ECHO_N "checking if we must include wchar.h to declare wchar_t... $ECHO_C" >&6 if test "${cf_cv_wchar_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 7567 "configure" +#line 8677 "configure" #include "confdefs.h" #include @@ -7582,23 +8692,23 @@ wchar_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7585: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8695: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7588: \$? = $ac_status" >&5 + echo "$as_me:8698: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7591: \"$ac_try\"") >&5 + { (eval echo "$as_me:8701: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7594: \$? = $ac_status" >&5 + echo "$as_me:8704: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wchar_t=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 7601 "configure" +#line 8711 "configure" #include "confdefs.h" #include @@ -7617,16 +8727,16 @@ wchar_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7620: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8730: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7623: \$? = $ac_status" >&5 + echo "$as_me:8733: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7626: \"$ac_try\"") >&5 + { (eval echo "$as_me:8736: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7629: \$? = $ac_status" >&5 + echo "$as_me:8739: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wchar_t=yes else @@ -7638,7 +8748,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7641: result: $cf_cv_wchar_t" >&5 +echo "$as_me:8751: result: $cf_cv_wchar_t" >&5 echo "${ECHO_T}$cf_cv_wchar_t" >&6 if test "$cf_cv_wchar_t" = yes ; then @@ -7660,14 +8770,14 @@ if test "$cf_cv_wchar_t" != unknown ; then fi # This is needed on Tru64 5.0 to declare wint_t -echo "$as_me:7663: checking if we must include wchar.h to declare wint_t" >&5 +echo "$as_me:8773: checking if we must include wchar.h to declare wint_t" >&5 echo $ECHO_N "checking if we must include wchar.h to declare wint_t... $ECHO_C" >&6 if test "${cf_cv_wint_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 7670 "configure" +#line 8780 "configure" #include "confdefs.h" #include @@ -7685,23 +8795,23 @@ wint_t state } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7688: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8798: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7691: \$? = $ac_status" >&5 + echo "$as_me:8801: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7694: \"$ac_try\"") >&5 + { (eval echo "$as_me:8804: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7697: \$? = $ac_status" >&5 + echo "$as_me:8807: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wint_t=no else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 7704 "configure" +#line 8814 "configure" #include "confdefs.h" #include @@ -7720,16 +8830,16 @@ wint_t value } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7723: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8833: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7726: \$? = $ac_status" >&5 + echo "$as_me:8836: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7729: \"$ac_try\"") >&5 + { (eval echo "$as_me:8839: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7732: \$? = $ac_status" >&5 + echo "$as_me:8842: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_wint_t=yes else @@ -7741,7 +8851,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:7744: result: $cf_cv_wint_t" >&5 +echo "$as_me:8854: result: $cf_cv_wint_t" >&5 echo "${ECHO_T}$cf_cv_wint_t" >&6 if test "$cf_cv_wint_t" = yes ; then @@ -7780,7 +8890,7 @@ case $cf_cv_abi_version in ;; esac -echo "$as_me:7783: checking whether to enable _LP64 definition in curses.h" >&5 +echo "$as_me:8893: checking whether to enable _LP64 definition in curses.h" >&5 echo $ECHO_N "checking whether to enable _LP64 definition in curses.h... $ECHO_C" >&6 # Check whether --enable-lp64 or --disable-lp64 was given. @@ -7790,7 +8900,7 @@ if test "${enable_lp64+set}" = set; then else with_lp64=$default_with_lp64 fi; -echo "$as_me:7793: result: $with_lp64" >&5 +echo "$as_me:8903: result: $with_lp64" >&5 echo "${ECHO_T}$with_lp64" >&6 if test "$with_lp64" = yes ; then @@ -7806,7 +8916,7 @@ if test "${enable_largefile+set}" = set; then fi; if test "$enable_largefile" != no; then - echo "$as_me:7809: checking for special C compiler options needed for large files" >&5 + echo "$as_me:8919: checking for special C compiler options needed for large files" >&5 echo $ECHO_N "checking for special C compiler options needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_CC+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7818,7 +8928,7 @@ else # IRIX 6.2 and later do not support large files by default, # so use the C compiler's -n32 option if that helps. cat >conftest.$ac_ext <<_ACEOF -#line 7821 "configure" +#line 8931 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7838,16 +8948,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7841: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8951: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7844: \$? = $ac_status" >&5 + echo "$as_me:8954: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7847: \"$ac_try\"") >&5 + { (eval echo "$as_me:8957: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7850: \$? = $ac_status" >&5 + echo "$as_me:8960: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7857,16 +8967,16 @@ fi rm -f conftest.$ac_objext CC="$CC -n32" rm -f conftest.$ac_objext -if { (eval echo "$as_me:7860: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:8970: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7863: \$? = $ac_status" >&5 + echo "$as_me:8973: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7866: \"$ac_try\"") >&5 + { (eval echo "$as_me:8976: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7869: \$? = $ac_status" >&5 + echo "$as_me:8979: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_CC=' -n32'; break else @@ -7880,13 +8990,13 @@ rm -f conftest.$ac_objext rm -f conftest.$ac_ext fi fi -echo "$as_me:7883: result: $ac_cv_sys_largefile_CC" >&5 +echo "$as_me:8993: result: $ac_cv_sys_largefile_CC" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_CC" >&6 if test "$ac_cv_sys_largefile_CC" != no; then CC=$CC$ac_cv_sys_largefile_CC fi - echo "$as_me:7889: checking for _FILE_OFFSET_BITS value needed for large files" >&5 + echo "$as_me:8999: checking for _FILE_OFFSET_BITS value needed for large files" >&5 echo $ECHO_N "checking for _FILE_OFFSET_BITS value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_file_offset_bits+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7894,7 +9004,7 @@ else while :; do ac_cv_sys_file_offset_bits=no cat >conftest.$ac_ext <<_ACEOF -#line 7897 "configure" +#line 9007 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -7914,16 +9024,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7917: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9027: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7920: \$? = $ac_status" >&5 + echo "$as_me:9030: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7923: \"$ac_try\"") >&5 + { (eval echo "$as_me:9033: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7926: \$? = $ac_status" >&5 + echo "$as_me:9036: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -7932,7 +9042,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 7935 "configure" +#line 9045 "configure" #include "confdefs.h" #define _FILE_OFFSET_BITS 64 #include @@ -7953,16 +9063,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:7956: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9066: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:7959: \$? = $ac_status" >&5 + echo "$as_me:9069: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:7962: \"$ac_try\"") >&5 + { (eval echo "$as_me:9072: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:7965: \$? = $ac_status" >&5 + echo "$as_me:9075: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_file_offset_bits=64; break else @@ -7973,7 +9083,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:7976: result: $ac_cv_sys_file_offset_bits" >&5 +echo "$as_me:9086: result: $ac_cv_sys_file_offset_bits" >&5 echo "${ECHO_T}$ac_cv_sys_file_offset_bits" >&6 if test "$ac_cv_sys_file_offset_bits" != no; then @@ -7982,8 +9092,8 @@ cat >>confdefs.h <&5 +rm -rf conftest* + echo "$as_me:9096: checking for _LARGE_FILES value needed for large files" >&5 echo $ECHO_N "checking for _LARGE_FILES value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_large_files+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -7991,7 +9101,7 @@ else while :; do ac_cv_sys_large_files=no cat >conftest.$ac_ext <<_ACEOF -#line 7994 "configure" +#line 9104 "configure" #include "confdefs.h" #include /* Check that off_t can represent 2**63 - 1 correctly. @@ -8011,16 +9121,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8014: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9124: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8017: \$? = $ac_status" >&5 + echo "$as_me:9127: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8020: \"$ac_try\"") >&5 + { (eval echo "$as_me:9130: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8023: \$? = $ac_status" >&5 + echo "$as_me:9133: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8029,7 +9139,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8032 "configure" +#line 9142 "configure" #include "confdefs.h" #define _LARGE_FILES 1 #include @@ -8050,16 +9160,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8053: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9163: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8056: \$? = $ac_status" >&5 + echo "$as_me:9166: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8059: \"$ac_try\"") >&5 + { (eval echo "$as_me:9169: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8062: \$? = $ac_status" >&5 + echo "$as_me:9172: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_large_files=1; break else @@ -8070,7 +9180,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8073: result: $ac_cv_sys_large_files" >&5 +echo "$as_me:9183: result: $ac_cv_sys_large_files" >&5 echo "${ECHO_T}$ac_cv_sys_large_files" >&6 if test "$ac_cv_sys_large_files" != no; then @@ -8079,11 +9189,11 @@ cat >>confdefs.h <&5 + echo "$as_me:9196: checking for _LARGEFILE_SOURCE value needed for large files" >&5 echo $ECHO_N "checking for _LARGEFILE_SOURCE value needed for large files... $ECHO_C" >&6 if test "${ac_cv_sys_largefile_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -8091,7 +9201,7 @@ else while :; do ac_cv_sys_largefile_source=no cat >conftest.$ac_ext <<_ACEOF -#line 8094 "configure" +#line 9204 "configure" #include "confdefs.h" #include int @@ -8103,16 +9213,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8106: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9216: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8109: \$? = $ac_status" >&5 + echo "$as_me:9219: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8112: \"$ac_try\"") >&5 + { (eval echo "$as_me:9222: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8115: \$? = $ac_status" >&5 + echo "$as_me:9225: \$? = $ac_status" >&5 (exit $ac_status); }; }; then break else @@ -8121,7 +9231,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext cat >conftest.$ac_ext <<_ACEOF -#line 8124 "configure" +#line 9234 "configure" #include "confdefs.h" #define _LARGEFILE_SOURCE 1 #include @@ -8134,16 +9244,16 @@ return !fseeko; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8137: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9247: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8140: \$? = $ac_status" >&5 + echo "$as_me:9250: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8143: \"$ac_try\"") >&5 + { (eval echo "$as_me:9253: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8146: \$? = $ac_status" >&5 + echo "$as_me:9256: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sys_largefile_source=1; break else @@ -8154,7 +9264,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext break done fi -echo "$as_me:8157: result: $ac_cv_sys_largefile_source" >&5 +echo "$as_me:9267: result: $ac_cv_sys_largefile_source" >&5 echo "${ECHO_T}$ac_cv_sys_largefile_source" >&6 if test "$ac_cv_sys_largefile_source" != no; then @@ -8163,18 +9273,18 @@ cat >>confdefs.h <&5 +echo "$as_me:9281: checking for fseeko" >&5 echo $ECHO_N "checking for fseeko... $ECHO_C" >&6 if test "${ac_cv_func_fseeko+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8177 "configure" +#line 9287 "configure" #include "confdefs.h" #include int @@ -8186,16 +9296,16 @@ return fseeko && fseeko (stdin, 0, 0); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:8189: \"$ac_link\"") >&5 +if { (eval echo "$as_me:9299: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:8192: \$? = $ac_status" >&5 + echo "$as_me:9302: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:8195: \"$ac_try\"") >&5 + { (eval echo "$as_me:9305: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8198: \$? = $ac_status" >&5 + echo "$as_me:9308: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_fseeko=yes else @@ -8205,7 +9315,7 @@ ac_cv_func_fseeko=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:8208: result: $ac_cv_func_fseeko" >&5 +echo "$as_me:9318: result: $ac_cv_func_fseeko" >&5 echo "${ECHO_T}$ac_cv_func_fseeko" >&6 if test $ac_cv_func_fseeko = yes; then @@ -8226,14 +9336,14 @@ fi test "$ac_cv_sys_largefile_source" != no && CPPFLAGS="$CPPFLAGS -D_LARGEFILE_SOURCE " test "$ac_cv_sys_file_offset_bits" != no && CPPFLAGS="$CPPFLAGS -D_FILE_OFFSET_BITS=$ac_cv_sys_file_offset_bits " - echo "$as_me:8229: checking whether to use struct dirent64" >&5 + echo "$as_me:9339: checking whether to use struct dirent64" >&5 echo $ECHO_N "checking whether to use struct dirent64... $ECHO_C" >&6 if test "${cf_cv_struct_dirent64+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 8236 "configure" +#line 9346 "configure" #include "confdefs.h" #include @@ -8254,16 +9364,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:8257: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:9367: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:8260: \$? = $ac_status" >&5 + echo "$as_me:9370: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:8263: \"$ac_try\"") >&5 + { (eval echo "$as_me:9373: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:8266: \$? = $ac_status" >&5 + echo "$as_me:9376: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_struct_dirent64=yes else @@ -8274,7 +9384,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:8277: result: $cf_cv_struct_dirent64" >&5 +echo "$as_me:9387: result: $cf_cv_struct_dirent64" >&5 echo "${ECHO_T}$cf_cv_struct_dirent64" >&6 test "$cf_cv_struct_dirent64" = yes && cat >>confdefs.h <<\EOF #define HAVE_STRUCT_DIRENT64 1 @@ -8283,7 +9393,7 @@ EOF fi ### use option --disable-tparm-varargs to make tparm() conform to X/Open -echo "$as_me:8286: checking if you want tparm not to use X/Open fixed-parameter list" >&5 +echo "$as_me:9396: checking if you want tparm not to use X/Open fixed-parameter list" >&5 echo $ECHO_N "checking if you want tparm not to use X/Open fixed-parameter list... $ECHO_C" >&6 # Check whether --enable-tparm-varargs or --disable-tparm-varargs was given. @@ -8293,14 +9403,14 @@ if test "${enable_tparm_varargs+set}" = set; then else with_tparm_varargs=yes fi; -echo "$as_me:8296: result: $with_tparm_varargs" >&5 +echo "$as_me:9406: result: $with_tparm_varargs" >&5 echo "${ECHO_T}$with_tparm_varargs" >&6 NCURSES_TPARM_VARARGS=0 test "$with_tparm_varargs" = yes && NCURSES_TPARM_VARARGS=1 ### use option --disable-tic-depends to make libtic not explicitly depend on ncurses/ncursesw if test "$with_ticlib" != no ; then -echo "$as_me:8303: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 +echo "$as_me:9413: checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library" >&5 echo $ECHO_N "checking if you want tic library to use explicit dependency on ncurses$LIB_SUFFIX library... $ECHO_C" >&6 # Check whether --enable-tic-depends or --disable-tic-depends was given. @@ -8310,14 +9420,14 @@ if test "${enable_tic_depends+set}" = set; then else with_tic_depends=yes fi; -echo "$as_me:8313: result: $with_tic_depends" >&5 +echo "$as_me:9423: result: $with_tic_depends" >&5 echo "${ECHO_T}$with_tic_depends" >&6 else with_tic_depends=no fi ### use option --with-bool to override bool's type -echo "$as_me:8320: checking for type of bool" >&5 +echo "$as_me:9430: checking for type of bool" >&5 echo $ECHO_N "checking for type of bool... $ECHO_C" >&6 # Check whether --with-bool or --without-bool was given. @@ -8327,10 +9437,10 @@ if test "${with_bool+set}" = set; then else NCURSES_BOOL=auto fi; -echo "$as_me:8330: result: $NCURSES_BOOL" >&5 +echo "$as_me:9440: result: $NCURSES_BOOL" >&5 echo "${ECHO_T}$NCURSES_BOOL" >&6 -echo "$as_me:8333: checking for alternate terminal capabilities file" >&5 +echo "$as_me:9443: checking for alternate terminal capabilities file" >&5 echo $ECHO_N "checking for alternate terminal capabilities file... $ECHO_C" >&6 # Check whether --with-caps or --without-caps was given. @@ -8341,11 +9451,11 @@ else TERMINFO_CAPS=Caps fi; test -f "${srcdir}/include/${TERMINFO_CAPS}" || TERMINFO_CAPS=Caps -echo "$as_me:8344: result: $TERMINFO_CAPS" >&5 +echo "$as_me:9454: result: $TERMINFO_CAPS" >&5 echo "${ECHO_T}$TERMINFO_CAPS" >&6 ### use option --with-chtype to override chtype's type -echo "$as_me:8348: checking for type of chtype" >&5 +echo "$as_me:9458: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 # Check whether --with-chtype or --without-chtype was given. @@ -8355,11 +9465,11 @@ if test "${with_chtype+set}" = set; then else NCURSES_CHTYPE=auto fi; -echo "$as_me:8358: result: $NCURSES_CHTYPE" >&5 +echo "$as_me:9468: result: $NCURSES_CHTYPE" >&5 echo "${ECHO_T}$NCURSES_CHTYPE" >&6 ### use option --with-ospeed to override ospeed's type -echo "$as_me:8362: checking for type of ospeed" >&5 +echo "$as_me:9472: checking for type of ospeed" >&5 echo $ECHO_N "checking for type of ospeed... $ECHO_C" >&6 # Check whether --with-ospeed or --without-ospeed was given. @@ -8369,11 +9479,11 @@ if test "${with_ospeed+set}" = set; then else NCURSES_OSPEED=short fi; -echo "$as_me:8372: result: $NCURSES_OSPEED" >&5 +echo "$as_me:9482: result: $NCURSES_OSPEED" >&5 echo "${ECHO_T}$NCURSES_OSPEED" >&6 ### use option --with-mmask-t to override mmask_t's type -echo "$as_me:8376: checking for type of mmask_t" >&5 +echo "$as_me:9486: checking for type of mmask_t" >&5 echo $ECHO_N "checking for type of mmask_t... $ECHO_C" >&6 # Check whether --with-mmask-t or --without-mmask-t was given. @@ -8383,11 +9493,25 @@ if test "${with_mmask_t+set}" = set; then else NCURSES_MMASK_T=auto fi; -echo "$as_me:8386: result: $NCURSES_MMASK_T" >&5 +echo "$as_me:9496: result: $NCURSES_MMASK_T" >&5 echo "${ECHO_T}$NCURSES_MMASK_T" >&6 +### use option --with-ccharw-max to override CCHARW_MAX size +echo "$as_me:9500: checking for size CCHARW_MAX" >&5 +echo $ECHO_N "checking for size CCHARW_MAX... $ECHO_C" >&6 + +# Check whether --with-ccharw-max or --without-ccharw-max was given. +if test "${with_ccharw_max+set}" = set; then + withval="$with_ccharw_max" + NCURSES_CCHARW_MAX="$withval" +else + NCURSES_CCHARW_MAX=5 +fi; +echo "$as_me:9510: result: $NCURSES_CCHARW_MAX" >&5 +echo "${ECHO_T}$NCURSES_CCHARW_MAX" >&6 + ### Enable compiling-in rcs id's -echo "$as_me:8390: checking if RCS identifiers should be compiled-in" >&5 +echo "$as_me:9514: checking if RCS identifiers should be compiled-in" >&5 echo $ECHO_N "checking if RCS identifiers should be compiled-in... $ECHO_C" >&6 # Check whether --with-rcs-ids or --without-rcs-ids was given. @@ -8397,7 +9521,7 @@ if test "${with_rcs_ids+set}" = set; then else with_rcs_ids=no fi; -echo "$as_me:8400: result: $with_rcs_ids" >&5 +echo "$as_me:9524: result: $with_rcs_ids" >&5 echo "${ECHO_T}$with_rcs_ids" >&6 test "$with_rcs_ids" = yes && cat >>confdefs.h <<\EOF #define USE_RCS_IDS 1 @@ -8405,7 +9529,7 @@ EOF ############################################################################### -echo "$as_me:8408: checking format of man-pages" >&5 +echo "$as_me:9532: checking format of man-pages" >&5 echo $ECHO_N "checking format of man-pages... $ECHO_C" >&6 # Check whether --with-manpage-format or --without-manpage-format was given. @@ -8433,7 +9557,7 @@ unknown) cf_catonly=yes cf_example=date - IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATHSEP}" + IFS="${IFS:- }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR}" for cf_dir in $MANPATH; do test -z "$cf_dir" && cf_dir=/usr/man for cf_name in $cf_dir/man*/$cf_example.[01]* $cf_dir/cat*/$cf_example.[01]* $cf_dir/man*/$cf_example $cf_dir/cat*/$cf_example @@ -8494,14 +9618,14 @@ unknown) ;; esac -echo "$as_me:8497: result: $MANPAGE_FORMAT" >&5 +echo "$as_me:9621: result: $MANPAGE_FORMAT" >&5 echo "${ECHO_T}$MANPAGE_FORMAT" >&6 if test -n "$cf_unknown" ; then - { echo "$as_me:8500: WARNING: Unexpected manpage-format $cf_unknown" >&5 + { echo "$as_me:9624: WARNING: Unexpected manpage-format $cf_unknown" >&5 echo "$as_me: WARNING: Unexpected manpage-format $cf_unknown" >&2;} fi -echo "$as_me:8504: checking for manpage renaming" >&5 +echo "$as_me:9628: checking for manpage renaming" >&5 echo $ECHO_N "checking for manpage renaming... $ECHO_C" >&6 # Check whether --with-manpage-renames or --without-manpage-renames was given. @@ -8529,7 +9653,7 @@ if test "$MANPAGE_RENAMES" != no ; then if test -f $srcdir/man/$MANPAGE_RENAMES ; then MANPAGE_RENAMES=`cd $srcdir/man && pwd`/$MANPAGE_RENAMES elif test ! -f $MANPAGE_RENAMES ; then - { { echo "$as_me:8532: error: not a filename: $MANPAGE_RENAMES" >&5 + { { echo "$as_me:9656: error: not a filename: $MANPAGE_RENAMES" >&5 echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} { (exit 1); exit 1; }; } fi @@ -8543,10 +9667,10 @@ echo "$as_me: error: not a filename: $MANPAGE_RENAMES" >&2;} fi fi -echo "$as_me:8546: result: $MANPAGE_RENAMES" >&5 +echo "$as_me:9670: result: $MANPAGE_RENAMES" >&5 echo "${ECHO_T}$MANPAGE_RENAMES" >&6 -echo "$as_me:8549: checking if manpage aliases will be installed" >&5 +echo "$as_me:9673: checking if manpage aliases will be installed" >&5 echo $ECHO_N "checking if manpage aliases will be installed... $ECHO_C" >&6 # Check whether --with-manpage-aliases or --without-manpage-aliases was given. @@ -8557,18 +9681,21 @@ else MANPAGE_ALIASES=yes fi; -echo "$as_me:8560: result: $MANPAGE_ALIASES" >&5 +echo "$as_me:9684: result: $MANPAGE_ALIASES" >&5 echo "${ECHO_T}$MANPAGE_ALIASES" >&6 -if test "$LN_S" = "ln -s"; then +case "x$LN_S" in #(vi +xln*) #(vi cf_use_symlinks=yes -else + ;; +*) cf_use_symlinks=no -fi + ;; +esac MANPAGE_SYMLINKS=no if test "$MANPAGE_ALIASES" = yes ; then -echo "$as_me:8571: checking if manpage symlinks should be used" >&5 +echo "$as_me:9698: checking if manpage symlinks should be used" >&5 echo $ECHO_N "checking if manpage symlinks should be used... $ECHO_C" >&6 # Check whether --with-manpage-symlinks or --without-manpage-symlinks was given. @@ -8581,17 +9708,17 @@ fi; if test "$$cf_use_symlinks" = no; then if test "$MANPAGE_SYMLINKS" = yes ; then - { echo "$as_me:8584: WARNING: cannot make symlinks" >&5 + { echo "$as_me:9711: WARNING: cannot make symlinks" >&5 echo "$as_me: WARNING: cannot make symlinks" >&2;} MANPAGE_SYMLINKS=no fi fi -echo "$as_me:8590: result: $MANPAGE_SYMLINKS" >&5 +echo "$as_me:9717: result: $MANPAGE_SYMLINKS" >&5 echo "${ECHO_T}$MANPAGE_SYMLINKS" >&6 fi -echo "$as_me:8594: checking for manpage tbl" >&5 +echo "$as_me:9721: checking for manpage tbl" >&5 echo $ECHO_N "checking for manpage tbl... $ECHO_C" >&6 # Check whether --with-manpage-tbl or --without-manpage-tbl was given. @@ -8602,7 +9729,7 @@ else MANPAGE_TBL=no fi; -echo "$as_me:8605: result: $MANPAGE_TBL" >&5 +echo "$as_me:9732: result: $MANPAGE_TBL" >&5 echo "${ECHO_T}$MANPAGE_TBL" >&6 if test "$prefix" = "NONE" ; then @@ -8635,7 +9762,7 @@ case "$MANPAGE_FORMAT" in #(vi cf_so_strip="Z" cf_compress=compress ;; -*gzip*) #(vi +*gzip*) cf_so_strip="gz" cf_compress=gzip ;; @@ -8658,14 +9785,12 @@ NCURSES_PATCH="$NCURSES_PATCH" NCURSES_OSPEED="$NCURSES_OSPEED" TERMINFO="$TERMINFO" -MKDIRS="sh `cd $srcdir && pwd`/mkdirs.sh" - INSTALL="$INSTALL" INSTALL_DATA="$INSTALL_DATA" transform="$program_transform_name" -TMP=\${TMPDIR-/tmp}/man\$\$ +TMP=\${TMPDIR:=/tmp}/man\$\$ trap "rm -f \$TMP" 0 1 2 5 15 form=\$1 @@ -8703,7 +9828,7 @@ case \$i in #(vi section=\`expr "\$i" : '.*\\.\\([0-9]\\)[xm]*'\`; if test \$verb = installing ; then if test ! -d \$cf_subdir\${section} ; then - \$MKDIRS \$cf_subdir\$section + mkdir -p \$cf_subdir\$section fi fi @@ -8718,12 +9843,12 @@ cat >>$cf_man_alias <<-CF_EOF2 s,@NCURSES_OSPEED@,\$NCURSES_OSPEED,g CF_EOF - for cf_name in captoinfo clear infocmp infotocap tic toe tput + for cf_name in captoinfo clear infocmp infotocap tabs tic toe tput tset do cf_NAME=`echo "$cf_name" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_name=`echo $cf_name|sed "$program_transform_name"` cat >>$cf_edit_man <<-CF_EOF - s,@$cf_NAME@,$cf_name, + s,@$cf_NAME@,$cf_name,g CF_EOF done @@ -8852,8 +9977,21 @@ cat >>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <>$cf_edit_man <\$TMP CF_EOF @@ -8913,7 +10051,7 @@ chmod 755 $cf_edit_man ############################################################################### ### Note that some functions (such as const) are normally disabled anyway. -echo "$as_me:8916: checking if you want to build with function extensions" >&5 +echo "$as_me:10054: checking if you want to build with function extensions" >&5 echo $ECHO_N "checking if you want to build with function extensions... $ECHO_C" >&6 # Check whether --enable-ext-funcs or --disable-ext-funcs was given. @@ -8923,7 +10061,7 @@ if test "${enable_ext_funcs+set}" = set; then else with_ext_funcs=yes fi; -echo "$as_me:8926: result: $with_ext_funcs" >&5 +echo "$as_me:10064: result: $with_ext_funcs" >&5 echo "${ECHO_T}$with_ext_funcs" >&6 if test "$with_ext_funcs" = yes ; then NCURSES_EXT_FUNCS=1 @@ -8941,6 +10079,10 @@ EOF cat >>confdefs.h <<\EOF #define HAVE_RESIZE_TERM 1 +EOF + + cat >>confdefs.h <<\EOF +#define HAVE_TERM_ENTRY_H 1 EOF cat >>confdefs.h <<\EOF @@ -8955,12 +10097,62 @@ EOF #define NCURSES_EXT_FUNCS 1 EOF + GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 + GENERATED_EXT_FUNCS= +fi + +echo "$as_me:10106: checking if you want to build with experimental SCREEN extensions" >&5 +echo $ECHO_N "checking if you want to build with experimental SCREEN extensions... $ECHO_C" >&6 + +# Check whether --enable-sp-funcs or --disable-sp-funcs was given. +if test "${enable_sp_funcs+set}" = set; then + enableval="$enable_sp_funcs" + with_sp_funcs=$enableval +else + with_sp_funcs=no +fi; +echo "$as_me:10116: result: $with_sp_funcs" >&5 +echo "${ECHO_T}$with_sp_funcs" >&6 +if test "$with_sp_funcs" = yes ; then + NCURSES_SP_FUNCS=1 + cat >>confdefs.h <<\EOF +#define NCURSES_SP_FUNCS 1 +EOF + + GENERATED_SP_FUNCS=generated +else + NCURSES_SP_FUNCS=0 + GENERATED_SP_FUNCS= +fi + +echo "$as_me:10130: checking if you want to build with experimental terminal-driver" >&5 +echo $ECHO_N "checking if you want to build with experimental terminal-driver... $ECHO_C" >&6 + +# Check whether --enable-term-driver or --disable-term-driver was given. +if test "${enable_term_driver+set}" = set; then + enableval="$enable_term_driver" + with_term_driver=$enableval +else + with_term_driver=no +fi; +echo "$as_me:10140: result: $with_term_driver" >&5 +echo "${ECHO_T}$with_term_driver" >&6 +if test "$with_term_driver" = yes ; then + cat >>confdefs.h <<\EOF +#define USE_TERM_DRIVER 1 +EOF + + if test "$with_sp_funcs" != yes ; then + { { echo "$as_me:10148: error: The term-driver option relies upon sp-funcs" >&5 +echo "$as_me: error: The term-driver option relies upon sp-funcs" >&2;} + { (exit 1); exit 1; }; } + fi fi ### use option --enable-const to turn on use of const beyond that in XSI. -echo "$as_me:8963: checking for extended use of const keyword" >&5 +echo "$as_me:10155: checking for extended use of const keyword" >&5 echo $ECHO_N "checking for extended use of const keyword... $ECHO_C" >&6 # Check whether --enable-const or --disable-const was given. @@ -8970,7 +10162,7 @@ if test "${enable_const+set}" = set; then else with_ext_const=no fi; -echo "$as_me:8973: result: $with_ext_const" >&5 +echo "$as_me:10165: result: $with_ext_const" >&5 echo "${ECHO_T}$with_ext_const" >&6 NCURSES_CONST='/*nothing*/' if test "$with_ext_const" = yes ; then @@ -8978,7 +10170,7 @@ if test "$with_ext_const" = yes ; then fi ### use option --enable-ext-colors to turn on use of colors beyond 16. -echo "$as_me:8981: checking if you want to use extended colors" >&5 +echo "$as_me:10173: checking if you want to use extended colors" >&5 echo $ECHO_N "checking if you want to use extended colors... $ECHO_C" >&6 # Check whether --enable-ext-colors or --disable-ext-colors was given. @@ -8988,12 +10180,12 @@ if test "${enable_ext_colors+set}" = set; then else with_ext_colors=no fi; -echo "$as_me:8991: result: $with_ext_colors" >&5 +echo "$as_me:10183: result: $with_ext_colors" >&5 echo "${ECHO_T}$with_ext_colors" >&6 NCURSES_EXT_COLORS=0 if test "$with_ext_colors" = yes ; then if test "$with_widec" != yes ; then - { { echo "$as_me:8996: error: This option applies only to wide-character library" >&5 + { { echo "$as_me:10188: error: This option applies only to wide-character library" >&5 echo "$as_me: error: This option applies only to wide-character library" >&2;} { (exit 1); exit 1; }; } else @@ -9004,7 +10196,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9007: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:10199: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9019,7 +10211,7 @@ EOF fi ### use option --enable-ext-mouse to modify coding to support 5-button mice -echo "$as_me:9022: checking if you want to use extended mouse encoding" >&5 +echo "$as_me:10214: checking if you want to use extended mouse encoding" >&5 echo $ECHO_N "checking if you want to use extended mouse encoding... $ECHO_C" >&6 # Check whether --enable-ext-mouse or --disable-ext-mouse was given. @@ -9029,7 +10221,7 @@ if test "${enable_ext_mouse+set}" = set; then else with_ext_mouse=no fi; -echo "$as_me:9032: result: $with_ext_mouse" >&5 +echo "$as_me:10224: result: $with_ext_mouse" >&5 echo "${ECHO_T}$with_ext_mouse" >&6 NCURSES_MOUSE_VERSION=1 if test "$with_ext_mouse" = yes ; then @@ -9040,7 +10232,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9043: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:10235: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9048,7 +10240,7 @@ fi fi -echo "$as_me:9051: checking if you want \$NCURSES_NO_PADDING code" >&5 +echo "$as_me:10243: checking if you want \$NCURSES_NO_PADDING code" >&5 echo $ECHO_N "checking if you want \$NCURSES_NO_PADDING code... $ECHO_C" >&6 # Check whether --enable-no-padding or --disable-no-padding was given. @@ -9058,19 +10250,19 @@ if test "${enable_no_padding+set}" = set; then else with_no_padding=$with_ext_funcs fi; -echo "$as_me:9061: result: $with_no_padding" >&5 +echo "$as_me:10253: result: $with_no_padding" >&5 echo "${ECHO_T}$with_no_padding" >&6 test "$with_no_padding" = yes && cat >>confdefs.h <<\EOF #define NCURSES_NO_PADDING 1 EOF -echo "$as_me:9067: checking for ANSI C header files" >&5 +echo "$as_me:10259: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9073 "configure" +#line 10265 "configure" #include "confdefs.h" #include #include @@ -9078,13 +10270,13 @@ else #include _ACEOF -if { (eval echo "$as_me:9081: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10273: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:9087: \$? = $ac_status" >&5 + echo "$as_me:10279: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9106,7 +10298,7 @@ rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 9109 "configure" +#line 10301 "configure" #include "confdefs.h" #include @@ -9117,14 +10309,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 9127 "configure" +#line 10319 "configure" #include "confdefs.h" #include @@ -9135,7 +10327,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -9145,7 +10337,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 9148 "configure" +#line 10340 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -9171,15 +10363,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9174: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10366: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9177: \$? = $ac_status" >&5 + echo "$as_me:10369: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9179: \"$ac_try\"") >&5 + { (eval echo "$as_me:10371: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9182: \$? = $ac_status" >&5 + echo "$as_me:10374: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -9192,7 +10384,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:9195: result: $ac_cv_header_stdc" >&5 +echo "$as_me:10387: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -9208,28 +10400,28 @@ for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:9211: checking for $ac_header" >&5 +echo "$as_me:10403: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9217 "configure" +#line 10409 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9223: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10415: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9226: \$? = $ac_status" >&5 + echo "$as_me:10418: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9229: \"$ac_try\"") >&5 + { (eval echo "$as_me:10421: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9232: \$? = $ac_status" >&5 + echo "$as_me:10424: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -9239,7 +10431,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9242: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:10434: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:10444: checking for signed char" >&5 echo $ECHO_N "checking for signed char... $ECHO_C" >&6 if test "${ac_cv_type_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9258 "configure" +#line 10450 "configure" #include "confdefs.h" $ac_includes_default int @@ -9270,16 +10462,16 @@ if (sizeof (signed char)) } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9273: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10465: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9276: \$? = $ac_status" >&5 + echo "$as_me:10468: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9279: \"$ac_try\"") >&5 + { (eval echo "$as_me:10471: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9282: \$? = $ac_status" >&5 + echo "$as_me:10474: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signed_char=yes else @@ -9289,10 +10481,10 @@ ac_cv_type_signed_char=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9292: result: $ac_cv_type_signed_char" >&5 +echo "$as_me:10484: result: $ac_cv_type_signed_char" >&5 echo "${ECHO_T}$ac_cv_type_signed_char" >&6 -echo "$as_me:9295: checking size of signed char" >&5 +echo "$as_me:10487: checking size of signed char" >&5 echo $ECHO_N "checking size of signed char... $ECHO_C" >&6 if test "${ac_cv_sizeof_signed_char+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -9301,7 +10493,7 @@ else if test "$cross_compiling" = yes; then # Depending upon the size, compute the lo and hi bounds. cat >conftest.$ac_ext <<_ACEOF -#line 9304 "configure" +#line 10496 "configure" #include "confdefs.h" $ac_includes_default int @@ -9313,21 +10505,21 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= 0)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9316: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10508: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9319: \$? = $ac_status" >&5 + echo "$as_me:10511: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9322: \"$ac_try\"") >&5 + { (eval echo "$as_me:10514: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9325: \$? = $ac_status" >&5 + echo "$as_me:10517: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=0 ac_mid=0 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 9330 "configure" +#line 10522 "configure" #include "confdefs.h" $ac_includes_default int @@ -9339,16 +10531,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9342: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10534: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9345: \$? = $ac_status" >&5 + echo "$as_me:10537: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9348: \"$ac_try\"") >&5 + { (eval echo "$as_me:10540: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9351: \$? = $ac_status" >&5 + echo "$as_me:10543: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid; break else @@ -9364,7 +10556,7 @@ cat conftest.$ac_ext >&5 ac_hi=-1 ac_mid=-1 while :; do cat >conftest.$ac_ext <<_ACEOF -#line 9367 "configure" +#line 10559 "configure" #include "confdefs.h" $ac_includes_default int @@ -9376,16 +10568,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) >= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9379: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10571: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9382: \$? = $ac_status" >&5 + echo "$as_me:10574: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9385: \"$ac_try\"") >&5 + { (eval echo "$as_me:10577: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9388: \$? = $ac_status" >&5 + echo "$as_me:10580: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_lo=$ac_mid; break else @@ -9401,7 +10593,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext while test "x$ac_lo" != "x$ac_hi"; do ac_mid=`expr '(' $ac_hi - $ac_lo ')' / 2 + $ac_lo` cat >conftest.$ac_ext <<_ACEOF -#line 9404 "configure" +#line 10596 "configure" #include "confdefs.h" $ac_includes_default int @@ -9413,16 +10605,16 @@ int _array_ [1 - 2 * !((sizeof (signed char)) <= $ac_mid)] } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9416: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:10608: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9419: \$? = $ac_status" >&5 + echo "$as_me:10611: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9422: \"$ac_try\"") >&5 + { (eval echo "$as_me:10614: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9425: \$? = $ac_status" >&5 + echo "$as_me:10617: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_hi=$ac_mid else @@ -9435,12 +10627,12 @@ done ac_cv_sizeof_signed_char=$ac_lo else if test "$cross_compiling" = yes; then - { { echo "$as_me:9438: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:10630: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 9443 "configure" +#line 10635 "configure" #include "confdefs.h" $ac_includes_default int @@ -9456,15 +10648,15 @@ fclose (f); } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:9459: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10651: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9462: \$? = $ac_status" >&5 + echo "$as_me:10654: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:9464: \"$ac_try\"") >&5 + { (eval echo "$as_me:10656: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9467: \$? = $ac_status" >&5 + echo "$as_me:10659: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_sizeof_signed_char=`cat conftest.val` else @@ -9480,7 +10672,7 @@ else ac_cv_sizeof_signed_char=0 fi fi -echo "$as_me:9483: result: $ac_cv_sizeof_signed_char" >&5 +echo "$as_me:10675: result: $ac_cv_sizeof_signed_char" >&5 echo "${ECHO_T}$ac_cv_sizeof_signed_char" >&6 cat >>confdefs.h <&5 +echo "$as_me:10686: checking if you want to use signed Boolean array in term.h" >&5 echo $ECHO_N "checking if you want to use signed Boolean array in term.h... $ECHO_C" >&6 # Check whether --enable-signed-char or --disable-signed-char was given. @@ -9501,12 +10693,12 @@ if test "${enable_signed_char+set}" = set; then else with_signed_char=no fi; -echo "$as_me:9504: result: $with_signed_char" >&5 +echo "$as_me:10696: result: $with_signed_char" >&5 echo "${ECHO_T}$with_signed_char" >&6 test "$with_signed_char" != yes && NCURSES_SBOOL="char" ### use option --enable-sigwinch to turn on use of SIGWINCH logic -echo "$as_me:9509: checking if you want SIGWINCH handler" >&5 +echo "$as_me:10701: checking if you want SIGWINCH handler" >&5 echo $ECHO_N "checking if you want SIGWINCH handler... $ECHO_C" >&6 # Check whether --enable-sigwinch or --disable-sigwinch was given. @@ -9516,14 +10708,14 @@ if test "${enable_sigwinch+set}" = set; then else with_sigwinch=$with_ext_funcs fi; -echo "$as_me:9519: result: $with_sigwinch" >&5 +echo "$as_me:10711: result: $with_sigwinch" >&5 echo "${ECHO_T}$with_sigwinch" >&6 test "$with_sigwinch" = yes && cat >>confdefs.h <<\EOF #define USE_SIGWINCH 1 EOF ### use option --enable-tcap-names to allow user to define new capabilities -echo "$as_me:9526: checking if you want user-definable terminal capabilities like termcap" >&5 +echo "$as_me:10718: checking if you want user-definable terminal capabilities like termcap" >&5 echo $ECHO_N "checking if you want user-definable terminal capabilities like termcap... $ECHO_C" >&6 # Check whether --enable-tcap-names or --disable-tcap-names was given. @@ -9533,7 +10725,7 @@ if test "${enable_tcap_names+set}" = set; then else with_tcap_names=$with_ext_funcs fi; -echo "$as_me:9536: result: $with_tcap_names" >&5 +echo "$as_me:10728: result: $with_tcap_names" >&5 echo "${ECHO_T}$with_tcap_names" >&6 NCURSES_XNAMES=0 test "$with_tcap_names" = yes && NCURSES_XNAMES=1 @@ -9541,7 +10733,7 @@ test "$with_tcap_names" = yes && NCURSES_XNAMES=1 ############################################################################### # These options are relatively safe to experiment with. -echo "$as_me:9544: checking if you want all development code" >&5 +echo "$as_me:10736: checking if you want all development code" >&5 echo $ECHO_N "checking if you want all development code... $ECHO_C" >&6 # Check whether --with-develop or --without-develop was given. @@ -9551,11 +10743,11 @@ if test "${with_develop+set}" = set; then else with_develop=no fi; -echo "$as_me:9554: result: $with_develop" >&5 +echo "$as_me:10746: result: $with_develop" >&5 echo "${ECHO_T}$with_develop" >&6 ### use option --enable-hard-tabs to turn on use of hard-tabs optimize -echo "$as_me:9558: checking if you want hard-tabs code" >&5 +echo "$as_me:10750: checking if you want hard-tabs code" >&5 echo $ECHO_N "checking if you want hard-tabs code... $ECHO_C" >&6 # Check whether --enable-hard-tabs or --disable-hard-tabs was given. @@ -9565,14 +10757,14 @@ if test "${enable_hard_tabs+set}" = set; then else enable_hard_tabs=$with_develop fi; -echo "$as_me:9568: result: $enable_hard_tabs" >&5 +echo "$as_me:10760: result: $enable_hard_tabs" >&5 echo "${ECHO_T}$enable_hard_tabs" >&6 test "$enable_hard_tabs" = yes && cat >>confdefs.h <<\EOF #define USE_HARD_TABS 1 EOF ### use option --enable-xmc-glitch to turn on use of magic-cookie optimize -echo "$as_me:9575: checking if you want limited support for xmc" >&5 +echo "$as_me:10767: checking if you want limited support for xmc" >&5 echo $ECHO_N "checking if you want limited support for xmc... $ECHO_C" >&6 # Check whether --enable-xmc-glitch or --disable-xmc-glitch was given. @@ -9582,7 +10774,7 @@ if test "${enable_xmc_glitch+set}" = set; then else enable_xmc_glitch=$with_develop fi; -echo "$as_me:9585: result: $enable_xmc_glitch" >&5 +echo "$as_me:10777: result: $enable_xmc_glitch" >&5 echo "${ECHO_T}$enable_xmc_glitch" >&6 test "$enable_xmc_glitch" = yes && cat >>confdefs.h <<\EOF #define USE_XMC_SUPPORT 1 @@ -9591,7 +10783,7 @@ EOF ############################################################################### # These are just experimental, probably should not be in a package: -echo "$as_me:9594: checking if you do not want to assume colors are white-on-black" >&5 +echo "$as_me:10786: checking if you do not want to assume colors are white-on-black" >&5 echo $ECHO_N "checking if you do not want to assume colors are white-on-black... $ECHO_C" >&6 # Check whether --enable-assumed-color or --disable-assumed-color was given. @@ -9601,14 +10793,14 @@ if test "${enable_assumed_color+set}" = set; then else with_assumed_color=yes fi; -echo "$as_me:9604: result: $with_assumed_color" >&5 +echo "$as_me:10796: result: $with_assumed_color" >&5 echo "${ECHO_T}$with_assumed_color" >&6 test "$with_assumed_color" = yes && cat >>confdefs.h <<\EOF #define USE_ASSUMED_COLOR 1 EOF ### use option --enable-hashmap to turn on use of hashmap scrolling logic -echo "$as_me:9611: checking if you want hashmap scrolling-optimization code" >&5 +echo "$as_me:10803: checking if you want hashmap scrolling-optimization code" >&5 echo $ECHO_N "checking if you want hashmap scrolling-optimization code... $ECHO_C" >&6 # Check whether --enable-hashmap or --disable-hashmap was given. @@ -9618,14 +10810,14 @@ if test "${enable_hashmap+set}" = set; then else with_hashmap=yes fi; -echo "$as_me:9621: result: $with_hashmap" >&5 +echo "$as_me:10813: result: $with_hashmap" >&5 echo "${ECHO_T}$with_hashmap" >&6 test "$with_hashmap" = yes && cat >>confdefs.h <<\EOF #define USE_HASHMAP 1 EOF ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment -echo "$as_me:9628: checking if you want colorfgbg code" >&5 +echo "$as_me:10820: checking if you want colorfgbg code" >&5 echo $ECHO_N "checking if you want colorfgbg code... $ECHO_C" >&6 # Check whether --enable-colorfgbg or --disable-colorfgbg was given. @@ -9635,16 +10827,33 @@ if test "${enable_colorfgbg+set}" = set; then else with_colorfgbg=no fi; -echo "$as_me:9638: result: $with_colorfgbg" >&5 +echo "$as_me:10830: result: $with_colorfgbg" >&5 echo "${ECHO_T}$with_colorfgbg" >&6 test "$with_colorfgbg" = yes && cat >>confdefs.h <<\EOF #define USE_COLORFGBG 1 EOF +### use option --enable-interop to turn on use of bindings used for interop +echo "$as_me:10837: checking if you want interop bindings" >&5 +echo $ECHO_N "checking if you want interop bindings... $ECHO_C" >&6 + +# Check whether --enable-interop or --disable-interop was given. +if test "${enable_interop+set}" = set; then + enableval="$enable_interop" + with_exp_interop=$enableval +else + with_exp_interop=no +fi; +echo "$as_me:10847: result: $with_exp_interop" >&5 +echo "${ECHO_T}$with_exp_interop" >&6 + +NCURSES_INTEROP_FUNCS=0 +test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 + # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. -echo "$as_me:9647: checking if you want to link with the pthread library" >&5 +echo "$as_me:10856: checking if you want to link with the pthread library" >&5 echo $ECHO_N "checking if you want to link with the pthread library... $ECHO_C" >&6 # Check whether --with-pthread or --without-pthread was given. @@ -9654,27 +10863,27 @@ if test "${with_pthread+set}" = set; then else with_pthread=no fi; -echo "$as_me:9657: result: $with_pthread" >&5 +echo "$as_me:10866: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" != no ; then - echo "$as_me:9661: checking for pthread.h" >&5 + echo "$as_me:10870: checking for pthread.h" >&5 echo $ECHO_N "checking for pthread.h... $ECHO_C" >&6 if test "${ac_cv_header_pthread_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9667 "configure" +#line 10876 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:9671: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:10880: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:9677: \$? = $ac_status" >&5 + echo "$as_me:10886: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -9693,7 +10902,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:9696: result: $ac_cv_header_pthread_h" >&5 +echo "$as_me:10905: result: $ac_cv_header_pthread_h" >&5 echo "${ECHO_T}$ac_cv_header_pthread_h" >&6 if test $ac_cv_header_pthread_h = yes; then @@ -9701,12 +10910,12 @@ if test $ac_cv_header_pthread_h = yes; then #define HAVE_PTHREADS_H 1 EOF - echo "$as_me:9704: checking if we can link with the pthread library" >&5 + echo "$as_me:10913: checking if we can link with the pthread library" >&5 echo $ECHO_N "checking if we can link with the pthread library... $ECHO_C" >&6 cf_save_LIBS="$LIBS" LIBS="-lpthread $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 9709 "configure" +#line 10918 "configure" #include "confdefs.h" #include @@ -9722,16 +10931,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:9725: \"$ac_link\"") >&5 +if { (eval echo "$as_me:10934: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:9728: \$? = $ac_status" >&5 + echo "$as_me:10937: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:9731: \"$ac_try\"") >&5 + { (eval echo "$as_me:10940: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9734: \$? = $ac_status" >&5 + echo "$as_me:10943: \$? = $ac_status" >&5 (exit $ac_status); }; }; then with_pthread=yes else @@ -9741,7 +10950,7 @@ with_pthread=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" - echo "$as_me:9744: result: $with_pthread" >&5 + echo "$as_me:10953: result: $with_pthread" >&5 echo "${ECHO_T}$with_pthread" >&6 if test "$with_pthread" = yes ; then @@ -9751,7 +10960,7 @@ echo "${ECHO_T}$with_pthread" >&6 EOF else - { { echo "$as_me:9754: error: Cannot link with pthread library" >&5 + { { echo "$as_me:10963: error: Cannot link with pthread library" >&5 echo "$as_me: error: Cannot link with pthread library" >&2;} { (exit 1); exit 1; }; } fi @@ -9760,28 +10969,109 @@ fi fi -echo "$as_me:9763: checking if you want to use weak-symbols for pthreads" >&5 +if test "x$with_pthread" != xno; then + echo "$as_me:10973: checking for pthread_kill" >&5 +echo $ECHO_N "checking for pthread_kill... $ECHO_C" >&6 +if test "${ac_cv_func_pthread_kill+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 10979 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char pthread_kill (); below. */ +#include +/* 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 pthread_kill (); +char (*f) (); + +int +main () +{ +/* 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_pthread_kill) || defined (__stub___pthread_kill) +choke me +#else +f = pthread_kill; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:11010: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:11013: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:11016: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:11019: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_pthread_kill=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_pthread_kill=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:11029: result: $ac_cv_func_pthread_kill" >&5 +echo "${ECHO_T}$ac_cv_func_pthread_kill" >&6 +if test $ac_cv_func_pthread_kill = yes; then + + echo "$as_me:11033: checking if you want to allow EINTR in wgetch with pthreads" >&5 +echo $ECHO_N "checking if you want to allow EINTR in wgetch with pthreads... $ECHO_C" >&6 + +# Check whether --enable-pthreads-eintr or --disable-pthreads-eintr was given. +if test "${enable_pthreads_eintr+set}" = set; then + enableval="$enable_pthreads_eintr" + use_pthreads_eintr=$enableval +else + use_pthreads_eintr=no +fi; + echo "$as_me:11043: result: $use_pthreads_eintr" >&5 +echo "${ECHO_T}$use_pthreads_eintr" >&6 + if test $use_pthreads_eintr = yes ; then + cat >>confdefs.h <<\EOF +#define USE_PTHREADS_EINTR 1 +EOF + + fi +fi + + echo "$as_me:11053: checking if you want to use weak-symbols for pthreads" >&5 echo $ECHO_N "checking if you want to use weak-symbols for pthreads... $ECHO_C" >&6 # Check whether --enable-weak-symbols or --disable-weak-symbols was given. if test "${enable_weak_symbols+set}" = set; then enableval="$enable_weak_symbols" - use_weak_symbols=$withval + use_weak_symbols=$enableval else use_weak_symbols=no fi; -echo "$as_me:9773: result: $use_weak_symbols" >&5 + echo "$as_me:11063: result: $use_weak_symbols" >&5 echo "${ECHO_T}$use_weak_symbols" >&6 -if test "$use_weak_symbols" = yes ; then + if test "$use_weak_symbols" = yes ; then -echo "$as_me:9777: checking if $CC supports weak symbols" >&5 +echo "$as_me:11067: checking if $CC supports weak symbols" >&5 echo $ECHO_N "checking if $CC supports weak symbols... $ECHO_C" >&6 if test "${cf_cv_weak_symbols+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 9784 "configure" +#line 11074 "configure" #include "confdefs.h" #include @@ -9807,16 +11097,16 @@ weak_symbol(fopen); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:9810: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11100: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:9813: \$? = $ac_status" >&5 + echo "$as_me:11103: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:9816: \"$ac_try\"") >&5 + { (eval echo "$as_me:11106: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:9819: \$? = $ac_status" >&5 + echo "$as_me:11109: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_weak_symbols=yes else @@ -9827,18 +11117,19 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:9830: result: $cf_cv_weak_symbols" >&5 +echo "$as_me:11120: result: $cf_cv_weak_symbols" >&5 echo "${ECHO_T}$cf_cv_weak_symbols" >&6 -else - cf_cv_weak_symbols=no -fi + else + cf_cv_weak_symbols=no + fi -if test $cf_cv_weak_symbols = yes ; then - cat >>confdefs.h <<\EOF + if test $cf_cv_weak_symbols = yes ; then + cat >>confdefs.h <<\EOF #define USE_WEAK_SYMBOLS 1 EOF + fi fi PTHREAD= @@ -9857,7 +11148,7 @@ fi # opaque outside of that, so there is no --enable-opaque option. We can use # this option without --with-pthreads, but this will be always set for # pthreads. -echo "$as_me:9860: checking if you want experimental reentrant code" >&5 +echo "$as_me:11151: checking if you want experimental reentrant code" >&5 echo $ECHO_N "checking if you want experimental reentrant code... $ECHO_C" >&6 # Check whether --enable-reentrant or --disable-reentrant was given. @@ -9867,21 +11158,23 @@ if test "${enable_reentrant+set}" = set; then else with_reentrant=no fi; -echo "$as_me:9870: result: $with_reentrant" >&5 +echo "$as_me:11161: result: $with_reentrant" >&5 echo "${ECHO_T}$with_reentrant" >&6 if test "$with_reentrant" = yes ; then cf_cv_enable_reentrant=1 cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then + if test $cf_cv_weak_symbols = yes ; then # remove pthread library from $LIBS LIBS=`echo "$LIBS" | sed -e 's/-lpthread[ ]//g' -e 's/-lpthread$//'` - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + TEST_LIBS="-lpthread $TEST_LIBS" + TEST_LIBS2="-lpthread $TEST_LIBS2" + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi cat >>confdefs.h <<\EOF #define USE_REENTRANT 1 EOF @@ -9891,7 +11184,7 @@ if test "${with_abi_version+set}" != set; then 5.*) cf_cv_rel_version=6.0 cf_cv_abi_version=6 - { echo "$as_me:9894: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 + { echo "$as_me:11187: WARNING: Overriding ABI version to $cf_cv_abi_version" >&5 echo "$as_me: WARNING: Overriding ABI version to $cf_cv_abi_version" >&2;} ;; esac @@ -9904,7 +11197,29 @@ else NCURSES_SIZE_T=short fi -echo "$as_me:9907: checking if you want experimental safe-sprintf code" >&5 +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + echo "$as_me:11202: checking for prefix used to wrap public variables" >&5 +echo $ECHO_N "checking for prefix used to wrap public variables... $ECHO_C" >&6 + +# Check whether --with-wrap-prefix or --without-wrap-prefix was given. +if test "${with_wrap_prefix+set}" = set; then + withval="$with_wrap_prefix" + NCURSES_WRAP_PREFIX=$withval +else + NCURSES_WRAP_PREFIX=_nc_ +fi; + echo "$as_me:11212: result: $NCURSES_WRAP_PREFIX" >&5 +echo "${ECHO_T}$NCURSES_WRAP_PREFIX" >&6 +else + NCURSES_WRAP_PREFIX=_nc_ +fi + +cat >>confdefs.h <&5 echo $ECHO_N "checking if you want experimental safe-sprintf code... $ECHO_C" >&6 # Check whether --enable-safe-sprintf or --disable-safe-sprintf was given. @@ -9914,7 +11229,7 @@ if test "${enable_safe_sprintf+set}" = set; then else with_safe_sprintf=no fi; -echo "$as_me:9917: result: $with_safe_sprintf" >&5 +echo "$as_me:11232: result: $with_safe_sprintf" >&5 echo "${ECHO_T}$with_safe_sprintf" >&6 test "$with_safe_sprintf" = yes && cat >>confdefs.h <<\EOF #define USE_SAFE_SPRINTF 1 @@ -9923,7 +11238,7 @@ EOF ### use option --disable-scroll-hints to turn off use of scroll-hints scrolling logic # when hashmap is used scroll hints are useless if test "$with_hashmap" = no ; then -echo "$as_me:9926: checking if you want to experiment without scrolling-hints code" >&5 +echo "$as_me:11241: checking if you want to experiment without scrolling-hints code" >&5 echo $ECHO_N "checking if you want to experiment without scrolling-hints code... $ECHO_C" >&6 # Check whether --enable-scroll-hints or --disable-scroll-hints was given. @@ -9933,7 +11248,7 @@ if test "${enable_scroll_hints+set}" = set; then else with_scroll_hints=yes fi; -echo "$as_me:9936: result: $with_scroll_hints" >&5 +echo "$as_me:11251: result: $with_scroll_hints" >&5 echo "${ECHO_T}$with_scroll_hints" >&6 test "$with_scroll_hints" = yes && cat >>confdefs.h <<\EOF #define USE_SCROLL_HINTS 1 @@ -9941,7 +11256,7 @@ EOF fi -echo "$as_me:9944: checking if you want experimental wgetch-events code" >&5 +echo "$as_me:11259: checking if you want experimental wgetch-events code" >&5 echo $ECHO_N "checking if you want experimental wgetch-events code... $ECHO_C" >&6 # Check whether --enable-wgetch-events or --disable-wgetch-events was given. @@ -9951,7 +11266,7 @@ if test "${enable_wgetch_events+set}" = set; then else with_wgetch_events=no fi; -echo "$as_me:9954: result: $with_wgetch_events" >&5 +echo "$as_me:11269: result: $with_wgetch_events" >&5 echo "${ECHO_T}$with_wgetch_events" >&6 test "$with_wgetch_events" = yes && cat >>confdefs.h <<\EOF #define NCURSES_WGETCH_EVENTS 1 @@ -9960,7 +11275,7 @@ EOF ############################################################################### ### use option --disable-echo to suppress full display compiling commands -echo "$as_me:9963: checking if you want to display full commands during build" >&5 +echo "$as_me:11278: checking if you want to display full commands during build" >&5 echo $ECHO_N "checking if you want to display full commands during build... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. @@ -9977,11 +11292,11 @@ else test -n "$LIBTOOL" && LIBTOOL="$LIBTOOL --silent" test -n "$LIBTOOL_CXX" && LIBTOOL_CXX="$LIBTOOL_CXX --silent" fi -echo "$as_me:9980: result: $with_echo" >&5 +echo "$as_me:11295: result: $with_echo" >&5 echo "${ECHO_T}$with_echo" >&6 ### use option --enable-warnings to turn on all gcc warnings -echo "$as_me:9984: checking if you want to see compiler warnings" >&5 +echo "$as_me:11299: checking if you want to see compiler warnings" >&5 echo $ECHO_N "checking if you want to see compiler warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. @@ -9989,10 +11304,11 @@ if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" with_warnings=$enableval fi; -echo "$as_me:9992: result: $with_warnings" >&5 +echo "$as_me:11307: result: $with_warnings" >&5 echo "${ECHO_T}$with_warnings" >&6 if test "x$with_warnings" = "xyes"; then + ADAFLAGS="$ADAFLAGS -gnatg" INTEL_COMPILER=no @@ -10000,12 +11316,12 @@ INTEL_COMPILER=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:10003: checking if this is really Intel C compiler" >&5 + echo "$as_me:11319: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 10008 "configure" +#line 11324 "configure" #include "confdefs.h" int @@ -10022,16 +11338,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10025: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11341: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10028: \$? = $ac_status" >&5 + echo "$as_me:11344: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10031: \"$ac_try\"") >&5 + { (eval echo "$as_me:11347: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10034: \$? = $ac_status" >&5 + echo "$as_me:11350: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -10042,14 +11358,14 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS="$cf_save_CFLAGS" - echo "$as_me:10045: result: $INTEL_COMPILER" >&5 + echo "$as_me:11361: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi cat > conftest.$ac_ext <&5 + { echo "$as_me:11385: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="-Wall" for cf_opt in \ wd1419 \ - wd1682 \ wd1683 \ wd1684 \ wd193 \ - wd279 \ wd593 \ + wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:10087: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11401: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10090: \$? = $ac_status" >&5 + echo "$as_me:11404: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10092: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11406: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi @@ -10098,13 +11412,13 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GCC" = yes then - { echo "$as_me:10101: checking for $CC warning options..." >&5 + { echo "$as_me:11415: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" - EXTRA_CFLAGS="-W -Wall" + EXTRA_CFLAGS= cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" - for cf_opt in \ + for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ @@ -10118,12 +11432,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} Wundef $cf_warn_CONST Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" - if { (eval echo "$as_me:10121: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11435: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10124: \$? = $ac_status" >&5 + echo "$as_me:11438: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10126: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11440: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case $cf_opt in #(vi Wcast-qual) #(vi @@ -10134,7 +11448,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 [34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 -echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 +echo "${as_me:-configure}:11451: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac @@ -10145,7 +11459,7 @@ echo "${as_me-configure}:10137: testing feature is broken in gcc $GCC_VERSION .. done CFLAGS="$cf_save_CFLAGS" fi -rm -f conftest* +rm -rf conftest* if test "$cf_with_cxx" = yes ; then @@ -10154,12 +11468,12 @@ INTEL_CPLUSPLUS=no if test "$GCC" = yes ; then case $host_os in linux*|gnu*) - echo "$as_me:10157: checking if this is really Intel C++ compiler" >&5 + echo "$as_me:11471: checking if this is really Intel C++ compiler" >&5 echo $ECHO_N "checking if this is really Intel C++ compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CXXFLAGS" CXXFLAGS="$CXXFLAGS -no-gcc" cat >conftest.$ac_ext <<_ACEOF -#line 10162 "configure" +#line 11476 "configure" #include "confdefs.h" int @@ -10176,16 +11490,16 @@ make an error } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:10179: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:11493: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10182: \$? = $ac_status" >&5 + echo "$as_me:11496: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:10185: \"$ac_try\"") >&5 + { (eval echo "$as_me:11499: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10188: \$? = $ac_status" >&5 + echo "$as_me:11502: \$? = $ac_status" >&5 (exit $ac_status); }; }; then INTEL_CPLUSPLUS=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147 -no-gcc" @@ -10196,7 +11510,7 @@ cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest.$ac_ext CXXFLAGS="$cf_save_CFLAGS" - echo "$as_me:10199: result: $INTEL_CPLUSPLUS" >&5 + echo "$as_me:11513: result: $INTEL_CPLUSPLUS" >&5 echo "${ECHO_T}$INTEL_CPLUSPLUS" >&6 ;; esac @@ -10210,7 +11524,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat > conftest.$ac_ext <&5 + { echo "$as_me:11545: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-Wall" @@ -10245,12 +11559,12 @@ echo "$as_me: checking for $CC warning options..." >&6;} wd981 do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -$cf_opt" - if { (eval echo "$as_me:10248: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11562: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10251: \$? = $ac_status" >&5 + echo "$as_me:11565: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10253: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11567: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" fi @@ -10259,7 +11573,7 @@ echo "${ECHO_T}... -$cf_opt" >&6 elif test "$GXX" = yes then - { echo "$as_me:10262: checking for $CXX warning options..." >&5 + { echo "$as_me:11576: checking for $CXX warning options..." >&5 echo "$as_me: checking for $CXX warning options..." >&6;} cf_save_CXXFLAGS="$CXXFLAGS" EXTRA_CXXFLAGS="-W -Wall" @@ -10288,23 +11602,23 @@ echo "$as_me: checking for $CXX warning options..." >&6;} Wundef $cf_gxx_extra_warnings Wno-unused do CXXFLAGS="$cf_save_CXXFLAGS $EXTRA_CXXFLAGS -Werror -$cf_opt" - if { (eval echo "$as_me:10291: \"$ac_compile\"") >&5 + if { (eval echo "$as_me:11605: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10294: \$? = $ac_status" >&5 + echo "$as_me:11608: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10296: result: ... -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11610: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CXXFLAGS="$EXTRA_CXXFLAGS -$cf_opt" else - test -n "$verbose" && echo "$as_me:10300: result: ... no -$cf_opt" >&5 + test -n "$verbose" && echo "$as_me:11614: result: ... no -$cf_opt" >&5 echo "${ECHO_T}... no -$cf_opt" >&6 fi done CXXFLAGS="$cf_save_CXXFLAGS" fi -rm -f conftest* +rm -rf conftest* ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' @@ -10333,10 +11647,10 @@ cat > conftest.i <&5 + { echo "$as_me:11650: checking for $CC __attribute__ directives..." >&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > conftest.$ac_ext <&5 - case $cf_attribute in - scanf|printf) - cat >conftest.h <conftest.h <conftest.h <conftest.h <conftest.h <&5 + + if { (eval echo "$as_me:11702: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:10380: \$? = $ac_status" >&5 + echo "$as_me:11705: \$? = $ac_status" >&5 (exit $ac_status); }; then - test -n "$verbose" && echo "$as_me:10382: result: ... $cf_attribute" >&5 + test -n "$verbose" && echo "$as_me:11707: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h + case $cf_attribute in #(vi + printf) #(vi + if test "$cf_printf_attribute" = no ; then + cat >>confdefs.h <>confdefs.h <>confdefs.h <>confdefs.h <&5 +echo "$as_me:11743: checking if you want to enable runtime assertions" >&5 echo $ECHO_N "checking if you want to enable runtime assertions... $ECHO_C" >&6 # Check whether --enable-assertions or --disable-assertions was given. @@ -10401,7 +11750,7 @@ if test "${enable_assertions+set}" = set; then else with_assertions=no fi; -echo "$as_me:10404: result: $with_assertions" >&5 +echo "$as_me:11753: result: $with_assertions" >&5 echo "${ECHO_T}$with_assertions" >&6 if test -n "$GCC" then @@ -10413,13 +11762,15 @@ EOF CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + + ADAFLAGS="$ADAFLAGS -gnata" + fi fi ### use option --disable-leaks to suppress "permanent" leaks, for testing -echo "$as_me:10422: checking if you want to use dmalloc for testing" >&5 +echo "$as_me:11773: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. @@ -10435,7 +11786,7 @@ EOF else with_dmalloc= fi; -echo "$as_me:10438: result: ${with_dmalloc:-no}" >&5 +echo "$as_me:11789: result: ${with_dmalloc:-no}" >&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -10461,8 +11812,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10477,6 +11828,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10492,8 +11853,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10505,7 +11866,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10519,23 +11880,23 @@ fi esac if test "$with_dmalloc" = yes ; then - echo "$as_me:10522: checking for dmalloc.h" >&5 + echo "$as_me:11883: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10528 "configure" +#line 11889 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10532: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:11893: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:10538: \$? = $ac_status" >&5 + echo "$as_me:11899: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10554,11 +11915,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10557: result: $ac_cv_header_dmalloc_h" >&5 +echo "$as_me:11918: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test $ac_cv_header_dmalloc_h = yes; then -echo "$as_me:10561: checking for dmalloc_debug in -ldmalloc" >&5 +echo "$as_me:11922: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10566,7 +11927,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10569 "configure" +#line 11930 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10585,16 +11946,16 @@ dmalloc_debug (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10588: \"$ac_link\"") >&5 +if { (eval echo "$as_me:11949: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10591: \$? = $ac_status" >&5 + echo "$as_me:11952: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10594: \"$ac_try\"") >&5 + { (eval echo "$as_me:11955: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10597: \$? = $ac_status" >&5 + echo "$as_me:11958: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else @@ -10605,7 +11966,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10608: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 +echo "$as_me:11969: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test $ac_cv_lib_dmalloc_dmalloc_debug = yes; then cat >>confdefs.h <&5 +echo "$as_me:11984: checking if you want to use dbmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. @@ -10636,7 +11997,7 @@ EOF else with_dbmalloc= fi; -echo "$as_me:10639: result: ${with_dbmalloc:-no}" >&5 +echo "$as_me:12000: result: ${with_dbmalloc:-no}" >&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case .$with_cflags in #(vi @@ -10662,8 +12023,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10678,6 +12039,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10693,8 +12064,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10706,7 +12077,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10720,23 +12091,23 @@ fi esac if test "$with_dbmalloc" = yes ; then - echo "$as_me:10723: checking for dbmalloc.h" >&5 + echo "$as_me:12094: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 10729 "configure" +#line 12100 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:10733: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:12104: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:10739: \$? = $ac_status" >&5 + echo "$as_me:12110: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -10755,11 +12126,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:10758: result: $ac_cv_header_dbmalloc_h" >&5 +echo "$as_me:12129: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test $ac_cv_header_dbmalloc_h = yes; then -echo "$as_me:10762: checking for debug_malloc in -ldbmalloc" >&5 +echo "$as_me:12133: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -10767,7 +12138,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 10770 "configure" +#line 12141 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -10786,16 +12157,16 @@ debug_malloc (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:10789: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12160: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:10792: \$? = $ac_status" >&5 + echo "$as_me:12163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:10795: \"$ac_try\"") >&5 + { (eval echo "$as_me:12166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:10798: \$? = $ac_status" >&5 + echo "$as_me:12169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else @@ -10806,7 +12177,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:10809: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 +echo "$as_me:12180: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test $ac_cv_lib_dbmalloc_debug_malloc = yes; then cat >>confdefs.h <&5 +echo "$as_me:12195: checking if you want to use valgrind for testing" >&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. @@ -10837,7 +12208,7 @@ EOF else with_valgrind= fi; -echo "$as_me:10840: result: ${with_valgrind:-no}" >&5 +echo "$as_me:12211: result: ${with_valgrind:-no}" >&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case .$with_cflags in #(vi @@ -10863,8 +12234,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -10879,6 +12250,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -10894,8 +12275,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -10907,7 +12288,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -10920,22 +12301,26 @@ fi ;; esac -echo "$as_me:10923: checking if you want to perform memory-leak testing" >&5 +echo "$as_me:12304: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" - with_no_leaks=yes + if test "x$enableval" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi else : ${with_no_leaks:=no} fi; -echo "$as_me:10933: result: $with_no_leaks" >&5 +echo "$as_me:12314: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$with_no_leaks" = yes ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 +EOF + + cat >>confdefs.h <<\EOF +#define YY_NO_LEAKS 1 EOF fi @@ -10975,7 +12360,7 @@ case "$CFLAGS $CPPFLAGS" in ;; esac -echo "$as_me:10978: checking whether to add trace feature to all models" >&5 +echo "$as_me:12363: checking whether to add trace feature to all models" >&5 echo $ECHO_N "checking whether to add trace feature to all models... $ECHO_C" >&6 # Check whether --with-trace or --without-trace was given. @@ -10985,7 +12370,7 @@ if test "${with_trace+set}" = set; then else cf_with_trace=$cf_all_traces fi; -echo "$as_me:10988: result: $cf_with_trace" >&5 +echo "$as_me:12373: result: $cf_with_trace" >&5 echo "${ECHO_T}$cf_with_trace" >&6 if test "$cf_with_trace" = yes ; then @@ -11008,8 +12393,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -11024,6 +12409,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -11039,8 +12434,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -11052,7 +12447,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -11066,13 +12461,17 @@ else fi ### Checks for libraries. -echo "$as_me:11069: checking for gettimeofday" >&5 +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) +echo "$as_me:12468: checking for gettimeofday" >&5 echo $ECHO_N "checking for gettimeofday... $ECHO_C" >&6 if test "${ac_cv_func_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11075 "configure" +#line 12474 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char gettimeofday (); below. */ @@ -11103,16 +12502,16 @@ f = gettimeofday; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11106: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12505: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11109: \$? = $ac_status" >&5 + echo "$as_me:12508: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11112: \"$ac_try\"") >&5 + { (eval echo "$as_me:12511: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11115: \$? = $ac_status" >&5 + echo "$as_me:12514: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_gettimeofday=yes else @@ -11122,7 +12521,7 @@ ac_cv_func_gettimeofday=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:11125: result: $ac_cv_func_gettimeofday" >&5 +echo "$as_me:12524: result: $ac_cv_func_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_func_gettimeofday" >&6 if test $ac_cv_func_gettimeofday = yes; then cat >>confdefs.h <<\EOF @@ -11131,7 +12530,7 @@ EOF else -echo "$as_me:11134: checking for gettimeofday in -lbsd" >&5 +echo "$as_me:12533: checking for gettimeofday in -lbsd" >&5 echo $ECHO_N "checking for gettimeofday in -lbsd... $ECHO_C" >&6 if test "${ac_cv_lib_bsd_gettimeofday+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11139,7 +12538,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lbsd $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11142 "configure" +#line 12541 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11158,16 +12557,16 @@ gettimeofday (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11161: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12560: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11164: \$? = $ac_status" >&5 + echo "$as_me:12563: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11167: \"$ac_try\"") >&5 + { (eval echo "$as_me:12566: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11170: \$? = $ac_status" >&5 + echo "$as_me:12569: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_bsd_gettimeofday=yes else @@ -11178,26 +12577,28 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11181: result: $ac_cv_lib_bsd_gettimeofday" >&5 +echo "$as_me:12580: result: $ac_cv_lib_bsd_gettimeofday" >&5 echo "${ECHO_T}$ac_cv_lib_bsd_gettimeofday" >&6 if test $ac_cv_lib_bsd_gettimeofday = yes; then cat >>confdefs.h <<\EOF #define HAVE_GETTIMEOFDAY 1 EOF - LIBS="$LIBS -lbsd" + LIBS="-lbsd $LIBS" fi fi + ;; +esac -echo "$as_me:11193: checking if -lm needed for math functions" >&5 +echo "$as_me:12594: checking if -lm needed for math functions" >&5 echo $ECHO_N "checking if -lm needed for math functions... $ECHO_C" >&6 if test "${cf_cv_need_libm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11200 "configure" +#line 12601 "configure" #include "confdefs.h" #include @@ -11212,16 +12613,16 @@ double x = rand(); printf("result = %g\n", sin(x)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11215: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12616: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11218: \$? = $ac_status" >&5 + echo "$as_me:12619: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11221: \"$ac_try\"") >&5 + { (eval echo "$as_me:12622: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11224: \$? = $ac_status" >&5 + echo "$as_me:12625: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_need_libm=no else @@ -11231,7 +12632,7 @@ cf_cv_need_libm=yes fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:11234: result: $cf_cv_need_libm" >&5 +echo "$as_me:12635: result: $cf_cv_need_libm" >&5 echo "${ECHO_T}$cf_cv_need_libm" >&6 if test "$cf_cv_need_libm" = yes then @@ -11239,13 +12640,13 @@ MATH_LIB=-lm fi ### Checks for header files. -echo "$as_me:11242: checking for ANSI C header files" >&5 +echo "$as_me:12643: checking for ANSI C header files" >&5 echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 if test "${ac_cv_header_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11248 "configure" +#line 12649 "configure" #include "confdefs.h" #include #include @@ -11253,13 +12654,13 @@ else #include _ACEOF -if { (eval echo "$as_me:11256: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:12657: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:11262: \$? = $ac_status" >&5 + echo "$as_me:12663: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11281,7 +12682,7 @@ rm -f conftest.err conftest.$ac_ext if test $ac_cv_header_stdc = yes; then # SunOS 4.x string.h does not declare mem*, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 11284 "configure" +#line 12685 "configure" #include "confdefs.h" #include @@ -11292,14 +12693,14 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >conftest.$ac_ext <<_ACEOF -#line 11302 "configure" +#line 12703 "configure" #include "confdefs.h" #include @@ -11310,7 +12711,7 @@ if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | else ac_cv_header_stdc=no fi -rm -f conftest* +rm -rf conftest* fi @@ -11320,7 +12721,7 @@ if test $ac_cv_header_stdc = yes; then : else cat >conftest.$ac_ext <<_ACEOF -#line 11323 "configure" +#line 12724 "configure" #include "confdefs.h" #include #if ((' ' & 0x0FF) == 0x020) @@ -11346,15 +12747,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:11349: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12750: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11352: \$? = $ac_status" >&5 + echo "$as_me:12753: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:11354: \"$ac_try\"") >&5 + { (eval echo "$as_me:12755: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11357: \$? = $ac_status" >&5 + echo "$as_me:12758: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -11367,7 +12768,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi fi -echo "$as_me:11370: result: $ac_cv_header_stdc" >&5 +echo "$as_me:12771: result: $ac_cv_header_stdc" >&5 echo "${ECHO_T}$ac_cv_header_stdc" >&6 if test $ac_cv_header_stdc = yes; then @@ -11380,13 +12781,13 @@ fi ac_header_dirent=no for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh` -echo "$as_me:11383: checking for $ac_hdr that defines DIR" >&5 +echo "$as_me:12784: checking for $ac_hdr that defines DIR" >&5 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11389 "configure" +#line 12790 "configure" #include "confdefs.h" #include #include <$ac_hdr> @@ -11401,16 +12802,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11404: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12805: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11407: \$? = $ac_status" >&5 + echo "$as_me:12808: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11410: \"$ac_try\"") >&5 + { (eval echo "$as_me:12811: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11413: \$? = $ac_status" >&5 + echo "$as_me:12814: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_Header=yes" else @@ -11420,7 +12821,7 @@ eval "$as_ac_Header=no" fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11423: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:12824: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 + echo "$as_me:12837: checking for opendir in -ldir" >&5 echo $ECHO_N "checking for opendir in -ldir... $ECHO_C" >&6 if test "${ac_cv_lib_dir_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11441,7 +12842,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-ldir $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11444 "configure" +#line 12845 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11460,16 +12861,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11463: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12864: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11466: \$? = $ac_status" >&5 + echo "$as_me:12867: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11469: \"$ac_try\"") >&5 + { (eval echo "$as_me:12870: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11472: \$? = $ac_status" >&5 + echo "$as_me:12873: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_dir_opendir=yes else @@ -11480,14 +12881,14 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11483: result: $ac_cv_lib_dir_opendir" >&5 +echo "$as_me:12884: result: $ac_cv_lib_dir_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_dir_opendir" >&6 if test $ac_cv_lib_dir_opendir = yes; then LIBS="$LIBS -ldir" fi else - echo "$as_me:11490: checking for opendir in -lx" >&5 + echo "$as_me:12891: checking for opendir in -lx" >&5 echo $ECHO_N "checking for opendir in -lx... $ECHO_C" >&6 if test "${ac_cv_lib_x_opendir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11495,7 +12896,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lx $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11498 "configure" +#line 12899 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11514,16 +12915,16 @@ opendir (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11517: \"$ac_link\"") >&5 +if { (eval echo "$as_me:12918: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11520: \$? = $ac_status" >&5 + echo "$as_me:12921: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11523: \"$ac_try\"") >&5 + { (eval echo "$as_me:12924: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11526: \$? = $ac_status" >&5 + echo "$as_me:12927: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_x_opendir=yes else @@ -11534,7 +12935,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11537: result: $ac_cv_lib_x_opendir" >&5 +echo "$as_me:12938: result: $ac_cv_lib_x_opendir" >&5 echo "${ECHO_T}$ac_cv_lib_x_opendir" >&6 if test $ac_cv_lib_x_opendir = yes; then LIBS="$LIBS -lx" @@ -11542,13 +12943,13 @@ fi fi -echo "$as_me:11545: checking whether time.h and sys/time.h may both be included" >&5 +echo "$as_me:12946: checking whether time.h and sys/time.h may both be included" >&5 echo $ECHO_N "checking whether time.h and sys/time.h may both be included... $ECHO_C" >&6 if test "${ac_cv_header_time+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11551 "configure" +#line 12952 "configure" #include "confdefs.h" #include #include @@ -11564,16 +12965,16 @@ return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11567: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:12968: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11570: \$? = $ac_status" >&5 + echo "$as_me:12971: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11573: \"$ac_try\"") >&5 + { (eval echo "$as_me:12974: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11576: \$? = $ac_status" >&5 + echo "$as_me:12977: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_header_time=yes else @@ -11583,7 +12984,7 @@ ac_cv_header_time=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11586: result: $ac_cv_header_time" >&5 +echo "$as_me:12987: result: $ac_cv_header_time" >&5 echo "${ECHO_T}$ac_cv_header_time" >&6 if test $ac_cv_header_time = yes; then @@ -11593,90 +12994,287 @@ EOF fi -echo "$as_me:11596: checking for regular-expression headers" >&5 +cf_regex_func=no + +cf_regex_libs="regex re" +case $host_os in #(vi +mingw*) + cf_regex_libs="regex.dll $cf_regex_libs" + ;; +esac + +echo "$as_me:13006: checking for regcomp" >&5 +echo $ECHO_N "checking for regcomp... $ECHO_C" >&6 +if test "${ac_cv_func_regcomp+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13012 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char regcomp (); below. */ +#include +/* 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 regcomp (); +char (*f) (); + +int +main () +{ +/* 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_regcomp) || defined (__stub___regcomp) +choke me +#else +f = regcomp; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13043: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13046: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13049: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13052: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_regcomp=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_regcomp=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:13062: result: $ac_cv_func_regcomp" >&5 +echo "${ECHO_T}$ac_cv_func_regcomp" >&6 +if test $ac_cv_func_regcomp = yes; then + cf_regex_func=regcomp +else + + for cf_regex_lib in $cf_regex_libs + do + as_ac_Lib=`echo "ac_cv_lib_$cf_regex_lib''_regcomp" | $as_tr_sh` +echo "$as_me:13071: checking for regcomp in -l$cf_regex_lib" >&5 +echo $ECHO_N "checking for regcomp in -l$cf_regex_lib... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Lib+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-l$cf_regex_lib $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 13079 "configure" +#include "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 regcomp (); +int +main () +{ +regcomp (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13098: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13101: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13104: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13107: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_Lib=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_Lib=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:13118: result: `eval echo '${'$as_ac_Lib'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Lib'}'`" >&6 +if test `eval echo '${'$as_ac_Lib'}'` = yes; then + + LIBS="-l$cf_regex_lib $LIBS" + cf_regex_func=regcomp + break +fi + + done + +fi + +if test "$cf_regex_func" = no ; then + echo "$as_me:13132: checking for compile" >&5 +echo $ECHO_N "checking for compile... $ECHO_C" >&6 +if test "${ac_cv_func_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 13138 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char compile (); below. */ +#include +/* 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 compile (); +char (*f) (); + +int +main () +{ +/* 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_compile) || defined (__stub___compile) +choke me +#else +f = compile; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13169: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13172: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13175: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13178: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_compile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_compile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:13188: result: $ac_cv_func_compile" >&5 +echo "${ECHO_T}$ac_cv_func_compile" >&6 +if test $ac_cv_func_compile = yes; then + cf_regex_func=compile +else + + echo "$as_me:13194: checking for compile in -lgen" >&5 +echo $ECHO_N "checking for compile in -lgen... $ECHO_C" >&6 +if test "${ac_cv_lib_gen_compile+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + ac_check_lib_save_LIBS=$LIBS +LIBS="-lgen $LIBS" +cat >conftest.$ac_ext <<_ACEOF +#line 13202 "configure" +#include "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 compile (); +int +main () +{ +compile (); + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13221: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13224: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13227: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13230: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_lib_gen_compile=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_lib_gen_compile=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +LIBS=$ac_check_lib_save_LIBS +fi +echo "$as_me:13241: result: $ac_cv_lib_gen_compile" >&5 +echo "${ECHO_T}$ac_cv_lib_gen_compile" >&6 +if test $ac_cv_lib_gen_compile = yes; then + + LIBS="-lgen $LIBS" + cf_regex_func=compile +fi + +fi + +fi + +if test "$cf_regex_func" = no ; then + { echo "$as_me:13254: WARNING: cannot find regular expression library" >&5 +echo "$as_me: WARNING: cannot find regular expression library" >&2;} +fi + +echo "$as_me:13258: checking for regular-expression headers" >&5 echo $ECHO_N "checking for regular-expression headers... $ECHO_C" >&6 -if test "${cf_cv_regex+set}" = set; then +if test "${cf_cv_regex_hdrs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -cat >conftest.$ac_ext <<_ACEOF -#line 11603 "configure" -#include "confdefs.h" -#include -#include -int -main () -{ - - regex_t *p; - int x = regcomp(p, "", 0); - int y = regexec(p, "", 0, 0, 0); - regfree(p); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11621: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11624: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11627: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11630: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_regex="regex.h" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cat >conftest.$ac_ext <<_ACEOF -#line 11638 "configure" -#include "confdefs.h" -#include -int -main () -{ - - char *p = compile("", "", "", 0); - int x = step("", ""); - - ; - return 0; -} -_ACEOF -rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11653: \"$ac_link\"") >&5 - (eval $ac_link) 2>&5 - ac_status=$? - echo "$as_me:11656: \$? = $ac_status" >&5 - (exit $ac_status); } && - { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11659: \"$ac_try\"") >&5 - (eval $ac_try) 2>&5 - ac_status=$? - echo "$as_me:11662: \$? = $ac_status" >&5 - (exit $ac_status); }; }; then - cf_cv_regex="regexp.h" -else - echo "$as_me: failed program was:" >&5 -cat conftest.$ac_ext >&5 - - cf_save_LIBS="$LIBS" - LIBS="-lgen $LIBS" +cf_cv_regex_hdrs=no +case $cf_regex_func in #(vi +compile) #(vi + for cf_regex_hdr in regexp.h regexpr.h + do cat >conftest.$ac_ext <<_ACEOF -#line 11672 "configure" +#line 13270 "configure" #include "confdefs.h" -#include +#include <$cf_regex_hdr> int main () { - char *p = compile("", "", ""); + char *p = compile("", "", "", 0); int x = step("", ""); ; @@ -11684,43 +13282,90 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11687: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13285: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11690: \$? = $ac_status" >&5 + echo "$as_me:13288: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11693: \"$ac_try\"") >&5 + { (eval echo "$as_me:13291: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11696: \$? = $ac_status" >&5 + echo "$as_me:13294: \$? = $ac_status" >&5 (exit $ac_status); }; }; then - cf_cv_regex="regexpr.h" + + cf_cv_regex_hdrs=$cf_regex_hdr + break + else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 -LIBS="$cf_save_LIBS" -fi -rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done + ;; +*) + for cf_regex_hdr in regex.h + do + cat >conftest.$ac_ext <<_ACEOF +#line 13311 "configure" +#include "confdefs.h" +#include +#include <$cf_regex_hdr> +int +main () +{ + + regex_t *p; + int x = regcomp(p, "", 0); + int y = regexec(p, "", 0, 0, 0); + regfree(p); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:13329: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:13332: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:13335: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:13338: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + + cf_cv_regex_hdrs=$cf_regex_hdr + break + +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + done + ;; +esac fi +echo "$as_me:13354: result: $cf_cv_regex_hdrs" >&5 +echo "${ECHO_T}$cf_cv_regex_hdrs" >&6 -echo "$as_me:11712: result: $cf_cv_regex" >&5 -echo "${ECHO_T}$cf_cv_regex" >&6 -case $cf_cv_regex in - regex.h) cat >>confdefs.h <<\EOF +case $cf_cv_regex_hdrs in #(vi + no) { echo "$as_me:13358: WARNING: no regular expression header found" >&5 +echo "$as_me: WARNING: no regular expression header found" >&2;} ;; #(vi + regex.h) cat >>confdefs.h <<\EOF #define HAVE_REGEX_H_FUNCS 1 EOF - ;; - regexp.h) cat >>confdefs.h <<\EOF + ;; #(vi + regexp.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXP_H_FUNCS 1 EOF - ;; - regexpr.h) cat >>confdefs.h <<\EOF + ;; #(vi + regexpr.h) cat >>confdefs.h <<\EOF #define HAVE_REGEXPR_H_FUNCS 1 EOF ;; @@ -11731,6 +13376,7 @@ fcntl.h \ getopt.h \ limits.h \ locale.h \ +math.h \ poll.h \ sys/bsdtypes.h \ sys/ioctl.h \ @@ -11745,23 +13391,23 @@ wctype.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:11748: checking for $ac_header" >&5 +echo "$as_me:13394: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11754 "configure" +#line 13400 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:11758: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:13404: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:11764: \$? = $ac_status" >&5 + echo "$as_me:13410: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -11780,7 +13426,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:11783: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:13429: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h < to declare fd_set if test "$ISC" = yes ; then -echo "$as_me:11797: checking for main in -lcposix" >&5 +echo "$as_me:13443: checking for main in -lcposix" >&5 echo $ECHO_N "checking for main in -lcposix... $ECHO_C" >&6 if test "${ac_cv_lib_cposix_main+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11802,7 +13448,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lcposix $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11805 "configure" +#line 13451 "configure" #include "confdefs.h" int @@ -11814,16 +13460,16 @@ main (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11817: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13463: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11820: \$? = $ac_status" >&5 + echo "$as_me:13466: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11823: \"$ac_try\"") >&5 + { (eval echo "$as_me:13469: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11826: \$? = $ac_status" >&5 + echo "$as_me:13472: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_cposix_main=yes else @@ -11834,7 +13480,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11837: result: $ac_cv_lib_cposix_main" >&5 +echo "$as_me:13483: result: $ac_cv_lib_cposix_main" >&5 echo "${ECHO_T}$ac_cv_lib_cposix_main" >&6 if test $ac_cv_lib_cposix_main = yes; then cat >>confdefs.h <&5 + echo "$as_me:13494: checking for bzero in -linet" >&5 echo $ECHO_N "checking for bzero in -linet... $ECHO_C" >&6 if test "${ac_cv_lib_inet_bzero+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11853,7 +13499,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-linet $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 11856 "configure" +#line 13502 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -11872,16 +13518,16 @@ bzero (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:11875: \"$ac_link\"") >&5 +if { (eval echo "$as_me:13521: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:11878: \$? = $ac_status" >&5 + echo "$as_me:13524: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:11881: \"$ac_try\"") >&5 + { (eval echo "$as_me:13527: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11884: \$? = $ac_status" >&5 + echo "$as_me:13530: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_inet_bzero=yes else @@ -11892,21 +13538,21 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:11895: result: $ac_cv_lib_inet_bzero" >&5 +echo "$as_me:13541: result: $ac_cv_lib_inet_bzero" >&5 echo "${ECHO_T}$ac_cv_lib_inet_bzero" >&6 if test $ac_cv_lib_inet_bzero = yes; then - LIBS="$LIBS -linet" + LIBS="-linet $LIBS" fi fi -echo "$as_me:11902: checking if sys/time.h works with sys/select.h" >&5 +echo "$as_me:13548: checking if sys/time.h works with sys/select.h" >&5 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6 if test "${cf_cv_sys_time_select+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 11909 "configure" +#line 13555 "configure" #include "confdefs.h" #include @@ -11926,16 +13572,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:11929: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13575: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:11932: \$? = $ac_status" >&5 + echo "$as_me:13578: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:11935: \"$ac_try\"") >&5 + { (eval echo "$as_me:13581: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:11938: \$? = $ac_status" >&5 + echo "$as_me:13584: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sys_time_select=yes else @@ -11947,7 +13593,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:11950: result: $cf_cv_sys_time_select" >&5 +echo "$as_me:13596: result: $cf_cv_sys_time_select" >&5 echo "${ECHO_T}$cf_cv_sys_time_select" >&6 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF #define HAVE_SYS_TIME_SELECT 1 @@ -11961,7 +13607,7 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $ ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return=return -echo "$as_me:11964: checking for $CC option to accept ANSI C" >&5 +echo "$as_me:13610: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -11969,7 +13615,7 @@ else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >conftest.$ac_ext <<_ACEOF -#line 11972 "configure" +#line 13618 "configure" #include "confdefs.h" #include #include @@ -12018,16 +13664,16 @@ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIO do CC="$ac_save_CC $ac_arg" rm -f conftest.$ac_objext -if { (eval echo "$as_me:12021: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13667: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12024: \$? = $ac_status" >&5 + echo "$as_me:13670: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12027: \"$ac_try\"") >&5 + { (eval echo "$as_me:13673: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12030: \$? = $ac_status" >&5 + echo "$as_me:13676: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_prog_cc_stdc=$ac_arg break @@ -12044,21 +13690,21 @@ fi case "x$ac_cv_prog_cc_stdc" in x|xno) - echo "$as_me:12047: result: none needed" >&5 + echo "$as_me:13693: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) - echo "$as_me:12050: result: $ac_cv_prog_cc_stdc" >&5 + echo "$as_me:13696: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac -echo "$as_me:12055: checking for an ANSI C-conforming const" >&5 +echo "$as_me:13701: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12061 "configure" +#line 13707 "configure" #include "confdefs.h" int @@ -12116,16 +13762,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12119: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13765: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12122: \$? = $ac_status" >&5 + echo "$as_me:13768: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12125: \"$ac_try\"") >&5 + { (eval echo "$as_me:13771: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12128: \$? = $ac_status" >&5 + echo "$as_me:13774: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_const=yes else @@ -12135,7 +13781,7 @@ ac_cv_c_const=no fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12138: result: $ac_cv_c_const" >&5 +echo "$as_me:13784: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then @@ -12145,7 +13791,7 @@ EOF fi -echo "$as_me:12148: checking for inline" >&5 +echo "$as_me:13794: checking for inline" >&5 echo $ECHO_N "checking for inline... $ECHO_C" >&6 if test "${ac_cv_c_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12153,7 +13799,7 @@ else ac_cv_c_inline=no for ac_kw in inline __inline__ __inline; do cat >conftest.$ac_ext <<_ACEOF -#line 12156 "configure" +#line 13802 "configure" #include "confdefs.h" #ifndef __cplusplus static $ac_kw int static_foo () {return 0; } @@ -12162,16 +13808,16 @@ $ac_kw int foo () {return 0; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12165: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13811: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12168: \$? = $ac_status" >&5 + echo "$as_me:13814: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12171: \"$ac_try\"") >&5 + { (eval echo "$as_me:13817: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12174: \$? = $ac_status" >&5 + echo "$as_me:13820: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_c_inline=$ac_kw; break else @@ -12182,7 +13828,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:12185: result: $ac_cv_c_inline" >&5 +echo "$as_me:13831: result: $ac_cv_c_inline" >&5 echo "${ECHO_T}$ac_cv_c_inline" >&6 case $ac_cv_c_inline in inline | yes) ;; @@ -12205,8 +13851,8 @@ if test "$ac_cv_c_inline" != no ; then : elif test "$GCC" = yes then - echo "$as_me:12208: checking if gcc supports options to tune inlining" >&5 -echo $ECHO_N "checking if gcc supports options to tune inlining... $ECHO_C" >&6 + echo "$as_me:13854: checking if $CC supports options to tune inlining" >&5 +echo $ECHO_N "checking if $CC supports options to tune inlining... $ECHO_C" >&6 if test "${cf_cv_gcc_inline+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else @@ -12214,7 +13860,7 @@ else cf_save_CFLAGS=$CFLAGS CFLAGS="$CFLAGS --param max-inline-insns-single=1200" cat >conftest.$ac_ext <<_ACEOF -#line 12217 "configure" +#line 13863 "configure" #include "confdefs.h" inline int foo(void) { return 1; } int @@ -12226,16 +13872,16 @@ ${cf_cv_main_return:-return} foo() } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12229: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:13875: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12232: \$? = $ac_status" >&5 + echo "$as_me:13878: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12235: \"$ac_try\"") >&5 + { (eval echo "$as_me:13881: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12238: \$? = $ac_status" >&5 + echo "$as_me:13884: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_gcc_inline=yes else @@ -12247,7 +13893,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext CFLAGS=$cf_save_CFLAGS fi -echo "$as_me:12250: result: $cf_cv_gcc_inline" >&5 +echo "$as_me:13896: result: $cf_cv_gcc_inline" >&5 echo "${ECHO_T}$cf_cv_gcc_inline" >&6 if test "$cf_cv_gcc_inline" = yes ; then @@ -12267,8 +13913,8 @@ no) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=yes + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=yes if test $cf_fix_cppflags = yes ; then cf_new_extra_cppflags="$cf_new_extra_cppflags $cf_add_cflags" @@ -12283,6 +13929,16 @@ no) *$cf_add_cflags) #(vi ;; *) #(vi + case $cf_add_cflags in #(vi + -D*) + cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` + +CPPFLAGS=`echo "$CPPFLAGS" | \ + sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ + -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` + + ;; + esac cf_new_cppflags="$cf_new_cppflags $cf_add_cflags" ;; esac @@ -12298,8 +13954,8 @@ yes) cf_tst_cflags=`echo ${cf_add_cflags} |sed -e 's/^[^"]*"'\''//'` test "${cf_add_cflags}" != "${cf_tst_cflags}" \ - && test -z "${cf_tst_cflags}" \ - && cf_fix_cppflags=no + && test -z "${cf_tst_cflags}" \ + && cf_fix_cppflags=no ;; esac done @@ -12311,7 +13967,7 @@ fi if test -n "$cf_new_cppflags" ; then - CPPFLAGS="$cf_new_cppflags $CPPFLAGS" + CPPFLAGS="$CPPFLAGS $cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then @@ -12323,7 +13979,7 @@ fi fi fi -echo "$as_me:12326: checking for signal global datatype" >&5 +echo "$as_me:13982: checking for signal global datatype" >&5 echo $ECHO_N "checking for signal global datatype... $ECHO_C" >&6 if test "${cf_cv_sig_atomic_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12335,7 +13991,7 @@ else "int" do cat >conftest.$ac_ext <<_ACEOF -#line 12338 "configure" +#line 13994 "configure" #include "confdefs.h" #include @@ -12358,16 +14014,16 @@ signal(SIGINT, handler); } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12361: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14017: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12364: \$? = $ac_status" >&5 + echo "$as_me:14020: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12367: \"$ac_try\"") >&5 + { (eval echo "$as_me:14023: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12370: \$? = $ac_status" >&5 + echo "$as_me:14026: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sig_atomic_t=$cf_type else @@ -12381,7 +14037,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12384: result: $cf_cv_sig_atomic_t" >&5 +echo "$as_me:14040: result: $cf_cv_sig_atomic_t" >&5 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <&5 +echo "$as_me:14048: checking for type of chtype" >&5 echo $ECHO_N "checking for type of chtype... $ECHO_C" >&6 if test "${cf_cv_typeof_chtype+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12399,7 +14055,7 @@ else cf_cv_typeof_chtype=long else cat >conftest.$ac_ext <<_ACEOF -#line 12402 "configure" +#line 14058 "configure" #include "confdefs.h" #define WANT_BITS 31 @@ -12434,15 +14090,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12437: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12440: \$? = $ac_status" >&5 + echo "$as_me:14096: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12442: \"$ac_try\"") >&5 + { (eval echo "$as_me:14098: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12445: \$? = $ac_status" >&5 + echo "$as_me:14101: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_typeof_chtype=`cat cf_test.out` else @@ -12457,7 +14113,7 @@ fi fi -echo "$as_me:12460: result: $cf_cv_typeof_chtype" >&5 +echo "$as_me:14116: result: $cf_cv_typeof_chtype" >&5 echo "${ECHO_T}$cf_cv_typeof_chtype" >&6 cat >>confdefs.h <&5 +echo "$as_me:14128: checking if unsigned literals are legal" >&5 echo $ECHO_N "checking if unsigned literals are legal... $ECHO_C" >&6 if test "${cf_cv_unsigned_literals+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12479 "configure" +#line 14135 "configure" #include "confdefs.h" int @@ -12488,16 +14144,16 @@ long x = 1L + 1UL + 1U + 1 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12491: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14147: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12494: \$? = $ac_status" >&5 + echo "$as_me:14150: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12497: \"$ac_try\"") >&5 + { (eval echo "$as_me:14153: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12500: \$? = $ac_status" >&5 + echo "$as_me:14156: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_unsigned_literals=yes else @@ -12509,7 +14165,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12512: result: $cf_cv_unsigned_literals" >&5 +echo "$as_me:14168: result: $cf_cv_unsigned_literals" >&5 echo "${ECHO_T}$cf_cv_unsigned_literals" >&6 cf_cv_1UL="1" @@ -12525,14 +14181,14 @@ test "$cf_cv_typeof_mmask_t" = unsigned && cf_cv_typeof_mmask_t="" ### Checks for external-data -echo "$as_me:12528: checking if external errno is declared" >&5 +echo "$as_me:14184: checking if external errno is declared" >&5 echo $ECHO_N "checking if external errno is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12535 "configure" +#line 14191 "configure" #include "confdefs.h" #ifdef HAVE_STDLIB_H @@ -12550,16 +14206,16 @@ int x = (int) errno } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12553: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14209: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12556: \$? = $ac_status" >&5 + echo "$as_me:14212: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12559: \"$ac_try\"") >&5 + { (eval echo "$as_me:14215: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12562: \$? = $ac_status" >&5 + echo "$as_me:14218: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_dcl_errno=yes else @@ -12570,7 +14226,7 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:12573: result: $cf_cv_dcl_errno" >&5 +echo "$as_me:14229: result: $cf_cv_dcl_errno" >&5 echo "${ECHO_T}$cf_cv_dcl_errno" >&6 if test "$cf_cv_dcl_errno" = no ; then @@ -12585,14 +14241,14 @@ fi # It's possible (for near-UNIX clones) that the data doesn't exist -echo "$as_me:12588: checking if external errno exists" >&5 +echo "$as_me:14244: checking if external errno exists" >&5 echo $ECHO_N "checking if external errno exists... $ECHO_C" >&6 if test "${cf_cv_have_errno+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12595 "configure" +#line 14251 "configure" #include "confdefs.h" #undef errno @@ -12607,16 +14263,16 @@ errno = 2 } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12610: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14266: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12613: \$? = $ac_status" >&5 + echo "$as_me:14269: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12616: \"$ac_try\"") >&5 + { (eval echo "$as_me:14272: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12619: \$? = $ac_status" >&5 + echo "$as_me:14275: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_errno=yes else @@ -12627,7 +14283,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12630: result: $cf_cv_have_errno" >&5 +echo "$as_me:14286: result: $cf_cv_have_errno" >&5 echo "${ECHO_T}$cf_cv_have_errno" >&6 if test "$cf_cv_have_errno" = yes ; then @@ -12640,7 +14296,7 @@ EOF fi -echo "$as_me:12643: checking if data-only library module links" >&5 +echo "$as_me:14299: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -12648,20 +14304,20 @@ else rm -f conftest.a cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:14310: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12657: \$? = $ac_status" >&5 + echo "$as_me:14313: \$? = $ac_status" >&5 (exit $ac_status); } ; then mv conftest.o data.o && \ - ( $AR $AR_OPTS conftest.a data.o ) 2>&5 1>/dev/null + ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 + if { (eval echo "$as_me:14333: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12680: \$? = $ac_status" >&5 + echo "$as_me:14336: \$? = $ac_status" >&5 (exit $ac_status); }; then mv conftest.o func.o && \ - ( $AR $AR_OPTS conftest.a func.o ) 2>&5 1>/dev/null + ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&5 >/dev/null @@ -12690,7 +14346,7 @@ EOF cf_cv_link_dataonly=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 12693 "configure" +#line 14349 "configure" #include "confdefs.h" int main() @@ -12701,15 +14357,15 @@ else _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:12704: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14360: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12707: \$? = $ac_status" >&5 + echo "$as_me:14363: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:12709: \"$ac_try\"") >&5 + { (eval echo "$as_me:14365: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12712: \$? = $ac_status" >&5 + echo "$as_me:14368: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_link_dataonly=yes else @@ -12724,7 +14380,7 @@ fi fi -echo "$as_me:12727: result: $cf_cv_link_dataonly" >&5 +echo "$as_me:14383: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then @@ -12759,13 +14415,13 @@ vsnprintf \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` -echo "$as_me:12762: checking for $ac_func" >&5 +echo "$as_me:14418: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12768 "configure" +#line 14424 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char $ac_func (); below. */ @@ -12796,16 +14452,16 @@ f = $ac_func; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12799: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14455: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12802: \$? = $ac_status" >&5 + echo "$as_me:14458: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12805: \"$ac_try\"") >&5 + { (eval echo "$as_me:14461: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12808: \$? = $ac_status" >&5 + echo "$as_me:14464: \$? = $ac_status" >&5 (exit $ac_status); }; }; then eval "$as_ac_var=yes" else @@ -12815,7 +14471,7 @@ eval "$as_ac_var=no" fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12818: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "$as_me:14474: result: `eval echo '${'$as_ac_var'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 if test `eval echo '${'$as_ac_var'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:14486: checking for terminal-capability database functions" >&5 echo $ECHO_N "checking for terminal-capability database functions... $ECHO_C" >&6 if test "${cf_cv_cgetent+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12837 "configure" +#line 14493 "configure" #include "confdefs.h" #include @@ -12854,16 +14510,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12857: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14513: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12860: \$? = $ac_status" >&5 + echo "$as_me:14516: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12863: \"$ac_try\"") >&5 + { (eval echo "$as_me:14519: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12866: \$? = $ac_status" >&5 + echo "$as_me:14522: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cgetent=yes else @@ -12875,7 +14531,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12878: result: $cf_cv_cgetent" >&5 +echo "$as_me:14534: result: $cf_cv_cgetent" >&5 echo "${ECHO_T}$cf_cv_cgetent" >&6 test "$cf_cv_cgetent" = yes && cat >>confdefs.h <<\EOF #define HAVE_BSD_CGETENT 1 @@ -12883,14 +14539,14 @@ EOF fi -echo "$as_me:12886: checking for isascii" >&5 +echo "$as_me:14542: checking for isascii" >&5 echo $ECHO_N "checking for isascii... $ECHO_C" >&6 if test "${cf_cv_have_isascii+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 12893 "configure" +#line 14549 "configure" #include "confdefs.h" #include int @@ -12902,16 +14558,16 @@ int x = isascii(' ') } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:12905: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14561: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:12908: \$? = $ac_status" >&5 + echo "$as_me:14564: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:12911: \"$ac_try\"") >&5 + { (eval echo "$as_me:14567: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12914: \$? = $ac_status" >&5 + echo "$as_me:14570: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_isascii=yes else @@ -12922,17 +14578,17 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:12925: result: $cf_cv_have_isascii" >&5 +echo "$as_me:14581: result: $cf_cv_have_isascii" >&5 echo "${ECHO_T}$cf_cv_have_isascii" >&6 test "$cf_cv_have_isascii" = yes && cat >>confdefs.h <<\EOF #define HAVE_ISASCII 1 EOF if test "$ac_cv_func_sigaction" = yes; then -echo "$as_me:12932: checking whether sigaction needs _POSIX_SOURCE" >&5 +echo "$as_me:14588: checking whether sigaction needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether sigaction needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 12935 "configure" +#line 14591 "configure" #include "confdefs.h" #include @@ -12946,16 +14602,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12949: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14605: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12952: \$? = $ac_status" >&5 + echo "$as_me:14608: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12955: \"$ac_try\"") >&5 + { (eval echo "$as_me:14611: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12958: \$? = $ac_status" >&5 + echo "$as_me:14614: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=no else @@ -12963,7 +14619,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 12966 "configure" +#line 14622 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -12978,16 +14634,16 @@ struct sigaction act } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:12981: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14637: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:12984: \$? = $ac_status" >&5 + echo "$as_me:14640: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:12987: \"$ac_try\"") >&5 + { (eval echo "$as_me:14643: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:12990: \$? = $ac_status" >&5 + echo "$as_me:14646: \$? = $ac_status" >&5 (exit $ac_status); }; }; then sigact_bad=yes cat >>confdefs.h <<\EOF @@ -13002,11 +14658,11 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext -echo "$as_me:13005: result: $sigact_bad" >&5 +echo "$as_me:14661: result: $sigact_bad" >&5 echo "${ECHO_T}$sigact_bad" >&6 fi -echo "$as_me:13009: checking if nanosleep really works" >&5 +echo "$as_me:14665: checking if nanosleep really works" >&5 echo $ECHO_N "checking if nanosleep really works... $ECHO_C" >&6 if test "${cf_cv_func_nanosleep+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13016,7 +14672,7 @@ if test "$cross_compiling" = yes; then cf_cv_func_nanosleep=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 13019 "configure" +#line 14675 "configure" #include "confdefs.h" #include @@ -13041,15 +14697,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13044: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14700: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13047: \$? = $ac_status" >&5 + echo "$as_me:14703: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13049: \"$ac_try\"") >&5 + { (eval echo "$as_me:14705: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13052: \$? = $ac_status" >&5 + echo "$as_me:14708: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_nanosleep=yes else @@ -13061,7 +14717,7 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:13064: result: $cf_cv_func_nanosleep" >&5 +echo "$as_me:14720: result: $cf_cv_func_nanosleep" >&5 echo "${ECHO_T}$cf_cv_func_nanosleep" >&6 test "$cf_cv_func_nanosleep" = "yes" && cat >>confdefs.h <<\EOF @@ -13075,23 +14731,23 @@ unistd.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:13078: checking for $ac_header" >&5 +echo "$as_me:14734: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13084 "configure" +#line 14740 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13088: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14744: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:13094: \$? = $ac_status" >&5 + echo "$as_me:14750: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13110,7 +14766,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13113: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:14769: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 +echo "$as_me:14784: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13134 "configure" +#line 14790 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:13138: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:14794: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:13144: \$? = $ac_status" >&5 + echo "$as_me:14800: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -13160,7 +14816,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:13163: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:14819: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 + echo "$as_me:14837: checking whether termios.h needs _POSIX_SOURCE" >&5 echo $ECHO_N "checking whether termios.h needs _POSIX_SOURCE... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 13184 "configure" +#line 14840 "configure" #include "confdefs.h" #include int @@ -13193,16 +14849,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13196: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14852: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13199: \$? = $ac_status" >&5 + echo "$as_me:14855: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13202: \"$ac_try\"") >&5 + { (eval echo "$as_me:14858: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13205: \$? = $ac_status" >&5 + echo "$as_me:14861: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=no else @@ -13210,7 +14866,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13213 "configure" +#line 14869 "configure" #include "confdefs.h" #define _POSIX_SOURCE @@ -13224,16 +14880,16 @@ struct termios foo; int x = foo.c_iflag } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13227: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:14883: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13230: \$? = $ac_status" >&5 + echo "$as_me:14886: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13233: \"$ac_try\"") >&5 + { (eval echo "$as_me:14889: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13236: \$? = $ac_status" >&5 + echo "$as_me:14892: \$? = $ac_status" >&5 (exit $ac_status); }; }; then termios_bad=unknown else @@ -13248,19 +14904,19 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:13251: result: $termios_bad" >&5 + echo "$as_me:14907: result: $termios_bad" >&5 echo "${ECHO_T}$termios_bad" >&6 fi fi -echo "$as_me:13256: checking for tcgetattr" >&5 +echo "$as_me:14912: checking for tcgetattr" >&5 echo $ECHO_N "checking for tcgetattr... $ECHO_C" >&6 if test "${cf_cv_have_tcgetattr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13263 "configure" +#line 14919 "configure" #include "confdefs.h" #include @@ -13288,16 +14944,16 @@ tcgetattr(1, &foo); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13291: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14947: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13294: \$? = $ac_status" >&5 + echo "$as_me:14950: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13297: \"$ac_try\"") >&5 + { (eval echo "$as_me:14953: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13300: \$? = $ac_status" >&5 + echo "$as_me:14956: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_have_tcgetattr=yes else @@ -13307,20 +14963,20 @@ cf_cv_have_tcgetattr=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13310: result: $cf_cv_have_tcgetattr" >&5 +echo "$as_me:14966: result: $cf_cv_have_tcgetattr" >&5 echo "${ECHO_T}$cf_cv_have_tcgetattr" >&6 test "$cf_cv_have_tcgetattr" = yes && cat >>confdefs.h <<\EOF #define HAVE_TCGETATTR 1 EOF -echo "$as_me:13316: checking for vsscanf function or workaround" >&5 +echo "$as_me:14972: checking for vsscanf function or workaround" >&5 echo $ECHO_N "checking for vsscanf function or workaround... $ECHO_C" >&6 if test "${cf_cv_func_vsscanf+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13323 "configure" +#line 14979 "configure" #include "confdefs.h" #include @@ -13336,16 +14992,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13339: \"$ac_link\"") >&5 +if { (eval echo "$as_me:14995: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13342: \$? = $ac_status" >&5 + echo "$as_me:14998: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13345: \"$ac_try\"") >&5 + { (eval echo "$as_me:15001: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13348: \$? = $ac_status" >&5 + echo "$as_me:15004: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vsscanf else @@ -13353,7 +15009,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13356 "configure" +#line 15012 "configure" #include "confdefs.h" #include @@ -13375,16 +15031,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13378: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15034: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13381: \$? = $ac_status" >&5 + echo "$as_me:15037: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13384: \"$ac_try\"") >&5 + { (eval echo "$as_me:15040: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13387: \$? = $ac_status" >&5 + echo "$as_me:15043: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=vfscanf else @@ -13392,7 +15048,7 @@ else cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 13395 "configure" +#line 15051 "configure" #include "confdefs.h" #include @@ -13414,16 +15070,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13417: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15073: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13420: \$? = $ac_status" >&5 + echo "$as_me:15076: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13423: \"$ac_try\"") >&5 + { (eval echo "$as_me:15079: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13426: \$? = $ac_status" >&5 + echo "$as_me:15082: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_vsscanf=_doscan else @@ -13438,7 +15094,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13441: result: $cf_cv_func_vsscanf" >&5 +echo "$as_me:15097: result: $cf_cv_func_vsscanf" >&5 echo "${ECHO_T}$cf_cv_func_vsscanf" >&6 case $cf_cv_func_vsscanf in #(vi @@ -13456,21 +15112,21 @@ EOF ;; esac -echo "$as_me:13459: checking for working mkstemp" >&5 +echo "$as_me:15115: checking for working mkstemp" >&5 echo $ECHO_N "checking for working mkstemp... $ECHO_C" >&6 if test "${cf_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else -rm -f conftest* +rm -rf conftest* if test "$cross_compiling" = yes; then - echo "$as_me:13467: checking for mkstemp" >&5 + echo "$as_me:15123: checking for mkstemp" >&5 echo $ECHO_N "checking for mkstemp... $ECHO_C" >&6 if test "${ac_cv_func_mkstemp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13473 "configure" +#line 15129 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char mkstemp (); below. */ @@ -13501,16 +15157,16 @@ f = mkstemp; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13504: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15160: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13507: \$? = $ac_status" >&5 + echo "$as_me:15163: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13510: \"$ac_try\"") >&5 + { (eval echo "$as_me:15166: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13513: \$? = $ac_status" >&5 + echo "$as_me:15169: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_mkstemp=yes else @@ -13520,12 +15176,12 @@ ac_cv_func_mkstemp=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13523: result: $ac_cv_func_mkstemp" >&5 +echo "$as_me:15179: result: $ac_cv_func_mkstemp" >&5 echo "${ECHO_T}$ac_cv_func_mkstemp" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13528 "configure" +#line 15184 "configure" #include "confdefs.h" #include @@ -13563,15 +15219,15 @@ int main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13566: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15222: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13569: \$? = $ac_status" >&5 + echo "$as_me:15225: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13571: \"$ac_try\"") >&5 + { (eval echo "$as_me:15227: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13574: \$? = $ac_status" >&5 + echo "$as_me:15230: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_mkstemp=yes @@ -13586,9 +15242,9 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:13589: result: $cf_cv_func_mkstemp" >&5 +echo "$as_me:15245: result: $cf_cv_func_mkstemp" >&5 echo "${ECHO_T}$cf_cv_func_mkstemp" >&6 -if test "$cf_cv_func_mkstemp" = yes ; then +if test "x$cf_cv_func_mkstemp" = xyes || test "x$ac_cv_func_mkstemp" = xyes ; then cat >>confdefs.h <<\EOF #define HAVE_MKSTEMP 1 EOF @@ -13604,21 +15260,21 @@ else fi if test "$cross_compiling" = yes ; then - { echo "$as_me:13607: WARNING: cross compiling: assume setvbuf params not reversed" >&5 + { echo "$as_me:15263: WARNING: cross compiling: assume setvbuf params not reversed" >&5 echo "$as_me: WARNING: cross compiling: assume setvbuf params not reversed" >&2;} else - echo "$as_me:13610: checking whether setvbuf arguments are reversed" >&5 + echo "$as_me:15266: checking whether setvbuf arguments are reversed" >&5 echo $ECHO_N "checking whether setvbuf arguments are reversed... $ECHO_C" >&6 if test "${ac_cv_func_setvbuf_reversed+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then - { { echo "$as_me:13616: error: cannot run test program while cross compiling" >&5 + { { echo "$as_me:15272: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >conftest.$ac_ext <<_ACEOF -#line 13621 "configure" +#line 15277 "configure" #include "confdefs.h" #include /* If setvbuf has the reversed format, exit 0. */ @@ -13635,15 +15291,15 @@ main () } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:13638: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15294: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13641: \$? = $ac_status" >&5 + echo "$as_me:15297: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:13643: \"$ac_try\"") >&5 + { (eval echo "$as_me:15299: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13646: \$? = $ac_status" >&5 + echo "$as_me:15302: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_setvbuf_reversed=yes else @@ -13656,7 +15312,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi rm -f core core.* *.core fi -echo "$as_me:13659: result: $ac_cv_func_setvbuf_reversed" >&5 +echo "$as_me:15315: result: $ac_cv_func_setvbuf_reversed" >&5 echo "${ECHO_T}$ac_cv_func_setvbuf_reversed" >&6 if test $ac_cv_func_setvbuf_reversed = yes; then @@ -13667,13 +15323,13 @@ EOF fi fi -echo "$as_me:13670: checking return type of signal handlers" >&5 +echo "$as_me:15326: checking return type of signal handlers" >&5 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6 if test "${ac_cv_type_signal+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13676 "configure" +#line 15332 "configure" #include "confdefs.h" #include #include @@ -13695,16 +15351,16 @@ int i; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13698: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15354: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13701: \$? = $ac_status" >&5 + echo "$as_me:15357: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13704: \"$ac_try\"") >&5 + { (eval echo "$as_me:15360: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13707: \$? = $ac_status" >&5 + echo "$as_me:15363: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_type_signal=void else @@ -13714,21 +15370,21 @@ ac_cv_type_signal=int fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13717: result: $ac_cv_type_signal" >&5 +echo "$as_me:15373: result: $ac_cv_type_signal" >&5 echo "${ECHO_T}$ac_cv_type_signal" >&6 cat >>confdefs.h <&5 +echo "$as_me:15380: checking for type sigaction_t" >&5 echo $ECHO_N "checking for type sigaction_t... $ECHO_C" >&6 if test "${cf_cv_type_sigaction+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13731 "configure" +#line 15387 "configure" #include "confdefs.h" #include @@ -13741,16 +15397,16 @@ sigaction_t x } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13744: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15400: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13747: \$? = $ac_status" >&5 + echo "$as_me:15403: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13750: \"$ac_try\"") >&5 + { (eval echo "$as_me:15406: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13753: \$? = $ac_status" >&5 + echo "$as_me:15409: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_sigaction=yes else @@ -13761,13 +15417,13 @@ fi rm -f conftest.$ac_objext conftest.$ac_ext fi -echo "$as_me:13764: result: $cf_cv_type_sigaction" >&5 +echo "$as_me:15420: result: $cf_cv_type_sigaction" >&5 echo "${ECHO_T}$cf_cv_type_sigaction" >&6 test "$cf_cv_type_sigaction" = yes && cat >>confdefs.h <<\EOF #define HAVE_TYPE_SIGACTION 1 EOF -echo "$as_me:13770: checking declaration of size-change" >&5 +echo "$as_me:15426: checking declaration of size-change" >&5 echo $ECHO_N "checking declaration of size-change... $ECHO_C" >&6 if test "${cf_cv_sizechange+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -13782,7 +15438,7 @@ do CPPFLAGS="$cf_save_CPPFLAGS" test -n "$cf_opts" && CPPFLAGS="$CPPFLAGS -D$cf_opts" cat >conftest.$ac_ext <<_ACEOF -#line 13785 "configure" +#line 15441 "configure" #include "confdefs.h" #include #ifdef HAVE_TERMIOS_H @@ -13826,16 +15482,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:13829: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:15485: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:13832: \$? = $ac_status" >&5 + echo "$as_me:15488: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:13835: \"$ac_try\"") >&5 + { (eval echo "$as_me:15491: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13838: \$? = $ac_status" >&5 + echo "$as_me:15494: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_sizechange=yes else @@ -13854,7 +15510,7 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:13857: result: $cf_cv_sizechange" >&5 +echo "$as_me:15513: result: $cf_cv_sizechange" >&5 echo "${ECHO_T}$cf_cv_sizechange" >&6 if test "$cf_cv_sizechange" != no ; then cat >>confdefs.h <<\EOF @@ -13871,13 +15527,13 @@ EOF esac fi -echo "$as_me:13874: checking for memmove" >&5 +echo "$as_me:15530: checking for memmove" >&5 echo $ECHO_N "checking for memmove... $ECHO_C" >&6 if test "${ac_cv_func_memmove+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13880 "configure" +#line 15536 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char memmove (); below. */ @@ -13908,16 +15564,16 @@ f = memmove; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13911: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15567: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13914: \$? = $ac_status" >&5 + echo "$as_me:15570: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13917: \"$ac_try\"") >&5 + { (eval echo "$as_me:15573: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13920: \$? = $ac_status" >&5 + echo "$as_me:15576: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_memmove=yes else @@ -13927,19 +15583,19 @@ ac_cv_func_memmove=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13930: result: $ac_cv_func_memmove" >&5 +echo "$as_me:15586: result: $ac_cv_func_memmove" >&5 echo "${ECHO_T}$ac_cv_func_memmove" >&6 if test $ac_cv_func_memmove = yes; then : else -echo "$as_me:13936: checking for bcopy" >&5 +echo "$as_me:15592: checking for bcopy" >&5 echo $ECHO_N "checking for bcopy... $ECHO_C" >&6 if test "${ac_cv_func_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 13942 "configure" +#line 15598 "configure" #include "confdefs.h" /* System header to define __stub macros and hopefully few prototypes, which can conflict with char bcopy (); below. */ @@ -13970,16 +15626,16 @@ f = bcopy; } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:13973: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15629: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:13976: \$? = $ac_status" >&5 + echo "$as_me:15632: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:13979: \"$ac_try\"") >&5 + { (eval echo "$as_me:15635: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:13982: \$? = $ac_status" >&5 + echo "$as_me:15638: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_func_bcopy=yes else @@ -13989,11 +15645,11 @@ ac_cv_func_bcopy=no fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi -echo "$as_me:13992: result: $ac_cv_func_bcopy" >&5 +echo "$as_me:15648: result: $ac_cv_func_bcopy" >&5 echo "${ECHO_T}$ac_cv_func_bcopy" >&6 if test $ac_cv_func_bcopy = yes; then - echo "$as_me:13996: checking if bcopy does overlapping moves" >&5 + echo "$as_me:15652: checking if bcopy does overlapping moves" >&5 echo $ECHO_N "checking if bcopy does overlapping moves... $ECHO_C" >&6 if test "${cf_cv_good_bcopy+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14003,7 +15659,7 @@ else cf_cv_good_bcopy=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14006 "configure" +#line 15662 "configure" #include "confdefs.h" int main() { @@ -14017,15 +15673,15 @@ int main() { _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14020: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15676: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14023: \$? = $ac_status" >&5 + echo "$as_me:15679: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14025: \"$ac_try\"") >&5 + { (eval echo "$as_me:15681: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14028: \$? = $ac_status" >&5 + echo "$as_me:15684: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_good_bcopy=yes else @@ -14038,7 +15694,7 @@ rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14041: result: $cf_cv_good_bcopy" >&5 +echo "$as_me:15697: result: $cf_cv_good_bcopy" >&5 echo "${ECHO_T}$cf_cv_good_bcopy" >&6 else @@ -14059,7 +15715,7 @@ EOF fi -echo "$as_me:14062: checking if poll really works" >&5 +echo "$as_me:15718: checking if poll really works" >&5 echo $ECHO_N "checking if poll really works... $ECHO_C" >&6 if test "${cf_cv_working_poll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14069,7 +15725,7 @@ if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 14072 "configure" +#line 15728 "configure" #include "confdefs.h" #include @@ -14090,15 +15746,15 @@ int main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:14093: \"$ac_link\"") >&5 +if { (eval echo "$as_me:15749: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14096: \$? = $ac_status" >&5 + echo "$as_me:15752: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:14098: \"$ac_try\"") >&5 + { (eval echo "$as_me:15754: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14101: \$? = $ac_status" >&5 + echo "$as_me:15757: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_working_poll=yes else @@ -14110,15 +15766,505 @@ fi rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext fi fi -echo "$as_me:14113: result: $cf_cv_working_poll" >&5 +echo "$as_me:15769: result: $cf_cv_working_poll" >&5 echo "${ECHO_T}$cf_cv_working_poll" >&6 test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_WORKING_POLL 1 EOF +echo "$as_me:15775: checking for va_copy" >&5 +echo $ECHO_N "checking for va_copy... $ECHO_C" >&6 +if test "${cf_cv_have_va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 15782 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + static va_list dst; + static va_list src; + va_copy(dst, src) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:15799: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:15802: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:15805: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15808: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have_va_copy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have_va_copy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:15818: result: $cf_cv_have_va_copy" >&5 +echo "${ECHO_T}$cf_cv_have_va_copy" >&6 + +test "$cf_cv_have_va_copy" = yes && cat >>confdefs.h <<\EOF +#define HAVE_VA_COPY 1 +EOF + +echo "$as_me:15825: checking for __va_copy" >&5 +echo $ECHO_N "checking for __va_copy... $ECHO_C" >&6 +if test "${cf_cv_have___va_copy+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +cat >conftest.$ac_ext <<_ACEOF +#line 15832 "configure" +#include "confdefs.h" + +#include + +int +main () +{ + + static va_list dst; + static va_list src; + __va_copy(dst, src) + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:15849: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:15852: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:15855: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15858: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_cv_have___va_copy=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_cv_have___va_copy=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:15868: result: $cf_cv_have___va_copy" >&5 +echo "${ECHO_T}$cf_cv_have___va_copy" >&6 + +test "$cf_cv_have___va_copy" = yes && cat >>confdefs.h <<\EOF +#define HAVE___VA_COPY 1 +EOF + +echo "$as_me:15875: checking for pid_t" >&5 +echo $ECHO_N "checking for pid_t... $ECHO_C" >&6 +if test "${ac_cv_type_pid_t+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 15881 "configure" +#include "confdefs.h" +$ac_includes_default +int +main () +{ +if ((pid_t *) 0) + return 0; +if (sizeof (pid_t)) + return 0; + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext +if { (eval echo "$as_me:15896: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:15899: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest.$ac_objext' + { (eval echo "$as_me:15902: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:15905: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_type_pid_t=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_type_pid_t=no +fi +rm -f conftest.$ac_objext conftest.$ac_ext +fi +echo "$as_me:15915: result: $ac_cv_type_pid_t" >&5 +echo "${ECHO_T}$ac_cv_type_pid_t" >&6 +if test $ac_cv_type_pid_t = yes; then + : +else + +cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +if eval "test \"\${$as_ac_Header+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 15936 "configure" +#include "confdefs.h" +#include <$ac_header> +_ACEOF +if { (eval echo "$as_me:15940: \"$ac_cpp conftest.$ac_ext\"") >&5 + (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 + ac_status=$? + egrep -v '^ *\+' conftest.er1 >conftest.err + rm -f conftest.er1 + cat conftest.err >&5 + echo "$as_me:15946: \$? = $ac_status" >&5 + (exit $ac_status); } >/dev/null; then + if test -s conftest.err; then + ac_cpp_err=$ac_c_preproc_warn_flag + else + ac_cpp_err= + fi +else + ac_cpp_err=yes +fi +if test -z "$ac_cpp_err"; then + eval "$as_ac_Header=yes" +else + echo "$as_me: failed program was:" >&5 + cat conftest.$ac_ext >&5 + eval "$as_ac_Header=no" +fi +rm -f conftest.err conftest.$ac_ext +fi +echo "$as_me:15965: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +if test `eval echo '${'$as_ac_Header'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +if eval "test \"\${$as_ac_var+set}\" = set"; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + cat >conftest.$ac_ext <<_ACEOF +#line 15984 "configure" +#include "confdefs.h" +/* System header to define __stub macros and hopefully few prototypes, + which can conflict with char $ac_func (); below. */ +#include +/* 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 $ac_func (); +char (*f) (); + +int +main () +{ +/* 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_$ac_func) || defined (__stub___$ac_func) +choke me +#else +f = $ac_func; +#endif + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:16015: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16018: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:16021: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16024: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + eval "$as_ac_var=yes" +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +eval "$as_ac_var=no" +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext +fi +echo "$as_me:16034: result: `eval echo '${'$as_ac_var'}'`" >&5 +echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +if test `eval echo '${'$as_ac_var'}'` = yes; then + cat >>confdefs.h <&5 +echo $ECHO_N "checking for working fork... $ECHO_C" >&6 +if test "${ac_cv_func_fork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_fork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +/* By Rüdiger Kuhlmann. */ + #include + #if HAVE_UNISTD_H + # include + #endif + /* Some systems only have a dummy stub for fork() */ + int main () + { + if (fork() < 0) + $ac_main_return (1); + $ac_main_return (0); + } +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:16069: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16072: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:16074: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16077: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_fork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_fork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:16089: result: $ac_cv_func_fork_works" >&5 +echo "${ECHO_T}$ac_cv_func_fork_works" >&6 + +fi +if test "x$ac_cv_func_fork_works" = xcross; then + case $host in + *-*-amigaos* | *-*-msdosdjgpp*) + # Override, as these systems have only a dummy fork() stub + ac_cv_func_fork_works=no + ;; + *) + ac_cv_func_fork_works=yes + ;; + esac + { echo "$as_me:16103: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_fork_works guessed due to cross-compiling." >&2;} +fi +ac_cv_func_vfork_works=$ac_cv_func_vfork +if test "x$ac_cv_func_vfork" = xyes; then + echo "$as_me:16108: checking for working vfork" >&5 +echo $ECHO_N "checking for working vfork... $ECHO_C" >&6 +if test "${ac_cv_func_vfork_works+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + if test "$cross_compiling" = yes; then + ac_cv_func_vfork_works=cross +else + cat >conftest.$ac_ext <<_ACEOF +#line 16117 "configure" +#include "confdefs.h" +/* Thanks to Paul Eggert for this test. */ +#include +#include +#include +#if HAVE_UNISTD_H +# include +#endif +#if HAVE_VFORK_H +# include +#endif +/* On some sparc systems, changes by the child to local and incoming + argument registers are propagated back to the parent. The compiler + is told about this with #include , but some compilers + (e.g. gcc -O) don't grok . Test for this by using a + static variable whose address is put into a register that is + clobbered by the vfork. */ +static +#ifdef __cplusplus +sparc_address_test (int arg) +# else +sparc_address_test (arg) int arg; +#endif +{ + static pid_t child; + if (!child) { + child = vfork (); + if (child < 0) { + perror ("vfork"); + _exit(2); + } + if (!child) { + arg = getpid(); + write(-1, "", 0); + _exit (arg); + } + } +} + +int +main () +{ + pid_t parent = getpid (); + pid_t child; + + sparc_address_test (); + + child = vfork (); + + if (child == 0) { + /* Here is another test for sparc vfork register problems. This + test uses lots of local variables, at least as many local + variables as main has allocated so far including compiler + temporaries. 4 locals are enough for gcc 1.40.3 on a Solaris + 4.1.3 sparc, but we use 8 to be safe. A buggy compiler should + reuse the register of parent for one of the local variables, + since it will think that parent can't possibly be used any more + in this routine. Assigning to the local variable will thus + munge parent in the parent process. */ + pid_t + p = getpid(), p1 = getpid(), p2 = getpid(), p3 = getpid(), + p4 = getpid(), p5 = getpid(), p6 = getpid(), p7 = getpid(); + /* Convince the compiler that p..p7 are live; otherwise, it might + use the same hardware register for all 8 local variables. */ + if (p != p1 || p != p2 || p != p3 || p != p4 + || p != p5 || p != p6 || p != p7) + _exit(1); + + /* On some systems (e.g. IRIX 3.3), vfork doesn't separate parent + from child file descriptors. If the child closes a descriptor + before it execs or exits, this munges the parent's descriptor + as well. Test for this by closing stdout in the child. */ + _exit(close(fileno(stdout)) != 0); + } else { + int status; + struct stat st; + + while (wait(&status) != child) + ; + $ac_main_return( + /* Was there some problem with vforking? */ + child < 0 + + /* Did the child fail? (This shouldn't happen.) */ + || status + + /* Did the vfork/compiler bug occur? */ + || parent != getpid() + + /* Did the file descriptor bug occur? */ + || fstat(fileno(stdout), &st) != 0 + ); + } +} +_ACEOF +rm -f conftest$ac_exeext +if { (eval echo "$as_me:16214: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:16217: \$? = $ac_status" >&5 + (exit $ac_status); } && { ac_try='./conftest$ac_exeext' + { (eval echo "$as_me:16219: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:16222: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_vfork_works=yes +else + echo "$as_me: program exited with status $ac_status" >&5 +echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +ac_cv_func_vfork_works=no +fi +rm -f core core.* *.core conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +fi +fi +echo "$as_me:16234: result: $ac_cv_func_vfork_works" >&5 +echo "${ECHO_T}$ac_cv_func_vfork_works" >&6 + +fi; +if test "x$ac_cv_func_fork_works" = xcross; then + ac_cv_func_vfork_works=ac_cv_func_vfork + { echo "$as_me:16240: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&5 +echo "$as_me: WARNING: CROSS: Result $ac_cv_func_vfork_works guessed due to cross-compiling." >&2;} +fi + +if test "x$ac_cv_func_vfork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_VFORK 1 +EOF + +else + +cat >>confdefs.h <<\EOF +#define vfork fork +EOF + +fi +if test "x$ac_cv_func_fork_works" = xyes; then + +cat >>confdefs.h <<\EOF +#define HAVE_WORKING_FORK 1 +EOF + +fi + # special check for test/ditto.c -echo "$as_me:14121: checking for openpty in -lutil" >&5 +echo "$as_me:16267: checking for openpty in -lutil" >&5 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6 if test "${ac_cv_lib_util_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14126,7 +16272,7 @@ else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14129 "configure" +#line 16275 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ @@ -14145,16 +16291,16 @@ openpty (); } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14148: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16294: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14151: \$? = $ac_status" >&5 + echo "$as_me:16297: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14154: \"$ac_try\"") >&5 + { (eval echo "$as_me:16300: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14157: \$? = $ac_status" >&5 + echo "$as_me:16303: \$? = $ac_status" >&5 (exit $ac_status); }; }; then ac_cv_lib_util_openpty=yes else @@ -14165,7 +16311,7 @@ fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS=$ac_check_lib_save_LIBS fi -echo "$as_me:14168: result: $ac_cv_lib_util_openpty" >&5 +echo "$as_me:16314: result: $ac_cv_lib_util_openpty" >&5 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6 if test $ac_cv_lib_util_openpty = yes; then cf_cv_lib_util=yes @@ -14173,7 +16319,7 @@ else cf_cv_lib_util=no fi -echo "$as_me:14176: checking for openpty header" >&5 +echo "$as_me:16322: checking for openpty header" >&5 echo $ECHO_N "checking for openpty header... $ECHO_C" >&6 if test "${cf_cv_func_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14184,7 +16330,7 @@ else for cf_header in pty.h libutil.h util.h do cat >conftest.$ac_ext <<_ACEOF -#line 14187 "configure" +#line 16333 "configure" #include "confdefs.h" #include <$cf_header> @@ -14201,16 +16347,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14204: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16350: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14207: \$? = $ac_status" >&5 + echo "$as_me:16353: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14210: \"$ac_try\"") >&5 + { (eval echo "$as_me:16356: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14213: \$? = $ac_status" >&5 + echo "$as_me:16359: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_func_openpty=$cf_header @@ -14228,7 +16374,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save_LIBS" fi -echo "$as_me:14231: result: $cf_cv_func_openpty" >&5 +echo "$as_me:16377: result: $cf_cv_func_openpty" >&5 echo "${ECHO_T}$cf_cv_func_openpty" >&6 if test "$cf_cv_func_openpty" != no ; then @@ -14274,13 +16420,13 @@ if test -n "$with_hashed_db/include" ; then fi if test "$cf_have_incdir" = no ; then - if test "$cf_add_incdir" = /usr/local/include ; then + if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cat >conftest.$ac_ext <<_ACEOF -#line 14283 "configure" +#line 16429 "configure" #include "confdefs.h" #include int @@ -14292,16 +16438,16 @@ printf("Hello") } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14295: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16441: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14298: \$? = $ac_status" >&5 + echo "$as_me:16444: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14301: \"$ac_try\"") >&5 + { (eval echo "$as_me:16447: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14304: \$? = $ac_status" >&5 + echo "$as_me:16450: \$? = $ac_status" >&5 (exit $ac_status); }; }; then : else @@ -14318,13 +16464,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 -echo "${as_me-configure}:14321: testing adding $cf_add_incdir to include-path ..." 1>&5 +echo "${as_me:-configure}:16467: testing adding $cf_add_incdir to include-path ..." 1>&5 - CPPFLAGS="-I$cf_add_incdir $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" - cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` - test "$cf_top_incdir" = "$cf_add_incdir" && break - cf_add_incdir="$cf_top_incdir" + cf_top_incdir=`echo $cf_add_incdir | sed -e 's%/include/.*$%/include%'` + test "$cf_top_incdir" = "$cf_add_incdir" && break + cf_add_incdir="$cf_top_incdir" else break fi @@ -14352,7 +16498,7 @@ if test -n "$with_hashed_db/lib" ; then if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 -echo "${as_me-configure}:14355: testing adding $cf_add_libdir to library-path ..." 1>&5 +echo "${as_me:-configure}:16501: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi @@ -14363,23 +16509,23 @@ fi fi esac -echo "$as_me:14366: checking for db.h" >&5 +echo "$as_me:16512: checking for db.h" >&5 echo $ECHO_N "checking for db.h... $ECHO_C" >&6 if test "${ac_cv_header_db_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 14372 "configure" +#line 16518 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:14376: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:16522: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:14382: \$? = $ac_status" >&5 + echo "$as_me:16528: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag @@ -14398,11 +16544,11 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:14401: result: $ac_cv_header_db_h" >&5 +echo "$as_me:16547: result: $ac_cv_header_db_h" >&5 echo "${ECHO_T}$ac_cv_header_db_h" >&6 if test $ac_cv_header_db_h = yes; then -echo "$as_me:14405: checking for version of db" >&5 +echo "$as_me:16551: checking for version of db" >&5 echo $ECHO_N "checking for version of db... $ECHO_C" >&6 if test "${cf_cv_hashed_db_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14413,10 +16559,10 @@ cf_cv_hashed_db_version=unknown for cf_db_version in 1 2 3 4 5 do -echo "${as_me-configure}:14416: testing checking for db version $cf_db_version ..." 1>&5 +echo "${as_me:-configure}:16562: testing checking for db version $cf_db_version ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 14419 "configure" +#line 16565 "configure" #include "confdefs.h" $ac_includes_default @@ -14446,16 +16592,16 @@ DBT *foo = 0 } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14449: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16595: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14452: \$? = $ac_status" >&5 + echo "$as_me:16598: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14455: \"$ac_try\"") >&5 + { (eval echo "$as_me:16601: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14458: \$? = $ac_status" >&5 + echo "$as_me:16604: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_hashed_db_version=$cf_db_version @@ -14469,16 +16615,16 @@ rm -f conftest.$ac_objext conftest.$ac_ext done fi -echo "$as_me:14472: result: $cf_cv_hashed_db_version" >&5 +echo "$as_me:16618: result: $cf_cv_hashed_db_version" >&5 echo "${ECHO_T}$cf_cv_hashed_db_version" >&6 if test "$cf_cv_hashed_db_version" = unknown ; then - { { echo "$as_me:14476: error: Cannot determine version of db" >&5 + { { echo "$as_me:16622: error: Cannot determine version of db" >&5 echo "$as_me: error: Cannot determine version of db" >&2;} { (exit 1); exit 1; }; } else -echo "$as_me:14481: checking for db libraries" >&5 +echo "$as_me:16627: checking for db libraries" >&5 echo $ECHO_N "checking for db libraries... $ECHO_C" >&6 if test "${cf_cv_hashed_db_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14492,10 +16638,10 @@ do LIBS="-l$cf_db_libs $LIBS" fi -echo "${as_me-configure}:14495: testing checking for library "$cf_db_libs" ..." 1>&5 +echo "${as_me:-configure}:16641: testing checking for library "$cf_db_libs" ..." 1>&5 cat >conftest.$ac_ext <<_ACEOF -#line 14498 "configure" +#line 16644 "configure" #include "confdefs.h" $ac_includes_default @@ -14550,16 +16696,16 @@ main () } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14553: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16699: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14556: \$? = $ac_status" >&5 + echo "$as_me:16702: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14559: \"$ac_try\"") >&5 + { (eval echo "$as_me:16705: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14562: \$? = $ac_status" >&5 + echo "$as_me:16708: \$? = $ac_status" >&5 (exit $ac_status); }; }; then if test -n "$cf_db_libs" ; then @@ -14579,11 +16725,11 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext done fi -echo "$as_me:14582: result: $cf_cv_hashed_db_libs" >&5 +echo "$as_me:16728: result: $cf_cv_hashed_db_libs" >&5 echo "${ECHO_T}$cf_cv_hashed_db_libs" >&6 if test "$cf_cv_hashed_db_libs" = unknown ; then - { { echo "$as_me:14586: error: Cannot determine library for db" >&5 + { { echo "$as_me:16732: error: Cannot determine library for db" >&5 echo "$as_me: error: Cannot determine library for db" >&2;} { (exit 1); exit 1; }; } elif test "$cf_cv_hashed_db_libs" != default ; then @@ -14593,7 +16739,7 @@ fi else - { { echo "$as_me:14596: error: Cannot find db.h" >&5 + { { echo "$as_me:16742: error: Cannot find db.h" >&5 echo "$as_me: error: Cannot find db.h" >&2;} { (exit 1); exit 1; }; } @@ -14608,7 +16754,7 @@ fi # Just in case, check if the C compiler has a bool type. -echo "$as_me:14611: checking if we should include stdbool.h" >&5 +echo "$as_me:16757: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -14616,7 +16762,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 14619 "configure" +#line 16765 "configure" #include "confdefs.h" int @@ -14628,23 +16774,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14631: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16777: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14634: \$? = $ac_status" >&5 + echo "$as_me:16780: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14637: \"$ac_try\"") >&5 + { (eval echo "$as_me:16783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14640: \$? = $ac_status" >&5 + echo "$as_me:16786: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14647 "configure" +#line 16793 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -14660,16 +16806,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14663: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16809: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14666: \$? = $ac_status" >&5 + echo "$as_me:16812: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14669: \"$ac_try\"") >&5 + { (eval echo "$as_me:16815: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14672: \$? = $ac_status" >&5 + echo "$as_me:16818: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -14683,13 +16829,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:14686: result: yes" >&5 +then echo "$as_me:16832: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:14688: result: no" >&5 +else echo "$as_me:16834: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:14692: checking for builtin bool type" >&5 +echo "$as_me:16838: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_cc_bool_type+set}" = set; then @@ -14697,7 +16843,7 @@ if test "${cf_cv_cc_bool_type+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 14700 "configure" +#line 16846 "configure" #include "confdefs.h" #include @@ -14712,16 +16858,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:14715: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:16861: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:14718: \$? = $ac_status" >&5 + echo "$as_me:16864: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:14721: \"$ac_try\"") >&5 + { (eval echo "$as_me:16867: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14724: \$? = $ac_status" >&5 + echo "$as_me:16870: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cc_bool_type=1 else @@ -14734,9 +16880,9 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_cc_bool_type" = 1 -then echo "$as_me:14737: result: yes" >&5 +then echo "$as_me:16883: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:14739: result: no" >&5 +else echo "$as_me:16885: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14758,16 +16904,16 @@ os2*) #(vi cf_stdcpp_libname=stdc++ ;; esac -echo "$as_me:14761: checking for library $cf_stdcpp_libname" >&5 +echo "$as_me:16907: checking for library $cf_stdcpp_libname" >&5 echo $ECHO_N "checking for library $cf_stdcpp_libname... $ECHO_C" >&6 if test "${cf_cv_libstdcpp+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save="$LIBS" - LIBS="$LIBS -l$cf_stdcpp_libname" + LIBS="-l$cf_stdcpp_libname $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14770 "configure" +#line 16916 "configure" #include "confdefs.h" #include @@ -14783,16 +16929,16 @@ strstreambuf foo(buf, sizeof(buf)) } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14786: \"$ac_link\"") >&5 +if { (eval echo "$as_me:16932: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14789: \$? = $ac_status" >&5 + echo "$as_me:16935: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14792: \"$ac_try\"") >&5 + { (eval echo "$as_me:16938: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14795: \$? = $ac_status" >&5 + echo "$as_me:16941: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_libstdcpp=yes else @@ -14804,12 +16950,12 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" fi -echo "$as_me:14807: result: $cf_cv_libstdcpp" >&5 +echo "$as_me:16953: result: $cf_cv_libstdcpp" >&5 echo "${ECHO_T}$cf_cv_libstdcpp" >&6 -test "$cf_cv_libstdcpp" = yes && CXXLIBS="$CXXLIBS -l$cf_stdcpp_libname" +test "$cf_cv_libstdcpp" = yes && CXXLIBS="-l$cf_stdcpp_libname $CXXLIBS" fi - echo "$as_me:14812: checking whether $CXX understands -c and -o together" >&5 + echo "$as_me:16958: checking whether $CXX understands -c and -o together" >&5 echo $ECHO_N "checking whether $CXX understands -c and -o together... $ECHO_C" >&6 if test "${cf_cv_prog_CXX_c_o+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -14825,29 +16971,29 @@ CF_EOF # We do the test twice because some compilers refuse to overwrite an # existing .o file with -o, though they will create one. ac_try='$CXX -c conftest.$ac_ext -o conftest2.$ac_objext >&5' -if { (eval echo "$as_me:14828: \"$ac_try\"") >&5 +if { (eval echo "$as_me:16974: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14831: \$? = $ac_status" >&5 + echo "$as_me:16977: \$? = $ac_status" >&5 (exit $ac_status); } && - test -f conftest2.$ac_objext && { (eval echo "$as_me:14833: \"$ac_try\"") >&5 + test -f conftest2.$ac_objext && { (eval echo "$as_me:16979: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14836: \$? = $ac_status" >&5 + echo "$as_me:16982: \$? = $ac_status" >&5 (exit $ac_status); }; then eval cf_cv_prog_CXX_c_o=yes else eval cf_cv_prog_CXX_c_o=no fi -rm -f conftest* +rm -rf conftest* fi if test $cf_cv_prog_CXX_c_o = yes; then - echo "$as_me:14847: result: yes" >&5 + echo "$as_me:16993: result: yes" >&5 echo "${ECHO_T}yes" >&6 else - echo "$as_me:14850: result: no" >&5 + echo "$as_me:16996: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -14867,12 +17013,12 @@ os2*) #(vi ;; esac if test "$GXX" = yes; then - echo "$as_me:14870: checking for lib$cf_gpp_libname" >&5 + echo "$as_me:17016: checking for lib$cf_gpp_libname" >&5 echo $ECHO_N "checking for lib$cf_gpp_libname... $ECHO_C" >&6 cf_save="$LIBS" - LIBS="$LIBS -l$cf_gpp_libname" + LIBS="-l$cf_gpp_libname $LIBS" cat >conftest.$ac_ext <<_ACEOF -#line 14875 "configure" +#line 17021 "configure" #include "confdefs.h" #include <$cf_gpp_libname/builtin.h> @@ -14886,19 +17032,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14889: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17035: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14892: \$? = $ac_status" >&5 + echo "$as_me:17038: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14895: \"$ac_try\"") >&5 + { (eval echo "$as_me:17041: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14898: \$? = $ac_status" >&5 + echo "$as_me:17044: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CXXLIBS="-l$cf_gpp_libname $CXXLIBS" if test "$cf_gpp_libname" = cpp ; then cat >>confdefs.h <<\EOF #define HAVE_GPP_BUILTIN_H 1 @@ -14914,7 +17060,7 @@ else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 14917 "configure" +#line 17063 "configure" #include "confdefs.h" #include @@ -14928,19 +17074,19 @@ two_arg_error_handler_t foo2 = lib_error_handler } _ACEOF rm -f conftest.$ac_objext conftest$ac_exeext -if { (eval echo "$as_me:14931: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17077: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:14934: \$? = $ac_status" >&5 + echo "$as_me:17080: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest$ac_exeext' - { (eval echo "$as_me:14937: \"$ac_try\"") >&5 + { (eval echo "$as_me:17083: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:14940: \$? = $ac_status" >&5 + echo "$as_me:17086: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cxx_library=yes - CXXLIBS="$CXXLIBS -l$cf_gpp_libname" + CXXLIBS="-l$cf_gpp_libname $CXXLIBS" cat >>confdefs.h <<\EOF #define HAVE_BUILTIN_H 1 EOF @@ -14954,7 +17100,7 @@ rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext fi rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext LIBS="$cf_save" - echo "$as_me:14957: result: $cf_cxx_library" >&5 + echo "$as_me:17103: result: $cf_cxx_library" >&5 echo "${ECHO_T}$cf_cxx_library" >&6 fi @@ -14970,7 +17116,7 @@ ac_compile='$CXX -c $CXXFLAGS $CPPFLAGS conftest.$ac_ext >&5' ac_link='$CXX -o conftest$ac_exeext $CXXFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return -echo "$as_me:14973: checking how to run the C++ preprocessor" >&5 +echo "$as_me:17119: checking how to run the C++ preprocessor" >&5 echo $ECHO_N "checking how to run the C++ preprocessor... $ECHO_C" >&6 if test -z "$CXXCPP"; then if test "${ac_cv_prog_CXXCPP+set}" = set; then @@ -14987,18 +17133,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 14990 "configure" +#line 17136 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:14995: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17141: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:15001: \$? = $ac_status" >&5 + echo "$as_me:17147: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15021,17 +17167,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 15024 "configure" +#line 17170 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:15028: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17174: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:15034: \$? = $ac_status" >&5 + echo "$as_me:17180: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15068,7 +17214,7 @@ fi else ac_cv_prog_CXXCPP=$CXXCPP fi -echo "$as_me:15071: result: $CXXCPP" >&5 +echo "$as_me:17217: result: $CXXCPP" >&5 echo "${ECHO_T}$CXXCPP" >&6 ac_preproc_ok=false for ac_cxx_preproc_warn_flag in '' yes @@ -15078,18 +17224,18 @@ do # On the NeXT, cc -E runs the code through the compiler's parser, # not just through cpp. "Syntax error" is here to catch this case. cat >conftest.$ac_ext <<_ACEOF -#line 15081 "configure" +#line 17227 "configure" #include "confdefs.h" #include Syntax error _ACEOF -if { (eval echo "$as_me:15086: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17232: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:15092: \$? = $ac_status" >&5 + echo "$as_me:17238: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15112,17 +17258,17 @@ rm -f conftest.err conftest.$ac_ext # OK, works on sane cases. Now check whether non-existent headers # can be detected and how. cat >conftest.$ac_ext <<_ACEOF -#line 15115 "configure" +#line 17261 "configure" #include "confdefs.h" #include _ACEOF -if { (eval echo "$as_me:15119: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17265: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:15125: \$? = $ac_status" >&5 + echo "$as_me:17271: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15150,7 +17296,7 @@ rm -f conftest.err conftest.$ac_ext if $ac_preproc_ok; then : else - { { echo "$as_me:15153: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 + { { echo "$as_me:17299: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&5 echo "$as_me: error: C++ preprocessor \"$CXXCPP\" fails sanity check" >&2;} { (exit 1); exit 1; }; } fi @@ -15165,23 +17311,23 @@ ac_main_return=return for ac_header in iostream typeinfo do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` -echo "$as_me:15168: checking for $ac_header" >&5 +echo "$as_me:17314: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.$ac_ext <<_ACEOF -#line 15174 "configure" +#line 17320 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF -if { (eval echo "$as_me:15178: \"$ac_cpp conftest.$ac_ext\"") >&5 +if { (eval echo "$as_me:17324: \"$ac_cpp conftest.$ac_ext\"") >&5 (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 ac_status=$? egrep -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 - echo "$as_me:15184: \$? = $ac_status" >&5 + echo "$as_me:17330: \$? = $ac_status" >&5 (exit $ac_status); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_cxx_preproc_warn_flag @@ -15200,7 +17346,7 @@ else fi rm -f conftest.err conftest.$ac_ext fi -echo "$as_me:15203: result: `eval echo '${'$as_ac_Header'}'`" >&5 +echo "$as_me:17349: result: `eval echo '${'$as_ac_Header'}'`" >&5 echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 if test `eval echo '${'$as_ac_Header'}'` = yes; then cat >>confdefs.h <&5 + echo "$as_me:17360: checking if iostream uses std-namespace" >&5 echo $ECHO_N "checking if iostream uses std-namespace... $ECHO_C" >&6 cat >conftest.$ac_ext <<_ACEOF -#line 15217 "configure" +#line 17363 "configure" #include "confdefs.h" #include @@ -15231,16 +17377,16 @@ cerr << "testing" << endl; } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15234: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17380: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15237: \$? = $ac_status" >&5 + echo "$as_me:17383: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15240: \"$ac_try\"") >&5 + { (eval echo "$as_me:17386: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15243: \$? = $ac_status" >&5 + echo "$as_me:17389: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_iostream_namespace=yes else @@ -15249,7 +17395,7 @@ cat conftest.$ac_ext >&5 cf_iostream_namespace=no fi rm -f conftest.$ac_objext conftest.$ac_ext - echo "$as_me:15252: result: $cf_iostream_namespace" >&5 + echo "$as_me:17398: result: $cf_iostream_namespace" >&5 echo "${ECHO_T}$cf_iostream_namespace" >&6 if test "$cf_iostream_namespace" = yes ; then cat >>confdefs.h <<\EOF @@ -15259,7 +17405,7 @@ EOF fi fi -echo "$as_me:15262: checking if we should include stdbool.h" >&5 +echo "$as_me:17408: checking if we should include stdbool.h" >&5 echo $ECHO_N "checking if we should include stdbool.h... $ECHO_C" >&6 if test "${cf_cv_header_stdbool_h+set}" = set; then @@ -15267,7 +17413,7 @@ if test "${cf_cv_header_stdbool_h+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 15270 "configure" +#line 17416 "configure" #include "confdefs.h" int @@ -15279,23 +17425,23 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15282: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17428: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15285: \$? = $ac_status" >&5 + echo "$as_me:17431: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15288: \"$ac_try\"") >&5 + { (eval echo "$as_me:17434: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15291: \$? = $ac_status" >&5 + echo "$as_me:17437: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=0 else echo "$as_me: failed program was:" >&5 cat conftest.$ac_ext >&5 cat >conftest.$ac_ext <<_ACEOF -#line 15298 "configure" +#line 17444 "configure" #include "confdefs.h" #ifndef __BEOS__ @@ -15311,16 +17457,16 @@ bool foo = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15314: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17460: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15317: \$? = $ac_status" >&5 + echo "$as_me:17463: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15320: \"$ac_try\"") >&5 + { (eval echo "$as_me:17466: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15323: \$? = $ac_status" >&5 + echo "$as_me:17469: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_header_stdbool_h=1 else @@ -15334,13 +17480,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_header_stdbool_h" = 1 -then echo "$as_me:15337: result: yes" >&5 +then echo "$as_me:17483: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:15339: result: no" >&5 +else echo "$as_me:17485: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:15343: checking for builtin bool type" >&5 +echo "$as_me:17489: checking for builtin bool type" >&5 echo $ECHO_N "checking for builtin bool type... $ECHO_C" >&6 if test "${cf_cv_builtin_bool+set}" = set; then @@ -15348,7 +17494,7 @@ if test "${cf_cv_builtin_bool+set}" = set; then else cat >conftest.$ac_ext <<_ACEOF -#line 15351 "configure" +#line 17497 "configure" #include "confdefs.h" #include @@ -15363,16 +17509,16 @@ bool x = false } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15366: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17512: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15369: \$? = $ac_status" >&5 + echo "$as_me:17515: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15372: \"$ac_try\"") >&5 + { (eval echo "$as_me:17518: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15375: \$? = $ac_status" >&5 + echo "$as_me:17521: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_builtin_bool=1 else @@ -15385,13 +17531,13 @@ rm -f conftest.$ac_objext conftest.$ac_ext fi if test "$cf_cv_builtin_bool" = 1 -then echo "$as_me:15388: result: yes" >&5 +then echo "$as_me:17534: result: yes" >&5 echo "${ECHO_T}yes" >&6 -else echo "$as_me:15390: result: no" >&5 +else echo "$as_me:17536: result: no" >&5 echo "${ECHO_T}no" >&6 fi -echo "$as_me:15394: checking for size of bool" >&5 +echo "$as_me:17540: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15402,7 +17548,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15405 "configure" +#line 17551 "configure" #include "confdefs.h" #include @@ -15444,15 +17590,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15447: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17593: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15450: \$? = $ac_status" >&5 + echo "$as_me:17596: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15452: \"$ac_try\"") >&5 + { (eval echo "$as_me:17598: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15455: \$? = $ac_status" >&5 + echo "$as_me:17601: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -15470,18 +17616,18 @@ fi fi rm -f cf_test.out -echo "$as_me:15473: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:17619: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:15479: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:17625: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi -echo "$as_me:15484: checking for special defines needed for etip.h" >&5 +echo "$as_me:17630: checking for special defines needed for etip.h" >&5 echo $ECHO_N "checking for special defines needed for etip.h... $ECHO_C" >&6 cf_save_CXXFLAGS="$CXXFLAGS" cf_result="none" @@ -15493,7 +17639,7 @@ do test -n "$cf_math" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_math}" test -n "$cf_excp" && CXXFLAGS="$CXXFLAGS -DETIP_NEEDS_${cf_excp}" cat >conftest.$ac_ext <<_ACEOF -#line 15496 "configure" +#line 17642 "configure" #include "confdefs.h" #include @@ -15507,16 +17653,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15510: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17656: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15513: \$? = $ac_status" >&5 + echo "$as_me:17659: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15516: \"$ac_try\"") >&5 + { (eval echo "$as_me:17662: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15519: \$? = $ac_status" >&5 + echo "$as_me:17665: \$? = $ac_status" >&5 (exit $ac_status); }; }; then test -n "$cf_math" && cat >>confdefs.h <&5 +echo "$as_me:17686: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 CXXFLAGS="$cf_save_CXXFLAGS" if test -n "$CXX"; then -echo "$as_me:15545: checking if $CXX accepts parameter initialization" >&5 +echo "$as_me:17691: checking if $CXX accepts parameter initialization" >&5 echo $ECHO_N "checking if $CXX accepts parameter initialization... $ECHO_C" >&6 if test "${cf_cv_cpp_param_init+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15559,7 +17705,7 @@ ac_main_return=return cf_cv_cpp_param_init=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15562 "configure" +#line 17708 "configure" #include "confdefs.h" class TEST { @@ -15578,15 +17724,15 @@ void main() { } _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15581: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17727: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15584: \$? = $ac_status" >&5 + echo "$as_me:17730: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15586: \"$ac_try\"") >&5 + { (eval echo "$as_me:17732: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15589: \$? = $ac_status" >&5 + echo "$as_me:17735: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_param_init=yes else @@ -15605,7 +17751,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:15608: result: $cf_cv_cpp_param_init" >&5 +echo "$as_me:17754: result: $cf_cv_cpp_param_init" >&5 echo "${ECHO_T}$cf_cv_cpp_param_init" >&6 fi test "$cf_cv_cpp_param_init" = yes && cat >>confdefs.h <<\EOF @@ -15614,7 +17760,7 @@ EOF if test -n "$CXX"; then -echo "$as_me:15617: checking if $CXX accepts static_cast" >&5 +echo "$as_me:17763: checking if $CXX accepts static_cast" >&5 echo $ECHO_N "checking if $CXX accepts static_cast... $ECHO_C" >&6 if test "${cf_cv_cpp_static_cast+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15628,7 +17774,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return cat >conftest.$ac_ext <<_ACEOF -#line 15631 "configure" +#line 17777 "configure" #include "confdefs.h" class NCursesPanel @@ -15672,16 +17818,16 @@ main () } _ACEOF rm -f conftest.$ac_objext -if { (eval echo "$as_me:15675: \"$ac_compile\"") >&5 +if { (eval echo "$as_me:17821: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? - echo "$as_me:15678: \$? = $ac_status" >&5 + echo "$as_me:17824: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='test -s conftest.$ac_objext' - { (eval echo "$as_me:15681: \"$ac_try\"") >&5 + { (eval echo "$as_me:17827: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15684: \$? = $ac_status" >&5 + echo "$as_me:17830: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_cpp_static_cast=yes else @@ -15699,7 +17845,7 @@ ac_compiler_gnu=$ac_cv_cxx_compiler_gnu ac_main_return=return fi -echo "$as_me:15702: result: $cf_cv_cpp_static_cast" >&5 +echo "$as_me:17848: result: $cf_cv_cpp_static_cast" >&5 echo "${ECHO_T}$cf_cv_cpp_static_cast" >&6 fi @@ -15709,12 +17855,12 @@ test "$cf_cv_cpp_static_cast" = yes && cat >>confdefs.h <<\EOF EOF CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' + CXX_ARFLAGS='$(ARFLAGS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-ar -o' + CXX_ARFLAGS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -15723,7 +17869,7 @@ EOF solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-xar -o' + CXX_ARFLAGS='-xar -o' fi ;; esac @@ -15747,7 +17893,7 @@ else else if test "$cf_cv_header_stdbool_h" = 1 ; then -echo "$as_me:15750: checking for size of bool" >&5 +echo "$as_me:17896: checking for size of bool" >&5 echo $ECHO_N "checking for size of bool... $ECHO_C" >&6 if test "${cf_cv_type_of_bool+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15758,7 +17904,7 @@ else cf_cv_type_of_bool=unknown else cat >conftest.$ac_ext <<_ACEOF -#line 15761 "configure" +#line 17907 "configure" #include "confdefs.h" #include @@ -15800,15 +17946,15 @@ main() _ACEOF rm -f conftest$ac_exeext -if { (eval echo "$as_me:15803: \"$ac_link\"") >&5 +if { (eval echo "$as_me:17949: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? - echo "$as_me:15806: \$? = $ac_status" >&5 + echo "$as_me:17952: \$? = $ac_status" >&5 (exit $ac_status); } && { ac_try='./conftest$ac_exeext' - { (eval echo "$as_me:15808: \"$ac_try\"") >&5 + { (eval echo "$as_me:17954: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? - echo "$as_me:15811: \$? = $ac_status" >&5 + echo "$as_me:17957: \$? = $ac_status" >&5 (exit $ac_status); }; }; then cf_cv_type_of_bool=`cat cf_test.out` if test -z "$cf_cv_type_of_bool"; then @@ -15826,25 +17972,25 @@ fi fi rm -f cf_test.out -echo "$as_me:15829: result: $cf_cv_type_of_bool" >&5 +echo "$as_me:17975: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 if test "$cf_cv_type_of_bool" = unknown ; then case .$NCURSES_BOOL in #(vi .auto|.) NCURSES_BOOL=unsigned;; esac - { echo "$as_me:15835: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 + { echo "$as_me:17981: WARNING: Assuming $NCURSES_BOOL for type of bool" >&5 echo "$as_me: WARNING: Assuming $NCURSES_BOOL for type of bool" >&2;} cf_cv_type_of_bool=$NCURSES_BOOL fi else - echo "$as_me:15841: checking for fallback type of bool" >&5 + echo "$as_me:17987: checking for fallback type of bool" >&5 echo $ECHO_N "checking for fallback type of bool... $ECHO_C" >&6 case "$host_cpu" in #(vi i?86) cf_cv_type_of_bool=char ;; #(vi *) cf_cv_type_of_bool=int ;; esac - echo "$as_me:15847: result: $cf_cv_type_of_bool" >&5 + echo "$as_me:17993: result: $cf_cv_type_of_bool" >&5 echo "${ECHO_T}$cf_cv_type_of_bool" >&6 fi fi @@ -15871,19 +18017,20 @@ fi if test -f "${srcdir}/Ada95/Makefile.in" ; then -if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - { echo "$as_me:15876: WARNING: libtool does not support Ada - disabling feature" >&5 + if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + { echo "$as_me:18022: WARNING: libtool does not support Ada - disabling feature" >&5 echo "$as_me: WARNING: libtool does not support Ada - disabling feature" >&2;} - cf_with_ada=no - fi -fi + cf_with_ada=no + fi + fi + + if test "$cf_with_ada" != "no" ; then -if test "$cf_with_ada" != "no" ; then cf_ada_make=gnatmake # Extract the first word of "$cf_ada_make", so it can be a program name with args. set dummy $cf_ada_make; ac_word=$2 -echo "$as_me:15886: checking for $ac_word" >&5 +echo "$as_me:18033: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_gnat_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15898,7 +18045,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_gnat_exists="yes" -echo "$as_me:15901: found $ac_dir/$ac_word" >&5 +echo "$as_me:18048: found $ac_dir/$ac_word" >&5 break done @@ -15907,10 +18054,10 @@ fi fi gnat_exists=$ac_cv_prog_gnat_exists if test -n "$gnat_exists"; then - echo "$as_me:15910: result: $gnat_exists" >&5 + echo "$as_me:18057: result: $gnat_exists" >&5 echo "${ECHO_T}$gnat_exists" >&6 else - echo "$as_me:15913: result: no" >&5 + echo "$as_me:18060: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15918,34 +18065,28 @@ if test "$ac_cv_prog_gnat_exists" = no; then cf_ada_make= else -echo "$as_me:15921: checking for gnat version" >&5 +echo "$as_me:18068: checking for gnat version" >&5 echo $ECHO_N "checking for gnat version... $ECHO_C" >&6 -cf_gnat_version=`${cf_ada_make-gnatmake} -v 2>&1 | grep '[0-9].[0-9][0-9]*' |\ - sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` -echo "$as_me:15925: result: $cf_gnat_version" >&5 +cf_gnat_version=`${cf_ada_make:-gnatmake} -v 2>&1 | \ + grep '[0-9].[0-9][0-9]*' |\ + sed -e '2,$d' -e 's/[^0-9 \.]//g' -e 's/^[ ]*//' -e 's/ .*//'` +echo "$as_me:18073: result: $cf_gnat_version" >&5 echo "${ECHO_T}$cf_gnat_version" >&6 -case $cf_gnat_version in - 3.1[1-9]*|3.[2-9]*|[4-9].*) - cf_cv_prog_gnat_correct=yes - ;; - *) echo Unsupported GNAT version $cf_gnat_version. Required is 3.11 or better. Disabling Ada95 binding. - cf_cv_prog_gnat_correct=no - ;; -esac -case $cf_gnat_version in - 3.[1-9]*|[4-9].*) - cf_compile_generics=generics - cf_generic_objects="\${GENOBJS}" - ;; - *) cf_compile_generics= - cf_generic_objects= - ;; +case $cf_gnat_version in #(vi +3.1[1-9]*|3.[2-9]*|[4-9].*) #(vi + cf_cv_prog_gnat_correct=yes + ;; +*) + { echo "$as_me:18081: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&5 +echo "$as_me: WARNING: Unsupported GNAT version $cf_gnat_version. We require 3.11 or better. Disabling Ada95 binding." >&2;} + cf_cv_prog_gnat_correct=no + ;; esac # Extract the first word of "m4", so it can be a program name with args. set dummy m4; ac_word=$2 -echo "$as_me:15948: checking for $ac_word" >&5 +echo "$as_me:18089: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_M4_exists+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 @@ -15960,7 +18101,7 @@ for ac_dir in $ac_dummy; do test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_M4_exists="yes" -echo "$as_me:15963: found $ac_dir/$ac_word" >&5 +echo "$as_me:18104: found $ac_dir/$ac_word" >&5 break done @@ -15969,10 +18110,10 @@ fi fi M4_exists=$ac_cv_prog_M4_exists if test -n "$M4_exists"; then - echo "$as_me:15972: result: $M4_exists" >&5 + echo "$as_me:18113: result: $M4_exists" >&5 echo "${ECHO_T}$M4_exists" >&6 else - echo "$as_me:15975: result: no" >&5 + echo "$as_me:18116: result: no" >&5 echo "${ECHO_T}no" >&6 fi @@ -15981,10 +18122,10 @@ fi echo Ada95 binding required program m4 not found. Ada95 binding disabled. fi if test "$cf_cv_prog_gnat_correct" = yes; then - echo "$as_me:15984: checking if GNAT works" >&5 + echo "$as_me:18125: checking if GNAT works" >&5 echo $ECHO_N "checking if GNAT works... $ECHO_C" >&6 -rm -f conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_prog_gnat_correct=no fi -rm -f conftest* +rm -rf conftest* *~conftest* - echo "$as_me:16012: result: $cf_cv_prog_gnat_correct" >&5 + echo "$as_me:18153: result: $cf_cv_prog_gnat_correct" >&5 echo "${ECHO_T}$cf_cv_prog_gnat_correct" >&6 fi fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - echo "$as_me:16019: checking if GNAT pragma Unreferenced works" >&5 + if test "$cf_cv_prog_gnat_correct" = yes; then + + ADAFLAGS="$ADAFLAGS -gnatpn" + + # make ADAFLAGS consistent with CFLAGS + case "$CFLAGS" in + *-g*) + + ADAFLAGS="$ADAFLAGS -g" + + ;; + esac + case "$CFLAGS" in + *-O*) + + ADAFLAGS="$ADAFLAGS -O3" + + ;; + esac + +echo "$as_me:18178: checking if GNAT supports generics" >&5 +echo $ECHO_N "checking if GNAT supports generics... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[1-9]*|[4-9].*) #(vi + cf_gnat_generics=yes + ;; +*) + cf_gnat_generics=no + ;; +esac +echo "$as_me:18188: result: $cf_gnat_generics" >&5 +echo "${ECHO_T}$cf_gnat_generics" >&6 + +if test "$cf_gnat_generics" = yes +then + cf_compile_generics=generics + cf_generic_objects="\${GENOBJS}" +else + cf_compile_generics= + cf_generic_objects= +fi + +echo "$as_me:18200: checking if GNAT supports SIGINT" >&5 +echo $ECHO_N "checking if GNAT supports SIGINT... $ECHO_C" >&6 +if test "${cf_cv_gnat_sigint+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + +rm -rf conftest* *~conftest* +cat >>conftest.ads <>conftest.adb <&5 2>&1 ) ; then + cf_cv_gnat_sigint=yes +else + cf_cv_gnat_sigint=no +fi +rm -rf conftest* *~conftest* + +fi +echo "$as_me:18248: result: $cf_cv_gnat_sigint" >&5 +echo "${ECHO_T}$cf_cv_gnat_sigint" >&6 + +if test $cf_cv_gnat_sigint = yes ; then + USE_GNAT_SIGINT="" +else + USE_GNAT_SIGINT="#" +fi + +echo "$as_me:18257: checking if GNAT pragma Unreferenced works" >&5 echo $ECHO_N "checking if GNAT pragma Unreferenced works... $ECHO_C" >&6 +if test "${cf_cv_pragma_unreferenced+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else -rm -f conftest* +rm -rf conftest* *~conftest* cat >>conftest.ads <&5 2>&1 ) ; then else cf_cv_pragma_unreferenced=no fi -rm -f conftest* +rm -rf conftest* *~conftest* - echo "$as_me:16046: result: $cf_cv_pragma_unreferenced" >&5 +fi +echo "$as_me:18288: result: $cf_cv_pragma_unreferenced" >&5 echo "${ECHO_T}$cf_cv_pragma_unreferenced" >&6 - # if the pragma is supported, use it (needed in the Trace code). - if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE - else - PRAGMA_UNREF=FALSE - fi +# if the pragma is supported, use it (needed in the Trace code). +if test $cf_cv_pragma_unreferenced = yes ; then + PRAGMA_UNREF=TRUE +else + PRAGMA_UNREF=FALSE +fi + +cf_gnat_libraries=no +cf_gnat_projects=no + +echo "$as_me:18301: checking if GNAT supports project files" >&5 +echo $ECHO_N "checking if GNAT supports project files... $ECHO_C" >&6 +case $cf_gnat_version in #(vi +3.[0-9]*) #(vi + ;; +*) + case $cf_cv_system_name in #(vi + cygwin*) #(vi + ;; + *) + mkdir conftest.src conftest.bin conftest.lib + cd conftest.src + rm -rf conftest* *~conftest* + cat >>library.gpr <>confpackage.ads <>confpackage.adb <&5 2>&1 ) ; then + cf_gnat_projects=yes + fi + cd .. + if test -f conftest.lib/confpackage.ali + then + cf_gnat_libraries=yes + fi + rm -rf conftest* *~conftest* + ;; + esac + ;; +esac +echo "$as_me:18369: result: $cf_gnat_projects" >&5 +echo "${ECHO_T}$cf_gnat_projects" >&6 + +if test $cf_gnat_projects = yes +then + echo "$as_me:18374: checking if GNAT supports libraries" >&5 +echo $ECHO_N "checking if GNAT supports libraries... $ECHO_C" >&6 + echo "$as_me:18376: result: $cf_gnat_libraries" >&5 +echo "${ECHO_T}$cf_gnat_libraries" >&6 +fi + +if test "$cf_gnat_projects" = yes +then + USE_OLD_MAKERULES="#" + USE_GNAT_PROJECTS="" +else + USE_OLD_MAKERULES="" + USE_GNAT_PROJECTS="#" +fi + +if test "$cf_gnat_libraries" = yes +then + USE_GNAT_LIBRARIES="" +else + USE_GNAT_LIBRARIES="#" +fi + +echo "$as_me:18396: checking for ada-compiler" >&5 +echo $ECHO_N "checking for ada-compiler... $ECHO_C" >&6 # Check whether --with-ada-compiler or --without-ada-compiler was given. if test "${with_ada_compiler+set}" = set; then @@ -16061,15 +18404,21 @@ else cf_ada_compiler=gnatmake fi; - cf_ada_package=terminal_interface +echo "$as_me:18407: result: $cf_ada_compiler" >&5 +echo "${ECHO_T}$cf_ada_compiler" >&6 + + cf_ada_package=terminal_interface + +echo "$as_me:18412: checking for ada-include" >&5 +echo $ECHO_N "checking for ada-include... $ECHO_C" >&6 # Check whether --with-ada-include or --without-ada-include was given. if test "${with_ada_include+set}" = set; then withval="$with_ada_include" else - withval="${ADA_INCLUDE-$prefix/lib/ada/adainclude}" -fi; if test -n "$prefix/lib/ada/adainclude" ; then + withval="${ADA_INCLUDE:-$prefix/share/ada/adainclude}" +fi; if test -n "$prefix/share/ada/adainclude" ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" @@ -16096,7 +18445,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:16099: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18448: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -16105,12 +18454,18 @@ esac fi ADA_INCLUDE="$withval" +echo "$as_me:18457: result: $ADA_INCLUDE" >&5 +echo "${ECHO_T}$ADA_INCLUDE" >&6 + +echo "$as_me:18460: checking for ada-objects" >&5 +echo $ECHO_N "checking for ada-objects... $ECHO_C" >&6 + # Check whether --with-ada-objects or --without-ada-objects was given. if test "${with_ada_objects+set}" = set; then withval="$with_ada_objects" else - withval="${ADA_OBJECTS-$prefix/lib/ada/adalib}" + withval="${ADA_OBJECTS:-$prefix/lib/ada/adalib}" fi; if test -n "$prefix/lib/ada/adalib" ; then if test "x$prefix" != xNONE; then @@ -16138,7 +18493,7 @@ case ".$withval" in #(vi withval=`echo $withval | sed -e s%NONE%$cf_path_syntax%` ;; *) - { { echo "$as_me:16141: error: expected a pathname, not \"$withval\"" >&5 + { { echo "$as_me:18496: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; @@ -16147,10 +18502,38 @@ esac fi ADA_OBJECTS="$withval" -fi -fi +echo "$as_me:18505: result: $ADA_OBJECTS" >&5 +echo "${ECHO_T}$ADA_OBJECTS" >&6 + +echo "$as_me:18508: checking if an Ada95 shared-library should be built" >&5 +echo $ECHO_N "checking if an Ada95 shared-library should be built... $ECHO_C" >&6 + +# Check whether --with-ada-sharedlib or --without-ada-sharedlib was given. +if test "${with_ada_sharedlib+set}" = set; then + withval="$with_ada_sharedlib" + with_ada_sharedlib=$withval else - cf_with_ada=no + with_ada_sharedlib=no +fi; +echo "$as_me:18518: result: $with_ada_sharedlib" >&5 +echo "${ECHO_T}$with_ada_sharedlib" >&6 + +ADA_SHAREDLIB='lib$(LIB_NAME).so.1' +MAKE_ADA_SHAREDLIB="#" + +if test "x$with_ada_sharedlib" != xno +then + MAKE_ADA_SHAREDLIB= + if test "x$with_ada_sharedlib" != xyes + then + ADA_SHAREDLIB="$with_ada_sharedlib" + fi +fi + + fi + fi +else + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -16163,7 +18546,7 @@ fi ### chooses to split module lists into libraries. ### ### (see CF_LIB_RULES). -echo "$as_me:16166: checking for library subsets" >&5 +echo "$as_me:18549: checking for library subsets" >&5 echo $ECHO_N "checking for library subsets... $ECHO_C" >&6 LIB_SUBSETS= @@ -16178,6 +18561,7 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" + if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -16185,17 +18569,32 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" + +# Most term-driver calls are to tinfo, but some like init_pair are to the +# base library (so it resides in base). +if test "$with_term_driver" != no ; then + LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" + case $cf_cv_system_name in #(vi + *mingw32*) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" + ;; + *) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" + ;; + esac +fi + test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" -echo "$as_me:16191: result: $LIB_SUBSETS" >&5 +echo "$as_me:18590: result: $LIB_SUBSETS" >&5 echo "${ECHO_T}$LIB_SUBSETS" >&6 ### Construct the list of include-directories to be generated -CPPFLAGS="-I. -I../include $CPPFLAGS" +CPPFLAGS="$CPPFLAGS -I. -I../include" if test "$srcdir" != "."; then - CPPFLAGS="-I\${srcdir}/../include $CPPFLAGS" + CPPFLAGS="$CPPFLAGS -I\${srcdir}/../include" fi if test "$GCC" != yes; then CPPFLAGS="$CPPFLAGS -I\${includedir}" @@ -16209,7 +18608,7 @@ elif test "$includedir" != "/usr/include"; then fi fi -ACPPFLAGS="-I. -I../../include $ACPPFLAGS" +ACPPFLAGS="-I. -I../include -I../../include $ACPPFLAGS" if test "$srcdir" != "."; then ACPPFLAGS="-I\${srcdir}/../../include $ACPPFLAGS" fi @@ -16226,7 +18625,7 @@ elif test "$includedir" != "/usr/include"; then fi ### Build up pieces for makefile rules -echo "$as_me:16229: checking default library suffix" >&5 +echo "$as_me:18628: checking default library suffix" >&5 echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -16237,46 +18636,50 @@ echo $ECHO_N "checking default library suffix... $ECHO_C" >&6 shared) DFT_ARG_SUFFIX='' ;; esac test -n "$LIB_SUFFIX" && DFT_ARG_SUFFIX="${LIB_SUFFIX}${DFT_ARG_SUFFIX}" -echo "$as_me:16240: result: $DFT_ARG_SUFFIX" >&5 +echo "$as_me:18639: result: $DFT_ARG_SUFFIX" >&5 echo "${ECHO_T}$DFT_ARG_SUFFIX" >&6 -echo "$as_me:16243: checking default library-dependency suffix" >&5 +echo "$as_me:18642: checking default library-dependency suffix" >&5 echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 - case $DFT_LWR_MODEL in - libtool) + case $DFT_LWR_MODEL in #(vi + libtool) #(vi DFT_LIB_SUFFIX='.la' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - normal) + normal) #(vi DFT_LIB_SUFFIX='.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - debug) + debug) #(vi DFT_LIB_SUFFIX='_g.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - profile) + profile) #(vi DFT_LIB_SUFFIX='_p.a' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + DFT_LIB_SUFFIX='.a' + DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX + ;; + cygwin*) #(vi DFT_LIB_SUFFIX='.dll' DFT_DEP_SUFFIX='.dll.a' ;; - darwin*) + darwin*) #(vi DFT_LIB_SUFFIX='.dylib' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi DFT_LIB_SUFFIX='.so' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; - *) + *) #(vi DFT_LIB_SUFFIX='.sl' DFT_DEP_SUFFIX=$DFT_LIB_SUFFIX ;; @@ -16289,10 +18692,10 @@ echo $ECHO_N "checking default library-dependency suffix... $ECHO_C" >&6 esac test -n "$LIB_SUFFIX" && DFT_LIB_SUFFIX="${LIB_SUFFIX}${DFT_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && DFT_DEP_SUFFIX="${LIB_SUFFIX}${DFT_DEP_SUFFIX}" -echo "$as_me:16292: result: $DFT_DEP_SUFFIX" >&5 +echo "$as_me:18695: result: $DFT_DEP_SUFFIX" >&5 echo "${ECHO_T}$DFT_DEP_SUFFIX" >&6 -echo "$as_me:16295: checking default object directory" >&5 +echo "$as_me:18698: checking default object directory" >&5 echo $ECHO_N "checking default object directory... $ECHO_C" >&6 case $DFT_LWR_MODEL in @@ -16308,51 +18711,55 @@ echo $ECHO_N "checking default object directory... $ECHO_C" >&6 DFT_OBJ_SUBDIR='obj_s' ;; esac esac -echo "$as_me:16311: result: $DFT_OBJ_SUBDIR" >&5 +echo "$as_me:18714: result: $DFT_OBJ_SUBDIR" >&5 echo "${ECHO_T}$DFT_OBJ_SUBDIR" >&6 # libtool thinks it can make c++ shared libraries (perhaps only g++) if test "$cf_with_cxx" = yes ; then -echo "$as_me:16316: checking c++ library-dependency suffix" >&5 +echo "$as_me:18719: checking c++ library-dependency suffix" >&5 echo $ECHO_N "checking c++ library-dependency suffix... $ECHO_C" >&6 if test "$with_libtool" != "no"; then CXX_LIB_SUFFIX=$DFT_DEP_SUFFIX else - case normal in - libtool) + case normal in #(vi + libtool) #(vi CXX_LIB_SUFFIX='.la' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - normal) + normal) #(vi CXX_LIB_SUFFIX='.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - debug) + debug) #(vi CXX_LIB_SUFFIX='_g.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - profile) + profile) #(vi CXX_LIB_SUFFIX='_p.a' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + CXX_LIB_SUFFIX='.a' + CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX + ;; + cygwin*) #(vi CXX_LIB_SUFFIX='.dll' CXX_DEP_SUFFIX='.dll.a' ;; - darwin*) + darwin*) #(vi CXX_LIB_SUFFIX='.dylib' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi CXX_LIB_SUFFIX='.so' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; - *) + *) #(vi CXX_LIB_SUFFIX='.sl' CXX_DEP_SUFFIX=$CXX_LIB_SUFFIX ;; @@ -16366,7 +18773,7 @@ else test -n "$LIB_SUFFIX" && CXX_LIB_SUFFIX="${LIB_SUFFIX}${CXX_LIB_SUFFIX}" test -n "$LIB_SUFFIX" && CXX_DEP_SUFFIX="${LIB_SUFFIX}${CXX_DEP_SUFFIX}" fi -echo "$as_me:16369: result: $CXX_LIB_SUFFIX" >&5 +echo "$as_me:18776: result: $CXX_LIB_SUFFIX" >&5 echo "${ECHO_T}$CXX_LIB_SUFFIX" >&6 fi @@ -16431,6 +18838,8 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" + TICS_LIST="$SHLIB_LIST $TEST_ARGS" + SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -16480,7 +18889,7 @@ normal|debug|profile) if test "$GCC" = yes ; then case $cf_cv_system_name in #( - OS/2*|os2*|aix[45]*) #( vi + OS/2*|os2*|aix[4]*|solaris2.1[0-9]|darwin*) #( vi LDFLAGS_STATIC= LDFLAGS_SHARED= ;; @@ -16491,7 +18900,7 @@ if test "$GCC" = yes ; then esac else case $cf_cv_system_name in #( - aix[45]*) #( from ld manpage + aix[456]*) #( from ld manpage LDFLAGS_STATIC=-bstatic LDFLAGS_SHARED=-bdynamic ;; @@ -16516,15 +18925,93 @@ else esac fi +if test -n "$LDFLAGS_STATIC" && test -n "$LDFLAGS_SHARED" +then + echo "$as_me:18930: checking if linker supports switching between static/dynamic" >&5 +echo $ECHO_N "checking if linker supports switching between static/dynamic... $ECHO_C" >&6 + + rm -f libconftest.a + cat >conftest.$ac_ext < +int cf_ldflags_static(FILE *fp) { return fflush(fp); } +EOF + if { (eval echo "$as_me:18939: \"$ac_compile\"") >&5 + (eval $ac_compile) 2>&5 + ac_status=$? + echo "$as_me:18942: \$? = $ac_status" >&5 + (exit $ac_status); } ; then + ( $AR $ARFLAGS libconftest.a conftest.o ) 2>&5 1>/dev/null + ( eval $RANLIB libconftest.a ) 2>&5 >/dev/null + fi + rm -f conftest.* + + cf_save_LIBS="$LIBS" + + LIBS="$LDFLAGS_STATIC -L`pwd` -lconftest $LDFLAGS_DYNAMIC $LIBS" + cat >conftest.$ac_ext <<_ACEOF +#line 18953 "configure" +#include "confdefs.h" + +#line 18956 "configure" +#include +int cf_ldflags_static(FILE *fp); + +int +main () +{ + + return cf_ldflags_static(stdin); + + ; + return 0; +} +_ACEOF +rm -f conftest.$ac_objext conftest$ac_exeext +if { (eval echo "$as_me:18971: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:18974: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:18977: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:18980: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + cf_ldflags_static=yes +else + echo "$as_me: failed program was:" >&5 +cat conftest.$ac_ext >&5 +cf_ldflags_static=no +fi +rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + + rm -f libconftest.* + LIBS="$cf_save_LIBS" + + echo "$as_me:18993: result: $cf_ldflags_static" >&5 +echo "${ECHO_T}$cf_ldflags_static" >&6 + + if test $cf_ldflags_static != yes + then + LDFLAGS_STATIC= + LDFLAGS_SHARED= + fi +else + LDFLAGS_STATIC= + LDFLAGS_SHARED= +fi + ;; esac -echo "$as_me:16522: checking where we will install curses.h" >&5 +echo "$as_me:19009: checking where we will install curses.h" >&5 echo $ECHO_N "checking where we will install curses.h... $ECHO_C" >&6 test "$with_overwrite" = no && \ test "x$includedir" = 'x${prefix}/include' && \ includedir='${prefix}/include/ncurses'${LIB_SUFFIX} -echo "$as_me:16527: result: $includedir" >&5 +echo "$as_me:19014: result: $includedir" >&5 echo "${ECHO_T}$includedir" >&6 ### Resolve a conflict between normal and wide-curses by forcing applications @@ -16532,10 +19019,11 @@ echo "${ECHO_T}$includedir" >&6 if test "$with_overwrite" != no ; then if test "$NCURSES_LIBUTF8" = 1 ; then NCURSES_LIBUTF8='defined(HAVE_LIBUTF8_H)' - { echo "$as_me:16535: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 + { echo "$as_me:19022: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&5 echo "$as_me: WARNING: Wide-character applications must define HAVE_LIBUTF8_H to include curses.h" >&2;} fi fi +WITH_OVERWRITE=$with_overwrite # used to separate tack out of the tree NCURSES_TREE= @@ -16548,7 +19036,7 @@ EOF ### Construct the list of subdirectories for which we'll customize makefiles ### with the appropriate compile-rules. -echo "$as_me:16551: checking for src modules" >&5 +echo "$as_me:19039: checking for src modules" >&5 echo $ECHO_N "checking for src modules... $ECHO_C" >&6 # dependencies and linker-arguments for test-programs @@ -16611,25 +19099,34 @@ EOF fi fi done -echo "$as_me:16614: result: $cf_cv_src_modules" >&5 +echo "$as_me:19102: result: $cf_cv_src_modules" >&5 echo "${ECHO_T}$cf_cv_src_modules" >&6 TEST_ARGS="-L${LIB_DIR} $TEST_ARGS" TEST_ARG2="-L${LIB_2ND} $TEST_ARG2" -SRC_SUBDIRS="man include" +SRC_SUBDIRS= +if test "x$cf_with_manpages" != xno ; then + SRC_SUBDIRS="$SRC_SUBDIRS man" +fi +SRC_SUBDIRS="$SRC_SUBDIRS include" for cf_dir in $cf_cv_src_modules do SRC_SUBDIRS="$SRC_SUBDIRS $cf_dir" done -SRC_SUBDIRS="$SRC_SUBDIRS test" +if test "x$cf_with_tests" != "xno" ; then + SRC_SUBDIRS="$SRC_SUBDIRS test" +fi test -z "$MAKE_TERMINFO" && SRC_SUBDIRS="$SRC_SUBDIRS misc" test "$cf_with_cxx_binding" != no && SRC_SUBDIRS="$SRC_SUBDIRS c++" ADA_SUBDIRS= if test "$cf_cv_prog_gnat_correct" = yes && test -f $srcdir/Ada95/Makefile.in; then - SRC_SUBDIRS="$SRC_SUBDIRS Ada95" - ADA_SUBDIRS="gen src samples" + SRC_SUBDIRS="$SRC_SUBDIRS Ada95" + ADA_SUBDIRS="gen src" + if test "x$cf_with_tests" != "xno" ; then + ADA_SUBDIRS="$ADA_SUBDIRS samples" + fi fi SUB_MAKEFILES= @@ -16639,15 +19136,16 @@ do done if test -n "$ADA_SUBDIRS"; then - for cf_dir in $ADA_SUBDIRS - do - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" - done + for cf_dir in $ADA_SUBDIRS + do + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/$cf_dir/Makefile" + done fi if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" + SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi DIRS_TO_MAKE="lib" @@ -16679,8 +19177,12 @@ do test ! -d $cf_dir && mkdir $cf_dir done +# symbols that differ when compiling Ada95 by itself. +NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' + +# values to use as strings cat >>confdefs.h <>confdefs.h <&5 -echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 -if test -n "$LDFLAGS" ; then -echo "$as_me:16766: result: maybe" >&5 -echo "${ECHO_T}maybe" >&6 -test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me-configure}:16770: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 - -test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me-configure}:16774: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -case "$EXTRA_LDFLAGS" in #(vi --Wl,-rpath,*) #(vi - cf_rpath_hack="-Wl,-rpath," - ;; --R\ *) - cf_rpath_hack="-R " - ;; --R*) - cf_rpath_hack="-R" - ;; -*) - cf_rpath_hack= - ;; -esac -if test -n "$cf_rpath_hack" ; then - cf_rpath_dst= - for cf_rpath_src in $LDFLAGS - do - test -n "$verbose" && echo " Filtering $cf_rpath_src" 1>&6 - -echo "${as_me-configure}:16796: testing Filtering $cf_rpath_src ..." 1>&5 - - case $cf_rpath_src in #(vi - -L*) #(vi - if test "$cf_rpath_hack" = "-R " ; then - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e 's%-L%-R %'` - else - cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e s%-L%$cf_rpath_hack%` - fi - test -n "$verbose" && echo " ...Filter $cf_rpath_tmp" 1>&6 - -echo "${as_me-configure}:16807: testing ...Filter $cf_rpath_tmp ..." 1>&5 - - EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" - ;; - esac - cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" - done - LDFLAGS=$cf_rpath_dst - test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 - -echo "${as_me-configure}:16817: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 - - test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 - -echo "${as_me-configure}:16821: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 - -fi -else -echo "$as_me:16825: result: no" >&5 -echo "${ECHO_T}no" >&6 -fi - -fi - ### Define substitutions for header files to avoid name-pollution if test "$cf_cv_have_tcgetattr" = yes ; then @@ -16849,9 +19290,82 @@ else fi ################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" +test "$use_database" = yes && \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" + SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" -ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/termcap.h include/unctrl.h $SUB_MAKEFILES Makefile" +SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi + +# Extract the first word of "tic", so it can be a program name with args. +set dummy tic; ac_word=$2 +echo "$as_me:19308: checking for $ac_word" >&5 +echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +if test "${ac_cv_path_TIC_PATH+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 +else + case $TIC_PATH in + [\\/]* | ?:[\\/]*) + ac_cv_path_TIC_PATH="$TIC_PATH" # Let the user override the test with a path. + ;; + *) + ac_save_IFS=$IFS; IFS=$ac_path_separator +ac_dummy="$PATH:/usr/local/ncurses/bin" +for ac_dir in $ac_dummy; do + IFS=$ac_save_IFS + test -z "$ac_dir" && ac_dir=. + if $as_executable_p "$ac_dir/$ac_word"; then + ac_cv_path_TIC_PATH="$ac_dir/$ac_word" + echo "$as_me:19325: found $ac_dir/$ac_word" >&5 + break +fi +done + + test -z "$ac_cv_path_TIC_PATH" && ac_cv_path_TIC_PATH="unknown" + ;; +esac +fi +TIC_PATH=$ac_cv_path_TIC_PATH + +if test -n "$TIC_PATH"; then + echo "$as_me:19337: result: $TIC_PATH" >&5 +echo "${ECHO_T}$TIC_PATH" >&6 +else + echo "$as_me:19340: result: no" >&5 +echo "${ECHO_T}no" >&6 +fi + +if test -n "$FALLBACK_LIST" +then + if test "$TIC_PATH" = unknown + then + { echo "$as_me:19348: WARNING: no tic program found for fallbacks" >&5 +echo "$as_me: WARNING: no tic program found for fallbacks" >&2;} + fi +fi + +if test "x$cf_with_tests" != xno ; then + MAKE_TESTS= +else + MAKE_TESTS="#" +fi + +ADAHTML_DIR=../../doc/html/ada + +SUB_SCRIPTS= +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + SUB_SCRIPTS="mk-dlls.sh" + ;; +esac + +ac_config_files="$ac_config_files include/MKterm.h.awk include/curses.head:include/curses.h.in include/ncurses_dll.h include/termcap.h include/unctrl.h $SUB_SCRIPTS $SUB_MAKEFILES Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure @@ -16932,7 +19446,7 @@ DEFS=-DHAVE_CONFIG_H : ${CONFIG_STATUS=./config.status} ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" -{ echo "$as_me:16935: creating $CONFIG_STATUS" >&5 +{ echo "$as_me:19449: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >$CONFIG_STATUS <<_ACEOF #! $SHELL @@ -17058,13 +19572,13 @@ $config_headers Configuration commands: $config_commands -Report bugs to ." +Report bugs to ." EOF cat >>$CONFIG_STATUS <>$CONFIG_STATUS <<\EOF echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header - { { echo "$as_me:17111: error: ambiguous option: $1 + { { echo "$as_me:19625: error: ambiguous option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: ambiguous option: $1 Try \`$0 --help' for more information." >&2;} @@ -17127,7 +19641,7 @@ Try \`$0 --help' for more information." >&2;} ac_need_defaults=false;; # This is an error. - -*) { { echo "$as_me:17130: error: unrecognized option: $1 + -*) { { echo "$as_me:19644: error: unrecognized option: $1 Try \`$0 --help' for more information." >&5 echo "$as_me: error: unrecognized option: $1 Try \`$0 --help' for more information." >&2;} @@ -17146,7 +19660,7 @@ cat >&5 << _ACEOF ## Running config.status. ## ## ----------------------- ## -This file was extended by $as_me 2.52.20080325, executed with +This file was extended by $as_me 2.52.20101002, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS @@ -17170,10 +19684,12 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" +LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -17181,13 +19697,15 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" +TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -17205,7 +19723,10 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" +cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" +cf_with_manpages="$cf_with_manpages" +cf_with_tests="$cf_with_tests" host="$host" target="$target" @@ -17218,13 +19739,15 @@ do # Handling of arguments. "include/MKterm.h.awk" ) CONFIG_FILES="$CONFIG_FILES include/MKterm.h.awk" ;; "include/curses.head" ) CONFIG_FILES="$CONFIG_FILES include/curses.head:include/curses.h.in" ;; + "include/ncurses_dll.h" ) CONFIG_FILES="$CONFIG_FILES include/ncurses_dll.h" ;; "include/termcap.h" ) CONFIG_FILES="$CONFIG_FILES include/termcap.h" ;; "include/unctrl.h" ) CONFIG_FILES="$CONFIG_FILES include/unctrl.h" ;; + "$SUB_SCRIPTS" ) CONFIG_FILES="$CONFIG_FILES $SUB_SCRIPTS" ;; "$SUB_MAKEFILES" ) CONFIG_FILES="$CONFIG_FILES $SUB_MAKEFILES" ;; "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "include/ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS include/ncurses_cfg.h:include/ncurses_cfg.hin" ;; - *) { { echo "$as_me:17227: error: invalid argument: $ac_config_target" >&5 + *) { { echo "$as_me:19750: error: invalid argument: $ac_config_target" >&5 echo "$as_me: error: invalid argument: $ac_config_target" >&2;} { (exit 1); exit 1; }; };; esac @@ -17349,7 +19872,12 @@ s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@LN_S@,$LN_S,;t t +s,@PKG_CONFIG@,$PKG_CONFIG,;t t +s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t +s,@PKG_CONFIG_LIBDIR@,$PKG_CONFIG_LIBDIR,;t t s,@SET_MAKE@,$SET_MAKE,;t t +s,@CTAGS@,$CTAGS,;t t +s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;t t @@ -17359,7 +19887,7 @@ s,@LD@,$LD,;t t s,@ac_ct_LD@,$ac_ct_LD,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t -s,@AR_OPTS@,$AR_OPTS,;t t +s,@ARFLAGS@,$ARFLAGS,;t t s,@DESTDIR@,$DESTDIR,;t t s,@BUILD_CC@,$BUILD_CC,;t t s,@BUILD_CPP@,$BUILD_CPP,;t t @@ -17370,7 +19898,9 @@ s,@BUILD_LIBS@,$BUILD_LIBS,;t t s,@BUILD_EXEEXT@,$BUILD_EXEEXT,;t t s,@BUILD_OBJEXT@,$BUILD_OBJEXT,;t t s,@cf_list_models@,$cf_list_models,;t t +s,@LIBTOOL_VERSION@,$LIBTOOL_VERSION,;t t s,@LIBTOOL@,$LIBTOOL,;t t +s,@LT_UNDEF@,$LT_UNDEF,;t t s,@LIBTOOL_CXX@,$LIBTOOL_CXX,;t t s,@LIBTOOL_OPTS@,$LIBTOOL_OPTS,;t t s,@LIB_CREATE@,$LIB_CREATE,;t t @@ -17392,6 +19922,7 @@ s,@CC_G_OPT@,$CC_G_OPT,;t t s,@CXX_G_OPT@,$CXX_G_OPT,;t t s,@LD_MODEL@,$LD_MODEL,;t t s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t +s,@LD_RPATH_OPT@,$LD_RPATH_OPT,;t t s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t s,@MK_SHARED_LIB@,$MK_SHARED_LIB,;t t s,@LINK_PROGS@,$LINK_PROGS,;t t @@ -17400,8 +19931,8 @@ s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t s,@LOCAL_LDFLAGS2@,$LOCAL_LDFLAGS2,;t t s,@INSTALL_LIB@,$INSTALL_LIB,;t t +s,@cf_ldd_prog@,$cf_ldd_prog,;t t s,@TERMINFO_SRC@,$TERMINFO_SRC,;t t -s,@PATHSEP@,$PATHSEP,;t t s,@FALLBACK_LIST@,$FALLBACK_LIST,;t t s,@WHICH_XTERM@,$WHICH_XTERM,;t t s,@TERMINFO_DIRS@,$TERMINFO_DIRS,;t t @@ -17423,19 +19954,26 @@ s,@NCURSES_TPARM_VARARGS@,$NCURSES_TPARM_VARARGS,;t t s,@NCURSES_BOOL@,$NCURSES_BOOL,;t t s,@TERMINFO_CAPS@,$TERMINFO_CAPS,;t t s,@NCURSES_OSPEED@,$NCURSES_OSPEED,;t t +s,@NCURSES_CCHARW_MAX@,$NCURSES_CCHARW_MAX,;t t s,@MANPAGE_RENAMES@,$MANPAGE_RENAMES,;t t s,@NCURSES_EXT_FUNCS@,$NCURSES_EXT_FUNCS,;t t +s,@GENERATED_EXT_FUNCS@,$GENERATED_EXT_FUNCS,;t t +s,@NCURSES_SP_FUNCS@,$NCURSES_SP_FUNCS,;t t +s,@GENERATED_SP_FUNCS@,$GENERATED_SP_FUNCS,;t t s,@NCURSES_CONST@,$NCURSES_CONST,;t t s,@NCURSES_EXT_COLORS@,$NCURSES_EXT_COLORS,;t t s,@NCURSES_MOUSE_VERSION@,$NCURSES_MOUSE_VERSION,;t t s,@NCURSES_SBOOL@,$NCURSES_SBOOL,;t t s,@NCURSES_XNAMES@,$NCURSES_XNAMES,;t t +s,@NCURSES_INTEROP_FUNCS@,$NCURSES_INTEROP_FUNCS,;t t s,@PTHREAD@,$PTHREAD,;t t s,@cf_cv_enable_reentrant@,$cf_cv_enable_reentrant,;t t s,@cf_cv_enable_opaque@,$cf_cv_enable_opaque,;t t s,@NCURSES_OPAQUE@,$NCURSES_OPAQUE,;t t s,@NCURSES_SIZE_T@,$NCURSES_SIZE_T,;t t +s,@NCURSES_WRAP_PREFIX@,$NCURSES_WRAP_PREFIX,;t t s,@ECHO_LINK@,$ECHO_LINK,;t t +s,@ADAFLAGS@,$ADAFLAGS,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@EXTRA_CXXFLAGS@,$EXTRA_CXXFLAGS,;t t s,@ADA_TRACE@,$ADA_TRACE,;t t @@ -17446,23 +19984,29 @@ s,@cf_cv_1UL@,$cf_cv_1UL,;t t s,@cf_cv_typeof_mmask_t@,$cf_cv_typeof_mmask_t,;t t s,@HAVE_VSSCANF@,$HAVE_VSSCANF,;t t s,@TEST_LIBS@,$TEST_LIBS,;t t +s,@TEST_LIBS2@,$TEST_LIBS2,;t t s,@CXXCPP@,$CXXCPP,;t t s,@CXXLDFLAGS@,$CXXLDFLAGS,;t t s,@CXX_AR@,$CXX_AR,;t t -s,@CXX_AR_OPTS@,$CXX_AR_OPTS,;t t +s,@CXX_ARFLAGS@,$CXX_ARFLAGS,;t t s,@CXXLIBS@,$CXXLIBS,;t t s,@USE_CXX_BOOL@,$USE_CXX_BOOL,;t t s,@gnat_exists@,$gnat_exists,;t t s,@M4_exists@,$M4_exists,;t t s,@cf_ada_make@,$cf_ada_make,;t t -s,@cf_ada_compiler@,$cf_ada_compiler,;t t -s,@cf_ada_package@,$cf_ada_package,;t t -s,@ADAFLAGS@,$ADAFLAGS,;t t s,@cf_compile_generics@,$cf_compile_generics,;t t s,@cf_generic_objects@,$cf_generic_objects,;t t +s,@USE_GNAT_SIGINT@,$USE_GNAT_SIGINT,;t t s,@PRAGMA_UNREF@,$PRAGMA_UNREF,;t t +s,@USE_OLD_MAKERULES@,$USE_OLD_MAKERULES,;t t +s,@USE_GNAT_PROJECTS@,$USE_GNAT_PROJECTS,;t t +s,@USE_GNAT_LIBRARIES@,$USE_GNAT_LIBRARIES,;t t +s,@cf_ada_compiler@,$cf_ada_compiler,;t t +s,@cf_ada_package@,$cf_ada_package,;t t s,@ADA_INCLUDE@,$ADA_INCLUDE,;t t s,@ADA_OBJECTS@,$ADA_OBJECTS,;t t +s,@ADA_SHAREDLIB@,$ADA_SHAREDLIB,;t t +s,@MAKE_ADA_SHAREDLIB@,$MAKE_ADA_SHAREDLIB,;t t s,@ACPPFLAGS@,$ACPPFLAGS,;t t s,@DFT_ARG_SUFFIX@,$DFT_ARG_SUFFIX,;t t s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t @@ -17490,9 +20034,15 @@ s,@TEST_ARG2@,$TEST_ARG2,;t t s,@TEST_DEP2@,$TEST_DEP2,;t t s,@ADA_SUBDIRS@,$ADA_SUBDIRS,;t t s,@DIRS_TO_MAKE@,$DIRS_TO_MAKE,;t t +s,@NCURSES_SHLIB2@,$NCURSES_SHLIB2,;t t s,@HAVE_TCGETATTR@,$HAVE_TCGETATTR,;t t s,@HAVE_TERMIO_H@,$HAVE_TERMIO_H,;t t s,@HAVE_TERMIOS_H@,$HAVE_TERMIOS_H,;t t +s,@MAKE_PC_FILES@,$MAKE_PC_FILES,;t t +s,@cross_compiling@,$cross_compiling,;t t +s,@TIC_PATH@,$TIC_PATH,;t t +s,@MAKE_TESTS@,$MAKE_TESTS,;t t +s,@ADAHTML_DIR@,$ADAHTML_DIR,;t t CEOF EOF @@ -17607,7 +20157,7 @@ done; } esac if test x"$ac_file" != x-; then - { echo "$as_me:17610: creating $ac_file" >&5 + { echo "$as_me:20160: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} rm -f "$ac_file" fi @@ -17625,7 +20175,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:17628: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20178: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -17638,7 +20188,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:17641: error: cannot find input file: $f" >&5 + { { echo "$as_me:20191: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -17704,7 +20254,7 @@ for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue * ) ac_file_in=$ac_file.in ;; esac - test x"$ac_file" != x- && { echo "$as_me:17707: creating $ac_file" >&5 + test x"$ac_file" != x- && { echo "$as_me:20257: creating $ac_file" >&5 echo "$as_me: creating $ac_file" >&6;} # First look for the input files in the build tree, otherwise in the @@ -17715,7 +20265,7 @@ echo "$as_me: creating $ac_file" >&6;} -) echo $tmp/stdin ;; [\\/$]*) # Absolute (can't be DOS-style, as IFS=:) - test -f "$f" || { { echo "$as_me:17718: error: cannot find input file: $f" >&5 + test -f "$f" || { { echo "$as_me:20268: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } echo $f;; @@ -17728,7 +20278,7 @@ echo "$as_me: error: cannot find input file: $f" >&2;} echo $srcdir/$f else # /dev/null tree - { { echo "$as_me:17731: error: cannot find input file: $f" >&5 + { { echo "$as_me:20281: error: cannot find input file: $f" >&5 echo "$as_me: error: cannot find input file: $f" >&2;} { (exit 1); exit 1; }; } fi;; @@ -17786,7 +20336,7 @@ cat >>$CONFIG_STATUS <<\EOF rm -f $tmp/in if test x"$ac_file" != x-; then if cmp -s $ac_file $tmp/config.h 2>/dev/null; then - { echo "$as_me:17789: $ac_file is unchanged" >&5 + { echo "$as_me:20339: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ @@ -17828,7 +20378,6 @@ done; } done EOF cat >>$CONFIG_STATUS <<\EOF - # # CONFIG_COMMANDS section. # @@ -17838,16 +20387,19 @@ for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue case $ac_dest in default ) +if test "x$cf_with_tests" != xno ; then for cf_dir in test do if test ! -d $srcdir/$cf_dir; then continue elif test -f $srcdir/$cf_dir/programs; then - $AWK -f $srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile + $AWK -f $srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK" $srcdir/$cf_dir/programs >>$cf_dir/Makefile fi done +fi + case $cf_cv_system_name in #(vi OS/2*|os2*) #(vi LIB_PREFIX='' @@ -17862,6 +20414,23 @@ if test $cf_cv_shlib_version = cygdll ; then TINFO_SUFFIX=.dll fi +if test -n "$TINFO_SUFFIX" ; then + case $TINFO_SUFFIX in + tw*) + TINFO_NAME="${TINFO_NAME}tw" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^tw//'` + ;; + t*) + TINFO_NAME="${TINFO_NAME}t" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^t//'` + ;; + w*) + TINFO_NAME="${TINFO_NAME}w" + TINFO_SUFFIX=`echo $TINFO_SUFFIX | sed 's/^w//'` + ;; + esac +fi + for cf_dir in $SRC_SUBDIRS do if test ! -d $srcdir/$cf_dir ; then @@ -17873,40 +20442,44 @@ do for cf_item in $cf_LIST_MODELS do - case $cf_item in - libtool) + case $cf_item in #(vi + libtool) #(vi cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) + normal) #(vi cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) + debug) #(vi cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) + profile) #(vi cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + cf_suffix='.a' + cf_depsuf=$cf_suffix + ;; + cygwin*) #(vi cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) + darwin*) #(vi cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) + *) #(vi cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -17927,6 +20500,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${REL_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${REL_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${REL_VERSION}'"$cf_suffix" @@ -17943,6 +20524,14 @@ do case "$cf_cv_system_name" in #(vi darwin*) case .${LIB_SUFFIX} in + .tw*) + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_suffix=tw'.${ABI_VERSION}'"$cf_suffix" + ;; + .t*) + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_suffix=t'.${ABI_VERSION}'"$cf_suffix" + ;; .w*) cf_suffix=`echo $cf_suffix | sed 's/^w//'` cf_suffix=w'.${ABI_VERSION}'"$cf_suffix" @@ -18020,40 +20609,44 @@ do cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` - case $cf_item in - libtool) + case $cf_item in #(vi + libtool) #(vi cf_suffix='.la' cf_depsuf=$cf_suffix ;; - normal) + normal) #(vi cf_suffix='.a' cf_depsuf=$cf_suffix ;; - debug) + debug) #(vi cf_suffix='_g.a' cf_depsuf=$cf_suffix ;; - profile) + profile) #(vi cf_suffix='_p.a' cf_depsuf=$cf_suffix ;; - shared) + shared) #(vi case $cf_cv_system_name in - cygwin*) + aix[56]*) #(vi + cf_suffix='.a' + cf_depsuf=$cf_suffix + ;; + cygwin*) #(vi cf_suffix='.dll' cf_depsuf='.dll.a' ;; - darwin*) + darwin*) #(vi cf_suffix='.dylib' cf_depsuf=$cf_suffix ;; - hpux*) + hpux*) #(vi case $target in - ia64*) + ia64*) #(vi cf_suffix='.so' cf_depsuf=$cf_suffix ;; - *) + *) #(vi cf_suffix='.sl' cf_depsuf=$cf_suffix ;; @@ -18123,6 +20716,16 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ if test "$cf_cv_shlib_version_infix" = yes ; then if test -n "$LIB_SUFFIX" ; then case $LIB_SUFFIX in + tw*) + cf_libname=`echo $cf_libname | sed 's/tw$//'` + cf_suffix=`echo $cf_suffix | sed 's/^tw//'` + cf_dir_suffix=tw + ;; + t*) + cf_libname=`echo $cf_libname | sed 's/t$//'` + cf_suffix=`echo $cf_suffix | sed 's/^t//'` + cf_dir_suffix=t + ;; w*) cf_libname=`echo $cf_libname | sed 's/w$//'` cf_suffix=`echo $cf_suffix | sed 's/^w//'` @@ -18140,17 +20743,19 @@ cf_ITEM=`echo "$cf_item" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQ prefix=$cf_prefix \ suffix=$cf_suffix \ subset=$cf_subset \ + SymLink="$LN_S" \ TermlibRoot=$TINFO_NAME \ TermlibSuffix=$TINFO_SUFFIX \ ShlibVer=$cf_cv_shlib_version \ ShlibVerInfix=$cf_cv_shlib_version_infix \ - ReLink=${cf_cv_do_relink-no} \ + ReLink=${cf_cv_do_relink:-no} \ DoLinks=$cf_cv_do_symlinks \ rmSoLocs=$cf_cv_rm_so_locs \ ldconfig="$LDCONFIG" \ overwrite=$WITH_OVERWRITE \ depend="$cf_depend" \ host="$host" \ + libtool_version="$LIBTOOL_VERSION" \ $srcdir/$cf_dir/modules >>$cf_dir/Makefile cf_suffix="$old_cf_suffix" @@ -18234,18 +20839,28 @@ cat >> Makefile <> Makefile <> Makefile <> Makefile <>Ada95/src/Makefile +fi +fi ;; esac done @@ -18392,4 +21013,4 @@ if test "$no_create" != yes; then # would make configure fail if this is the last instruction. $ac_cs_success || { (exit 1); exit 1; } fi -${MAKE-make} preinstall +${MAKE:-make} preinstall diff --git a/contrib/ncurses/configure.in b/contrib/ncurses/configure.in index 2b4422a439d2..d5bc841e9b04 100644 --- a/contrib/ncurses/configure.in +++ b/contrib/ncurses/configure.in @@ -1,5 +1,5 @@ dnl*************************************************************************** -dnl Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * +dnl Copyright (c) 1998-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 * @@ -28,14 +28,14 @@ dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 1995-on dnl -dnl $Id: configure.in,v 1.454 2008/10/18 14:53:32 tom Exp $ +dnl $Id: configure.in,v 1.520 2011/03/28 00:22:26 tom Exp $ dnl Process this file with autoconf to produce a configure script. dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.13.20020210) -AC_REVISION($Revision: 1.454 $) +AC_REVISION($Revision: 1.520 $) AC_INIT(ncurses/base/lib_initscr.c) AC_CONFIG_HEADER(include/ncurses_cfg.h:include/ncurses_cfg.hin) @@ -122,6 +122,13 @@ AC_ARG_WITH(ada, [cf_with_ada=yes]) AC_MSG_RESULT($cf_with_ada) +AC_MSG_CHECKING(if you want to install manpages) +AC_ARG_WITH(manpages, + [ --without-manpages suppress install of manpages], + [cf_with_manpages=$withval], + [cf_with_manpages=yes]) +AC_MSG_RESULT($cf_with_manpages) + AC_MSG_CHECKING(if you want to build programs such as tic) AC_ARG_WITH(progs, [ --without-progs suppress build with programs (e.g., tic)], @@ -129,6 +136,13 @@ AC_ARG_WITH(progs, [cf_with_progs=yes]) AC_MSG_RESULT($cf_with_progs) +AC_MSG_CHECKING(if you want to build test-programs) +AC_ARG_WITH(tests, + [ --without-tests suppress build with test-programs], + [cf_with_tests=$withval], + [cf_with_tests=yes]) +AC_MSG_RESULT($cf_with_tests) + AC_MSG_CHECKING(if you wish to install curses.h) AC_ARG_WITH(curses-h, [ --without-curses-h install curses.h as ncurses.h only], @@ -148,10 +162,35 @@ CF_PROG_AWK CF_PROG_EGREP CF_PROG_INSTALL CF_PROG_LINT -AC_PROG_LN_S +CF_PROG_LN_S AC_SYS_LONG_FILE_NAMES +# if we find pkg-config, check if we should install the ".pc" files. +CF_PKG_CONFIG + +if test "$PKG_CONFIG" != no ; then + AC_MSG_CHECKING(if we should install .pc files for $PKG_CONFIG) + + # Leave this as something that can be overridden in the environment. + if test -z "$PKG_CONFIG_LIBDIR" ; then + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG" | sed -e 's,/[[^/]]*/[[^/]]*$,,'`/lib/pkgconfig + fi + PKG_CONFIG_LIBDIR=`echo "$PKG_CONFIG_LIBDIR" | sed -e 's/^://' -e 's/:.*//'` + if test -n "$PKG_CONFIG_LIBDIR" && test -d "$PKG_CONFIG_LIBDIR" ; then + AC_ARG_ENABLE(pc-files, + [ --enable-pc-files generate and install .pc files for pkg-config], + [enable_pc_files=$enableval], + [enable_pc_files=no]) + AC_MSG_RESULT($enable_pc_files) + else + AC_MSG_RESULT(no) + AC_MSG_WARN(did not find library $PKG_CONFIG_LIBDIR) + enable_pc_files=no + fi +fi +AC_SUBST(PKG_CONFIG_LIBDIR) + AC_MSG_CHECKING(if we should assume mixed-case filenames) AC_ARG_ENABLE(mixed-case, [ --enable-mixed-case tic should assume mixed-case filenames], @@ -176,7 +215,7 @@ dnl These are standard among *NIX systems, but not when cross-compiling AC_CHECK_TOOL(RANLIB, ranlib, ':') AC_CHECK_TOOL(LD, ld, ld) AC_CHECK_TOOL(AR, ar, ar) -CF_SUBST(archiver options,AR_OPTS,rv) +CF_AR_FLAGS dnl Special option for use by system-builders: the install-prefix is used to dnl adjust the location into which the actual install is done, so that an @@ -327,6 +366,7 @@ if test "$with_gpm" != no ; then SHLIB_LIST="-ldl $SHLIB_LIST" else SHLIB_LIST="-lgpm $SHLIB_LIST" + CF_ADD_LIB(gpm,TEST_LIBS) fi AC_DEFINE(HAVE_LIBGPM) CF_CHECK_GPM_WGETCH @@ -380,6 +420,11 @@ if test "$CC_SHARED_OPTS" = "unknown"; then done fi +### If we're building with rpath, try to link non-standard libs that way too. +if test "$DFT_LWR_MODEL" = "shared"; then + CF_DISABLE_RPATH_HACK +fi + ############################################################################### CF_HELP_MESSAGE(Fine-Tuning Your Configuration:) @@ -413,7 +458,7 @@ if test "$use_database" != no ; then AC_DEFINE(USE_DATABASE) AC_MSG_CHECKING(which terminfo source-file will be installed) - AC_ARG_ENABLE(database, + AC_ARG_WITH(database, [ --with-database=XXX specify terminfo source to install], [TERMINFO_SRC=$withval]) AC_MSG_RESULT($TERMINFO_SRC) @@ -618,7 +663,7 @@ AC_MSG_CHECKING(if you want broken-linker support code) AC_ARG_ENABLE(broken_linker, [ --enable-broken_linker compile with broken-linker support code], [with_broken_linker=$enableval], - [with_broken_linker=${BROKEN_LINKER-no}]) + [with_broken_linker=${BROKEN_LINKER:-no}]) AC_MSG_RESULT($with_broken_linker) BROKEN_LINKER=0 @@ -655,7 +700,7 @@ NCURSES_WCHAR_T=0 NCURSES_WINT_T=0 # Check to define _XOPEN_SOURCE "automatically" -CF_XOPEN_SOURCE +CF_XOPEN_SOURCE(500) # Work around breakage on OS X CF_SIGWINCH @@ -676,7 +721,15 @@ AC_MSG_RESULT($with_widec) if test "$with_widec" = yes ; then LIB_SUFFIX="w${LIB_SUFFIX}" AC_DEFINE(USE_WIDEC_SUPPORT) - CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) + + case "$CFLAGS $CPPFLAGS" in #(vi + *-D_XOPEN_SOURCE=500) #(vi + ;; + *) + CF_PREDEFINE(_XOPEN_SOURCE_EXTENDED) + ;; + esac + # with_overwrite=no NCURSES_CH_T=cchar_t AC_CHECK_FUNCS(putwc btowc wctob mbtowc wctomb mblen mbrlen mbrtowc wcsrtombs mbsrtowcs wcstombs mbstowcs) @@ -797,6 +850,15 @@ AC_ARG_WITH(mmask-t, [NCURSES_MMASK_T=auto]) AC_MSG_RESULT($NCURSES_MMASK_T) +### use option --with-ccharw-max to override CCHARW_MAX size +AC_MSG_CHECKING(for size CCHARW_MAX) +AC_ARG_WITH(ccharw-max, + [ --with-ccharw-max=XXX override size CCHARW_MAX], + [NCURSES_CCHARW_MAX="$withval"], + [NCURSES_CCHARW_MAX=5]) +AC_MSG_RESULT($NCURSES_CCHARW_MAX) +AC_SUBST(NCURSES_CCHARW_MAX) + ### Enable compiling-in rcs id's AC_MSG_CHECKING(if RCS identifiers should be compiled-in) AC_ARG_WITH(rcs-ids, @@ -807,7 +869,7 @@ AC_MSG_RESULT($with_rcs_ids) test "$with_rcs_ids" = yes && AC_DEFINE(USE_RCS_IDS) ############################################################################### -CF_MAN_PAGES([ captoinfo clear infocmp infotocap tic toe tput ]) +CF_MAN_PAGES([ captoinfo clear infocmp infotocap tabs tic toe tput tset ]) ############################################################################### CF_HELP_MESSAGE(Extensions:) @@ -825,13 +887,47 @@ if test "$with_ext_funcs" = yes ; then AC_DEFINE(HAVE_HAS_KEY) AC_DEFINE(HAVE_RESIZETERM) AC_DEFINE(HAVE_RESIZE_TERM) + AC_DEFINE(HAVE_TERM_ENTRY_H) AC_DEFINE(HAVE_USE_DEFAULT_COLORS) AC_DEFINE(HAVE_WRESIZE) AC_DEFINE(NCURSES_EXT_FUNCS) + GENERATED_EXT_FUNCS=generated else NCURSES_EXT_FUNCS=0 + GENERATED_EXT_FUNCS= fi AC_SUBST(NCURSES_EXT_FUNCS) +AC_SUBST(GENERATED_EXT_FUNCS) + +AC_MSG_CHECKING(if you want to build with experimental SCREEN extensions) +AC_ARG_ENABLE(sp-funcs, + [ --enable-sp-funcs enable experimental SCREEN-extensions], + [with_sp_funcs=$enableval], + [with_sp_funcs=no]) +AC_MSG_RESULT($with_sp_funcs) +if test "$with_sp_funcs" = yes ; then + NCURSES_SP_FUNCS=1 + AC_DEFINE(NCURSES_SP_FUNCS) + GENERATED_SP_FUNCS=generated +else + NCURSES_SP_FUNCS=0 + GENERATED_SP_FUNCS= +fi +AC_SUBST(NCURSES_SP_FUNCS) +AC_SUBST(GENERATED_SP_FUNCS) + +AC_MSG_CHECKING(if you want to build with experimental terminal-driver) +AC_ARG_ENABLE(term-driver, + [ --enable-term-driver enable experimental terminal-driver], + [with_term_driver=$enableval], + [with_term_driver=no]) +AC_MSG_RESULT($with_term_driver) +if test "$with_term_driver" = yes ; then + AC_DEFINE(USE_TERM_DRIVER) + if test "$with_sp_funcs" != yes ; then + AC_MSG_ERROR(The term-driver option relies upon sp-funcs) + fi +fi ### use option --enable-const to turn on use of const beyond that in XSI. AC_MSG_CHECKING(for extended use of const keyword) @@ -973,30 +1069,55 @@ test "$with_hashmap" = yes && AC_DEFINE(USE_HASHMAP) ### use option --enable-colorfgbg to turn on use of $COLORFGBG environment AC_MSG_CHECKING(if you want colorfgbg code) AC_ARG_ENABLE(colorfgbg, - [ --enable-colorfgbg compile with $COLORFGBG code], + [ --enable-colorfgbg compile-in experimental $COLORFGBG code], [with_colorfgbg=$enableval], [with_colorfgbg=no]) AC_MSG_RESULT($with_colorfgbg) test "$with_colorfgbg" = yes && AC_DEFINE(USE_COLORFGBG) +### use option --enable-interop to turn on use of bindings used for interop +AC_MSG_CHECKING(if you want interop bindings) +AC_ARG_ENABLE(interop, + [ --enable-interop compile-in experimental interop bindings], + [with_exp_interop=$enableval], + [with_exp_interop=no]) +AC_MSG_RESULT($with_exp_interop) + +NCURSES_INTEROP_FUNCS=0 +test "$with_exp_interop" = yes && NCURSES_INTEROP_FUNCS=1 +AC_SUBST(NCURSES_INTEROP_FUNCS) + # This is still experimental (20080329), but should ultimately be moved to # the script-block --with-normal, etc. CF_WITH_PTHREAD -AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) -AC_ARG_ENABLE(weak-symbols, - [ --enable-weak-symbols enable weak-symbols for pthreads], - [use_weak_symbols=$withval], - [use_weak_symbols=no]) -AC_MSG_RESULT($use_weak_symbols) -if test "$use_weak_symbols" = yes ; then - CF_WEAK_SYMBOLS -else - cf_cv_weak_symbols=no -fi +if test "x$with_pthread" != xno; then + AC_CHECK_FUNC(pthread_kill,[ + AC_MSG_CHECKING(if you want to allow EINTR in wgetch with pthreads) + AC_ARG_ENABLE(pthreads-eintr, + [ --enable-pthreads-eintr enable EINTR in wgetch with pthreads], + [use_pthreads_eintr=$enableval], + [use_pthreads_eintr=no]) + AC_MSG_RESULT($use_pthreads_eintr) + if test $use_pthreads_eintr = yes ; then + AC_DEFINE(USE_PTHREADS_EINTR) + fi]) -if test $cf_cv_weak_symbols = yes ; then - AC_DEFINE(USE_WEAK_SYMBOLS) + AC_MSG_CHECKING(if you want to use weak-symbols for pthreads) + AC_ARG_ENABLE(weak-symbols, + [ --enable-weak-symbols enable weak-symbols for pthreads], + [use_weak_symbols=$enableval], + [use_weak_symbols=no]) + AC_MSG_RESULT($use_weak_symbols) + if test "$use_weak_symbols" = yes ; then + CF_WEAK_SYMBOLS + else + cf_cv_weak_symbols=no + fi + + if test $cf_cv_weak_symbols = yes ; then + AC_DEFINE(USE_WEAK_SYMBOLS) + fi fi PTHREAD= @@ -1024,11 +1145,13 @@ if test "$with_reentrant" = yes ; then cf_cv_enable_opaque="NCURSES_INTERNALS" NCURSES_OPAQUE=1 NCURSES_SIZE_T=int - if test $cf_cv_weak_symbols = yes ; then - CF_REMOVE_LIB(LIBS,$LIBS,pthread) - else - LIB_SUFFIX="t${LIB_SUFFIX}" - fi + if test $cf_cv_weak_symbols = yes ; then + CF_REMOVE_LIB(LIBS,$LIBS,pthread) + CF_ADD_LIB(pthread,TEST_LIBS) + CF_ADD_LIB(pthread,TEST_LIBS2) + else + LIB_SUFFIX="t${LIB_SUFFIX}" + fi AC_DEFINE(USE_REENTRANT) CF_NCURSES_ABI_6 else @@ -1042,6 +1165,20 @@ AC_SUBST(cf_cv_enable_opaque) AC_SUBST(NCURSES_OPAQUE) AC_SUBST(NCURSES_SIZE_T) +### Allow using a different wrap-prefix +if test "$cf_cv_enable_reentrant" != 0 || test "$BROKEN_LINKER" = 1 ; then + AC_MSG_CHECKING(for prefix used to wrap public variables) + AC_ARG_WITH(wrap-prefix, + [ --with-wrap-prefix=XXX override prefix used for public variables], + [NCURSES_WRAP_PREFIX=$withval], + [NCURSES_WRAP_PREFIX=_nc_]) + AC_MSG_RESULT($NCURSES_WRAP_PREFIX) +else + NCURSES_WRAP_PREFIX=_nc_ +fi +AC_SUBST(NCURSES_WRAP_PREFIX) +AC_DEFINE_UNQUOTED(NCURSES_WRAP_PREFIX,"$NCURSES_WRAP_PREFIX") + AC_MSG_CHECKING(if you want experimental safe-sprintf code) AC_ARG_ENABLE(safe-sprintf, [ --enable-safe-sprintf compile with experimental safe-sprintf code], @@ -1097,7 +1234,7 @@ AC_ARG_ENABLE(warnings, AC_MSG_RESULT($with_warnings) if test "x$with_warnings" = "xyes"; then - ADAFLAGS="$ADAFLAGS -gnatg" + CF_ADD_ADAFLAGS(-gnatg) CF_GCC_WARNINGS(Wdeclaration-after-statement Wextra Wno-unknown-pragmas Wswitch-enum) if test "$cf_with_cxx" = yes ; then CF_GXX_WARNINGS(Wno-unused) @@ -1119,7 +1256,7 @@ then AC_DEFINE(NDEBUG) CPPFLAGS="$CPPFLAGS -DNDEBUG" else - ADAFLAGS="$ADAFLAGS -gnata" + CF_ADD_ADAFLAGS(-gnata) fi fi @@ -1165,12 +1302,18 @@ fi AC_SUBST(ADA_TRACE) ### Checks for libraries. +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + ;; +*) AC_CHECK_FUNC(gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY),[ AC_CHECK_LIB(bsd, gettimeofday, AC_DEFINE(HAVE_GETTIMEOFDAY) - LIBS="$LIBS -lbsd")])dnl CLIX: bzero, select, gettimeofday + CF_ADD_LIB(bsd))])dnl CLIX: bzero, select, gettimeofday + ;; +esac CF_MATH_LIB(MATH_LIB,sin(x)) AC_SUBST(MATH_LIB) @@ -1187,6 +1330,7 @@ fcntl.h \ getopt.h \ limits.h \ locale.h \ +math.h \ poll.h \ sys/bsdtypes.h \ sys/ioctl.h \ @@ -1204,7 +1348,7 @@ wctype.h \ # Note: even non-Posix ISC needs to declare fd_set if test "$ISC" = yes ; then AC_CHECK_LIB(cposix,main) - AC_CHECK_LIB(inet,bzero,LIBS="$LIBS -linet")dnl also 'select()' + AC_CHECK_LIB(inet,bzero,CF_ADD_LIB(inet))dnl also 'select()' fi CF_SYS_TIME_SELECT @@ -1287,6 +1431,8 @@ CF_TYPE_SIGACTION CF_SIZECHANGE CF_FUNC_MEMMOVE CF_FUNC_POLL +CF_VA_COPY +AC_FUNC_VFORK # special check for test/ditto.c CF_FUNC_OPENPTY @@ -1294,10 +1440,11 @@ if test "$cf_cv_func_openpty" != no ; then AC_DEFINE_UNQUOTED(USE_OPENPTY_HEADER,<$cf_cv_func_openpty>) AC_DEFINE(USE_XTERM_PTY) if test "$cf_cv_lib_util" = yes ; then - TEST_LIBS="-lutil $TEST_LIBS" + CF_ADD_LIB(util,TEST_LIBS) fi fi AC_SUBST(TEST_LIBS) +AC_SUBST(TEST_LIBS2) if test "$with_hashed_db" != no ; then AC_DEFINE(USE_HASHED_DB) @@ -1354,12 +1501,12 @@ cerr << "testing" << endl; CF_CPP_STATIC_CAST CXX_AR='$(AR)' - CXX_AR_OPTS='$(AR_OPTS)' + CXX_ARFLAGS='$(ARFLAGS)' case $cf_cv_system_name in #(vi irix*) #(vi if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-ar -o' + CXX_ARFLAGS='-ar -o' fi ;; sco3.2v5*) #(vi @@ -1368,13 +1515,13 @@ cerr << "testing" << endl; solaris2*) if test "$GXX" != yes ; then CXX_AR='$(CXX)' - CXX_AR_OPTS='-xar -o' + CXX_ARFLAGS='-xar -o' fi ;; esac AC_SUBST(CXXLDFLAGS) AC_SUBST(CXX_AR) - AC_SUBST(CXX_AR_OPTS) + AC_SUBST(CXX_ARFLAGS) else cf_cxx_library=no cf_cv_builtin_bool=1 @@ -1435,99 +1582,49 @@ if test -f "${srcdir}/Ada95/Makefile.in" ; then dnl libtool does not know anything about GNAT, though a change made in 1998 dnl provided for it "someday". Disable the ada subtree if we are using dnl libtool -TD 20070714 -if test "$cf_with_ada" != "no" ; then - if test "$with_libtool" != "no"; then - AC_MSG_WARN(libtool does not support Ada - disabling feature) - cf_with_ada=no - fi -fi + if test "$cf_with_ada" != "no" ; then + if test "$with_libtool" != "no"; then + AC_MSG_WARN(libtool does not support Ada - disabling feature) + cf_with_ada=no + fi + fi dnl Check for availability of GNU Ada Translator (GNAT). dnl At the moment we support no other Ada95 compiler. -if test "$cf_with_ada" != "no" ; then -cf_ada_make=gnatmake -AC_CHECK_PROG(gnat_exists, $cf_ada_make, yes, no) -if test "$ac_cv_prog_gnat_exists" = no; then - cf_ada_make= + if test "$cf_with_ada" != "no" ; then + CF_PROG_GNAT + if test "$cf_cv_prog_gnat_correct" = yes; then + CF_ADD_ADAFLAGS(-gnatpn) + + # make ADAFLAGS consistent with CFLAGS + case "$CFLAGS" in + *-g*) + CF_ADD_ADAFLAGS(-g) + ;; + esac + case "$CFLAGS" in + *-O*) + CF_ADD_ADAFLAGS(-O3) + ;; + esac + + CF_GNAT_GENERICS + CF_GNAT_SIGINT + CF_GNAT_PRAGMA_UNREF + CF_GNAT_PROJECTS + + CF_WITH_ADA_COMPILER + + cf_ada_package=terminal_interface + AC_SUBST(cf_ada_package) + + CF_WITH_ADA_INCLUDE + CF_WITH_ADA_OBJECTS + CF_WITH_ADA_SHAREDLIB + fi + fi else - CF_GNAT_VERSION - AC_CHECK_PROG(M4_exists, m4, yes, no) - if test "$ac_cv_prog_M4_exists" = no; then - cf_cv_prog_gnat_correct=no - echo Ada95 binding required program m4 not found. Ada95 binding disabled. - fi - if test "$cf_cv_prog_gnat_correct" = yes; then - AC_MSG_CHECKING(if GNAT works) - CF_GNAT_TRY_RUN([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is -begin - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_prog_gnat_correct=yes],[cf_cv_prog_gnat_correct=no]) - AC_MSG_RESULT($cf_cv_prog_gnat_correct) - fi -fi -if test "$cf_cv_prog_gnat_correct" = yes; then - ADAFLAGS="-O3 -gnatpn $ADAFLAGS" - - AC_MSG_CHECKING(if GNAT pragma Unreferenced works) - CF_GNAT_TRY_LINK([procedure conftest;], -[with Text_IO; -with GNAT.OS_Lib; -procedure conftest is - test : Integer; - pragma Unreferenced (test); -begin - test := 1; - Text_IO.Put ("Hello World"); - Text_IO.New_Line; - GNAT.OS_Lib.OS_Exit (0); -end conftest;],[cf_cv_pragma_unreferenced=yes],[cf_cv_pragma_unreferenced=no]) - AC_MSG_RESULT($cf_cv_pragma_unreferenced) - - # if the pragma is supported, use it (needed in the Trace code). - if test $cf_cv_pragma_unreferenced = yes ; then - PRAGMA_UNREF=TRUE - else - PRAGMA_UNREF=FALSE - fi - - AC_ARG_WITH(ada-compiler, - [ --with-ada-compiler=CMD specify Ada95 compiler command (default gnatmake)], - [cf_ada_compiler=$withval], - [cf_ada_compiler=gnatmake]) - - cf_ada_package=terminal_interface - - AC_SUBST(cf_ada_make) - AC_SUBST(cf_ada_compiler) - AC_SUBST(cf_ada_package) - AC_SUBST(ADAFLAGS) - AC_SUBST(cf_compile_generics) - AC_SUBST(cf_generic_objects) - AC_SUBST(PRAGMA_UNREF) - - CF_WITH_PATH(ada-include, - [ --with-ada-include=DIR Ada includes are in DIR], - ADA_INCLUDE, - PREFIX/lib/ada/adainclude, - [$]prefix/lib/ada/adainclude) - AC_SUBST(ADA_INCLUDE) - - CF_WITH_PATH(ada-objects, - [ --with-ada-objects=DIR Ada objects are in DIR], - ADA_OBJECTS, - PREFIX/lib/ada/adalib, - [$]prefix/lib/ada/adalib) - AC_SUBST(ADA_OBJECTS) - -fi -fi -else - cf_with_ada=no + cf_with_ada=no fi ### Construct the ncurses library-subsets, if any, from this set of keywords: @@ -1554,6 +1651,7 @@ fi LIB_SUBSETS="${LIB_SUBSETS}termlib" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_tinfo" + if test "$with_termlib" != no ; then LIB_SUBSETS="${LIB_SUBSETS} " else @@ -1561,6 +1659,21 @@ else fi LIB_SUBSETS="${LIB_SUBSETS}base" + +# Most term-driver calls are to tinfo, but some like init_pair are to the +# base library (so it resides in base). +if test "$with_term_driver" != no ; then + LIB_SUBSETS="${LIB_SUBSETS}+port_drivers" + case $cf_cv_system_name in #(vi + *mingw32*) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo+port_win32con" + ;; + *) #(vi + LIB_SUBSETS="${LIB_SUBSETS}+port_tinfo" + ;; + esac +fi + test "$with_widec" = yes && LIB_SUBSETS="${LIB_SUBSETS}+widechar" test "$with_ext_funcs" = yes && LIB_SUBSETS="${LIB_SUBSETS}+ext_funcs" @@ -1656,6 +1769,8 @@ if test "$with_termlib" != no ; then TEST_ARGS="${TEST_DEPS}" TEST_ARG2="${TEST_DEP2}" TINFO_ARGS="-L${LIB_DIR} $TEST_ARGS" + TICS_LIST="$SHLIB_LIST $TEST_ARGS" + SHLIB_LIST="${SHLIB_LIST} $TEST_ARGS" else TEST_ARGS="-l${TINFO_ARG_SUFFIX}" TEST_ARG2="-l${TINFO_ARG_SUFFIX}" @@ -1723,6 +1838,7 @@ if test "$NCURSES_LIBUTF8" = 1 ; then AC_MSG_WARN(Wide-character applications must define HAVE_LIBUTF8_H to include curses.h) fi fi +WITH_OVERWRITE=$with_overwrite AC_SUBST(WITH_OVERWRITE) AC_SUBST(TICS_LIST) @@ -1742,40 +1858,91 @@ AC_DEFINE(HAVE_SLK_COLOR) CF_SRC_MODULES($modules_to_build) if test "$cf_with_ada" != "no" && test "$cf_cv_prog_gnat_correct" != "no"; then - SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses-config" + SUB_MAKEFILES="$SUB_MAKEFILES Ada95/gen/adacurses${DFT_ARG_SUFFIX}-config:Ada95/gen/adacurses-config.in" + SUB_MAKEFILES="$SUB_MAKEFILES man/adacurses${DFT_ARG_SUFFIX}-config.1:man/MKada_config.in" fi CF_DIRS_TO_MAKE -AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATHSEP') +# symbols that differ when compiling Ada95 by itself. +NCURSES_SHLIB2='sh $(top_srcdir)/misc/shlib' +AC_SUBST(NCURSES_SHLIB2) + +# values to use as strings +AC_DEFINE_UNQUOTED(NCURSES_PATHSEP,'$PATH_SEPARATOR') AC_DEFINE_UNQUOTED(NCURSES_VERSION_STRING, "${NCURSES_MAJOR}.${NCURSES_MINOR}.${NCURSES_PATCH}") ### Now that we're done running tests, add the compiler-warnings, if any CF_ADD_CFLAGS($EXTRA_CFLAGS) -### If we're building with rpath, try to link non-standard libs that way too. -if test "$DFT_LWR_MODEL" = "shared"; then - CF_RPATH_HACK -fi - ### Define substitutions for header files to avoid name-pollution CF_SUBST_IF(["$cf_cv_have_tcgetattr" = yes], HAVE_TCGETATTR, 1, 0) CF_SUBST_IF(["$ac_cv_header_termio_h" = yes], HAVE_TERMIO_H, 1, 0) CF_SUBST_IF(["$ac_cv_header_termios_h" = yes], HAVE_TERMIOS_H, 1, 0) ################################################################################ -test "$use_database" = yes && SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" +test "$use_database" = yes && \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/run_tic.sh:misc/run_tic.in" + SUB_MAKEFILES="$SUB_MAKEFILES misc/ncurses-config:misc/ncurses-config.in" +SUB_MAKEFILES="$SUB_MAKEFILES man/ncurses${DFT_ARG_SUFFIX}${cf_cv_abi_version}-config.1:man/MKncu_config.in" + +if test x"$enable_pc_files" = xyes ; then \ +SUB_MAKEFILES="$SUB_MAKEFILES misc/gen-pkgconfig:misc/gen-pkgconfig.in" +MAKE_PC_FILES= +else +MAKE_PC_FILES="#" +fi +AC_SUBST(MAKE_PC_FILES) +AC_SUBST(cross_compiling) + +AC_PATH_PROG(TIC_PATH,tic,unknown,$PATH:/usr/local/ncurses/bin) +if test -n "$FALLBACK_LIST" +then + if test "$TIC_PATH" = unknown + then + AC_MSG_WARN(no tic program found for fallbacks) + fi +fi +AC_SUBST(TIC_PATH) + +if test "x$cf_with_tests" != xno ; then + MAKE_TESTS= +else + MAKE_TESTS="#" +fi +AC_SUBST(MAKE_TESTS) + +ADAHTML_DIR=../../doc/html/ada +AC_SUBST(ADAHTML_DIR) + +SUB_SCRIPTS= +case $cf_cv_system_name in #(vi +*mingw32*) #(vi + SUB_SCRIPTS="mk-dlls.sh" + ;; +esac + AC_OUTPUT( \ include/MKterm.h.awk \ include/curses.head:include/curses.h.in \ + include/ncurses_dll.h \ include/termcap.h \ include/unctrl.h \ + $SUB_SCRIPTS \ $SUB_MAKEFILES \ Makefile,[ -CF_PRG_RULES([$srcdir/test/mk-test.awk ECHO_LINK="$ECHO_LINK"], test) +if test "x$cf_with_tests" != xno ; then + CF_PRG_RULES([$srcdir/test/mk-test.awk INSTALL=no ECHO_LINK="$ECHO_LINK"], test) +fi CF_LIB_RULES($SRC_SUBDIRS) + +if test "x$cf_with_ada" != xno ; then +if test -z "$USE_OLD_MAKERULES" ; then + $AWK -f $srcdir/Ada95/mk-1st.awk <$srcdir/Ada95/src/modules >>Ada95/src/Makefile +fi +fi ],[ ### Special initialization commands, used to pass information from the ### configuration-run into config.status @@ -1785,10 +1952,12 @@ DFT_ARG_SUFFIX="$DFT_ARG_SUFFIX" DFT_LWR_MODEL="$DFT_LWR_MODEL" ECHO_LINK="$ECHO_LINK" LDCONFIG="$LDCONFIG" +LIBTOOL_VERSION="$LIBTOOL_VERSION" LIB_NAME="$LIB_NAME" LIB_SUBSETS="$LIB_SUBSETS" LIB_SUFFIX="$LIB_SUFFIX" LIB_TRACING="$LIB_TRACING" +LN_S="$LN_S" MAKE_TERMINFO="$MAKE_TERMINFO" NCURSES_MAJOR="$NCURSES_MAJOR" NCURSES_MINOR="$NCURSES_MINOR" @@ -1796,13 +1965,15 @@ NCURSES_OSPEED="$NCURSES_OSPEED" NCURSES_PATCH="$NCURSES_PATCH" SRC_SUBDIRS="$SRC_SUBDIRS" TERMINFO="$TERMINFO" +TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" +TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" +TICS_NAME="$TICS_NAME" +TIC_PATH="$TIC_PATH" TINFO_ARG_SUFFIX="$TINFO_ARG_SUFFIX" TINFO_LIB_SUFFIX="$TINFO_LIB_SUFFIX" TINFO_NAME="$TINFO_NAME" TINFO_SUFFIX="$TINFO_SUFFIX" -TICS_ARG_SUFFIX="$TICS_ARG_SUFFIX" -TICS_LIB_SUFFIX="$TICS_LIB_SUFFIX" -TICS_NAME="$TICS_NAME" +USE_OLD_MAKERULES="$USE_OLD_MAKERULES" WITH_CURSES_H="$with_curses_h" WITH_ECHO="$with_echo" WITH_OVERWRITE="$with_overwrite" @@ -1820,9 +1991,12 @@ cf_cv_shared_soname='$cf_cv_shared_soname' cf_cv_shlib_version="$cf_cv_shlib_version" cf_cv_shlib_version_infix="$cf_cv_shlib_version_infix" cf_cv_system_name="$cf_cv_system_name" +cf_with_ada="$cf_with_ada" cf_with_cxx_binding="$cf_with_cxx_binding" +cf_with_manpages="$cf_with_manpages" +cf_with_tests="$cf_with_tests" host="$host" target="$target" ],cat)dnl -${MAKE-make} preinstall +${MAKE:-make} preinstall diff --git a/contrib/ncurses/dist.mk b/contrib/ncurses/dist.mk index 551d773313f3..371f0043b3fa 100644 --- a/contrib/ncurses/dist.mk +++ b/contrib/ncurses/dist.mk @@ -1,5 +1,5 @@ ############################################################################## -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. # +# Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.671 2008/11/02 00:58:38 tom Exp $ +# $Id: dist.mk,v 1.810 2011/04/04 22:42:20 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -36,8 +36,8 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 5 -NCURSES_MINOR = 7 -NCURSES_PATCH = 20081102 +NCURSES_MINOR = 9 +NCURSES_PATCH = 20110404 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) @@ -57,8 +57,7 @@ GNATHTML= `type -p gnathtml || type -p gnathtml.pl` # has the effect of lengthening the text portion of the page -- so man2html # would remove some text. The man program on Redhat 6.1 appears to work with # man2html if we set the top/bottom margins to 6 (the default is 7). Newer -# versions of 'man' on Linux leave no margin (and make it harder to sync with -# pages). +# versions of 'man' leave no margin (and make it harder to sync with pages). MAN2HTML= man2html -botm=0 -topm=0 -cgiurl '$$title.$$section$$subsection.html' ALL = ANNOUNCE doc/html/announce.html doc/ncurses-intro.doc doc/hackguide.doc manhtml adahtml diff --git a/contrib/ncurses/doc/html/announce.html b/contrib/ncurses/doc/html/announce.html index 234c703145a7..961e7571cf61 100644 --- a/contrib/ncurses/doc/html/announce.html +++ b/contrib/ncurses/doc/html/announce.html @@ -1,8 +1,8 @@ - + - - -Announcing ncurses 5.7 - - - - - -

Announcing ncurses 5.7

- -The ncurses (new curses) library is a free software emulation of -curses in System V Release 4.0, and more. It uses terminfo format, -supports pads and color -and multiple highlights and forms characters and function-key mapping, -and has all the other SYSV-curses enhancements over BSD curses.

- -In mid-June 1995, the maintainer of 4.4BSD curses declared that he -considered 4.4BSD curses obsolete, and encouraged the keepers of -Unix releases such as BSD/OS, FreeBSD and NetBSD to switch over to -ncurses.

- -The ncurses code was developed under GNU/Linux. -It has been in use for some time with OpenBSD as the system curses library, -and on FreeBSD and NetBSD as an external package. -It should port easily to any ANSI/POSIX-conforming UNIX. -It has even been ported to OS/2 Warp!

- -The distribution includes the library and support utilities, including a -terminfo compiler tic(1), a decompiler infocmp(1), clear(1), tput(1), tset(1), -and a termcap conversion tool captoinfo(1). Full manual pages are provided for -the library and tools.

- -The ncurses distribution is available via anonymous FTP at -the GNU distribution site -ftp://ftp.gnu.org/gnu/ncurses/ . -
It is also available at -ftp://invisible-island.net/ncurses/ . - -

Release Notes

- -This release is designed to be upward compatible from ncurses 5.0 through 5.6; -very few applications will require recompilation, depending on the platform. -These are the highlights from the change-log since ncurses 5.6 release. -

-Interface changes: -

    -
  • generate linkable stubs for some macros: -
    - getattrs - -
-New features and improvements: -
    -
  • library -
      -
    • new flavor of the ncurses library provides rudimentary - support for POSIX threads. Several functions are - reentrant, but most require either a window-level or - screen-level mutex.
      - (This is API-compatible, - but not ABI-compatible with the normal library). - -
    • add NCURSES_OPAQUE symbol to curses.h, will - use to make structs opaque in selected configurations. - -
    • add NCURSES_EXT_FUNCS and - NCURSES_EXT_COLORS symbols to curses.h to make - it simpler to tell if the extended functions and/or colors - are declared. - -
    • add wresize() to C++ binding - -
    • eliminate fixed-buffer vsprintf() calls in C++ binding. - -
    • add several functions to C++ binding which wrap C functions - that pass a WINDOW* parameter. - -
    • adapt mouse-handling code from menu library in form-library - -
    • improve tracing for form library, showing created forms, - fields, etc. - -
    • make $NCURSES_NO_PADDING feature work for termcap interface . - -
    • add check to trace-file open, if the given name is a - directory, add ".log" to the name and try again. - -
    • several new manpages: curs_legacy.3x, curs_memleaks.3x, - curs_opaque.3x and curs_threads.3x -
    - -
  • programs: -
      -
    • modified three test-programs to demonstrate the threading - support in this version: ditto, rain, worm. - -
    • several new test-programs: demo_panels, dots_mvcur, - inch_wide, inchs, key_name, key_names, savescreen, - savescreen.sh test_arrays, test_get_wstr, test_getstr, - test_instr, test_inwstr and test_opaque. - -
    • add adacurses-config to the Ada95 install. - -
    • modify tic -f option to format spaces as - \s to prevent them from being lost when that - is read back in unformatted strings. - -
    • The tack program is now distributed separately - from ncurses. -
    - -
  • terminal database -
      -
    • added entries: -
        -
      • Eterm-256color, - Eterm-88color and - rxvt-88color -
      • aterm -
      • konsole-256color -
      • mrxvt -
      • screen.mlterm -
      • screen.rxvt -
      • teraterm4.59 is now the primary primary - teraterm entry, renamed original to - teraterm2.3 -
      • 9term terminal -
      • Newbury Data entries -
      -
    • updated/improved entries: -
        -
      • gnome to version 2.22.3 -
      • h19, z100 -
      • konsole to version 1.6.6 -
      • mlterm, mlterm+pcfkeys -
      • xterm, and building-blocks for function-keys - to xterm patch #230. -
      -
    -
-Major bug fixes: -
    -
  • add logic to tic for cancelling strings in user-defined - capabilities - (this is needed for - current konsole terminfo entry). - -
  • modify mk-1st.awk so the generated makefile rules for - linking or installing shared libraries do not first remove the - library, in case it is in use, e.g., libncurses.so by - /bin/sh. - -
  • correct check for notimeout() in wgetch(). - -
  • fix a sign-extension bug in infocmp's repair_acsc() function. - -
  • change winnstr() to stop at the end of the line. - -
  • make Ada95 demo_panels() example work. - -
  • fix for adding a non-spacing character at the beginning of a line. - -
  • fill in extended-color pair to make colors work - for wide-characters using extended-colors. - -
  • improve refresh of window on top of multi-column characters, - taking into account split characters on left/right window - boundaries. - -
  • modify win_wchnstr() to ensure that only a base cell - is returned for each multi-column character. - -
  • improve waddch() and winsch() handling of - EILSEQ from mbrtowc() by using unctrl() - to display illegal bytes rather than trying to append further bytes - to make up a valid sequence. - -
  • restore curs_set() state after - endwin()/refresh() - -
  • modify keyname() to use "^X" form only if - meta() has been called, or if keyname() - is called without initializing curses, e.g., via - initscr() or newterm(). - -
  • modify unctrl() to check codes in 128-255 range versus - isprint(). - If they are not printable, and locale was set, use a "M-" or "~" - sequence. - -
  • improve resizeterm() by moving ripped-off lines, and - repainting the soft-keys. - -
  • modify form library to accept control characters such as newline - in set_field_buffer(), which is compatible with Solaris. - -
  • use NCURSES_MOUSE_MASK() in definition of - BUTTON_RELEASE(), etc., to make those work properly - with the --enable-ext-mouse configuration - -
  • correct some functions in Ada95 binding which were using return - value from C where none was returned. - -
  • reviewed/fixed issues reported by Coverity and Klocwork tools. -
- -Portability: -
    -
  • configure script: -
      -
    • new options: -
      - -
      --disable-big-strings -
      control whether static string tables are generated as single - large strings (to improve startup performance), or as array - of individual strings. - -
      --disable-relink -
      control whether shared libraries are relinked (during install) - when rpath is enabled. - -
      --disable-tic-depends -
      make explicit whether tic library depends on ncurses/ncursesw - library. - -
      --enable-mixed-case -
      override the configure script's check if the filesystem - supports mixed-case filenames. - This allows one to control how the terminal database - maps to the filesystem. - For filesystems that do not support mixed-case, the library - uses generate 2-character (hexadecimal) codes for the - lower-level of the filesystem terminfo database - -
      --enable-reentrant -
      builds a different flavor of the ncurses library (ncursest) - which improves reentrant use of the - library by reducing global and static variables - (see the "--with-pthread" option for the threaded support). - -
      --enable-weak-symbols -
      use weak-symbols for linking to the POSIX thread library, - and use the same soname for the ncurses shared library - as the normal library (caveat: the ABI is for the threaded - library, which makes global data accessed via functions). - -
      --with-pthread -
      build with the POSIX thread library (tested with AIX, - Linux, FreeBSD, OpenBSD, HPUX, IRIX64, Solaris, Tru64). - -
      --with-ticlib -
      build/install the tic-support functions in a separate library - -
      - -
    • improved options: -
      - -
      --enable-ext-colors -
      requires the wide-character configuration. - -
      --with-chtype -
      ignore option value "unsigned" is always added to - the type in curses.h; do the same for --with-mmask-t. - -
      --with-dmalloc -
      build-fix for redefinition of strndup. - -
      --with-hashed-db -
      accepts a parameter which is the install-prefix of a given - Berkeley Database. - -
      --with-hashed-db -
      the $LIBS environment variable overrides the search for the db - library. - -
      --without-hashed-db -
      assumed when "--disable-database" is used. - -
      - -
    - -
  • other configure/build issues: -
      -
    • build-fixes for LynxOS -
    • modify shared-library rules to allow FreeBSD 3.x to use rpath. -
    • build-fix for FreeBSD "contemporary" TTY interface. -
    • build-fixes for AIX with libtool. -
    • build-fixes for Darwin and libtool. -
    • modify BeOS-specific ifdef's to build on Haiku. -
    • corrected gcc options for building shared libraries on Solaris - and IRIX64. -
    • change shared-library configuration for OpenBSD, make rpath work. -
    • build-fixes for using libutf8, e.g., on OpenBSD 3.7 -
    • add "-e" option in ncurses/Makefile.in when generating source-files - to force earlier exit if the build environment fails unexpectedly. -
    • add support for shared libraries for QNX. -
    • change delimiter in MKlib_gen.sh from '%' to '@', to - avoid substitution by IBM xlc to '#' as part of its extensions to - digraphs. -
    - -
  • library: -
      -
    • rewrite wrapper for wcrtomb(), making it work on - Solaris. This is used in the form library to determine the length - of the buffer needed by field_buffer. -
    • add/use configure script macro CF_SIG_ATOMIC_T, use the corresponding - type for data manipulated by signal handlers. -
    • set locale in misc/ncurses-config.in since it uses a range -
    • disable GPM mouse support when $TERM does not happen to contain - "linux", since Gpm_Open() no longer limits its assertion to terminals - that it might handle, e.g., within "screen" in xterm. -
    • reset mouse file-descriptor when unloading GPM library. -
    - -
  • test programs: -
      -
    • update test programs to build/work with various UNIX curses for - comparisons. -
    -
- -

Features of Ncurses

- -The ncurses package is fully compatible with SVr4 (System V Release 4) curses: - -
    -
  • All 257 of the SVr4 calls have been implemented (and are documented). -
  • Full support for SVr4 curses features including keyboard mapping, color, -forms-drawing with ACS characters, and automatic recognition of keypad -and function keys. -
  • An emulation of the SVr4 panels library, supporting -a stack of windows with backing store, is included. -
  • An emulation of the SVr4 menus library, supporting -a uniform but flexible interface for menu programming, is included. -
  • An emulation of the SVr4 form library, supporting -data collection through on-screen forms, is included. -
  • Binary terminfo entries generated by the ncurses tic(1) implementation -are bit-for-bit-compatible with the entry format SVr4 curses uses. -
  • The utilities have options to allow you to filter terminfo -entries for use with less capable curses/terminfo -versions such as the HP/UX and AIX ports.
- -The ncurses package also has many useful extensions over SVr4: - -
    -
  • The API is 8-bit clean and base-level conformant with the X/OPEN curses -specification, XSI curses (that is, it implements all BASE level features, -and most EXTENDED features). -It includes many function calls not supported under SVr4 curses -(but portability of all -calls is documented so you can use the SVr4 subset only). -
  • Unlike SVr3 curses, ncurses can write to the rightmost-bottommost corner -of the screen if your terminal has an insert-character capability. -
  • Ada95 and C++ bindings. -
  • Support for mouse event reporting with X Window xterm -and FreeBSD and OS/2 console windows. -
  • Extended mouse support via Alessandro Rubini's gpm package. -
  • The function wresize() allows you to resize windows, preserving -their data. -
  • The function use_default_colors() allows you to -use the terminal's default colors for the default color pair, -achieving the effect of transparent colors. -
  • The functions keyok() -and define_key() allow -you to better control the use of function keys, -e.g., disabling the ncurses KEY_MOUSE, -or by defining more than one control sequence to map to a given key code. -
  • Support for 256-color terminals, such as modern xterm, when configured -using the --enable-ext-colors option. -
  • Support for 16-color terminals, such as aixterm and modern xterm. -
  • Better cursor-movement optimization. The package now features a -cursor-local-movement computation more efficient than either BSD's -or System V's. -
  • Super hardware scrolling support. The screen-update code incorporates -a novel, simple, and cheap algorithm that enables it to make optimal -use of hardware scrolling, line-insertion, and line-deletion -for screen-line movements. This algorithm is more powerful than -the 4.4BSD curses quickch() routine. -
  • Real support for terminals with the magic-cookie glitch. The -screen-update code will refrain from drawing a highlight if the magic- -cookie unattributed spaces required just before the beginning and -after the end would step on a non-space character. It will -automatically shift highlight boundaries when doing so would make it -possible to draw the highlight without changing the visual appearance -of the screen. -
  • It is possible to generate the library with a list of pre-loaded -fallback entries linked to it so that it can serve those terminal types even -when no terminfo tree or termcap file is accessible (this may be useful -for support of screen-oriented programs that must run in single-user mode). -
  • The tic(1)/captoinfo utility provided with ncurses has the -ability to translate many termcaps from the XENIX, IBM and -AT&T extension sets. -
  • A BSD-like tset(1) utility is provided. -
  • The ncurses library and utilities will automatically read terminfo -entries from $HOME/.terminfo if it exists, and compile to that directory -if it exists and the user has no write access to the system directory. -This feature makes it easier for users to have personal terminfo entries -without giving up access to the system terminfo directory. -
  • You may specify a path of directories to search for compiled -descriptions with the environment variable TERMINFO_DIRS (this -generalizes the feature provided by TERMINFO under stock System V.) -
  • In terminfo source files, use capabilities may refer not just to -other entries in the same source file (as in System V) but also to -compiled entries in either the system terminfo directory or the user's -$HOME/.terminfo directory. -
  • A script (capconvert) is provided to help BSD users -transition from termcap to terminfo. It gathers the information in a -TERMCAP environment variable and/or a ~/.termcap local entries file -and converts it to an equivalent local terminfo tree under $HOME/.terminfo. -
  • Automatic fallback to the /etc/termcap file can be compiled in -when it is not possible to build a terminfo tree. This feature is neither -fast nor cheap, you don't want to use it unless you have to, -but it's there. -
  • The table-of-entries utility toe makes it easy for users to -see exactly what terminal types are available on the system. -
  • The library meets the XSI requirement that every macro entry -point have a corresponding function which may be linked (and will be -prototype-checked) if the macro definition is disabled with -#undef. -
  • An HTML "Introduction to Programming with NCURSES" document provides -a narrative introduction to the curses programming interface. -
- -

State of the Package

- -Numerous bugs present in earlier versions have been fixed; the -library is far more reliable than it used to be. Bounds checking in many -`dangerous' entry points has been improved. The code is now type-safe -according to gcc -Wall. The library has been checked for malloc leaks and -arena corruption by the Purify memory-allocation tester.

- -The ncurses code has been tested with a wide variety of applications -including (versions starting with those noted): -

-
cdk -
Curses Development Kit -
-http://invisible-island.net/cdk/ -
-http://www.vexus.ca/products/CDK/ -
ded -
directory-editor -
-http://invisible-island.net/ded/ -
dialog -
the underlying application used in Slackware's setup, and the basis -for similar applications on GNU/Linux. -
-http://invisible-island.net/dialog/ -
lynx -
the character-screen WWW browser -
-http://lynx.isc.org/release/ -
Midnight Commander -
file manager -
-http://www.ibiblio.org/mc/ -
mutt -
mail utility -
-http://www.mutt.org/ -
ncftp -
file-transfer utility -
-http://www.ncftp.com/ -
nvi -
New vi versions 1.50 are able to use ncurses versions 1.9.7 and later. -
-http://www.bostic.com/vi/ -
-
pinfo -
Lynx-like info browser. -https://alioth.debian.org/projects/pinfo/ -
tin -
newsreader, supporting color, MIME -http://www.tin.org/ -
-as well as some that use ncurses for the terminfo support alone: -
-
minicom -
terminal emulator -
- -http://alioth.debian.org/projects/minicom/ -
vile -
vi-like-emacs -
-http://invisible-island.net/vile/ -
-

- -The ncurses distribution includes a selection of test programs (including -a few games). - -

Who's Who and What's What

- -Zeyd Ben-Halim -started it from a previous package pcurses, written by Pavel Curtis. -Eric S. Raymond -continued development. -Jürgen Pfeifer wrote most of the form and menu libraries. -Ongoing work is being done by -Thomas Dickey. -Thomas Dickey -acts as the maintainer for the Free Software Foundation, -which holds the copyright on ncurses. -Contact the current maintainers at -bug-ncurses@gnu.org. -

- -To join the ncurses mailing list, please write email to -bug-ncurses-request@gnu.org containing the line: -

+
+
+
+  
+
+  Announcing ncurses 5.9
+  
+  
+
+
+
+  

Announcing ncurses 5.9

The ncurses (new curses) + library is a free software emulation of curses in System V + Release 4.0, and more. It uses terminfo format, supports pads and + color and multiple highlights and forms characters and + function-key mapping, and has all the other SYSV-curses + enhancements over BSD curses. + +

In mid-June 1995, the maintainer of 4.4BSD curses declared + that he considered 4.4BSD curses obsolete, and encouraged the + keepers of Unix releases such as BSD/OS, FreeBSD and NetBSD to + switch over to ncurses.

+ +

The ncurses code was developed under GNU/Linux. It has been in + use for some time with OpenBSD as the system curses library, and + on FreeBSD and NetBSD as an external package. It should port + easily to any ANSI/POSIX-conforming UNIX. It has even been ported + to OS/2 Warp!

+ +

The distribution includes the library and support utilities, + including a terminfo compiler tic(1), a decompiler infocmp(1), + clear(1), tput(1), tset(1), and a termcap conversion tool + captoinfo(1). Full manual pages are provided for the library and + tools.

+ +

The ncurses distribution is available via anonymous FTP at the + GNU distribution site ftp://ftp.gnu.org/gnu/ncurses/ .
+ + It is also available at ftp://invisible-island.net/ncurses/ .

+ +

Release Notes

This release is designed to be upward + compatible from ncurses 5.0 through 5.8; very few applications + will require recompilation, depending on the platform. These are + the highlights from the change-log since ncurses 5.8 release. +

+ This is a bug-fix release, correcting a small number of urgent problems + in the ncurses library from the 5.8 release. +

+ It also improves the Ada95 binding: +

    +
  • fixes a longstanding portability problem with its use of the + set_field_type + function. Because that function uses variable-length argument lists, + its interface with gnat does not work with certain platforms. +
  • improves configurability and portability, particularly when built + separately from the main ncurses tree. The 5.8 release introduced + scripts which can be used to construct separate tarballs for the + Ada95 and ncurses examples. +

    Those were a proof of concept. For the 5.9 release, those + scripts are augmented with rpm- and dpkg-scripts used in test builds + against a variety of gnat- and system ncurses versions as old as + gnat 3.15 and ncurses 5.4 (see snapshots and systems tested + here. +

  • additional improvements were made for portability of the + ncurses examples, adding rpm- and dpkg-scripts for test-builds. + See + this page + for snapshots and other information. +
+ +

Features of Ncurses

The ncurses package is fully + compatible with SVr4 (System V Release 4) curses: + +
    +
  • All 257 of the SVr4 calls have been implemented (and are + documented).
  • + +
  • Full support for SVr4 curses features including keyboard + mapping, color, forms-drawing with ACS characters, and + automatic recognition of keypad and function keys.
  • + +
  • An emulation of the SVr4 panels library, supporting a stack + of windows with backing store, is included.
  • + +
  • An emulation of the SVr4 menus library, supporting a + uniform but flexible interface for menu programming, is + included.
  • + +
  • An emulation of the SVr4 form library, supporting data + collection through on-screen forms, is included.
  • + +
  • Binary terminfo entries generated by the ncurses tic(1) + implementation are bit-for-bit-compatible with the entry format + SVr4 curses uses.
  • + +
  • The utilities have options to allow you to filter terminfo + entries for use with less capable + curses/terminfo versions such + as the HP/UX and AIX ports.
  • +
The ncurses package also has many useful extensions over + SVr4: + +
    +
  • The API is 8-bit clean and base-level conformant with the + X/OPEN curses specification, XSI curses (that is, it implements + all BASE level features, and most EXTENDED features). It + includes many function calls not supported under SVr4 curses + (but portability of all calls is documented so you can use the + SVr4 subset only).
  • + +
  • Unlike SVr3 curses, ncurses can write to the + rightmost-bottommost corner of the screen if your terminal has + an insert-character capability.
  • + +
  • Ada95 and C++ bindings.
  • + +
  • Support for mouse event reporting with X Window xterm and + FreeBSD and OS/2 console windows.
  • + +
  • Extended mouse support via Alessandro Rubini's gpm + package.
  • + +
  • The function wresize allows you to resize + windows, preserving their data.
  • + +
  • The function use_default_colors allows you to + use the terminal's default colors for the default color pair, + achieving the effect of transparent colors.
  • + +
  • The functions keyok and + define_key allow you to better control the use of + function keys, e.g., disabling the ncurses KEY_MOUSE, or by + defining more than one control sequence to map to a given key + code.
  • + +
  • Support for 256-color terminals, such as modern xterm, when + configured using the --enable-ext-colors + option.
  • + +
  • Support for 16-color terminals, such as aixterm + and modern xterm.
  • + +
  • Better cursor-movement optimization. The package now + features a cursor-local-movement computation more efficient + than either BSD's or System V's.
  • + +
  • Super hardware scrolling support. The screen-update code + incorporates a novel, simple, and cheap algorithm that enables + it to make optimal use of hardware scrolling, line-insertion, + and line-deletion for screen-line movements. This algorithm is + more powerful than the 4.4BSD curses quickch + routine.
  • + +
  • Real support for terminals with the magic-cookie glitch. + The screen-update code will refrain from drawing a highlight if + the magic- cookie unattributed spaces required just before the + beginning and after the end would step on a non-space + character. It will automatically shift highlight boundaries + when doing so would make it possible to draw the highlight + without changing the visual appearance of the screen.
  • + +
  • It is possible to generate the library with a list of + pre-loaded fallback entries linked to it so that it can serve + those terminal types even when no terminfo tree or termcap file + is accessible (this may be useful for support of + screen-oriented programs that must run in single-user + mode).
  • + +
  • The tic(1)/captoinfo utility provided with ncurses has the + ability to translate many termcaps from the XENIX, IBM and + AT&T extension sets.
  • + +
  • A BSD-like tset(1) utility is provided.
  • + +
  • The ncurses library and utilities will automatically read + terminfo entries from $HOME/.terminfo if it exists, and compile + to that directory if it exists and the user has no write access + to the system directory. This feature makes it easier for users + to have personal terminfo entries without giving up access to + the system terminfo directory.
  • + +
  • You may specify a path of directories to search for + compiled descriptions with the environment variable + TERMINFO_DIRS (this generalizes the feature provided by + TERMINFO under stock System V.)
  • + +
  • In terminfo source files, use capabilities may refer not + just to other entries in the same source file (as in System V) + but also to compiled entries in either the system terminfo + directory or the user's $HOME/.terminfo directory.
  • + +
  • A script (capconvert) is provided to help + BSD users transition from termcap to terminfo. It gathers the + information in a TERMCAP environment variable and/or a + ~/.termcap local entries file and converts it to an equivalent + local terminfo tree under $HOME/.terminfo.
  • + +
  • Automatic fallback to the /etc/termcap file can be compiled + in when it is not possible to build a terminfo tree. This + feature is neither fast nor cheap, you don't want to use it + unless you have to, but it's there.
  • + +
  • The table-of-entries utility toe makes it + easy for users to see exactly what terminal types are available + on the system.
  • + +
  • The library meets the XSI requirement that every macro + entry point have a corresponding function which may be linked + (and will be prototype-checked) if the macro definition is + disabled with #undef.
  • + +
  • An HTML "Introduction to Programming with NCURSES" document + provides a narrative introduction to the curses programming + interface.
  • +
+ +

State of the Package

Numerous bugs present in earlier + versions have been fixed; the library is far more reliable than + it used to be. Bounds checking in many `dangerous' entry points + has been improved. The code is now type-safe according to gcc + -Wall. The library has been checked for malloc leaks and arena + corruption by the Purify memory-allocation tester. + +

The ncurses code has been tested with a wide variety of + applications including (versions starting with those noted):

+ +
+
cdk
+ +
Curses Development Kit
+ http://invisible-island.net/cdk/
+ + http://www.vexus.ca/products/CDK/
+ +
ded
+ +
directory-editor
+ http://invisible-island.net/ded/
+ +
dialog
+ +
the underlying application used in Slackware's setup, and + the basis for similar applications on GNU/Linux.
+ http://invisible-island.net/dialog/
+ +
lynx
+ +
the character-screen WWW browser
+ http://lynx.isc.org/release/
+ +
Midnight Commander
+ +
file manager
+ http://www.midnight-commander.org/
+ +
mutt
+ +
mail utility
+ http://www.mutt.org/
+ +
ncftp
+ +
file-transfer utility
+ http://www.ncftp.com/
+ +
nvi
+ +
New vi versions 1.50 are able to use ncurses versions 1.9.7 + and later.
+ https://sites.google.com/a/bostic.com/keithbostic/nvi
+
+ +
pinfo
+ +
Lynx-like info browser. https://alioth.debian.org/projects/pinfo/
+ +
tin
+ +
newsreader, supporting color, MIME http://www.tin.org/
+
as well as some that use ncurses for the terminfo support + alone: + +
+
minicom
+ +
terminal emulator
+ http://alioth.debian.org/projects/minicom/
+ +
vile
+ +
vi-like-emacs
+ http://invisible-island.net/vile/
+
+ +

The ncurses distribution includes a selection of test programs + (including a few games).

+ +

Who's Who and What's What

Zeyd Ben-Halim started it from + a previous package pcurses, written by Pavel Curtis. Eric S. + Raymond continued development. Jürgen Pfeifer wrote most of + the form and menu libraries. Ongoing work is being done by + Thomas Dickey. + Thomas Dickey acts as the maintainer for the Free Software + Foundation, which holds the copyright on ncurses. Contact the + current maintainers at bug-ncurses@gnu.org. + +

To join the ncurses mailing list, please write email to + bug-ncurses-request@gnu.org containing the line:

+
              subscribe <name>@<host.domain>
-
+
-This list is open to anyone interested in helping with the development and -testing of this package.

+

This list is open to anyone interested in helping with the + development and testing of this package.

-Beta versions of ncurses and patches to the current release are made available at -ftp://invisible-island.net/ncurses/ . +

Beta versions of ncurses and patches to the current release + are made available at ftp://invisible-island.net/ncurses/ .

-

Future Plans

-
    -
  • Extended-level XPG4 conformance, with internationalization support. -
  • Ports to more systems, including DOS and Windows. -
-We need people to help with these projects. If you are interested in working -on them, please join the ncurses list. +

Future Plans

-

Other Related Resources

+
    +
  • Extended-level XPG4 conformance, with internationalization + support.
  • -The distribution provides a newer version of the terminfo-format -terminal description file once maintained by -Eric Raymond . -Unlike the older version, the termcap and terminfo data are provided -in the same file, and provides several user-definable extensions -beyond the X/Open specification.

    +

  • Ports to more systems, including DOS and Windows.
  • +
We need people to help with these projects. If you are + interested in working on them, please join the ncurses list. -You can find lots of information on terminal-related topics -not covered in the terminfo file at -Richard Shuford's -archive . - - - +

Other Related Resources

The distribution provides a newer + version of the terminfo-format terminal description file once + maintained by Eric + Raymond . Unlike the older version, the termcap and + terminfo data are provided in the same file, and provides several + user-definable extensions beyond the X/Open specification. + +

You can find lots of information on terminal-related topics + not covered in the terminfo file at + Richard Shuford's archive .

+ + diff --git a/contrib/ncurses/doc/html/hackguide.html b/contrib/ncurses/doc/html/hackguide.html index 97d1369170c1..417f4c9855e3 100644 --- a/contrib/ncurses/doc/html/hackguide.html +++ b/contrib/ncurses/doc/html/hackguide.html @@ -1,8 +1,8 @@ - + term.h and comp_captab.c disagree about the <--\n"); - printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); - printf("#endif\n\n"); - - free(hash_table); - return EXIT_SUCCESS; + return ptr; } -#endif diff --git a/contrib/ncurses/ncurses/tinfo/comp_parse.c b/contrib/ncurses/ncurses/tinfo/comp_parse.c index 3325a0ddae6c..8204d75a8193 100644 --- a/contrib/ncurses/ncurses/tinfo/comp_parse.c +++ b/contrib/ncurses/ncurses/tinfo/comp_parse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -51,9 +51,8 @@ #include #include -#include -MODULE_ID("$Id: comp_parse.c,v 1.69 2008/08/16 21:58:16 tom Exp $") +MODULE_ID("$Id: comp_parse.c,v 1.73 2010/12/25 23:06:37 tom Exp $") static void sanity_check2(TERMTYPE *, bool); NCURSES_IMPEXP void NCURSES_API(*_nc_check_termtype2) (TERMTYPE *, bool) = sanity_check2; @@ -92,16 +91,18 @@ force_bar(char *dst, char *src) } return src; } +#define ForceBar(dst, src) ((strchr(src, '|') == 0) ? force_bar(dst, src) : src) NCURSES_EXPORT(bool) _nc_entry_match(char *n1, char *n2) /* do any of the aliases in a pair of terminal names match? */ { char *pstart, *qstart, *pend, *qend; - char nc1[MAX_NAME_SIZE + 2], nc2[MAX_NAME_SIZE + 2]; + char nc1[MAX_NAME_SIZE + 2]; + char nc2[MAX_NAME_SIZE + 2]; - n1 = force_bar(nc1, n1); - n2 = force_bar(nc2, n2); + n1 = ForceBar(nc1, n1); + n2 = ForceBar(nc2, n2); for (pstart = n1; (pend = strchr(pstart, '|')); pstart = pend + 1) for (qstart = n2; (qend = strchr(qstart, '|')); qstart = qend + 1) @@ -273,7 +274,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) unresolved++; total_unresolved++; - _nc_curr_line = lookline; + _nc_curr_line = (int) lookline; _nc_warning("resolution of use=%s failed", lookfor); qp->uses[i].link = 0; } @@ -375,7 +376,7 @@ _nc_resolve_uses2(bool fullresolve, bool literal) if (_nc_check_termtype != 0) { _nc_curr_col = -1; for_entry_list(qp) { - _nc_curr_line = qp->startline; + _nc_curr_line = (int) qp->startline; _nc_set_type(_nc_first_name(qp->tterm.term_names)); _nc_check_termtype2(&qp->tterm, literal); } @@ -473,7 +474,6 @@ _nc_leaks_tic(void) { _nc_alloc_entry_leaks(); _nc_captoinfo_leaks(); - _nc_comp_captab_leaks(); _nc_comp_scan_leaks(); #if BROKEN_LINKER || USE_REENTRANT _nc_names_leaks(); diff --git a/contrib/ncurses/ncurses/tinfo/comp_scan.c b/contrib/ncurses/ncurses/tinfo/comp_scan.c index da97dad89ad8..71af5e70e81b 100644 --- a/contrib/ncurses/ncurses/tinfo/comp_scan.c +++ b/contrib/ncurses/ncurses/tinfo/comp_scan.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -50,10 +50,9 @@ #include #include -#include #include -MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: comp_scan.c,v 1.89 2010/12/25 23:06:37 tom Exp $") /* * Maximum length of string capability we'll accept before raising an error. @@ -63,19 +62,13 @@ MODULE_ID("$Id: comp_scan.c,v 1.83 2008/08/16 19:22:55 tom Exp $") #define iswhite(ch) (ch == ' ' || ch == '\t') -NCURSES_EXPORT_VAR(int) -_nc_syntax = 0; /* termcap or terminfo? */ -NCURSES_EXPORT_VAR(long) -_nc_curr_file_pos = 0; /* file offset of current line */ -NCURSES_EXPORT_VAR(long) -_nc_comment_start = 0; /* start of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_comment_end = 0; /* end of comment range before name */ -NCURSES_EXPORT_VAR(long) -_nc_start_line = 0; /* start line of current entry */ +NCURSES_EXPORT_VAR (int) _nc_syntax = 0; /* termcap or terminfo? */ +NCURSES_EXPORT_VAR (long) _nc_curr_file_pos = 0; /* file offset of current line */ +NCURSES_EXPORT_VAR (long) _nc_comment_start = 0; /* start of comment range before name */ +NCURSES_EXPORT_VAR (long) _nc_comment_end = 0; /* end of comment range before name */ +NCURSES_EXPORT_VAR (long) _nc_start_line = 0; /* start line of current entry */ -NCURSES_EXPORT_VAR(struct token) -_nc_curr_token = +NCURSES_EXPORT_VAR (struct token) _nc_curr_token = { 0, 0, 0 }; @@ -93,8 +86,7 @@ static int pushtype; /* type of pushback token */ static char *pushname; #if NCURSES_EXT_FUNCS -NCURSES_EXPORT_VAR(bool) -_nc_disable_period = FALSE; /* used by tic -a option */ +NCURSES_EXPORT_VAR (bool) _nc_disable_period = FALSE; /* used by tic -a option */ #endif /***************************************************************************** @@ -213,6 +205,10 @@ next_char(void) if (fgets(result + used, (int) (allocated - used), yyin) != 0) { bufstart = result; if (used == 0) { + if (_nc_curr_line == 0 + && IS_TIC_MAGIC(result)) { + _nc_err_abort("This is a compiled terminal description, not a source"); + } _nc_curr_line++; _nc_curr_col = 0; } @@ -433,7 +429,7 @@ _nc_get_token(bool silent) && !strchr(terminfo_punct, (char) ch)) { if (!silent) _nc_warning("Illegal character (expected alphanumeric or %s) - '%s'", - terminfo_punct, unctrl((chtype) ch)); + terminfo_punct, unctrl(UChar(ch))); _nc_panic_mode(separator); goto start_token; } @@ -489,7 +485,6 @@ _nc_get_token(bool silent) if (OkToAdd()) { AddCh(ch); } else { - ch = EOF; break; } } @@ -600,7 +595,7 @@ _nc_get_token(bool silent) case '@': if ((ch = next_char()) != separator && !silent) _nc_warning("Missing separator after `%s', have %s", - tok_buf, unctrl((chtype) ch)); + tok_buf, unctrl(UChar(ch))); _nc_curr_token.tk_name = tok_buf; type = CANCEL; break; @@ -621,7 +616,7 @@ _nc_get_token(bool silent) _nc_warning("Missing separator"); } _nc_curr_token.tk_name = tok_buf; - _nc_curr_token.tk_valnumber = number; + _nc_curr_token.tk_valnumber = (int) number; type = NUMBER; break; @@ -641,7 +636,7 @@ _nc_get_token(bool silent) /* just to get rid of the compiler warning */ type = UNDEF; if (!silent) - _nc_warning("Illegal character - '%s'", unctrl((chtype) ch)); + _nc_warning("Illegal character - '%s'", unctrl(UChar(ch))); } } /* end else (first_column == FALSE) */ } /* end else (ch != EOF) */ @@ -734,48 +729,47 @@ _nc_trans_string(char *ptr, char *last) int count = 0; int number = 0; int i, c; - chtype ch, last_ch = '\0'; + int last_ch = '\0'; bool ignored = FALSE; bool long_warning = FALSE; - while ((ch = c = next_char()) != (chtype) separator && c != EOF) { + while ((c = next_char()) != separator && c != EOF) { if (ptr >= (last - 1)) { if (c != EOF) { while ((c = next_char()) != separator && c != EOF) { ; } - ch = c; } break; } if ((_nc_syntax == SYN_TERMCAP) && c == '\n') break; - if (ch == '^' && last_ch != '%') { - ch = c = next_char(); + if (c == '^' && last_ch != '%') { + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (!(is7bits(ch) && isprint(ch))) { - _nc_warning("Illegal ^ character - '%s'", unctrl(ch)); + if (!(is7bits(c) && isprint(c))) { + _nc_warning("Illegal ^ character - '%s'", unctrl(UChar(c))); } - if (ch == '?') { + if (c == '?') { *(ptr++) = '\177'; if (_nc_tracing) _nc_warning("Allow ^? as synonym for \\177"); } else { - if ((ch &= 037) == 0) - ch = 128; - *(ptr++) = (char) (ch); + if ((c &= 037) == 0) + c = 128; + *(ptr++) = (char) (c); } - } else if (ch == '\\') { - ch = c = next_char(); + } else if (c == '\\') { + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); - if (ch >= '0' && ch <= '7') { - number = ch - '0'; + if (c >= '0' && c <= '7') { + number = c - '0'; for (i = 0; i < 2; i++) { - ch = c = next_char(); + c = next_char(); if (c == EOF) _nc_err_abort(MSG_NO_INPUTS); @@ -852,31 +846,31 @@ _nc_trans_string(char *ptr, char *last) default: _nc_warning("Illegal character '%s' in \\ sequence", - unctrl(ch)); + unctrl(UChar(c))); /* FALLTHRU */ case '|': - *(ptr++) = (char) ch; - } /* endswitch (ch) */ - } /* endelse (ch < '0' || ch > '7') */ + *(ptr++) = (char) c; + } /* endswitch (c) */ + } /* endelse (c < '0' || c > '7') */ } - /* end else if (ch == '\\') */ - else if (ch == '\n' && (_nc_syntax == SYN_TERMINFO)) { + /* end else if (c == '\\') */ + else if (c == '\n' && (_nc_syntax == SYN_TERMINFO)) { /* * Newlines embedded in a terminfo string are ignored, provided * that the next line begins with whitespace. */ ignored = TRUE; } else { - *(ptr++) = (char) ch; + *(ptr++) = (char) c; } if (!ignored) { if (_nc_curr_col <= 1) { - push_back((char) ch); - ch = '\n'; + push_back((char) c); + c = '\n'; break; } - last_ch = ch; + last_ch = c; count++; } ignored = FALSE; @@ -889,7 +883,7 @@ _nc_trans_string(char *ptr, char *last) *ptr = '\0'; - return (ch); + return (c); } /* diff --git a/contrib/ncurses/ncurses/tinfo/db_iterator.c b/contrib/ncurses/ncurses/tinfo/db_iterator.c index fdc2bb09eadc..82665cb54be6 100644 --- a/contrib/ncurses/ncurses/tinfo/db_iterator.c +++ b/contrib/ncurses/ncurses/tinfo/db_iterator.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2006-2007,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,7 +38,7 @@ #include -MODULE_ID("$Id: db_iterator.c,v 1.6 2007/04/22 00:00:26 tom Exp $") +MODULE_ID("$Id: db_iterator.c,v 1.9 2010/12/25 23:00:25 tom Exp $") #define HaveTicDirectory _nc_globals.have_tic_directory #define KeepTicDirectory _nc_globals.keep_tic_directory @@ -104,7 +104,7 @@ next_list_item(const char *source, int *offset) if (source != 0) { FreeIfNeeded(ThisDbList); ThisDbList = strdup(source); - ThisDbSize = strlen(source); + ThisDbSize = (int) strlen(source); } if (ThisDbList != 0 && ThisDbSize && *offset < ThisDbSize) { @@ -118,11 +118,10 @@ next_list_item(const char *source, int *offset) * again, using the data at the offset. */ if (marker == 0) { - *offset += strlen(result) + 1; - marker = result + *offset; + *offset += (int) strlen(result); } else { *marker++ = 0; - *offset = marker - ThisDbList; + *offset = (int) (marker - ThisDbList); } if (*result == 0 && result != (ThisDbList + ThisDbSize)) result = system_db; diff --git a/contrib/ncurses/ncurses/tinfo/entries.c b/contrib/ncurses/ncurses/tinfo/entries.c index cf2a8337b870..b1e14a803f31 100644 --- a/contrib/ncurses/ncurses/tinfo/entries.c +++ b/contrib/ncurses/ncurses/tinfo/entries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2006-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,6 +28,7 @@ /**************************************************************************** * Author: Thomas E. Dickey * + * and: Juergen Pfeifer * ****************************************************************************/ #include @@ -35,9 +36,8 @@ #include #include -#include -MODULE_ID("$Id: entries.c,v 1.8 2008/09/27 13:11:10 tom Exp $") +MODULE_ID("$Id: entries.c,v 1.17 2010/01/23 17:57:43 tom Exp $") /**************************************************************************** * @@ -119,6 +119,12 @@ _nc_leaks_tinfo(void) #if NO_LEAKS _nc_free_tparm(); _nc_tgetent_leaks(); + + if (TerminalOf(CURRENT_SCREEN) != 0) { + del_curterm(TerminalOf(CURRENT_SCREEN)); + } + + _nc_comp_captab_leaks(); _nc_free_entries(_nc_head); _nc_get_type(0); _nc_first_name(0); @@ -131,6 +137,12 @@ _nc_leaks_tinfo(void) if ((s = _nc_home_terminfo()) != 0) free(s); + +#ifdef TRACE + trace(0); + _nc_trace_buf(-1, 0); +#endif + #endif /* NO_LEAKS */ returnVoid; } diff --git a/contrib/ncurses/ncurses/tinfo/free_ttype.c b/contrib/ncurses/ncurses/tinfo/free_ttype.c index fa0fff1b83fb..ad056ba4545b 100644 --- a/contrib/ncurses/ncurses/tinfo/free_ttype.c +++ b/contrib/ncurses/ncurses/tinfo/free_ttype.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1999-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -41,9 +41,8 @@ #include #include -#include -MODULE_ID("$Id: free_ttype.c,v 1.13 2006/06/25 10:46:02 tom Exp $") +MODULE_ID("$Id: free_ttype.c,v 1.15 2011/02/06 01:08:31 tom Exp $") NCURSES_EXPORT(void) _nc_free_termtype(TERMTYPE *ptr) @@ -70,6 +69,7 @@ use_extended_names(bool flag) { int oldflag = _nc_user_definable; + START_TRACE(); T((T_CALLED("use_extended_names(%d)"), flag)); _nc_user_definable = flag; returnBool(oldflag); diff --git a/contrib/ncurses/ncurses/tinfo/hashed_db.c b/contrib/ncurses/ncurses/tinfo/hashed_db.c index 3fc04eae3cca..bf7a968ee96d 100644 --- a/contrib/ncurses/ncurses/tinfo/hashed_db.c +++ b/contrib/ncurses/ncurses/tinfo/hashed_db.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2006 Free Software Foundation, Inc. * + * Copyright (c) 2006,2008 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2006 * + * Author: Thomas E. Dickey 2006-on * ****************************************************************************/ #include @@ -36,7 +36,7 @@ #if USE_HASHED_DB -MODULE_ID("$Id: hashed_db.c,v 1.13 2006/08/19 19:48:38 tom Exp $") +MODULE_ID("$Id: hashed_db.c,v 1.14 2008/12/13 20:59:02 tom Exp $") #if HASHED_DB_API >= 2 static DBC *cursor; @@ -49,27 +49,30 @@ NCURSES_EXPORT(DB *) _nc_db_open(const char *path, bool modify) { DB *result = 0; + int code; #if HASHED_DB_API >= 4 db_create(&result, NULL, 0); - result->open(result, - NULL, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644); + if ((code = result->open(result, + NULL, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644)) != 0) { + result = 0; + } #elif HASHED_DB_API >= 3 db_create(&result, NULL, 0); - result->open(result, - path, - NULL, - DB_HASH, - modify ? DB_CREATE : DB_RDONLY, - 0644); + if ((code = result->open(result, + path, + NULL, + DB_HASH, + modify ? DB_CREATE : DB_RDONLY, + 0644)) != 0) { + result = 0; + } #elif HASHED_DB_API >= 2 - int code; - if ((code = db_open(path, DB_HASH, modify ? DB_CREATE : DB_RDONLY, @@ -77,21 +80,22 @@ _nc_db_open(const char *path, bool modify) (DB_ENV *) 0, (DB_INFO *) 0, &result)) != 0) { - T(("cannot open %s: %s", path, strerror(code))); result = 0; - } else { - T(("opened %s", path)); } #else - result = dbopen(path, - modify ? (O_CREAT | O_RDWR) : O_RDONLY, - 0644, - DB_HASH, - NULL); - if (result != 0) { - T(("opened %s", path)); + if ((result = dbopen(path, + modify ? (O_CREAT | O_RDWR) : O_RDONLY, + 0644, + DB_HASH, + NULL)) == 0) { + code = errno; } #endif + if (result != 0) { + T(("opened %s", path)); + } else { + T(("cannot open %s: %s", path, strerror(code))); + } return result; } diff --git a/contrib/ncurses/ncurses/tinfo/home_terminfo.c b/contrib/ncurses/ncurses/tinfo/home_terminfo.c index 4521c4a8da68..69d69f95bf7c 100644 --- a/contrib/ncurses/ncurses/tinfo/home_terminfo.c +++ b/contrib/ncurses/ncurses/tinfo/home_terminfo.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,7 +37,7 @@ #include #include -MODULE_ID("$Id: home_terminfo.c,v 1.11 2008/08/03 23:43:11 tom Exp $") +MODULE_ID("$Id: home_terminfo.c,v 1.12 2010/12/25 23:43:58 tom Exp $") /* ncurses extension...fall back on user's private directory */ @@ -53,7 +53,7 @@ _nc_home_terminfo(void) if (use_terminfo_vars()) { if (MyBuffer == 0) { if ((home = getenv("HOME")) != 0) { - unsigned want = (strlen(home) + sizeof(PRIVATE_INFO)); + size_t want = (strlen(home) + sizeof(PRIVATE_INFO)); MyBuffer = typeMalloc(char, want); if (MyBuffer == 0) _nc_err_abort(MSG_NO_MEMORY); diff --git a/contrib/ncurses/ncurses/tinfo/init_keytry.c b/contrib/ncurses/ncurses/tinfo/init_keytry.c index 2f6fe4f6fad7..ea47b382b493 100644 --- a/contrib/ncurses/ncurses/tinfo/init_keytry.c +++ b/contrib/ncurses/ncurses/tinfo/init_keytry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,16 +27,9 @@ ****************************************************************************/ #include - -#include -/* keypad_xmit, keypad_local, meta_on, meta_off */ -/* cursor_visible,cursor_normal,cursor_invisible */ - #include /* struct tinfo_fkeys */ -#include - -MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") +MODULE_ID("$Id: init_keytry.c,v 1.17 2010/04/24 22:29:56 tom Exp $") /* ** _nc_init_keytry() @@ -50,7 +43,7 @@ MODULE_ID("$Id: init_keytry.c,v 1.12 2008/05/24 21:44:51 tom Exp $") * than cur_term. */ #undef CUR -#define CUR (sp->_term)->type. +#define CUR SP_TERMTYPE #if BROKEN_LINKER #undef _nc_tinfo_fkeys @@ -73,7 +66,7 @@ _nc_tinfo_fkeysf(void) NCURSES_EXPORT(void) _nc_init_keytry(SCREEN *sp) { - size_t n; + unsigned n; /* The sp->_keytry value is initialized in newterm(), where the sp * structure is created, because we can not tell where keypad() or @@ -97,12 +90,13 @@ _nc_init_keytry(SCREEN *sp) { TERMTYPE *tp = &(sp->_term->type); for (n = STRCOUNT; n < NUM_STRINGS(tp); ++n) { - const char *name = ExtStrname(tp, n, strnames); + const char *name = ExtStrname(tp, (int) n, strnames); char *value = tp->Strings[n]; if (name != 0 && *name == 'k' && value != 0 - && key_defined(value) == 0) { + && NCURSES_SP_NAME(key_defined) (NCURSES_SP_ARGx + value) == 0) { (void) _nc_add_to_try(&(sp->_keytry), value, n - STRCOUNT + KEY_MAX); diff --git a/contrib/ncurses/ncurses/tinfo/lib_acs.c b/contrib/ncurses/ncurses/tinfo/lib_acs.c index 919e47287a7b..d8fdedca843f 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_acs.c +++ b/contrib/ncurses/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,17 +30,21 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ #include -#include /* ena_acs, acs_chars */ -MODULE_ID("$Id: lib_acs.c,v 1.36 2008/08/16 19:22:55 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_acs.c,v 1.43 2010/12/25 23:00:45 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map -NCURSES_EXPORT_VAR(chtype *) -_nc_acs_map(void) +NCURSES_EXPORT(chtype *) +NCURSES_PUBLIC_VAR(acs_map) (void) { if (MyBuffer == 0) MyBuffer = typeCalloc(chtype, ACS_LEN); @@ -48,17 +52,35 @@ _nc_acs_map(void) } #undef MyBuffer #else -NCURSES_EXPORT_VAR(chtype) acs_map[ACS_LEN] = +NCURSES_EXPORT_VAR (chtype) acs_map[ACS_LEN] = { 0 }; #endif +#ifdef USE_TERM_DRIVER +NCURSES_EXPORT(chtype) +NCURSES_SP_NAME(_nc_acs_char) (NCURSES_SP_DCLx int c) +{ + chtype *map; + if (c < 0 || c >= ACS_LEN) + return (chtype) 0; + map = (SP_PARM != 0) ? SP_PARM->_acs_map : +#if BROKEN_LINKER || USE_REENTRANT + _nc_prescreen.real_acs_map +#else + acs_map +#endif + ; + return map[c]; +} +#endif /* USE_TERM_DRIVER */ + NCURSES_EXPORT(void) -_nc_init_acs(void) +NCURSES_SP_NAME(_nc_init_acs) (NCURSES_SP_DCL0) { chtype *fake_map = acs_map; - chtype *real_map = SP != 0 ? SP->_acs_map : fake_map; + chtype *real_map = SP_PARM != 0 ? SP_PARM->_acs_map : fake_map; int j; T(("initializing ACS map")); @@ -71,9 +93,9 @@ _nc_init_acs(void) if (real_map != fake_map) { for (j = 1; j < ACS_LEN; ++j) { real_map[j] = 0; - fake_map[j] = A_ALTCHARSET | j; - if (SP) - SP->_screen_acs_map[j] = FALSE; + fake_map[j] = A_ALTCHARSET | (chtype) j; + if (SP_PARM) + SP_PARM->_screen_acs_map[j] = FALSE; } } else { for (j = 1; j < ACS_LEN; ++j) { @@ -118,7 +140,34 @@ _nc_init_acs(void) real_map['{'] = '*'; /* should be greek pi */ real_map['|'] = '!'; /* should be not-equal */ real_map['}'] = 'f'; /* should be pound-sterling symbol */ + /* thick-line-drawing */ + real_map['L'] = '+'; /* upper left corner */ + real_map['M'] = '+'; /* lower left corner */ + real_map['K'] = '+'; /* upper right corner */ + real_map['J'] = '+'; /* lower right corner */ + real_map['T'] = '+'; /* tee pointing left */ + real_map['U'] = '+'; /* tee pointing right */ + real_map['V'] = '+'; /* tee pointing up */ + real_map['W'] = '+'; /* tee pointing down */ + real_map['Q'] = '-'; /* horizontal line */ + real_map['X'] = '|'; /* vertical line */ + real_map['N'] = '+'; /* large plus or crossover */ + /* double-line-drawing */ + real_map['C'] = '+'; /* upper left corner */ + real_map['D'] = '+'; /* lower left corner */ + real_map['B'] = '+'; /* upper right corner */ + real_map['A'] = '+'; /* lower right corner */ + real_map['G'] = '+'; /* tee pointing left */ + real_map['F'] = '+'; /* tee pointing right */ + real_map['H'] = '+'; /* tee pointing up */ + real_map['I'] = '+'; /* tee pointing down */ + real_map['R'] = '-'; /* horizontal line */ + real_map['Y'] = '|'; /* vertical line */ + real_map['E'] = '+'; /* large plus or crossover */ +#ifdef USE_TERM_DRIVER + CallDriver_2(SP_PARM, initacs, real_map, fake_map); +#else if (ena_acs != NULL) { TPUTS_TRACE("ena_acs"); putp(ena_acs); @@ -140,7 +189,7 @@ _nc_init_acs(void) size_t i; for (i = 1; i < ACS_LEN; ++i) { if (real_map[i] == 0) { - real_map[i] = i; + real_map[i] = (chtype) i; if (real_map != fake_map) { if (SP != 0) SP->_screen_acs_map[i] = TRUE; @@ -191,4 +240,13 @@ _nc_init_acs(void) _nc_unlock_global(tracef); } #endif /* TRACE */ +#endif } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_init_acs(void) +{ + NCURSES_SP_NAME(_nc_init_acs) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_baudrate.c b/contrib/ncurses/ncurses/tinfo/lib_baudrate.c index b9cdfda9acce..9302f022b89c 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_baudrate.c +++ b/contrib/ncurses/ncurses/tinfo/lib_baudrate.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,7 +38,6 @@ */ #include -#include /* cur_term, pad_char */ #include /* ospeed */ #if defined(__FreeBSD__) #include @@ -80,7 +79,7 @@ #undef USE_OLD_TTY #endif /* USE_OLD_TTY */ -MODULE_ID("$Id: lib_baudrate.c,v 1.27 2008/06/28 15:19:24 tom Exp $") +MODULE_ID("$Id: lib_baudrate.c,v 1.31 2010/12/19 01:50:50 tom Exp $") /* * int @@ -195,11 +194,11 @@ _nc_ospeed(int BaudRate) } NCURSES_EXPORT(int) -baudrate(void) +NCURSES_SP_NAME(baudrate) (NCURSES_SP_DCL0) { int result; - T((T_CALLED("baudrate()"))); + T((T_CALLED("baudrate(%p)"), (void *) SP_PARM)); /* * In debugging, allow the environment symbol to override when we're @@ -207,32 +206,41 @@ baudrate(void) * that take into account costs that depend on baudrate. */ #ifdef TRACE - if (!isatty(fileno(SP ? SP->_ofp : stdout)) + if (IsValidTIScreen(SP_PARM) + && !isatty(fileno(SP_PARM ? SP_PARM->_ofp : stdout)) && getenv("BAUDRATE") != 0) { int ret; if ((ret = _nc_getenv_num("BAUDRATE")) <= 0) ret = 9600; - ospeed = _nc_ospeed(ret); + ospeed = (NCURSES_OSPEED) _nc_ospeed(ret); returnCode(ret); } #endif - if (cur_term != 0) { + if (IsValidTIScreen(SP_PARM)) { #ifdef USE_OLD_TTY - result = cfgetospeed(&cur_term->Nttyb); + result = cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); ospeed = _nc_ospeed(result); #else /* !USE_OLD_TTY */ #ifdef TERMIOS - ospeed = cfgetospeed(&cur_term->Nttyb); + ospeed = (NCURSES_OSPEED) cfgetospeed(&(TerminalOf(SP_PARM)->Nttyb)); #else - ospeed = cur_term->Nttyb.sg_ospeed; + ospeed = (NCURSES_OSPEED) TerminalOf(SP_PARM)->Nttyb.sg_ospeed; #endif result = _nc_baudrate(ospeed); #endif - cur_term->_baudrate = result; + TerminalOf(SP_PARM)->_baudrate = result; } else { result = ERR; } returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +baudrate(void) +{ + return NCURSES_SP_NAME(baudrate) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_cur_term.c b/contrib/ncurses/ncurses/tinfo/lib_cur_term.c index 626578d5c08b..86e130e78527 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_cur_term.c +++ b/contrib/ncurses/ncurses/tinfo/lib_cur_term.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,69 +37,141 @@ */ #include -#include /* TTY, cur_term */ #include /* ospeed */ -MODULE_ID("$Id: lib_cur_term.c,v 1.18 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_cur_term.c,v 1.30 2010/12/19 01:38:45 tom Exp $") #undef CUR #define CUR termp->type. -#if BROKEN_LINKER || USE_REENTRANT +#if BROKEN_LINKER && !USE_REENTRANT +NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; +#elif BROKEN_LINKER || USE_REENTRANT + +NCURSES_EXPORT(TERMINAL *) +NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_DCL0) +{ + return ((0 != TerminalOf(SP_PARM)) ? TerminalOf(SP_PARM) : CurTerm); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(TERMINAL *) +_nc_get_cur_term(void) +{ + return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(TERMINAL *) NCURSES_PUBLIC_VAR(cur_term) (void) { - return (SP != 0 && SP->_term != 0) ? SP->_term : _nc_prescreen._cur_term; +#if NCURSES_SP_FUNCS + return NCURSES_SP_NAME(_nc_get_cur_term) (CURRENT_SCREEN); +#else + return NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG); +#endif } + #else NCURSES_EXPORT_VAR(TERMINAL *) cur_term = 0; #endif NCURSES_EXPORT(TERMINAL *) -set_curterm(TERMINAL * termp) +NCURSES_SP_NAME(set_curterm) (NCURSES_SP_DCLx TERMINAL * termp) { TERMINAL *oldterm; - T((T_CALLED("set_curterm(%p)"), termp)); + T((T_CALLED("set_curterm(%p)"), (void *) termp)); _nc_lock_global(curses); oldterm = cur_term; - if (SP) - SP->_term = termp; -#if BROKEN_LINKER || USE_REENTRANT - _nc_prescreen._cur_term = termp; -#else + if (SP_PARM) + SP_PARM->_term = termp; +#if BROKEN_LINKER && !USE_REENTRANT cur_term = termp; +#else + CurTerm = termp; #endif if (termp != 0) { - ospeed = _nc_ospeed(termp->_baudrate); +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); + if (TCB->drv->isTerminfo && termp->type.Strings) { + PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); + } + TCB->csp = SP_PARM; +#else + ospeed = (NCURSES_OSPEED) _nc_ospeed(termp->_baudrate); if (termp->type.Strings) { PC = (char) ((pad_char != NULL) ? pad_char[0] : 0); } +#endif } _nc_unlock_global(curses); - T((T_RETURN("%p"), oldterm)); + T((T_RETURN("%p"), (void *) oldterm)); return (oldterm); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(TERMINAL *) +set_curterm(TERMINAL * termp) +{ + return NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN, termp); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(del_curterm) (NCURSES_SP_DCLx TERMINAL * termp) +{ + int rc = ERR; + + T((T_CALLED("del_curterm(%p, %p)"), (void *) SP_PARM, (void *) termp)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) termp; +#endif + TERMINAL *cur = ( +#if BROKEN_LINKER && !USE_REENTRANT + cur_term +#elif BROKEN_LINKER || USE_REENTRANT + NCURSES_SP_NAME(_nc_get_cur_term) (NCURSES_SP_ARG) +#else + cur_term +#endif + ); + + _nc_free_termtype(&(termp->type)); + if (termp == cur) + NCURSES_SP_NAME(set_curterm) (NCURSES_SP_ARGx 0); + + FreeIfNeeded(termp->_termname); +#if USE_HOME_TERMINFO + if (_nc_globals.home_terminfo != 0) + FreeAndNull(_nc_globals.home_terminfo); +#endif +#ifdef USE_TERM_DRIVER + if (TCB->drv) + TCB->drv->release(TCB); +#endif + free(termp); + + rc = OK; + } + returnCode(rc); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) del_curterm(TERMINAL * termp) { int rc = ERR; - T((T_CALLED("del_curterm(%p)"), termp)); - _nc_lock_global(curses); - if (termp != 0) { - _nc_free_termtype(&(termp->type)); - FreeIfNeeded(termp->_termname); - free(termp); - if (termp == cur_term) - set_curterm(0); - rc = OK; - } + rc = NCURSES_SP_NAME(del_curterm) (CURRENT_SCREEN, termp); _nc_unlock_global(curses); - returnCode(rc); + return (rc); } +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_data.c b/contrib/ncurses/ncurses/tinfo/lib_data.c index e84209d4022c..195ddf978ab6 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_data.c +++ b/contrib/ncurses/ncurses/tinfo/lib_data.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -41,7 +42,7 @@ #include -MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") +MODULE_ID("$Id: lib_data.c,v 1.61 2010/05/15 22:06:56 tom Exp $") /* * OS/2's native linker complains if we don't initialize public data when @@ -51,17 +52,17 @@ MODULE_ID("$Id: lib_data.c,v 1.52 2008/08/23 22:16:15 tom Exp $") NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(stdscr) (void) { - return SP ? SP->_stdscr : 0; + return CURRENT_SCREEN ? StdScreen(CURRENT_SCREEN) : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(curscr) (void) { - return SP ? SP->_curscr : 0; + return CURRENT_SCREEN ? CurScreen(CURRENT_SCREEN) : 0; } NCURSES_EXPORT(WINDOW *) NCURSES_PUBLIC_VAR(newscr) (void) { - return SP ? SP->_newscr : 0; + return CURRENT_SCREEN ? NewScreen(CURRENT_SCREEN) : 0; } #else NCURSES_EXPORT_VAR(WINDOW *) stdscr = 0; @@ -93,7 +94,7 @@ _nc_screen(void) NCURSES_EXPORT(int) _nc_alloc_screen(void) { - return ((my_screen = typeCalloc(SCREEN, 1)) != 0); + return ((my_screen = _nc_alloc_screen_sp()) != 0); } NCURSES_EXPORT(void) @@ -103,6 +104,7 @@ _nc_set_screen(SCREEN *sp) } #else + NCURSES_EXPORT_VAR(SCREEN *) SP = NULL; /* Some linkers require initialized data... */ #endif /* *INDENT-OFF* */ @@ -140,7 +142,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* tgetent_index */ 0, /* tgetent_sequence */ +#ifndef USE_SP_WINDOWLIST 0, /* _nc_windowlist */ +#endif #if USE_HOME_TERMINFO NULL, /* home_terminfo */ @@ -151,6 +155,10 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* safeprint_rows */ #endif +#ifdef USE_TERM_DRIVER + 0, /* term_driver */ +#endif + #ifdef TRACE FALSE, /* init_trace */ CHARS_0s, /* trace_fname */ @@ -174,7 +182,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { { CHARS_0s, CHARS_0s }, /* traceatr_color_buf */ 0, /* traceatr_color_sel */ -1, /* traceatr_color_last */ - +#if !defined(USE_PTHREADS) && USE_REENTRANT + 0, /* nested_tracef */ +#endif #endif /* TRACE */ #ifdef USE_PTHREADS PTHREAD_MUTEX_INITIALIZER, /* mutex_curses */ @@ -183,6 +193,9 @@ NCURSES_EXPORT_VAR(NCURSES_GLOBALS) _nc_globals = { 0, /* nested_tracef */ 0, /* use_pthreads */ #endif +#if USE_PTHREADS_EINTR + 0, /* read_thread */ +#endif }; #define STACK_FRAME_0 { { 0 }, 0 } @@ -196,8 +209,10 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { TRUE, /* use_env */ FALSE, /* filter_mode */ A_NORMAL, /* previous_attr */ +#ifndef USE_SP_RIPOFF RIPOFF_0s, /* ripoff */ NULL, /* rsp */ +#endif { /* tparm_state */ #ifdef TRACE NULL, /* tname */ @@ -221,10 +236,13 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { #if NCURSES_NO_PADDING FALSE, /* flag to set if padding disabled */ #endif + 0, /* _outch */ #if BROKEN_LINKER || USE_REENTRANT NULL, /* real_acs_map */ 0, /* LINES */ 0, /* COLS */ + 8, /* TABSIZE */ + 1000, /* ESCDELAY */ 0, /* cur_term */ #ifdef TRACE 0L, /* _outchars */ @@ -234,6 +252,22 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = { }; /* *INDENT-ON* */ +/* + * wgetch() and other functions with a WINDOW* parameter may use a SCREEN* + * internally, and it is useful to allow those to be invoked without switching + * SCREEN's, e.g., for multi-threaded applications. + */ +NCURSES_EXPORT(SCREEN *) +_nc_screen_of(WINDOW *win) +{ + SCREEN *sp = 0; + + if (win != 0) { + sp = WINDOW_EXT(win, screen); + } + return (sp); +} + /******************************************************************************/ #ifdef USE_PTHREADS static void @@ -314,7 +348,9 @@ _nc_mutex_unlock(pthread_mutex_t * obj) return 0; return pthread_mutex_unlock(obj); } +#endif /* USE_PTHREADS */ +#if defined(USE_PTHREADS) || USE_PTHREADS_EINTR #if USE_WEAK_SYMBOLS /* * NB: sigprocmask(2) is global but pthread_sigmask(3p) diff --git a/contrib/ncurses/ncurses/tinfo/lib_has_cap.c b/contrib/ncurses/ncurses/tinfo/lib_has_cap.c index 0dc66bd9b918..d1b9b8d966da 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_has_cap.c +++ b/contrib/ncurses/ncurses/tinfo/lib_has_cap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-2003 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,25 +42,53 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_has_cap.c,v 1.4 2003/10/25 19:43:55 tom Exp $") +MODULE_ID("$Id: lib_has_cap.c,v 1.9 2009/10/24 22:15:47 tom Exp $") +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_ic) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + + T((T_CALLED("has_ic(%p)"), (void *) SP_PARM)); + + if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { + code = ((insert_character || parm_ich + || (enter_insert_mode && exit_insert_mode)) + && (delete_character || parm_dch)) ? TRUE : FALSE; + } + + returnCode(code); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_ic(void) { - T((T_CALLED("has_ic()"))); - returnCode(cur_term && - (insert_character || parm_ich - || (enter_insert_mode && exit_insert_mode)) - && (delete_character || parm_dch)); + return NCURSES_SP_NAME(has_ic) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(bool) +NCURSES_SP_NAME(has_il) (NCURSES_SP_DCL0) +{ + bool code = FALSE; + T((T_CALLED("has_il(%p)"), (void *) SP_PARM)); + if (IsValidTIScreen(SP_PARM) && IsTermInfo(SP_PARM)) { + code = ((insert_line || parm_insert_line) + && (delete_line || parm_delete_line)) ? TRUE : FALSE; + } + + returnCode(code); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(bool) has_il(void) { - T((T_CALLED("has_il()"))); - returnCode(cur_term - && (insert_line || parm_insert_line) - && (delete_line || parm_delete_line)); + return NCURSES_SP_NAME(has_il) (CURRENT_SCREEN); } +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_kernel.c b/contrib/ncurses/ncurses/tinfo/lib_kernel.c index 89dc1e80ea8e..37f70842907d 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_kernel.c +++ b/contrib/ncurses/ncurses/tinfo/lib_kernel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2004 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 2002 * + * and: Thomas E. Dickey 2002 * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -46,9 +47,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_kernel.c,v 1.24 2004/05/08 17:11:21 tom Exp $") +MODULE_ID("$Id: lib_kernel.c,v 1.31 2010/12/19 01:21:19 tom Exp $") static int _nc_vdisable(void) @@ -59,7 +59,7 @@ _nc_vdisable(void) #endif #if defined(_PC_VDISABLE) if (value == -1) { - value = fpathconf(0, _PC_VDISABLE); + value = (int) fpathconf(0, _PC_VDISABLE); if (value == -1) { value = 0377; } @@ -79,23 +79,33 @@ _nc_vdisable(void) */ NCURSES_EXPORT(char) -erasechar(void) +NCURSES_SP_NAME(erasechar) (NCURSES_SP_DCL0) { int result = ERR; - T((T_CALLED("erasechar()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("erasechar(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - result = cur_term->Ottyb.c_cc[VERASE]; + result = termp->Ottyb.c_cc[VERASE]; if (result == _nc_vdisable()) result = ERR; #else - result = cur_term->Ottyb.sg_erase; + result = termp->Ottyb.sg_erase; #endif } - returnCode(result); + returnChar((char) result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char) +erasechar(void) +{ + return NCURSES_SP_NAME(erasechar) (CURRENT_SCREEN); +} +#endif + /* * killchar() * @@ -104,23 +114,33 @@ erasechar(void) */ NCURSES_EXPORT(char) -killchar(void) +NCURSES_SP_NAME(killchar) (NCURSES_SP_DCL0) { int result = ERR; - T((T_CALLED("killchar()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("killchar(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - result = cur_term->Ottyb.c_cc[VKILL]; + result = termp->Ottyb.c_cc[VKILL]; if (result == _nc_vdisable()) result = ERR; #else - result = cur_term->Ottyb.sg_kill; + result = termp->Ottyb.sg_kill; #endif } - returnCode(result); + returnChar((char) result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char) +killchar(void) +{ + return NCURSES_SP_NAME(killchar) (CURRENT_SCREEN); +} +#endif + /* * flushinp() * @@ -129,26 +149,36 @@ killchar(void) */ NCURSES_EXPORT(int) -flushinp(void) +NCURSES_SP_NAME(flushinp) (NCURSES_SP_DCL0) { - T((T_CALLED("flushinp()"))); + TERMINAL *termp = TerminalOf(SP_PARM); - if (cur_term != 0) { + T((T_CALLED("flushinp(%p)"), (void *) SP_PARM)); + + if (termp != 0) { #ifdef TERMIOS - tcflush(cur_term->Filedes, TCIFLUSH); + tcflush(termp->Filedes, TCIFLUSH); #else errno = 0; do { - ioctl(cur_term->Filedes, TIOCFLUSH, 0); + ioctl(termp->Filedes, TIOCFLUSH, 0); } while (errno == EINTR); #endif - if (SP) { - SP->_fifohead = -1; - SP->_fifotail = 0; - SP->_fifopeek = 0; + if (SP_PARM) { + SP_PARM->_fifohead = -1; + SP_PARM->_fifotail = 0; + SP_PARM->_fifopeek = 0; } returnCode(OK); } returnCode(ERR); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +flushinp(void) +{ + return NCURSES_SP_NAME(flushinp) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_longname.c b/contrib/ncurses/ncurses/tinfo/lib_longname.c index 1301ee516944..14903175b322 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_longname.c +++ b/contrib/ncurses/ncurses/tinfo/lib_longname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998,2000 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -40,8 +42,38 @@ #include -MODULE_ID("$Id: lib_longname.c,v 1.9 2000/12/10 02:55:07 tom Exp $") +MODULE_ID("$Id: lib_longname.c,v 1.12 2010/12/20 00:31:26 tom Exp $") +#if USE_REENTRANT +NCURSES_EXPORT(char *) +NCURSES_SP_NAME(longname) (NCURSES_SP_DCL0) +{ + static char empty[] = + {'\0'}; + char *ptr; + + T((T_CALLED("longname(%p)"), (void *) SP_PARM)); + + if (SP_PARM) { + for (ptr = SP_PARM->_ttytype + strlen(SP_PARM->_ttytype); + ptr > SP_PARM->_ttytype; + ptr--) + if (*ptr == '|') + returnPtr(ptr + 1); + returnPtr(SP_PARM->_ttytype); + } + return empty; +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +longname(void) +{ + return NCURSES_SP_NAME(longname) (CURRENT_SCREEN); +} +#endif + +#else NCURSES_EXPORT(char *) longname(void) { @@ -49,9 +81,11 @@ longname(void) T((T_CALLED("longname()"))); - for (ptr = ttytype + strlen(ttytype); ptr > ttytype; ptr--) + for (ptr = ttytype + strlen(ttytype); + ptr > ttytype; + ptr--) if (*ptr == '|') returnPtr(ptr + 1); - returnPtr(ttytype); } +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_napms.c b/contrib/ncurses/ncurses/tinfo/lib_napms.c index 417b3b4b4dbc..1e6abda10d09 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_napms.c +++ b/contrib/ncurses/ncurses/tinfo/lib_napms.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -49,13 +51,17 @@ #endif #endif -MODULE_ID("$Id: lib_napms.c,v 1.17 2008/05/03 21:34:13 tom Exp $") +MODULE_ID("$Id: lib_napms.c,v 1.20 2009/11/07 20:37:30 tom Exp $") NCURSES_EXPORT(int) -napms(int ms) +NCURSES_SP_NAME(napms) (NCURSES_SP_DCLx int ms) { + (void) SP_PARM; T((T_CALLED("napms(%d)"), ms)); +#ifdef USE_TERM_DRIVER + CallDriver_1(SP_PARM, nap, ms); +#else /* !USE_TERM_DRIVER */ #if HAVE_NANOSLEEP { struct timespec request, remaining; @@ -69,6 +75,15 @@ napms(int ms) #else _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); #endif +#endif /* !USE_TERM_DRIVER */ returnCode(OK); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +napms(int ms) +{ + return NCURSES_SP_NAME(napms) (CURRENT_SCREEN, ms); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_options.c b/contrib/ncurses/ncurses/tinfo/lib_options.c index f3b1485bf111..654bf940aa1f 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_options.c +++ b/contrib/ncurses/ncurses/tinfo/lib_options.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,53 +42,67 @@ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_options.c,v 1.58 2008/08/16 21:20:48 Werner.Fink Exp $") - -static int _nc_curs_set(SCREEN *, int); -static int _nc_meta(SCREEN *, bool); +MODULE_ID("$Id: lib_options.c,v 1.71 2009/10/24 21:56:15 tom Exp $") NCURSES_EXPORT(int) idlok(WINDOW *win, bool flag) { - T((T_CALLED("idlok(%p,%d)"), win, flag)); + int res = ERR; + T((T_CALLED("idlok(%p,%d)"), (void *) win, flag)); if (win) { - _nc_idlok = win->_idlok = (flag && (has_il() || change_scroll_region)); - returnCode(OK); - } else - returnCode(ERR); + SCREEN *sp = _nc_screen_of(win); + if (sp && IsTermInfo(sp)) { + sp->_nc_sp_idlok = + win->_idlok = (flag && (NCURSES_SP_NAME(has_il) (NCURSES_SP_ARG) + || change_scroll_region)); + res = OK; + } + } + returnCode(res); } NCURSES_EXPORT(void) idcok(WINDOW *win, bool flag) { - T((T_CALLED("idcok(%p,%d)"), win, flag)); - - if (win) - _nc_idcok = win->_idcok = (flag && has_ic()); + T((T_CALLED("idcok(%p,%d)"), (void *) win, flag)); + if (win) { + SCREEN *sp = _nc_screen_of(win); + sp->_nc_sp_idcok = win->_idcok = (flag && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)); + } returnVoid; } NCURSES_EXPORT(int) -halfdelay(int t) +NCURSES_SP_NAME(halfdelay) (NCURSES_SP_DCLx int t) { - T((T_CALLED("halfdelay(%d)"), t)); + T((T_CALLED("halfdelay(%p,%d)"), (void *) SP_PARM, t)); - if (t < 1 || t > 255 || SP == 0) + if (t < 1 || t > 255 || !IsValidTIScreen(SP_PARM)) returnCode(ERR); - cbreak(); - SP->_cbreak = t + 1; + NCURSES_SP_NAME(cbreak) (NCURSES_SP_ARG); + SP_PARM->_cbreak = t + 1; returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +halfdelay(int t) +{ + return NCURSES_SP_NAME(halfdelay) (CURRENT_SCREEN, t); +} +#endif + NCURSES_EXPORT(int) nodelay(WINDOW *win, bool flag) { - T((T_CALLED("nodelay(%p,%d)"), win, flag)); + T((T_CALLED("nodelay(%p,%d)"), (void *) win, flag)); if (win) { if (flag == TRUE) @@ -102,7 +117,7 @@ nodelay(WINDOW *win, bool flag) NCURSES_EXPORT(int) notimeout(WINDOW *win, bool f) { - T((T_CALLED("notimeout(%p,%d)"), win, f)); + T((T_CALLED("notimeout(%p,%d)"), (void *) win, f)); if (win) { win->_notimeout = f; @@ -114,7 +129,7 @@ notimeout(WINDOW *win, bool f) NCURSES_EXPORT(void) wtimeout(WINDOW *win, int delay) { - T((T_CALLED("wtimeout(%p,%d)"), win, delay)); + T((T_CALLED("wtimeout(%p,%d)"), (void *) win, delay)); if (win) { win->_delay = delay; @@ -125,11 +140,11 @@ wtimeout(WINDOW *win, int delay) NCURSES_EXPORT(int) keypad(WINDOW *win, bool flag) { - T((T_CALLED("keypad(%p,%d)"), win, flag)); + T((T_CALLED("keypad(%p,%d)"), (void *) win, flag)); if (win) { win->_use_keypad = flag; - returnCode(_nc_keypad(SP, flag)); + returnCode(_nc_keypad(_nc_screen_of(win), flag)); } else returnCode(ERR); } @@ -137,38 +152,106 @@ keypad(WINDOW *win, bool flag) NCURSES_EXPORT(int) meta(WINDOW *win GCC_UNUSED, bool flag) { - int result; + int result = ERR; + SCREEN *sp = (win == 0) ? CURRENT_SCREEN : _nc_screen_of(win); /* Ok, we stay relaxed and don't signal an error if win is NULL */ - T((T_CALLED("meta(%p,%d)"), win, flag)); - result = _nc_meta(SP, flag); + T((T_CALLED("meta(%p,%d)"), (void *) win, flag)); + + /* Ok, we stay relaxed and don't signal an error if win is NULL */ + + if (sp != 0) { + sp->_use_meta = flag; +#ifdef USE_TERM_DRIVER + if (IsTermInfo(sp)) { + if (flag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + } + } +#else + if (flag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_on", meta_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "meta_off", meta_off); + } +#endif + result = OK; + } returnCode(result); } /* curs_set() moved here to narrow the kernel interface */ NCURSES_EXPORT(int) -curs_set(int vis) +NCURSES_SP_NAME(curs_set) (NCURSES_SP_DCLx int vis) { - int result; + int code = ERR; + T((T_CALLED("curs_set(%p,%d)"), (void *) SP_PARM, vis)); - T((T_CALLED("curs_set(%d)"), vis)); - result = _nc_curs_set(SP, vis); - returnCode(result); + if (SP_PARM != 0 && vis >= 0 && vis <= 2) { + int cursor = SP_PARM->_cursor; + bool bBuiltIn = !IsTermInfo(SP_PARM); + if (vis == cursor) { + code = cursor; + } else { + if (!bBuiltIn) { + switch (vis) { + case 2: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_visible", + cursor_visible); + break; + case 1: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_normal", + cursor_normal); + break; + case 0: + code = NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "cursor_invisible", + cursor_invisible); + break; + } + } else + code = ERR; + if (code != ERR) + code = (cursor == -1 ? 1 : cursor); + SP_PARM->_cursor = vis; + } + } + returnCode(code); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -typeahead(int fd) +curs_set(int vis) { - T((T_CALLED("typeahead(%d)"), fd)); - if (SP != 0) { - SP->_checkfd = fd; + return (NCURSES_SP_NAME(curs_set) (CURRENT_SCREEN, vis)); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(typeahead) (NCURSES_SP_DCLx int fd) +{ + T((T_CALLED("typeahead(%p, %d)"), (void *) SP_PARM, fd)); + if (IsValidTIScreen(SP_PARM)) { + SP_PARM->_checkfd = fd; returnCode(OK); } else { returnCode(ERR); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +typeahead(int fd) +{ + return NCURSES_SP_NAME(typeahead) (CURRENT_SCREEN, fd); +} +#endif + /* ** has_key() ** @@ -189,43 +272,50 @@ has_key_internal(int keycode, TRIES * tp) || has_key_internal(keycode, tp->sibling)); } +#ifdef USE_TERM_DRIVER +NCURSES_EXPORT(int) +TINFO_HAS_KEY(SCREEN *sp, int keycode) +{ + return IsValidTIScreen(sp) ? + has_key_internal(keycode, sp->_keytry) : 0; +} +#else +NCURSES_EXPORT(int) +NCURSES_SP_NAME(has_key) (NCURSES_SP_DCLx int keycode) +{ + T((T_CALLED("has_key(%p,%d)"), (void *) SP_PARM, keycode)); + returnCode(SP != 0 ? has_key_internal(keycode, SP_PARM->_keytry) : FALSE); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) has_key(int keycode) { - T((T_CALLED("has_key(%d)"), keycode)); - returnCode(SP != 0 ? has_key_internal(keycode, SP->_keytry) : FALSE); + return NCURSES_SP_NAME(has_key) (CURRENT_SCREEN, keycode); } +#endif +#endif #endif /* NCURSES_EXT_FUNCS */ -/* - * Internal entrypoints use SCREEN* parameter to obtain capabilities rather - * than cur_term. - */ -#undef CUR -#define CUR (sp->_term)->type. - -static int -_nc_putp(const char *name GCC_UNUSED, const char *value) +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_DCLx + const char *name, const char *value) { - int rc = ERR; - - if (value) { - TPUTS_TRACE(name); - rc = putp(value); - } - return rc; -} - -static int -_nc_putp_flush(const char *name, const char *value) -{ - int rc = _nc_putp(name, value); + int rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); if (rc != ERR) { _nc_flush(); } return rc; } +#if 0 && NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_putp_flush(const char *name, const char *value) +{ + return NCURSES_SP_NAME(_nc_putp_flush) (CURRENT_SCREEN, name, value); +} +#endif + /* Turn the keypad on/off * * Note: we flush the output because changing this mode causes some terminals @@ -245,12 +335,12 @@ _nc_keypad(SCREEN *sp, bool flag) * has wgetch() reading in more than one thread. putp() and below * may use SP explicitly. */ - if (_nc_use_pthreads && sp != SP) { + if (_nc_use_pthreads && sp != CURRENT_SCREEN) { SCREEN *save_sp; /* cannot use use_screen(), since that is not in tinfo library */ _nc_lock_global(curses); - save_sp = SP; + save_sp = CURRENT_SCREEN; _nc_set_screen(sp); rc = _nc_keypad(sp, flag); _nc_set_screen(save_sp); @@ -258,10 +348,19 @@ _nc_keypad(SCREEN *sp, bool flag) } else #endif { +#ifdef USE_TERM_DRIVER + rc = CallDriver_1(sp, kpad, flag); + if (rc == OK) + sp->_keypad_on = flag; +#else if (flag) { - (void) _nc_putp_flush("keypad_xmit", keypad_xmit); + (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "keypad_xmit", + keypad_xmit); } else if (!flag && keypad_local) { - (void) _nc_putp_flush("keypad_local", keypad_local); + (void) NCURSES_SP_NAME(_nc_putp_flush) (NCURSES_SP_ARGx + "keypad_local", + keypad_local); } if (flag && !sp->_tried) { @@ -270,58 +369,8 @@ _nc_keypad(SCREEN *sp, bool flag) } sp->_keypad_on = flag; rc = OK; +#endif } } return (rc); } - -static int -_nc_curs_set(SCREEN *sp, int vis) -{ - int result = ERR; - - T((T_CALLED("curs_set(%d)"), vis)); - if (sp != 0 && vis >= 0 && vis <= 2) { - int cursor = sp->_cursor; - - if (vis == cursor) { - result = cursor; - } else { - switch (vis) { - case 2: - result = _nc_putp_flush("cursor_visible", cursor_visible); - break; - case 1: - result = _nc_putp_flush("cursor_normal", cursor_normal); - break; - case 0: - result = _nc_putp_flush("cursor_invisible", cursor_invisible); - break; - } - if (result != ERR) - result = (cursor == -1 ? 1 : cursor); - sp->_cursor = vis; - } - } - returnCode(result); -} - -static int -_nc_meta(SCREEN *sp, bool flag) -{ - int result = ERR; - - /* Ok, we stay relaxed and don't signal an error if win is NULL */ - - if (SP != 0) { - SP->_use_meta = flag; - - if (flag) { - _nc_putp("meta_on", meta_on); - } else { - _nc_putp("meta_off", meta_off); - } - result = OK; - } - return result; -} diff --git a/contrib/ncurses/ncurses/tinfo/lib_print.c b/contrib/ncurses/ncurses/tinfo/lib_print.c index 975b46d85773..c7bd3a62fa87 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_print.c +++ b/contrib/ncurses/ncurses/tinfo/lib_print.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,23 +29,31 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_print.c,v 1.16 2006/11/26 00:26:34 tom Exp $") +MODULE_ID("$Id: lib_print.c,v 1.20 2010/06/05 22:18:35 tom Exp $") NCURSES_EXPORT(int) -mcprint(char *data, int len) +NCURSES_SP_NAME(mcprint) (NCURSES_SP_DCLx char *data, int len) /* ship binary character data to the printer via mc4/mc5/mc5p */ { + int result; char *mybuf, *switchon; - size_t onsize, offsize, res; + size_t onsize, offsize; + size_t need; errno = 0; - if (!cur_term || (!prtr_non && (!prtr_on || !prtr_off))) { + if (!HasTInfoTerminal(SP_PARM) + || len <= 0 + || (!prtr_non && (!prtr_on || !prtr_off))) { errno = ENODEV; return (ERR); } @@ -60,8 +68,10 @@ mcprint(char *data, int len) offsize = strlen(prtr_off); } + need = onsize + (size_t) len + offsize; + if (switchon == 0 - || (mybuf = typeMalloc(char, onsize + len + offsize + 1)) == 0) { + || (mybuf = typeMalloc(char, need + 1)) == 0) { errno = ENOMEM; return (ERR); } @@ -78,15 +88,24 @@ mcprint(char *data, int len) * data has actually been shipped to the terminal. If the write(2) * operation is truly atomic we're protected from this. */ - res = write(cur_term->Filedes, mybuf, onsize + len + offsize); + result = (int) write(TerminalOf(SP_PARM)->Filedes, mybuf, need); /* * By giving up our scheduler slot here we increase the odds that the * kernel will ship the contiguous clist items from the last write * immediately. */ +#ifndef __MINGW32__ (void) sleep(0); - +#endif free(mybuf); - return (res); + return (result); } + +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +mcprint(char *data, int len) +{ + return NCURSES_SP_NAME(mcprint) (CURRENT_SCREEN, data, len); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_raw.c b/contrib/ncurses/ncurses/tinfo/lib_raw.c index 58e71889af12..b524a1bb55be 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_raw.c +++ b/contrib/ncurses/ncurses/tinfo/lib_raw.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1998 on * + * and: Thomas E. Dickey 1998-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -47,9 +48,8 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") +MODULE_ID("$Id: lib_raw.c,v 1.19 2010/04/24 23:49:12 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -61,7 +61,7 @@ MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #ifdef __EMX__ #include -#define _nc_setmode(mode) setmode(SP->_ifd, mode) +#define _nc_setmode(mode) setmode(SP_PARM->_ifd, mode) #else #define _nc_setmode(mode) /* nothing */ #endif @@ -77,188 +77,235 @@ MODULE_ID("$Id: lib_raw.c,v 1.14 2007/09/29 21:50:22 tom Exp $") #endif /* TRACE */ NCURSES_EXPORT(int) -raw(void) +NCURSES_SP_NAME(raw) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("raw()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("raw(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("raw"); _nc_setmode(O_BINARY); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~(ICANON | ISIG | IEXTEN); - buf.c_iflag &= ~(COOKED_INPUT); + buf.c_lflag &= (unsigned) ~(ICANON | ISIG | IEXTEN); + buf.c_iflag &= (unsigned) ~(COOKED_INPUT); buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= RAW; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_raw = TRUE; - SP->_cbreak = 1; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_raw = TRUE; + SP_PARM->_cbreak = 1; + termp->Nttyb = buf; } AFTER("raw"); } returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -cbreak(void) +raw(void) +{ + return NCURSES_SP_NAME(raw) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(cbreak) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("cbreak()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("cbreak(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("cbreak"); _nc_setmode(O_BINARY); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~ICANON; - buf.c_iflag &= ~ICRNL; + buf.c_lflag &= (unsigned) ~ICANON; + buf.c_iflag &= (unsigned) ~ICRNL; buf.c_lflag |= ISIG; buf.c_cc[VMIN] = 1; buf.c_cc[VTIME] = 0; #else buf.sg_flags |= CBREAK; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_cbreak = 1; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_cbreak = 1; + termp->Nttyb = buf; } AFTER("cbreak"); } returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +cbreak(void) +{ + return NCURSES_SP_NAME(cbreak) (CURRENT_SCREEN); +} +#endif + /* * Note: * this implementation may be wrong. See the comment under intrflush(). */ NCURSES_EXPORT(void) -qiflush(void) +NCURSES_SP_NAME(qiflush) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("qiflush()"))); - - if (cur_term != 0) { + T((T_CALLED("qiflush(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("qiflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS - buf.c_lflag &= ~(NOFLSH); - result = _nc_set_tty_mode(&buf); + buf.c_lflag &= (unsigned) ~(NOFLSH); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif if (result == OK) - cur_term->Nttyb = buf; + termp->Nttyb = buf; AFTER("qiflush"); } returnVoid; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +qiflush(void) +{ + NCURSES_SP_NAME(qiflush) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(int) -noraw(void) +NCURSES_SP_NAME(noraw) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("noraw()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("noraw(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("noraw"); _nc_setmode(O_TEXT); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= ISIG | ICANON | - (cur_term->Ottyb.c_lflag & IEXTEN); + (termp->Ottyb.c_lflag & IEXTEN); buf.c_iflag |= COOKED_INPUT; #else buf.sg_flags &= ~(RAW | CBREAK); #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_raw = FALSE; - SP->_cbreak = 0; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_raw = FALSE; + SP_PARM->_cbreak = 0; + termp->Nttyb = buf; } AFTER("noraw"); } returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -nocbreak(void) +noraw(void) +{ + return NCURSES_SP_NAME(noraw) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(nocbreak) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("nocbreak()"))); - - if (SP != 0 && cur_term != 0) { + T((T_CALLED("nocbreak(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("nocbreak"); _nc_setmode(O_TEXT); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= ICANON; buf.c_iflag |= ICRNL; #else buf.sg_flags &= ~CBREAK; #endif - if ((result = _nc_set_tty_mode(&buf)) == OK) { - SP->_cbreak = 0; - cur_term->Nttyb = buf; + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); + if (result == OK) { + SP_PARM->_cbreak = 0; + termp->Nttyb = buf; } AFTER("nocbreak"); } returnCode(result); } -/* - * Note: - * this implementation may be wrong. See the comment under intrflush(). - */ +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +nocbreak(void) +{ + return NCURSES_SP_NAME(nocbreak) (CURRENT_SCREEN); +} +#endif + NCURSES_EXPORT(void) -noqiflush(void) +NCURSES_SP_NAME(noqiflush) (NCURSES_SP_DCL0) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("noqiflush()"))); - - if (cur_term != 0) { + T((T_CALLED("noqiflush(%p)"), (void *) SP_PARM)); + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("noqiflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS buf.c_lflag |= NOFLSH; - result = _nc_set_tty_mode(&buf); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif - if (result == OK) { - cur_term->Nttyb = buf; - } + if (result == OK) + termp->Nttyb = buf; AFTER("noqiflush"); } returnVoid; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +noqiflush(void) +{ + NCURSES_SP_NAME(noqiflush) (CURRENT_SCREEN); +} +#endif + /* * This call does the same thing as the qiflush()/noqiflush() pair. We know * for certain that SVr3 intrflush() tweaks the NOFLSH bit; on the other hand, @@ -267,30 +314,41 @@ noqiflush(void) * curs_inopts(3x) is too exact to be coincidence. */ NCURSES_EXPORT(int) -intrflush(WINDOW *win GCC_UNUSED, bool flag) +NCURSES_SP_NAME(intrflush) (NCURSES_SP_DCLx WINDOW *win GCC_UNUSED, bool flag) { int result = ERR; + TERMINAL *termp; - T((T_CALLED("intrflush(%d)"), flag)); + T((T_CALLED("intrflush(%p,%d)"), (void *) SP_PARM, flag)); + if (SP_PARM == 0) + returnCode(ERR); - if (cur_term != 0) { + if ((termp = TerminalOf(SP_PARM)) != 0) { TTY buf; BEFORE("intrflush"); - buf = cur_term->Nttyb; + buf = termp->Nttyb; #ifdef TERMIOS if (flag) - buf.c_lflag &= ~(NOFLSH); + buf.c_lflag &= (unsigned) ~(NOFLSH); else buf.c_lflag |= (NOFLSH); - result = _nc_set_tty_mode(&buf); + result = NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx &buf); #else /* FIXME */ #endif if (result == OK) { - cur_term->Nttyb = buf; + termp->Nttyb = buf; } AFTER("intrflush"); } returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +intrflush(WINDOW *win GCC_UNUSED, bool flag) +{ + return NCURSES_SP_NAME(intrflush) (CURRENT_SCREEN, win, flag); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_setup.c b/contrib/ncurses/ncurses/tinfo/lib_setup.c index 8cfaf12c5348..5fcf2ae3fc32 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_setup.c +++ b/contrib/ncurses/ncurses/tinfo/lib_setup.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,7 +42,6 @@ #include #include /* for MAX_NAME_SIZE */ -#include #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -51,9 +51,7 @@ #include #endif -#include /* lines, columns, cur_term */ - -MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.135 2011/02/06 01:04:21 tom Exp $") /**************************************************************************** * @@ -109,61 +107,96 @@ MODULE_ID("$Id: lib_setup.c,v 1.111 2008/08/03 22:42:33 tom Exp $") * Wrap global variables in this module. */ #if USE_REENTRANT + NCURSES_EXPORT(char *) NCURSES_PUBLIC_VAR(ttytype) (void) { static char empty[] = ""; - return cur_term ? cur_term->type.term_names : empty; + char *result = empty; + +#if NCURSES_SP_FUNCS + if (CURRENT_SCREEN) { + TERMINAL *termp = TerminalOf(CURRENT_SCREEN); + if (termp != 0) { + result = termp->type.term_names; + } + } +#else + if (cur_term != 0) { + result = cur_term->type.term_names; + } +#endif + return result; } + NCURSES_EXPORT(int *) -_nc_ptr_Lines(void) +_nc_ptr_Lines(SCREEN *sp) { - return ptrLines(); + return ptrLines(sp); } + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(LINES) (void) { - return *_nc_ptr_Lines(); + return *_nc_ptr_Lines(CURRENT_SCREEN); } + NCURSES_EXPORT(int *) -_nc_ptr_Cols(void) +_nc_ptr_Cols(SCREEN *sp) { - return ptrCols(); + return ptrCols(sp); } + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(COLS) (void) { - return *_nc_ptr_Cols(); + return *_nc_ptr_Cols(CURRENT_SCREEN); } + +NCURSES_EXPORT(int *) +_nc_ptr_Tabsize(SCREEN *sp) +{ + return ptrTabsize(sp); +} + NCURSES_EXPORT(int) NCURSES_PUBLIC_VAR(TABSIZE) (void) { - return SP ? SP->_TABSIZE : 8; + return *_nc_ptr_Tabsize(CURRENT_SCREEN); } #else NCURSES_EXPORT_VAR(char) ttytype[NAMESIZE] = ""; NCURSES_EXPORT_VAR(int) LINES = 0; NCURSES_EXPORT_VAR(int) COLS = 0; -NCURSES_EXPORT_VAR(int) TABSIZE = 0; +NCURSES_EXPORT_VAR(int) TABSIZE = 8; #endif #if NCURSES_EXT_FUNCS NCURSES_EXPORT(int) -set_tabsize(int value) +NCURSES_SP_NAME(set_tabsize) (NCURSES_SP_DCLx int value) { int code = OK; #if USE_REENTRANT - if (SP) { - SP->_TABSIZE = value; + if (SP_PARM) { + SP_PARM->_TABSIZE = value; } else { code = ERR; } #else + (void) SP_PARM; TABSIZE = value; #endif return code; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +set_tabsize(int value) +{ + return NCURSES_SP_NAME(set_tabsize) (CURRENT_SCREEN, value); +} #endif +#endif /* NCURSES_EXT_FUNCS */ #if USE_SIGWINCH /* @@ -188,42 +221,71 @@ _nc_handle_sigwinch(SCREEN *sp) #endif NCURSES_EXPORT(void) -use_env(bool f) +NCURSES_SP_NAME(use_env) (NCURSES_SP_DCLx bool f) { - T((T_CALLED("use_env()"))); + T((T_CALLED("use_env(%p,%d)"), (void *) SP_PARM, (int) f)); +#if NCURSES_SP_FUNCS + if (IsPreScreen(SP_PARM)) { + SP_PARM->_use_env = f; + } +#else _nc_prescreen.use_env = f; +#endif returnVoid; } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_get_screensize(SCREEN *sp, int *linep, int *colp) +use_env(bool f) +{ + T((T_CALLED("use_env(%d)"), (int) f)); + _nc_prescreen.use_env = f; + returnVoid; +} +#endif + +NCURSES_EXPORT(void) +_nc_get_screensize(SCREEN *sp, +#ifdef USE_TERM_DRIVER + TERMINAL * termp, +#endif + int *linep, int *colp) /* Obtain lines/columns values from the environment and/or terminfo entry */ { +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB; + int my_tabsize; + + assert(termp != 0 && linep != 0 && colp != 0); + TCB = (TERMINAL_CONTROL_BLOCK *) termp; + + my_tabsize = TCB->info.tabsize; + TCB->drv->size(TCB, linep, colp); + +#if USE_REENTRANT + if (sp != 0) { + sp->_TABSIZE = my_tabsize; + } +#else + (void) sp; + TABSIZE = my_tabsize; +#endif + T(("TABSIZE = %d", my_tabsize)); +#else /* !USE_TERM_DRIVER */ TERMINAL *termp = cur_term; int my_tabsize; /* figure out the size of the screen */ T(("screen size: terminfo lines = %d columns = %d", lines, columns)); - if (!_nc_prescreen.use_env) { - *linep = (int) lines; - *colp = (int) columns; - } else { /* usually want to query LINES and COLUMNS from environment */ + *linep = (int) lines; + *colp = (int) columns; + + if (_nc_prescreen.use_env) { int value; - *linep = *colp = 0; - - /* first, look for environment variables */ - if ((value = _nc_getenv_num("LINES")) > 0) { - *linep = value; - } - if ((value = _nc_getenv_num("COLUMNS")) > 0) { - *colp = value; - } - T(("screen size: environment LINES = %d COLUMNS = %d", *linep, *colp)); - #ifdef __EMX__ - if (*linep <= 0 || *colp <= 0) { + { int screendata[2]; _scrsize(screendata); *colp = screendata[0]; @@ -233,33 +295,41 @@ _nc_get_screensize(SCREEN *sp, int *linep, int *colp) } #endif #if HAVE_SIZECHANGE - /* if that didn't work, maybe we can try asking the OS */ - if (*linep <= 0 || *colp <= 0) { - if (isatty(cur_term->Filedes)) { - STRUCT_WINSIZE size; + /* try asking the OS */ + if (isatty(cur_term->Filedes)) { + STRUCT_WINSIZE size; - errno = 0; - do { - if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) < 0 - && errno != EINTR) - goto failure; - } while - (errno == EINTR); - - /* - * Solaris lets users override either dimension with an - * environment variable. - */ - if (*linep <= 0) - *linep = (sp != 0 && sp->_filtered) ? 1 : WINSIZE_ROWS(size); - if (*colp <= 0) + errno = 0; + do { + if (ioctl(cur_term->Filedes, IOCTL_WINSIZE, &size) >= 0) { + *linep = ((sp != 0 && sp->_filtered) + ? 1 + : WINSIZE_ROWS(size)); *colp = WINSIZE_COLS(size); - } - /* FALLTHRU */ - failure:; + T(("SYS screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + break; + } + } while + (errno == EINTR); } #endif /* HAVE_SIZECHANGE */ + /* + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. + */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); + } + /* if we can't get dynamic info about the size, use static */ if (*linep <= 0) { *linep = (int) lines; @@ -298,19 +368,31 @@ _nc_get_screensize(SCREEN *sp, int *linep, int *colp) TABSIZE = my_tabsize; #endif T(("TABSIZE = %d", TABSIZE)); +#endif /* USE_TERM_DRIVER */ } #if USE_SIZECHANGE NCURSES_EXPORT(void) _nc_update_screensize(SCREEN *sp) { - TERMINAL *termp = cur_term; - int old_lines = lines; int new_lines; - int old_cols = columns; int new_cols; - _nc_get_screensize(sp, &new_lines, &new_cols); +#ifdef USE_TERM_DRIVER + int old_lines; + int old_cols; + + assert(sp != 0); + + CallDriver_2(sp, getsize, &old_lines, &old_cols); + +#else + TERMINAL *termp = cur_term; + int old_lines = lines; + int old_cols = columns; +#endif + + TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols); /* * See is_term_resized() and resizeterm(). @@ -320,7 +402,7 @@ _nc_update_screensize(SCREEN *sp) if (sp != 0 && sp->_resize != 0) { if ((new_lines != old_lines) || (new_cols != old_cols)) - sp->_resize(new_lines, new_cols); + sp->_resize(NCURSES_SP_ARGx new_lines, new_cols); sp->_sig_winch = FALSE; } } @@ -353,8 +435,8 @@ _nc_update_screensize(SCREEN *sp) * Return 1 if entry found, 0 if not found, -1 if database not accessible, * just like tgetent(). */ -static int -grab_entry(const char *const tn, TERMTYPE *const tp) +int +_nc_setup_tinfo(const char *const tn, TERMTYPE *const tp) { char filename[PATH_MAX]; int status = _nc_read_entry(tn, filename, tp); @@ -381,28 +463,27 @@ grab_entry(const char *const tn, TERMTYPE *const tp) #endif /* -** do_prototype() -** ** Take the real command character out of the CC environment variable ** and substitute it in for the prototype given in 'command_character'. */ -static void -do_prototype(TERMINAL * termp) +void +_nc_tinfo_cmdch(TERMINAL * termp, char proto) { unsigned i; char CC; - char proto; char *tmp; - if ((tmp = getenv("CC")) != 0) { - if ((CC = *tmp) != 0) { - proto = *command_character; - - for_each_string(i, &(termp->type)) { - for (tmp = termp->type.Strings[i]; *tmp; tmp++) { - if (*tmp == proto) - *tmp = CC; - } + /* + * Only use the character if the string is a single character, + * since it is fairly common for developers to set the C compiler + * name as an environment variable - using the same symbol. + */ + if ((tmp = getenv("CC")) != 0 && strlen(tmp) == 1) { + CC = *tmp; + for_each_string(i, &(termp->type)) { + for (tmp = termp->type.Strings[i]; *tmp; tmp++) { + if (*tmp == proto) + *tmp = CC; } } } @@ -465,39 +546,64 @@ _nc_unicode_locale(void) NCURSES_EXPORT(int) _nc_locale_breaks_acs(TERMINAL * termp) { + const char *env_name = "NCURSES_NO_UTF8_ACS"; char *env; + int value; + int result = 0; - if ((env = getenv("NCURSES_NO_UTF8_ACS")) != 0) { - return atoi(env); + if ((env = getenv(env_name)) != 0) { + result = _nc_getenv_num(env_name); + } else if ((value = tigetnum("U8")) >= 0) { + result = value; /* use extension feature */ } else if ((env = getenv("TERM")) != 0) { - if (strstr(env, "linux")) - return 1; /* always broken */ - if (strstr(env, "screen") != 0 - && ((env = getenv("TERMCAP")) != 0 - && strstr(env, "screen") != 0) - && strstr(env, "hhII00") != 0) { + if (strstr(env, "linux")) { + result = 1; /* always broken */ + } else if (strstr(env, "screen") != 0 + && ((env = getenv("TERMCAP")) != 0 + && strstr(env, "screen") != 0) + && strstr(env, "hhII00") != 0) { if (CONTROL_N(enter_alt_charset_mode) || CONTROL_O(enter_alt_charset_mode) || CONTROL_N(set_attributes) || - CONTROL_O(set_attributes)) - return 1; + CONTROL_O(set_attributes)) { + result = 1; + } } } - return 0; + return result; } -/* - * This entrypoint is called from tgetent() to allow a special case of reusing - * the same TERMINAL data (see comment). - */ NCURSES_EXPORT(int) -_nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) +TINFO_SETUP_TERM(TERMINAL ** tp, + NCURSES_CONST char *tname, + int Filedes, + int *errret, + bool reuse) { - TERMINAL *termp; +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = 0; +#else int status; +#endif + TERMINAL *termp; + SCREEN *sp = 0; + int code = ERR; START_TRACE(); - T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret)); + +#ifdef USE_TERM_DRIVER + T((T_CALLED("_nc_setupterm_ex(%p,%s,%d,%p)"), + (void *) tp, _nc_visbuf(tname), Filedes, (void *) errret)); + + if (tp == 0) { + ret_error0(TGETENT_ERR, + "Invalid parameter, internal error.\n"); + } else + termp = *tp; +#else + termp = cur_term; + T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, (void *) errret)); +#endif if (tname == 0) { tname = getenv("TERM"); @@ -538,22 +644,37 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) * properly with this feature). */ if (reuse - && (termp = cur_term) != 0 + && (termp != 0) && termp->Filedes == Filedes && termp->_termname != 0 && !strcmp(termp->_termname, tname) && _nc_name_match(termp->type.term_names, tname, "|")) { T(("reusing existing terminal information and mode-settings")); + code = OK; } else { - +#ifdef USE_TERM_DRIVER + termp = (TERMINAL *) typeCalloc(TERMINAL_CONTROL_BLOCK, 1); +#else termp = typeCalloc(TERMINAL, 1); - +#endif if (termp == 0) { ret_error0(TGETENT_ERR, "Not enough memory to create terminal structure.\n"); } +#ifdef USE_TERM_DRIVER + INIT_TERM_DRIVER(); + TCB = (TERMINAL_CONTROL_BLOCK *) termp; + code = _nc_globals.term_driver(TCB, tname, errret); + if (code == OK) { + termp->Filedes = (short) Filedes; + termp->_termname = strdup(tname); + } else { + ret_error0(TGETENT_ERR, + "Could not find any driver to handle this terminal.\n"); + } +#else #if USE_DATABASE || USE_TERMCAP - status = grab_entry(tname, &termp->type); + status = _nc_setup_tinfo(tname, &termp->type); #else status = TGETENT_NO; #endif @@ -581,13 +702,13 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) ttytype[NAMESIZE - 1] = '\0'; #endif - termp->Filedes = Filedes; + termp->Filedes = (short) Filedes; termp->_termname = strdup(tname); set_curterm(termp); - if (command_character && getenv("CC")) - do_prototype(termp); + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); /* * If an application calls setupterm() rather than initscr() or @@ -599,25 +720,95 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse) def_prog_mode(); baudrate(); } + code = OK; +#endif } +#ifdef USE_TERM_DRIVER + *tp = termp; + NCURSES_SP_NAME(set_curterm) (sp, termp); + TCB->drv->init(TCB); +#else + sp = SP; +#endif + /* * We should always check the screensize, just in case. */ - _nc_get_screensize(SP, ptrLines(), ptrCols()); + TINFO_GET_SIZE(sp, termp, ptrLines(sp), ptrCols(sp)); if (errret) *errret = TGETENT_YES; +#ifndef USE_TERM_DRIVER if (generic_type) { ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); } if (hard_copy) { ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); } - returnCode(OK); +#endif + returnCode(code); } +#if NCURSES_SP_FUNCS +/* + * In case of handling multiple screens, we need to have a screen before + * initialization in setupscreen takes place. This is to extend the substitute + * for some of the stuff in _nc_prescreen, especially for slk and ripoff + * handling which should be done per screen. + */ +NCURSES_EXPORT(SCREEN *) +new_prescr(void) +{ + static SCREEN *sp; + + START_TRACE(); + T((T_CALLED("new_prescr()"))); + + if (sp == 0) { + sp = _nc_alloc_screen_sp(); + if (sp != 0) { + sp->rsp = sp->rippedoff; + sp->_filtered = _nc_prescreen.filter_mode; + sp->_use_env = _nc_prescreen.use_env; +#if NCURSES_NO_PADDING + sp->_no_padding = _nc_prescreen._no_padding; +#endif + sp->slk_format = 0; + sp->_slk = 0; + sp->_prescreen = TRUE; + SP_PRE_INIT(sp); +#if USE_REENTRANT + sp->_TABSIZE = _nc_prescreen._TABSIZE; + sp->_ESCDELAY = _nc_prescreen._ESCDELAY; +#endif + } + } + returnSP(sp); +} +#endif + +#ifdef USE_TERM_DRIVER +/* + * This entrypoint is called from tgetent() to allow a special case of reusing + * the same TERMINAL data (see comment). + */ +NCURSES_EXPORT(int) +_nc_setupterm(NCURSES_CONST char *tname, + int Filedes, + int *errret, + bool reuse) +{ + int res; + TERMINAL *termp; + res = TINFO_SETUP_TERM(&termp, tname, Filedes, errret, reuse); + if (ERR != res) + NCURSES_SP_NAME(set_curterm) (CURRENT_SCREEN_PRE, termp); + return res; +} +#endif + /* * setupterm(termname, Filedes, errret) * diff --git a/contrib/ncurses/ncurses/tinfo/lib_termcap.c b/contrib/ncurses/ncurses/tinfo/lib_termcap.c index addcc2472bd7..21db21be3d3b 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_termcap.c +++ b/contrib/ncurses/ncurses/tinfo/lib_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * * * * some of the code in here was contributed by: * * Magnus Bengtsson, d6mbeng@dtek.chalmers.se (Nov'93) * @@ -45,9 +46,11 @@ #include #include -#include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -MODULE_ID("$Id: lib_termcap.c,v 1.63 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.73 2010/12/25 19:27:12 tom Exp $") NCURSES_EXPORT_VAR(char *) UP = 0; NCURSES_EXPORT_VAR(char *) BC = 0; @@ -82,16 +85,26 @@ extern char _nc_termcap[]; /* buffer to copy out */ ***************************************************************************/ NCURSES_EXPORT(int) -tgetent(char *bufp, const char *name) +NCURSES_SP_NAME(tgetent) (NCURSES_SP_DCLx char *bufp, const char *name) { - int errcode; + int rc = ERR; int n; bool found_cache = FALSE; +#ifdef USE_TERM_DRIVER + TERMINAL *termp = 0; +#endif START_TRACE(); T((T_CALLED("tgetent()"))); - _nc_setupterm((NCURSES_CONST char *) name, STDOUT_FILENO, &errcode, TRUE); + TINFO_SETUP_TERM(&termp, (NCURSES_CONST char *) name, + STDOUT_FILENO, &rc, TRUE); + +#ifdef USE_TERM_DRIVER + if (termp == 0 || + !((TERMINAL_CONTROL_BLOCK *) termp)->drv->isTerminfo) + return (rc); +#endif /* * In general we cannot tell if the fixed sgr0 is still used by the @@ -115,9 +128,9 @@ tgetent(char *bufp, const char *name) /* * Also free the terminfo data that we loaded (much bigger leak). */ - if (LAST_TRM != 0 && LAST_TRM != cur_term) { + if (LAST_TRM != 0 && LAST_TRM != TerminalOf(SP_PARM)) { TERMINAL *trm = LAST_TRM; - del_curterm(LAST_TRM); + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx LAST_TRM); for (CacheInx = 0; CacheInx < TGETENT_MAX; ++CacheInx) if (LAST_TRM == trm) LAST_TRM = 0; @@ -137,7 +150,7 @@ tgetent(char *bufp, const char *name) } CacheInx = best; } - LAST_TRM = cur_term; + LAST_TRM = TerminalOf(SP_PARM); LAST_SEQ = ++CacheSeq; PC = 0; @@ -145,7 +158,7 @@ tgetent(char *bufp, const char *name) BC = 0; FIX_SGR0 = 0; /* don't free it - application may still use */ - if (errcode == 1) { + if (rc == 1) { if (cursor_left) if ((backspaces_with_bs = (char) !strcmp(cursor_left, "\b")) == 0) @@ -159,7 +172,7 @@ tgetent(char *bufp, const char *name) if (backspace_if_not_bs != NULL) BC = backspace_if_not_bs; - if ((FIX_SGR0 = _nc_trim_sgr0(&(cur_term->type))) != 0) { + if ((FIX_SGR0 = _nc_trim_sgr0(&(TerminalOf(SP_PARM)->type))) != 0) { if (!strcmp(FIX_SGR0, exit_attribute_mode)) { if (FIX_SGR0 != exit_attribute_mode) { free(FIX_SGR0); @@ -170,8 +183,8 @@ tgetent(char *bufp, const char *name) LAST_BUF = bufp; LAST_USE = TRUE; - SetNoPadding(SP); - (void) baudrate(); /* sets ospeed as a side-effect */ + SetNoPadding(SP_PARM); + (void) NCURSES_SP_NAME(baudrate) (NCURSES_SP_ARG); /* sets ospeed as a side-effect */ /* LINT_PREPRO #if 0*/ @@ -190,9 +203,28 @@ tgetent(char *bufp, const char *name) strncpy(bufp, _nc_termcap, 1024); #endif - returnCode(errcode); + returnCode(rc); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetent(char *bufp, const char *name) +{ + return NCURSES_SP_NAME(tgetent) (CURRENT_SCREEN, bufp, name); +} +#endif + +#if 0 +static bool +same_tcname(const char *a, const char *b) +{ + fprintf(stderr, "compare(%s,%s)\n", a, b); + return !strncmp(a, b, 2); +} +#else +#define same_tcname(a,b) !strncmp(a,b,2) +#endif + /*************************************************************************** * * tgetflag(str) @@ -203,24 +235,48 @@ tgetent(char *bufp, const char *name) ***************************************************************************/ NCURSES_EXPORT(int) -tgetflag(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetflag) (NCURSES_SP_DCLx NCURSES_CONST char *id) { - unsigned i; + int result = 0; /* Solaris returns zero for missing flag */ + int i, j; - T((T_CALLED("tgetflag(%s)"), id)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolcodes); - if (!strncmp(id, capname, 2)) { - /* setupterm forces invalid booleans to false */ - returnCode(tp->Booleans[i]); + T((T_CALLED("tgetflag(%p, %s)"), (void *) SP_PARM, id)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, BOOLEAN, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + /* note: setupterm forces invalid booleans to false */ + result = tp->Booleans[j]; + } } - returnCode(0); /* Solaris does this */ + returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetflag(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetflag) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetnum(str) @@ -231,25 +287,48 @@ tgetflag(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(int) -tgetnum(NCURSES_CONST char *id) +NCURSES_SP_NAME(tgetnum) (NCURSES_SP_DCLx NCURSES_CONST char *id) { - unsigned i; + int result = ABSENT_NUMERIC; + int i, j; - T((T_CALLED("tgetnum(%s)"), id)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_number(i, tp) { - const char *capname = ExtNumname(tp, i, numcodes); - if (!strncmp(id, capname, 2)) { - if (!VALID_NUMERIC(tp->Numbers[i])) - returnCode(ABSENT_NUMERIC); - returnCode(tp->Numbers[i]); + T((T_CALLED("tgetnum(%p, %s)"), (void *) SP_PARM, id)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, NUMBER, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_number(i, tp) { + const char *capname = ExtNumname(tp, i, numcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + if (VALID_NUMERIC(tp->Numbers[j])) + result = tp->Numbers[j]; + } } - returnCode(ABSENT_NUMERIC); + returnCode(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +tgetnum(NCURSES_CONST char *id) +{ + return NCURSES_SP_NAME(tgetnum) (CURRENT_SCREEN, id); +} +#endif + /*************************************************************************** * * tgetstr(str, area) @@ -260,40 +339,62 @@ tgetnum(NCURSES_CONST char *id) ***************************************************************************/ NCURSES_EXPORT(char *) -tgetstr(NCURSES_CONST char *id, char **area) +NCURSES_SP_NAME(tgetstr) (NCURSES_SP_DCLx NCURSES_CONST char *id, char **area) { - unsigned i; char *result = NULL; + int i, j; - T((T_CALLED("tgetstr(%s,%p)"), id, area)); - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_string(i, tp) { - const char *capname = ExtStrname(tp, i, strcodes); - if (!strncmp(id, capname, 2)) { - result = tp->Strings[i]; - TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); - /* setupterm forces canceled strings to null */ - if (VALID_STRING(result)) { - if (result == exit_attribute_mode - && FIX_SGR0 != 0) { - result = FIX_SGR0; - TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); - } - if (area != 0 - && *area != 0) { - (void) strcpy(*area, result); - result = *area; - *area += strlen(*area) + 1; - } + T((T_CALLED("tgetstr(%s,%p)"), id, (void *) area)); + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(id, STRING, TRUE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_string(i, tp) { + const char *capname = ExtStrname(tp, i, strcodes); + if (same_tcname(id, capname)) { + j = i; + break; + } + } + } +#endif + if (j >= 0) { + result = tp->Strings[j]; + TR(TRACE_DATABASE, ("found match : %s", _nc_visbuf(result))); + /* setupterm forces canceled strings to null */ + if (VALID_STRING(result)) { + if (result == exit_attribute_mode + && FIX_SGR0 != 0) { + result = FIX_SGR0; + TR(TRACE_DATABASE, ("altered to : %s", _nc_visbuf(result))); + } + if (area != 0 + && *area != 0) { + (void) strcpy(*area, result); + result = *area; + *area += strlen(*area) + 1; } - break; } } } returnPtr(result); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +tgetstr(NCURSES_CONST char *id, char **area) +{ + return NCURSES_SP_NAME(tgetstr) (CURRENT_SCREEN, id, area); +} +#endif + #if NO_LEAKS NCURSES_EXPORT(void) _nc_tgetent_leaks(void) diff --git a/contrib/ncurses/ncurses/tinfo/lib_termname.c b/contrib/ncurses/ncurses/tinfo/lib_termname.c index 713d0be8c360..e3f6827ee018 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_termname.c +++ b/contrib/ncurses/ncurses/tinfo/lib_termname.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2003,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -28,17 +28,31 @@ #include -MODULE_ID("$Id: lib_termname.c,v 1.8 2003/12/27 18:23:01 tom Exp $") +MODULE_ID("$Id: lib_termname.c,v 1.12 2009/10/24 21:56:58 tom Exp $") NCURSES_EXPORT(char *) -termname(void) +NCURSES_SP_NAME(termname) (NCURSES_SP_DCL0) { char *name = 0; - T((T_CALLED("termname()"))); + T((T_CALLED("termname(%p)"), (void *) SP_PARM)); +#if NCURSES_SP_FUNCS + if (TerminalOf(SP_PARM) != 0) { + name = TerminalOf(SP_PARM)->_termname; + } +#else if (cur_term != 0) name = cur_term->_termname; +#endif returnPtr(name); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(char *) +termname(void) +{ + return NCURSES_SP_NAME(termname) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_ti.c b/contrib/ncurses/ncurses/tinfo/lib_ti.c index df460f953ea7..e41234210c85 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_ti.c +++ b/contrib/ncurses/ncurses/tinfo/lib_ti.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2003 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,75 +29,159 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ #include -#include #include -MODULE_ID("$Id: lib_ti.c,v 1.23 2003/05/24 21:10:28 tom Exp $") +MODULE_ID("$Id: lib_ti.c,v 1.29 2010/01/23 17:57:43 tom Exp $") +#if 0 +static bool +same_name(const char *a, const char *b) +{ + fprintf(stderr, "compare(%s,%s)\n", a, b); + return !strcmp(a, b); +} +#else +#define same_name(a,b) !strcmp(a,b) +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tigetflag) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + int result = ABSENT_BOOLEAN; + int i, j; + + T((T_CALLED("tigetflag(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, BOOLEAN, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_boolean(i, tp) { + const char *capname = ExtBoolname(tp, i, boolnames); + if (same_name(str, capname)) { + j = i; + break; + } + } + } +#endif + if (j >= 0) { + /* note: setupterm forces invalid booleans to false */ + result = tp->Booleans[j]; + } + } + + returnCode(result); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetflag(NCURSES_CONST char *str) { - unsigned i; + return NCURSES_SP_NAME(tigetflag) (CURRENT_SCREEN, str); +} +#endif - T((T_CALLED("tigetflag(%s)"), str)); +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tigetnum) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + int i, j; + int result = CANCELLED_NUMERIC; /* Solaris returns a -1 on error */ - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_boolean(i, tp) { - const char *capname = ExtBoolname(tp, i, boolnames); - if (!strcmp(str, capname)) { - /* setupterm forces invalid booleans to false */ - returnCode(tp->Booleans[i]); + T((T_CALLED("tigetnum(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, NUMBER, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_number(i, tp) { + const char *capname = ExtNumname(tp, i, numnames); + if (same_name(str, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + if (VALID_NUMERIC(tp->Numbers[j])) + result = tp->Numbers[j]; + else + result = ABSENT_NUMERIC; + } } - returnCode(ABSENT_BOOLEAN); + returnCode(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) tigetnum(NCURSES_CONST char *str) { - unsigned i; + return NCURSES_SP_NAME(tigetnum) (CURRENT_SCREEN, str); +} +#endif - T((T_CALLED("tigetnum(%s)"), str)); +NCURSES_EXPORT(char *) +NCURSES_SP_NAME(tigetstr) (NCURSES_SP_DCLx NCURSES_CONST char *str) +{ + char *result = CANCELLED_STRING; + int i, j; - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_number(i, tp) { - const char *capname = ExtNumname(tp, i, numnames); - if (!strcmp(str, capname)) { - if (!VALID_NUMERIC(tp->Numbers[i])) - returnCode(ABSENT_NUMERIC); - returnCode(tp->Numbers[i]); + T((T_CALLED("tigetstr(%p, %s)"), (void *) SP_PARM, str)); + + if (HasTInfoTerminal(SP_PARM)) { + TERMTYPE *tp = &(TerminalOf(SP_PARM)->type); + struct name_table_entry const *entry_ptr; + + entry_ptr = _nc_find_type_entry(str, STRING, FALSE); + if (entry_ptr != 0) { + j = entry_ptr->nte_index; + } +#if NCURSES_XNAMES + else { + j = -1; + for_each_ext_string(i, tp) { + const char *capname = ExtStrname(tp, i, strnames); + if (same_name(str, capname)) { + j = i; + break; + } } } +#endif + if (j >= 0) { + /* note: setupterm forces cancelled strings to null */ + result = tp->Strings[j]; + } } - returnCode(CANCELLED_NUMERIC); /* Solaris returns a -1 instead */ + returnPtr(result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(char *) tigetstr(NCURSES_CONST char *str) { - unsigned i; - - T((T_CALLED("tigetstr(%s)"), str)); - - if (cur_term != 0) { - TERMTYPE *tp = &(cur_term->type); - for_each_string(i, tp) { - const char *capname = ExtStrname(tp, i, strnames); - if (!strcmp(str, capname)) { - /* setupterm forces cancelled strings to null */ - returnPtr(tp->Strings[i]); - } - } - } - - returnPtr(CANCELLED_STRING); + return NCURSES_SP_NAME(tigetstr) (CURRENT_SCREEN, str); } +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_tparm.c b/contrib/ncurses/ncurses/tinfo/lib_tparm.c index ba2a8404030e..7cd12f7f6845 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_tparm.c +++ b/contrib/ncurses/ncurses/tinfo/lib_tparm.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,10 +40,9 @@ #include #include -#include #include -MODULE_ID("$Id: lib_tparm.c,v 1.76 2008/08/16 19:22:55 tom Exp $") +MODULE_ID("$Id: lib_tparm.c,v 1.82 2011/01/15 22:19:12 tom Exp $") /* * char * @@ -140,7 +139,7 @@ save_text(const char *fmt, const char *s, int len) { size_t s_len = strlen(s); if (len > (int) s_len) - s_len = len; + s_len = (size_t) len; get_space(s_len + 1); @@ -451,12 +450,13 @@ _nc_tparm_analyze(const char *string, char *p_is_s[NUM_PARM], int *popcount) } static NCURSES_INLINE char * -tparam_internal(const char *string, va_list ap) +tparam_internal(bool use_TPARM_ARG, const char *string, va_list ap) { char *p_is_s[NUM_PARM]; TPARM_ARG param[NUM_PARM]; - int popcount; + int popcount = 0; int number; + int num_args; int len; int level; int x, y; @@ -479,7 +479,13 @@ tparam_internal(const char *string, va_list ap) if (TPS(fmt_buff) == 0) return NULL; - for (i = 0; i < max(popcount, number); i++) { + if (number > NUM_PARM) + number = NUM_PARM; + if (popcount > NUM_PARM) + popcount = NUM_PARM; + num_args = max(popcount, number); + + for (i = 0; i < num_args; i++) { /* * A few caps (such as plab_norm) have string-valued parms. * We'll have to assume that the caller knows the difference, since @@ -489,8 +495,11 @@ tparam_internal(const char *string, va_list ap) */ if (p_is_s[i] != 0) { p_is_s[i] = va_arg(ap, char *); - } else { + param[i] = 0; + } else if (use_TPARM_ARG) { param[i] = va_arg(ap, TPARM_ARG); + } else { + param[i] = (TPARM_ARG) va_arg(ap, int); } } @@ -508,7 +517,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } } #ifdef TRACE @@ -517,7 +526,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i] != 0) save_text(", %s", _nc_visbuf(p_is_s[i]), 0); else - save_number(", %d", param[i], 0); + save_number(", %d", (int) param[i], 0); } _tracef(T_CALLED("%s(%s%s)"), TPS(tname), _nc_visbuf(cp), TPS(out_buff)); TPS(out_used) = 0; @@ -564,7 +573,7 @@ tparam_internal(const char *string, va_list ap) if (p_is_s[i]) spush(p_is_s[i]); else - npush(param[i]); + npush((int) param[i]); } break; @@ -772,7 +781,7 @@ tparm_varargs(NCURSES_CONST char *string,...) #ifdef TRACE TPS(tname) = "tparm"; #endif /* TRACE */ - result = tparam_internal(string, ap); + result = tparam_internal(TRUE, string, ap); va_end(ap); return result; } @@ -793,3 +802,19 @@ tparm_proto(NCURSES_CONST char *string, return tparm_varargs(string, a1, a2, a3, a4, a5, a6, a7, a8, a9); } #endif /* NCURSES_TPARM_VARARGS */ + +NCURSES_EXPORT(char *) +tiparm(const char *string,...) +{ + va_list ap; + char *result; + + _nc_tparm_err = 0; + va_start(ap, string); +#ifdef TRACE + TPS(tname) = "tiparm"; +#endif /* TRACE */ + result = tparam_internal(FALSE, string, ap); + va_end(ap); + return result; +} diff --git a/contrib/ncurses/ncurses/tinfo/lib_tputs.c b/contrib/ncurses/ncurses/tinfo/lib_tputs.c index a8b7276895a5..dc70f3e0b0b8 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_tputs.c +++ b/contrib/ncurses/ncurses/tinfo/lib_tputs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -41,12 +42,16 @@ */ #include + +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #include -#include /* padding_baud_rate, xon_xoff */ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.66 2008/06/28 13:12:15 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.81 2010/12/20 00:42:50 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -69,63 +74,136 @@ _nc_set_no_padding(SCREEN *sp) } #endif -static int (*my_outch) (int c) = _nc_outch; +#if NCURSES_SP_FUNCS +#define SetOutCh(func) if (SP_PARM) SP_PARM->_outch = func; else _nc_prescreen._outch = func +#define GetOutCh() (SP_PARM ? SP_PARM->_outch : _nc_prescreen._outch) +#else +#define SetOutCh(func) static_outch = func +#define GetOutCh() static_outch +static NCURSES_SP_OUTC static_outch = NCURSES_SP_NAME(_nc_outch); +#endif NCURSES_EXPORT(int) -delay_output(int ms) +NCURSES_SP_NAME(delay_output) (NCURSES_SP_DCLx int ms) { - T((T_CALLED("delay_output(%d)"), ms)); + T((T_CALLED("delay_output(%p,%d)"), (void *) SP_PARM, ms)); + + if (!HasTInfoTerminal(SP_PARM)) + returnCode(ERR); if (no_pad_char) { - _nc_flush(); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); napms(ms); } else { + NCURSES_SP_OUTC my_outch = GetOutCh(); register int nullcount; nullcount = (ms * _nc_baudrate(ospeed)) / (BAUDBYTE * 1000); for (_nc_nulls_sent += nullcount; nullcount > 0; nullcount--) - my_outch(PC); - if (my_outch == _nc_outch) - _nc_flush(); + my_outch(NCURSES_SP_ARGx PC); + if (my_outch == NCURSES_SP_NAME(_nc_outch)) + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); } returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +delay_output(int ms) +{ + return NCURSES_SP_NAME(delay_output) (CURRENT_SCREEN, ms); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_DCL0) +{ + (void) fflush(NC_OUTPUT(SP_PARM)); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_flush(void) { - (void) fflush(NC_OUTPUT); + NCURSES_SP_NAME(_nc_flush) (CURRENT_SCREEN); } +#endif NCURSES_EXPORT(int) -_nc_outch(int ch) +NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) { + int rc = OK; + COUNT_OUTCHARS(1); - if (SP != 0 - && SP->_cleanup) { - char tmp = ch; + if (HasTInfoTerminal(SP_PARM) + && SP_PARM != 0 + && SP_PARM->_cleanup) { + char tmp = (char) ch; /* * POSIX says write() is safe in a signal handler, but the * buffered I/O is not. */ - write(fileno(NC_OUTPUT), &tmp, 1); + if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1) + rc = ERR; } else { - putc(ch, NC_OUTPUT); + if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF) + rc = ERR; } - return OK; + return rc; } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outch(int ch) +{ + return NCURSES_SP_NAME(_nc_outch) (CURRENT_SCREEN, ch); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(putp) (NCURSES_SP_DCLx const char *string) +{ + return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + string, 1, NCURSES_SP_NAME(_nc_outch)); +} + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_DCLx + const char *name GCC_UNUSED, + const char *string) +{ + int rc = ERR; + + if (string != 0) { + TPUTS_TRACE(name); + rc = NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx string); + } + return rc; +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) putp(const char *string) { - return tputs(string, 1, _nc_outch); + return NCURSES_SP_NAME(putp) (CURRENT_SCREEN, string); } NCURSES_EXPORT(int) -tputs(const char *string, int affcnt, int (*outc) (int)) +_nc_putp(const char *name, const char *string) { + return NCURSES_SP_NAME(_nc_putp) (CURRENT_SCREEN, name, string); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx + const char *string, + int affcnt, + NCURSES_SP_OUTC outc) +{ + NCURSES_SP_OUTC my_outch = GetOutCh(); bool always_delay; bool normal_delay; int number; @@ -137,7 +215,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) char addrbuf[32]; if (USE_TRACEF(TRACE_TPUTS)) { - if (outc == _nc_outch) + if (outc == NCURSES_SP_NAME(_nc_outch)) (void) strcpy(addrbuf, "_nc_outch"); else (void) sprintf(addrbuf, "%p", outc); @@ -152,10 +230,19 @@ tputs(const char *string, int affcnt, int (*outc) (int)) } #endif /* TRACE */ + if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM)) + return ERR; + if (!VALID_STRING(string)) return ERR; - if (cur_term == 0) { + if ( +#if NCURSES_SP_FUNCS + (SP_PARM != 0 && SP_PARM->_term == 0) +#else + cur_term == 0 +#endif + ) { always_delay = FALSE; normal_delay = TRUE; } else { @@ -164,7 +251,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) !xon_xoff && padding_baud_rate #if NCURSES_NO_PADDING - && !GetNoPadding(SP) + && !GetNoPadding(SP_PARM) #endif && (_nc_baudrate(ospeed) >= padding_baud_rate); } @@ -198,24 +285,24 @@ tputs(const char *string, int affcnt, int (*outc) (int)) } #endif /* BSD_TPUTS */ - my_outch = outc; /* redirect delay_output() */ + SetOutCh(outc); /* redirect delay_output() */ while (*string) { if (*string != '$') - (*outc) (*string); + (*outc) (NCURSES_SP_ARGx *string); else { string++; if (*string != '<') { - (*outc) ('$'); + (*outc) (NCURSES_SP_ARGx '$'); if (*string) - (*outc) (*string); + (*outc) (NCURSES_SP_ARGx *string); } else { bool mandatory; string++; if ((!isdigit(UChar(*string)) && *string != '.') || !strchr(string, '>')) { - (*outc) ('$'); - (*outc) ('<'); + (*outc) (NCURSES_SP_ARGx '$'); + (*outc) (NCURSES_SP_ARGx '<'); continue; } @@ -250,7 +337,7 @@ tputs(const char *string, int affcnt, int (*outc) (int)) && (always_delay || normal_delay || mandatory)) - delay_output(number / 10); + NCURSES_SP_NAME(delay_output) (NCURSES_SP_ARGx number / 10); } /* endelse (*string == '<') */ } /* endelse (*string == '$') */ @@ -270,6 +357,25 @@ tputs(const char *string, int affcnt, int (*outc) (int)) delay_output(trailpad / 10); #endif /* BSD_TPUTS */ - my_outch = _nc_outch; + SetOutCh(my_outch); return OK; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_outc_wrapper(SCREEN *sp, int c) +{ + if (0 == sp) { + return (ERR); + } else { + return sp->jump(c); + } +} + +NCURSES_EXPORT(int) +tputs(const char *string, int affcnt, int (*outc) (int)) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx string, affcnt, _nc_outc_wrapper); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c index a2b38a3327f1..663a06898090 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c +++ b/contrib/ncurses/ncurses/tinfo/lib_ttyflags.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,159 +36,246 @@ */ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_ttyflags.c,v 1.18 2008/08/03 22:10:44 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_ttyflags.c,v 1.27 2010/12/25 23:43:58 tom Exp $") NCURSES_EXPORT(int) -_nc_get_tty_mode(TTY * buf) +NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; - if (buf == 0) { + if (buf == 0 || SP_PARM == 0) { result = ERR; } else { - if (cur_term == 0) { + TERMINAL *termp = TerminalOf(SP_PARM); + + if (0 == termp) { result = ERR; } else { +#ifdef USE_TERM_DRIVER + result = CallDriver_2(SP_PARM, sgmode, FALSE, buf); +#else for (;;) { - if (GET_TTY(cur_term->Filedes, buf) != 0) { + if (GET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; result = ERR; } break; } +#endif } if (result == ERR) memset(buf, 0, sizeof(*buf)); TR(TRACE_BITS, ("_nc_get_tty_mode(%d): %s", - cur_term ? cur_term->Filedes : -1, + termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -_nc_set_tty_mode(TTY * buf) +_nc_get_tty_mode(TTY * buf) +{ + return NCURSES_SP_NAME(_nc_get_tty_mode) (CURRENT_SCREEN, buf); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_DCLx TTY * buf) { int result = OK; - if (buf == 0) { + if (buf == 0 || SP_PARM == 0) { result = ERR; } else { - if (cur_term == 0) { + TERMINAL *termp = TerminalOf(SP_PARM); + + if (0 == termp) { result = ERR; } else { +#ifdef USE_TERM_DRIVER + result = CallDriver_2(SP_PARM, sgmode, TRUE, buf); +#else for (;;) { - if (SET_TTY(cur_term->Filedes, buf) != 0) { + if (SET_TTY(termp->Filedes, buf) != 0) { if (errno == EINTR) continue; - if ((errno == ENOTTY) && (SP != 0)) - SP->_notty = TRUE; + if ((errno == ENOTTY) && (SP_PARM != 0)) + SP_PARM->_notty = TRUE; result = ERR; } break; } +#endif } TR(TRACE_BITS, ("_nc_set_tty_mode(%d): %s", - cur_term ? cur_term->Filedes : -1, + termp ? termp->Filedes : -1, _nc_trace_ttymode(buf))); } return (result); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -def_shell_mode(void) +_nc_set_tty_mode(TTY * buf) +{ + return NCURSES_SP_NAME(_nc_set_tty_mode) (CURRENT_SCREEN, buf); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_DCL0) { int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_shell_mode()"))); + T((T_CALLED("def_shell_mode(%p)"), (void *) SP_PARM)); - if (cur_term != 0) { + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, FALSE, TRUE); +#else /* * If XTABS was on, remove the tab and backtab capabilities. */ - if (_nc_get_tty_mode(&cur_term->Ottyb) == OK) { + if (_nc_get_tty_mode(&termp->Ottyb) == OK) { #ifdef TERMIOS - if (cur_term->Ottyb.c_oflag & OFLAGS_TABS) + if (termp->Ottyb.c_oflag & OFLAGS_TABS) tab = back_tab = NULL; #else - if (cur_term->Ottyb.sg_flags & XTABS) + if (termp->Ottyb.sg_flags & XTABS) tab = back_tab = NULL; #endif rc = OK; } +#endif } returnCode(rc); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) -def_prog_mode(void) +def_shell_mode(void) +{ + return NCURSES_SP_NAME(def_shell_mode) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_DCL0) { int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); - T((T_CALLED("def_prog_mode()"))); + T((T_CALLED("def_prog_mode(%p)"), (void *) SP_PARM)); - if (cur_term != 0) { + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, TRUE, TRUE); +#else /* * Turn off the XTABS bit in the tty structure if it was on. */ - if (_nc_get_tty_mode(&cur_term->Nttyb) == OK) { + if (_nc_get_tty_mode(&termp->Nttyb) == OK) { #ifdef TERMIOS - cur_term->Nttyb.c_oflag &= ~OFLAGS_TABS; + termp->Nttyb.c_oflag &= (unsigned) (~OFLAGS_TABS); #else - cur_term->Nttyb.sg_flags &= ~XTABS; + termp->Nttyb.sg_flags &= (unsigned) (~XTABS); #endif rc = OK; } +#endif } returnCode(rc); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +def_prog_mode(void) +{ + return NCURSES_SP_NAME(def_prog_mode) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_DCL0) +{ + int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); + + T((T_CALLED("reset_prog_mode(%p)"), (void *) SP_PARM)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, TRUE, FALSE); +#else + if (_nc_set_tty_mode(&termp->Nttyb) == OK) { + if (SP_PARM) { + if (SP_PARM->_keypad_on) + _nc_keypad(SP_PARM, TRUE); + NC_BUFFERED(SP_PARM, TRUE); + } + rc = OK; + } +#endif + } + returnCode(rc); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_prog_mode(void) { - T((T_CALLED("reset_prog_mode()"))); + return NCURSES_SP_NAME(reset_prog_mode) (CURRENT_SCREEN); +} +#endif - if (cur_term != 0) { - if (_nc_set_tty_mode(&cur_term->Nttyb) == OK) { - if (SP) { - if (SP->_keypad_on) - _nc_keypad(SP, TRUE); - NC_BUFFERED(TRUE); - } - returnCode(OK); +NCURSES_EXPORT(int) +NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_DCL0) +{ + int rc = ERR; + TERMINAL *termp = TerminalOf(SP_PARM); + + T((T_CALLED("reset_shell_mode(%p)"), (void *) SP_PARM)); + + if (termp != 0) { +#ifdef USE_TERM_DRIVER + rc = CallDriver_2(SP_PARM, mode, FALSE, FALSE); +#else + if (SP_PARM) { + _nc_keypad(SP_PARM, FALSE); + _nc_flush(); + NC_BUFFERED(SP_PARM, FALSE); } + rc = _nc_set_tty_mode(&termp->Ottyb); +#endif } - returnCode(ERR); + returnCode(rc); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) reset_shell_mode(void) { - T((T_CALLED("reset_shell_mode()"))); - - if (cur_term != 0) { - if (SP) { - _nc_keypad(SP, FALSE); - _nc_flush(); - NC_BUFFERED(FALSE); - } - returnCode(_nc_set_tty_mode(&cur_term->Ottyb)); - } - returnCode(ERR); + return NCURSES_SP_NAME(reset_shell_mode) (CURRENT_SCREEN); } +#endif static TTY * -saved_tty(void) +saved_tty(NCURSES_SP_DCL0) { TTY *result = 0; - if (SP != 0) { - result = &(SP->_saved_tty); + if (SP_PARM != 0) { + result = (TTY *) & (SP_PARM->_saved_tty); } else { if (_nc_prescreen.saved_tty == 0) { _nc_prescreen.saved_tty = typeCalloc(TTY, 1); @@ -204,17 +291,31 @@ saved_tty(void) */ NCURSES_EXPORT(int) -savetty(void) +NCURSES_SP_NAME(savetty) (NCURSES_SP_DCL0) { - T((T_CALLED("savetty()"))); - - returnCode(_nc_get_tty_mode(saved_tty())); + T((T_CALLED("savetty(%p)"), (void *) SP_PARM)); + returnCode(NCURSES_SP_NAME(_nc_get_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +savetty(void) +{ + return NCURSES_SP_NAME(savetty) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(resetty) (NCURSES_SP_DCL0) +{ + T((T_CALLED("resetty(%p)"), (void *) SP_PARM)); + returnCode(NCURSES_SP_NAME(_nc_set_tty_mode) (NCURSES_SP_ARGx saved_tty(NCURSES_SP_ARG))); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) resetty(void) { - T((T_CALLED("resetty()"))); - - returnCode(_nc_set_tty_mode(saved_tty())); + return NCURSES_SP_NAME(resetty) (CURRENT_SCREEN); } +#endif diff --git a/contrib/ncurses/ncurses/tinfo/make_hash.c b/contrib/ncurses/ncurses/tinfo/make_hash.c new file mode 100644 index 000000000000..15c281def50c --- /dev/null +++ b/contrib/ncurses/ncurses/tinfo/make_hash.c @@ -0,0 +1,294 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Zeyd M. Ben-Halim 1992,1995 * + * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + ****************************************************************************/ + +/* + * make_hash.c --- build-time program for constructing comp_captab.c + * + */ + +#include + +#include +#include + +#include + +MODULE_ID("$Id: make_hash.c,v 1.3 2010/05/22 18:02:50 tom Exp $") + +/* + * _nc_make_hash_table() + * + * Takes the entries in table[] and hashes them into hash_table[] + * by name. There are CAPTABSIZE entries in table[] and HASHTABSIZE + * slots in hash_table[]. + * + */ + +#undef MODULE_ID +#define MODULE_ID(id) /*nothing */ +#include + +/* + * int hash_function(string) + * + * Computes the hashing function on the given string. + * + * The current hash function is the sum of each consectutive pair + * of characters, taken as two-byte integers, mod HASHTABSIZE. + * + */ + +static int +hash_function(const char *string) +{ + long sum = 0; + + while (*string) { + sum += (long) (*string + (*(string + 1) << 8)); + string++; + } + + return (int) (sum % HASHTABSIZE); +} + +static void +_nc_make_hash_table(struct name_table_entry *table, + HashValue * hash_table) +{ + short i; + int hashvalue; + int collisions = 0; + + for (i = 0; i < HASHTABSIZE; i++) { + hash_table[i] = -1; + } + for (i = 0; i < CAPTABSIZE; i++) { + hashvalue = hash_function(table[i].nte_name); + + if (hash_table[hashvalue] >= 0) + collisions++; + + if (hash_table[hashvalue] != 0) + table[i].nte_link = hash_table[hashvalue]; + hash_table[hashvalue] = i; + } + + printf("/* %d collisions out of %d entries */\n", collisions, CAPTABSIZE); +} + +/* + * This filter reads from standard input a list of tab-delimited columns, + * (e.g., from Caps.filtered) computes the hash-value of a specified column and + * writes the hashed tables to standard output. + * + * By compiling the hash table at build time, we're able to make the entire + * set of terminfo and termcap tables readonly (and also provide some runtime + * performance enhancement). + */ + +#define MAX_COLUMNS BUFSIZ /* this _has_ to be worst-case */ + +static char ** +parse_columns(char *buffer) +{ + static char **list; + + int col = 0; + + if (list == 0 && (list = typeCalloc(char *, MAX_COLUMNS)) == 0) + return (0); + + if (*buffer != '#') { + while (*buffer != '\0') { + char *s; + for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++) + /*EMPTY */ ; + if (s != buffer) { + char mark = *s; + *s = '\0'; + if ((s - buffer) > 1 + && (*buffer == '"') + && (s[-1] == '"')) { /* strip the quotes */ + assert(s > buffer + 1); + s[-1] = '\0'; + buffer++; + } + list[col] = buffer; + col++; + if (mark == '\0') + break; + while (*++s && isspace(UChar(*s))) + /*EMPTY */ ; + buffer = s; + } else + break; + } + } + return col ? list : 0; +} + +int +main(int argc, char **argv) +{ + struct name_table_entry *name_table = typeCalloc(struct + name_table_entry, CAPTABSIZE); + HashValue *hash_table = typeCalloc(HashValue, HASHTABSIZE); + const char *root_name = ""; + int column = 0; + int bigstring = 0; + int n; + char buffer[BUFSIZ]; + + static const char *typenames[] = + {"BOOLEAN", "NUMBER", "STRING"}; + + short BoolCount = 0; + short NumCount = 0; + short StrCount = 0; + + /* The first argument is the column-number (starting with 0). + * The second is the root name of the tables to generate. + */ + if (argc <= 3 + || (column = atoi(argv[1])) <= 0 + || (column >= MAX_COLUMNS) + || *(root_name = argv[2]) == 0 + || (bigstring = atoi(argv[3])) < 0 + || name_table == 0 + || hash_table == 0) { + fprintf(stderr, "usage: make_hash column root_name bigstring\n"); + exit(EXIT_FAILURE); + } + + /* + * Read the table into our arrays. + */ + for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) { + char **list, *nlp = strchr(buffer, '\n'); + if (nlp) + *nlp = '\0'; + list = parse_columns(buffer); + if (list == 0) /* blank or comment */ + continue; + name_table[n].nte_link = -1; /* end-of-hash */ + name_table[n].nte_name = strdup(list[column]); + if (!strcmp(list[2], "bool")) { + name_table[n].nte_type = BOOLEAN; + name_table[n].nte_index = BoolCount++; + } else if (!strcmp(list[2], "num")) { + name_table[n].nte_type = NUMBER; + name_table[n].nte_index = NumCount++; + } else if (!strcmp(list[2], "str")) { + name_table[n].nte_type = STRING; + name_table[n].nte_index = StrCount++; + } else { + fprintf(stderr, "Unknown type: %s\n", list[2]); + exit(EXIT_FAILURE); + } + n++; + } + _nc_make_hash_table(name_table, hash_table); + + /* + * Write the compiled tables to standard output + */ + if (bigstring) { + int len = 0; + int nxt; + + printf("static const char %s_names_text[] = \\\n", root_name); + for (n = 0; n < CAPTABSIZE; n++) { + nxt = (int) strlen(name_table[n].nte_name) + 5; + if (nxt + len > 72) { + printf("\\\n"); + len = 0; + } + printf("\"%s\\0\" ", name_table[n].nte_name); + len += nxt; + } + printf(";\n\n"); + + len = 0; + printf("static name_table_data const %s_names_data[] =\n", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + printf("\t{ %15d,\t%10s,\t%3d, %3d }%c\n", + len, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + len += (int) strlen(name_table[n].nte_name) + 1; + } + printf("};\n\n"); + printf("static struct name_table_entry *_nc_%s_table = 0;\n\n", root_name); + } else { + + printf("static struct name_table_entry %s _nc_%s_table[] =\n", + bigstring ? "" : "const", + root_name); + printf("{\n"); + for (n = 0; n < CAPTABSIZE; n++) { + sprintf(buffer, "\"%s\"", + name_table[n].nte_name); + printf("\t{ %15s,\t%10s,\t%3d, %3d }%c\n", + buffer, + typenames[name_table[n].nte_type], + name_table[n].nte_index, + name_table[n].nte_link, + n < CAPTABSIZE - 1 ? ',' : ' '); + } + printf("};\n\n"); + } + + printf("static const HashValue _nc_%s_hash_table[%d] =\n", + root_name, + HASHTABSIZE + 1); + printf("{\n"); + for (n = 0; n < HASHTABSIZE; n++) { + printf("\t%3d,\n", hash_table[n]); + } + printf("\t0\t/* base-of-table */\n"); + printf("};\n\n"); + + printf("#if (BOOLCOUNT!=%d)||(NUMCOUNT!=%d)||(STRCOUNT!=%d)\n", + BoolCount, NumCount, StrCount); + printf("#error\t--> term.h and comp_captab.c disagree about the <--\n"); + printf("#error\t--> numbers of booleans, numbers and/or strings <--\n"); + printf("#endif\n\n"); + + free(hash_table); + return EXIT_SUCCESS; +} diff --git a/contrib/ncurses/ncurses/tinfo/make_keys.c b/contrib/ncurses/ncurses/tinfo/make_keys.c index c084f87fb943..a7854e3fe604 100644 --- a/contrib/ncurses/ncurses/tinfo/make_keys.c +++ b/contrib/ncurses/ncurses/tinfo/make_keys.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -37,18 +37,18 @@ */ #define USE_TERMLIB 1 -#include +#include -MODULE_ID("$Id: make_keys.c,v 1.14 2008/08/03 21:57:22 tom Exp $") +MODULE_ID("$Id: make_keys.c,v 1.19 2010/06/05 22:08:00 tom Exp $") #include -#define UNKNOWN (SIZEOF(strnames) + SIZEOF(strfnames)) +#define UNKNOWN (unsigned) (SIZEOF(strnames) + SIZEOF(strfnames)) -static size_t +static unsigned lookup(const char *name) { - size_t n; + unsigned n; bool found = FALSE; for (n = 0; strnames[n] != 0; n++) { if (!strcmp(name, strnames[n])) { @@ -73,7 +73,7 @@ make_keys(FILE *ifp, FILE *ofp) char buffer[BUFSIZ]; char from[256]; char to[256]; - int maxlen = 16; + unsigned maxlen = 16; int scanned; while (fgets(buffer, sizeof(buffer), ifp) != 0) { @@ -85,14 +85,14 @@ make_keys(FILE *ifp, FILE *ofp) scanned = sscanf(buffer, "%255s %255s", to, from); if (scanned == 2) { - int code = lookup(from); + unsigned code = lookup(from); if (code == UNKNOWN) continue; - if ((int) strlen(from) > maxlen) - maxlen = strlen(from); - fprintf(ofp, "\t{ %4d, %-*.*s },\t/* %s */\n", + if (strlen(from) > maxlen) + maxlen = (unsigned) strlen(from); + fprintf(ofp, "\t{ %4u, %-*.*s },\t/* %s */\n", code, - maxlen, maxlen, + (int) maxlen, (int) maxlen, to, from); } diff --git a/contrib/ncurses/ncurses/tinfo/name_match.c b/contrib/ncurses/ncurses/tinfo/name_match.c index d576901fa2e9..a9ac64278888 100644 --- a/contrib/ncurses/ncurses/tinfo/name_match.c +++ b/contrib/ncurses/ncurses/tinfo/name_match.c @@ -31,10 +31,9 @@ ****************************************************************************/ #include -#include #include -MODULE_ID("$Id: name_match.c,v 1.17 2008/08/03 19:49:33 tom Exp $") +MODULE_ID("$Id: name_match.c,v 1.18 2008/11/16 00:19:59 juergen Exp $") /* * _nc_first_name(char *names) diff --git a/contrib/ncurses/ncurses/tinfo/parse_entry.c b/contrib/ncurses/ncurses/tinfo/parse_entry.c index cf7a5f409d7c..ddbc25204fec 100644 --- a/contrib/ncurses/ncurses/tinfo/parse_entry.c +++ b/contrib/ncurses/ncurses/tinfo/parse_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,9 +46,8 @@ #include #include -#include -MODULE_ID("$Id: parse_entry.c,v 1.69 2008/08/16 21:52:03 tom Exp $") +MODULE_ID("$Id: parse_entry.c,v 1.75 2010/05/01 19:35:09 tom Exp $") #ifdef LINT static short const parametrized[] = @@ -84,13 +83,13 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) case NUMBER: first = tp->ext_Booleans; last = tp->ext_Numbers + first; - offset = tp->ext_Booleans + tp->ext_Numbers; + offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); tindex = tp->num_Numbers; break; case STRING: - first = tp->ext_Booleans + tp->ext_Numbers; + first = (unsigned) (tp->ext_Booleans + tp->ext_Numbers); last = tp->ext_Strings + first; - offset = tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings; + offset = (unsigned) (tp->ext_Booleans + tp->ext_Numbers + tp->ext_Strings); tindex = tp->num_Strings; break; case CANCEL: @@ -137,27 +136,31 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) break; } } + +#define for_each_value(max) \ + for (last = (unsigned) (max - 1); last > tindex; last--) + if (!found) { switch (token_type) { case BOOLEAN: - tp->ext_Booleans += 1; - tp->num_Booleans += 1; + tp->ext_Booleans++; + tp->num_Booleans++; tp->Booleans = typeRealloc(NCURSES_SBOOL, tp->num_Booleans, tp->Booleans); - for (last = tp->num_Booleans - 1; last > tindex; last--) + for_each_value(tp->num_Booleans) tp->Booleans[last] = tp->Booleans[last - 1]; break; case NUMBER: - tp->ext_Numbers += 1; - tp->num_Numbers += 1; + tp->ext_Numbers++; + tp->num_Numbers++; tp->Numbers = typeRealloc(short, tp->num_Numbers, tp->Numbers); - for (last = tp->num_Numbers - 1; last > tindex; last--) + for_each_value(tp->num_Numbers) tp->Numbers[last] = tp->Numbers[last - 1]; break; case STRING: - tp->ext_Strings += 1; - tp->num_Strings += 1; + tp->ext_Strings++; + tp->num_Strings++; tp->Strings = typeRealloc(char *, tp->num_Strings, tp->Strings); - for (last = tp->num_Strings - 1; last > tindex; last--) + for_each_value(tp->num_Strings) tp->Strings[last] = tp->Strings[last - 1]; break; } @@ -170,7 +173,7 @@ _nc_extend_names(ENTRY * entryp, char *name, int token_type) temp.nte_name = tp->ext_Names[offset]; temp.nte_type = token_type; - temp.nte_index = tindex; + temp.nte_index = (short) tindex; temp.nte_link = -1; return &temp; @@ -379,16 +382,14 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) && !strcmp("ma", _nc_curr_token.tk_name)) { /* tell max_attributes from arrow_key_map */ entry_ptr = _nc_find_type_entry("ma", NUMBER, - _nc_get_table(_nc_syntax - != 0)); + _nc_syntax != 0); assert(entry_ptr != 0); } else if (token_type == STRING && !strcmp("MT", _nc_curr_token.tk_name)) { /* map terminfo's string MT to MT */ entry_ptr = _nc_find_type_entry("MT", STRING, - _nc_get_table(_nc_syntax - != 0)); + _nc_syntax != 0); assert(entry_ptr != 0); } else if (token_type == BOOLEAN @@ -444,7 +445,7 @@ _nc_parse_entry(struct entry *entryp, int literal, bool silent) case NUMBER: entryp->tterm.Numbers[entry_ptr->nte_index] = - _nc_curr_token.tk_valnumber; + (short) _nc_curr_token.tk_valnumber; break; case STRING: @@ -510,9 +511,9 @@ NCURSES_EXPORT(int) _nc_capcmp(const char *s, const char *t) /* compare two string capabilities, stripping out padding */ { - if (!s && !t) + if (!VALID_STRING(s) && !VALID_STRING(t)) return (0); - else if (!s || !t) + else if (!VALID_STRING(s) || !VALID_STRING(t)) return (1); for (;;) { @@ -667,7 +668,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) else if (PRESENT(backspace_if_not_bs)) cursor_left = backspace_if_not_bs; } - /* vi doesn't use "do", but it does seems to use nl (or '\n') instead */ + /* vi doesn't use "do", but it does seem to use nl (or '\n') instead */ if (WANTED(cursor_down)) { if (PRESENT(linefeed_if_not_lf)) cursor_down = linefeed_if_not_lf; @@ -772,7 +773,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) * isn't from mytinfo... */ if (PRESENT(other_non_function_keys)) { - char *base = other_non_function_keys; + char *base; char *bp, *cp, *dp; struct name_table_entry const *from_ptr; struct name_table_entry const *to_ptr; @@ -788,7 +789,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) for (base = other_non_function_keys; (cp = strchr(base, ',')) != 0; base = cp + 1) { - size_t len = cp - base; + size_t len = (unsigned) (cp - base); for (ap = ko_xlate; ap->from; ap++) { if (len == strlen(ap->from) @@ -840,7 +841,7 @@ postprocess_termcap(TERMTYPE *tp, bool has_base) } else *dp++ = *bp; } - *dp++ = '\0'; + *dp = '\0'; tp->Strings[to_ptr->nte_index] = _nc_save_str(buf2); } diff --git a/contrib/ncurses/ncurses/tinfo/read_entry.c b/contrib/ncurses/ncurses/tinfo/read_entry.c index b4ea61ca194e..e38b9cbe49d8 100644 --- a/contrib/ncurses/ncurses/tinfo/read_entry.c +++ b/contrib/ncurses/ncurses/tinfo/read_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,9 +40,8 @@ #include #include -#include -MODULE_ID("$Id: read_entry.c,v 1.102 2008/08/03 19:33:04 tom Exp $") +MODULE_ID("$Id: read_entry.c,v 1.108 2011/02/26 15:36:06 tom Exp $") #define TYPE_CALLOC(type,elts) typeCalloc(type, (unsigned)(elts)) @@ -57,7 +56,7 @@ convert_shorts(char *buf, short *Numbers, int count) else if (IS_NEG2(buf + 2 * i)) Numbers[i] = CANCELLED_NUMERIC; else - Numbers[i] = LOW_MSB(buf + 2 * i); + Numbers[i] = (short) LOW_MSB(buf + 2 * i); TR(TRACE_DATABASE, ("get Numbers[%d]=%d", i, Numbers[i])); } } @@ -99,9 +98,9 @@ fake_read(char *src, int *offset, int limit, char *dst, unsigned want) if (have > 0) { if ((int) want > have) - want = have; + want = (unsigned) have; memcpy(dst, src + *offset, want); - *offset += want; + *offset += (int) want; } else { want = 0; } @@ -155,7 +154,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) return (TGETENT_NO); } - want = str_size + name_size + 1; + want = (unsigned) (str_size + name_size + 1); if (str_size) { /* try to allocate space for the string table */ if (str_count * 2 >= (int) sizeof(buf) @@ -173,14 +172,14 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) want = min(MAX_NAME_SIZE, (unsigned) name_size); ptr->str_table = string_table; ptr->term_names = string_table; - if ((have = Read(ptr->term_names, want)) != want) { + if ((have = (unsigned) Read(ptr->term_names, want)) != want) { memset(ptr->term_names + have, 0, want - have); } ptr->term_names[want] = '\0'; string_table += (want + 1); if (have > MAX_NAME_SIZE) - offset = (have - MAX_NAME_SIZE); + offset = (int) (have - MAX_NAME_SIZE); /* grab the booleans */ if ((ptr->Booleans = TYPE_CALLOC(NCURSES_SBOOL, @@ -234,7 +233,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) int ext_str_count = LOW_MSB(buf + 4); int ext_str_size = LOW_MSB(buf + 6); int ext_str_limit = LOW_MSB(buf + 8); - unsigned need = (ext_bool_count + ext_num_count + ext_str_count); + unsigned need = (unsigned) (ext_bool_count + ext_num_count + ext_str_count); int base = 0; if (need >= sizeof(buf) @@ -247,9 +246,9 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) || ext_str_limit < 0) return (TGETENT_NO); - ptr->num_Booleans = BOOLCOUNT + ext_bool_count; - ptr->num_Numbers = NUMCOUNT + ext_num_count; - ptr->num_Strings = STRCOUNT + ext_str_count; + ptr->num_Booleans = UShort(BOOLCOUNT + ext_bool_count); + ptr->num_Numbers = UShort(NUMCOUNT + ext_num_count); + ptr->num_Strings = UShort(STRCOUNT + ext_str_count); ptr->Booleans = typeRealloc(NCURSES_SBOOL, ptr->num_Booleans, ptr->Booleans); ptr->Numbers = typeRealloc(short, ptr->num_Numbers, ptr->Numbers); @@ -261,7 +260,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-booleans @%d", ext_bool_count, offset)); - if ((ptr->ext_Booleans = ext_bool_count) != 0) { + if ((ptr->ext_Booleans = UShort(ext_bool_count)) != 0) { if (Read(ptr->Booleans + BOOLCOUNT, (unsigned) ext_bool_count) != ext_bool_count) return (TGETENT_NO); @@ -270,7 +269,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ %d extended-numbers @%d", ext_num_count, offset)); - if ((ptr->ext_Numbers = ext_num_count) != 0) { + if ((ptr->ext_Numbers = UShort(ext_num_count)) != 0) { if (!read_shorts(buf, ext_num_count)) return (TGETENT_NO); TR(TRACE_DATABASE, ("Before converting extended-numbers")); @@ -279,21 +278,22 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) TR(TRACE_DATABASE, ("READ extended-offsets @%d", offset)); if ((ext_str_count || need) - && !read_shorts(buf, ext_str_count + need)) + && !read_shorts(buf, ext_str_count + (int) need)) return (TGETENT_NO); TR(TRACE_DATABASE, ("READ %d bytes of extended-strings @%d", ext_str_limit, offset)); if (ext_str_limit) { - if ((ptr->ext_str_table = typeMalloc(char, ext_str_limit)) == 0) - return (TGETENT_NO); + ptr->ext_str_table = typeMalloc(char, (size_t) ext_str_limit); + if (ptr->ext_str_table == 0) + return (TGETENT_NO); if (Read(ptr->ext_str_table, (unsigned) ext_str_limit) != ext_str_limit) return (TGETENT_NO); TR(TRACE_DATABASE, ("first extended-string is %s", _nc_visbuf(ptr->ext_str_table))); } - if ((ptr->ext_Strings = ext_str_count) != 0) { + if ((ptr->ext_Strings = UShort(ext_str_count)) != 0) { TR(TRACE_DATABASE, ("Before computing extended-string capabilities str_count=%d, ext_str_count=%d", str_count, ext_str_count)); @@ -305,7 +305,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) _nc_visbuf(ptr->Strings[i + str_count]))); ptr->Strings[i + STRCOUNT] = ptr->Strings[i + str_count]; if (VALID_STRING(ptr->Strings[i + STRCOUNT])) - base += (strlen(ptr->Strings[i + STRCOUNT]) + 1); + base += (int) (strlen(ptr->Strings[i + STRCOUNT]) + 1); TR(TRACE_DATABASE, ("... to [%d] %s", i + STRCOUNT, _nc_visbuf(ptr->Strings[i + STRCOUNT]))); @@ -314,7 +314,7 @@ _nc_read_termtype(TERMTYPE *ptr, char *buffer, int limit) if (need) { if (ext_str_count >= (MAX_ENTRY_SIZE * 2)) - return (TGETENT_NO); + return (TGETENT_NO); if ((ptr->ext_Names = TYPE_CALLOC(char *, need)) == 0) return (TGETENT_NO); TR(TRACE_DATABASE, @@ -364,16 +364,18 @@ NCURSES_EXPORT(int) _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) /* return 1 if read, 0 if not found or garbled */ { - int code, fd = -1; + FILE *fp = 0; + int code; int limit; char buffer[MAX_ENTRY_SIZE + 1]; if (_nc_access(filename, R_OK) < 0 - || (fd = open(filename, O_RDONLY | O_BINARY)) < 0) { + || (fp = fopen(filename, "rb")) == 0) { T(("cannot open terminfo %s (errno=%d)", filename, errno)); code = TGETENT_NO; } else { - if ((limit = read(fd, buffer, sizeof(buffer))) > 0) { + if ((limit = (int) fread(buffer, sizeof(char), sizeof(buffer), fp)) + > 0) { T(("read terminfo %s", filename)); if ((code = _nc_read_termtype(ptr, buffer, limit)) == TGETENT_NO) { @@ -382,7 +384,7 @@ _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) } else { code = TGETENT_NO; } - close(fd); + fclose(fp); } return (code); @@ -404,26 +406,22 @@ _nc_read_tic_entry(char *filename, /* * If we are looking in a directory, assume the entry is a file under that, * according to the normal rules. - * - * FIXME - add caseless-filename fixup. */ - if (_nc_is_dir_path(path)) { - unsigned need = 4 + strlen(path) + strlen(name); + unsigned need = (unsigned) (LEAF_LEN + 3 + strlen(path) + strlen(name)); + if (need <= limit) + (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); - if (need <= limit) { - (void) sprintf(filename, "%s/" LEAF_FMT "/%s", path, *name, name); - result = _nc_read_file_entry(filename, tp); - } - } + if (_nc_is_dir_path(path)) + result = _nc_read_file_entry(filename, tp); #if USE_HASHED_DB else { static const char suffix[] = DBM_SUFFIX; DB *capdbp; unsigned lens = sizeof(suffix) - 1; unsigned size = strlen(path); - unsigned need = lens + size; + unsigned test = lens + size; - if (need <= limit) { + if (test < limit) { if (size >= lens && !strcmp(path + size - lens, suffix)) (void) strcpy(filename, path); @@ -515,6 +513,7 @@ _nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp) { int code = TGETENT_NO; + sprintf(filename, "%.*s", PATH_MAX - 1, name); if (strlen(name) == 0 || strcmp(name, ".") == 0 || strcmp(name, "..") == 0 diff --git a/contrib/ncurses/ncurses/tinfo/read_termcap.c b/contrib/ncurses/ncurses/tinfo/read_termcap.c index d94d1a42466d..b39a5bebaa47 100644 --- a/contrib/ncurses/ncurses/tinfo/read_termcap.c +++ b/contrib/ncurses/ncurses/tinfo/read_termcap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -56,9 +56,8 @@ #include #include #include -#include -MODULE_ID("$Id: read_termcap.c,v 1.71 2006/07/29 12:06:51 tom Exp $") +MODULE_ID("$Id: read_termcap.c,v 1.74 2010/01/23 17:57:43 tom Exp $") #if !PURE_TERMINFO @@ -79,6 +78,15 @@ get_termpath(void) return result; } +/* + * Note: + * getcap(), cgetent(), etc., are BSD functions. A copy of those was added to + * this file in November 1995, derived from the BSD4.4 Lite sources. + * + * The initial adaptation uses 518 lines from that source. + * The current source (in 2009) uses 183 lines of BSD4.4 Lite (441 ignoring + * whitespace). + */ #if USE_GETCAP #if HAVE_BSD_CGETENT @@ -107,11 +115,7 @@ static int _nc_nfcmp(const char *, char *); * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgment: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * diff --git a/contrib/ncurses/ncurses/tinfo/setbuf.c b/contrib/ncurses/ncurses/tinfo/setbuf.c index ba910e8983a4..a2e2660c8664 100644 --- a/contrib/ncurses/ncurses/tinfo/setbuf.c +++ b/contrib/ncurses/ncurses/tinfo/setbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2003,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2008 * ****************************************************************************/ /* @@ -40,7 +42,7 @@ #include -MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") +MODULE_ID("$Id: setbuf.c,v 1.16 2010/08/28 21:08:31 tom Exp $") /* * If the output file descriptor is connected to a tty (the typical case) it @@ -98,11 +100,20 @@ MODULE_ID("$Id: setbuf.c,v 1.13 2007/05/12 19:04:02 tom Exp $") * buffer. So we disable this by default (there may yet be a workaround). */ NCURSES_EXPORT(void) -_nc_set_buffer(FILE *ofp, bool buffered) +NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_DCLx FILE *ofp, bool buffered) { + int Cols; + int Lines; + + if (0 == SP_PARM) + return; + + Cols = *(ptrCols(SP_PARM)); + Lines = *(ptrLines(SP_PARM)); + /* optional optimization hack -- do before any output to ofp */ #if HAVE_SETVBUF || HAVE_SETBUFFER - if (SP->_buffered != buffered) { + if (SP_PARM->_buffered != buffered) { unsigned buf_len; char *buf_ptr; @@ -114,11 +125,11 @@ _nc_set_buffer(FILE *ofp, bool buffered) setmode(ofp, O_BINARY); #endif if (buffered != 0) { - buf_len = min(LINES * (COLS + 6), 2800); - if ((buf_ptr = SP->_setbuf) == 0) { + buf_len = (unsigned) min(Lines * (Cols + 6), 2800); + if ((buf_ptr = SP_PARM->_setbuf) == 0) { if ((buf_ptr = typeMalloc(char, buf_len)) == NULL) return; - SP->_setbuf = buf_ptr; + SP_PARM->_setbuf = buf_ptr; /* Don't try to free this! */ } #if !USE_SETBUF_0 @@ -144,7 +155,15 @@ _nc_set_buffer(FILE *ofp, bool buffered) (void) setbuffer(ofp, buf_ptr, (int) buf_len); #endif - SP->_buffered = buffered; + SP_PARM->_buffered = buffered; } #endif /* HAVE_SETVBUF || HAVE_SETBUFFER */ } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_set_buffer(FILE *ofp, bool buffered) +{ + NCURSES_SP_NAME(_nc_set_buffer) (CURRENT_SCREEN, ofp, buffered); +} +#endif diff --git a/contrib/ncurses/ncurses/tinfo/tinfo_driver.c b/contrib/ncurses/ncurses/tinfo/tinfo_driver.c new file mode 100644 index 000000000000..5b3b55a4519e --- /dev/null +++ b/contrib/ncurses/ncurses/tinfo/tinfo_driver.c @@ -0,0 +1,1337 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer * + * * + ****************************************************************************/ + +#include +#define CUR ((TERMINAL*)TCB)->type. +#include + +#if HAVE_NANOSLEEP +#include +#if HAVE_SYS_TIME_H +#include /* needed for MacOS X DP3 */ +#endif +#endif + +#if HAVE_SIZECHANGE +# if !defined(sun) || !TERMIOS +# if HAVE_SYS_IOCTL_H +# include +# endif +# endif +#endif + +MODULE_ID("$Id: tinfo_driver.c,v 1.13 2010/12/20 01:47:09 tom Exp $") + +/* + * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, + * Solaris, IRIX) define TIOCGWINSZ and struct winsize. + */ +#ifdef TIOCGSIZE +# define IOCTL_WINSIZE TIOCGSIZE +# define STRUCT_WINSIZE struct ttysize +# define WINSIZE_ROWS(n) (int)n.ts_lines +# define WINSIZE_COLS(n) (int)n.ts_cols +#else +# ifdef TIOCGWINSZ +# define IOCTL_WINSIZE TIOCGWINSZ +# define STRUCT_WINSIZE struct winsize +# define WINSIZE_ROWS(n) (int)n.ws_row +# define WINSIZE_COLS(n) (int)n.ws_col +# endif +#endif + +/* + * These should be screen structure members. They need to be globals for + * historical reasons. So we assign them in start_color() and also in + * set_term()'s screen-switching logic. + */ +#if USE_REENTRANT +NCURSES_EXPORT(int) +NCURSES_PUBLIC_VAR(COLOR_PAIRS) (void) +{ + return CURRENT_SCREEN ? CURRENT_SCREEN->_pair_count : -1; +} +NCURSES_EXPORT(int) +NCURSES_PUBLIC_VAR(COLORS) (void) +{ + return CURRENT_SCREEN ? CURRENT_SCREEN->_color_count : -1; +} +#else +NCURSES_EXPORT_VAR(int) COLOR_PAIRS = 0; +NCURSES_EXPORT_VAR(int) COLORS = 0; +#endif + +#define TCBMAGIC NCDRV_MAGIC(NCDRV_TINFO) +#define AssertTCB() assert(TCB!=0 && TCB->magic==TCBMAGIC) +#define SetSP() assert(TCB->csp!=0); sp = TCB->csp + +/* + * This routine needs to do all the work to make curscr look + * like newscr. + */ +static int +drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + AssertTCB(); + return TINFO_DOUPDATE(TCB->csp); +} + +#define ret_error(code, fmt, arg) if (errret) {\ + *errret = code;\ + return(FALSE); \ + } else {\ + fprintf(stderr, fmt, arg);\ + exit(EXIT_FAILURE);\ + } + +#define ret_error0(code, msg) if (errret) {\ + *errret = code;\ + return(FALSE);\ + } else {\ + fprintf(stderr, msg);\ + exit(EXIT_FAILURE);\ + } + +static bool +drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret) +{ + bool result = FALSE; + int status; + TERMINAL *termp; + SCREEN *sp; + + assert(TCB != 0 && tname != 0); + termp = (TERMINAL *) TCB; + sp = TCB->csp; + TCB->magic = TCBMAGIC; + +#if (USE_DATABASE || USE_TERMCAP) + status = _nc_setup_tinfo(tname, &termp->type); +#else + status = TGETENT_NO; +#endif + + /* try fallback list if entry on disk */ + if (status != TGETENT_YES) { + const TERMTYPE *fallback = _nc_fallback(tname); + + if (fallback) { + termp->type = *fallback; + status = TGETENT_YES; + } + } + + if (status != TGETENT_YES) { + NCURSES_SP_NAME(del_curterm) (NCURSES_SP_ARGx termp); + if (status == TGETENT_ERR) { + ret_error0(status, "terminals database is inaccessible\n"); + } else if (status == TGETENT_NO) { + ret_error(status, "'%s': unknown terminal type.\n", tname); + } + } + result = TRUE; +#if !USE_REENTRANT + strncpy(ttytype, termp->type.term_names, NAMESIZE - 1); + ttytype[NAMESIZE - 1] = '\0'; +#endif + + if (command_character) + _nc_tinfo_cmdch(termp, *command_character); + + if (generic_type) { + ret_error(TGETENT_NO, "'%s': I need something more specific.\n", tname); + } + if (hard_copy) { + ret_error(TGETENT_YES, "'%s': I can't handle hardcopy terminals.\n", tname); + } + + return result; +} + +static int +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, bool beepFlag) +{ + SCREEN *sp; + int res = ERR; + + AssertTCB(); + SetSP(); + + /* FIXME: should make sure that we are not in altchar mode */ + if (beepFlag) { + if (bell) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); + NCURSES_SP_NAME(_nc_flush) (sp); + } else if (flash_screen) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "flash_screen", + flash_screen); + NCURSES_SP_NAME(_nc_flush) (sp); + } + } else { + if (flash_screen) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "flash_screen", + flash_screen); + NCURSES_SP_NAME(_nc_flush) (sp); + } else if (bell) { + res = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "bell", bell); + NCURSES_SP_NAME(_nc_flush) (sp); + } + } + return res; +} + +/* + * SVr4 curses is known to interchange color codes (1,4) and (3,6), possibly + * to maintain compatibility with a pre-ANSI scheme. The same scheme is + * also used in the FreeBSD syscons. + */ +static int +toggled_colors(int c) +{ + if (c < 16) { + static const int table[] = + {0, 4, 2, 6, 1, 5, 3, 7, + 8, 12, 10, 14, 9, 13, 11, 15}; + c = table[c]; + } + return c; +} + +static int +drv_print(TERMINAL_CONTROL_BLOCK * TCB, char *data, int len) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +#if NCURSES_EXT_FUNCS + return NCURSES_SP_NAME(mcprint) (TCB->csp, data, len); +#else + return ERR; +#endif +} + +static int +drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, int fg, int bg) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + if (sp != 0 && orig_pair && orig_colors && (initialize_pair != 0)) { +#if NCURSES_EXT_FUNCS + sp->_default_color = isDefaultColor(fg) || isDefaultColor(bg); + sp->_has_sgr_39_49 = (NCURSES_SP_NAME(tigetflag) (NCURSES_SP_ARGx + "AX") + == TRUE); + sp->_default_fg = isDefaultColor(fg) ? COLOR_DEFAULT : (fg & C_MASK); + sp->_default_bg = isDefaultColor(bg) ? COLOR_DEFAULT : (bg & C_MASK); + if (sp->_color_pairs != 0) { + bool save = sp->_default_color; + sp->_default_color = TRUE; + NCURSES_SP_NAME(init_pair) (NCURSES_SP_ARGx + 0, + (short)fg, + (short)bg); + sp->_default_color = save; + } +#endif + code = OK; + } + return (code); +} + +static void +drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + bool fore, + int color, + NCURSES_SP_OUTC outc) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (fore) { + if (set_a_foreground) { + TPUTS_TRACE("set_a_foreground"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_a_foreground, color), 1, outc); + } else { + TPUTS_TRACE("set_foreground"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_foreground, + toggled_colors(color)), 1, outc); + } + } else { + if (set_a_background) { + TPUTS_TRACE("set_a_background"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_a_background, color), 1, outc); + } else { + TPUTS_TRACE("set_background"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_background, + toggled_colors(color)), 1, outc); + } + } +} + +static bool +drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (orig_pair != 0) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_pair", orig_pair); + result = TRUE; + } + return result; +} + +static bool +drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (orig_colors != 0) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "orig_colors", orig_colors); + result = TRUE; + } + return result; +} + +static int +drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *linep, int *colp) +{ + SCREEN *sp; + bool useEnv = TRUE; + + AssertTCB(); + sp = TCB->csp; /* can be null here */ + + if (sp) { + useEnv = sp->_use_env; + } else + useEnv = _nc_prescreen.use_env; + + /* figure out the size of the screen */ + T(("screen size: terminfo lines = %d columns = %d", lines, columns)); + + *linep = (int) lines; + *colp = (int) columns; + + if (useEnv) { + int value; + +#ifdef __EMX__ + { + int screendata[2]; + _scrsize(screendata); + *colp = screendata[0]; + *linep = screendata[1]; + T(("EMX screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + } +#endif +#if HAVE_SIZECHANGE + /* try asking the OS */ + { + TERMINAL *termp = (TERMINAL *) TCB; + if (isatty(termp->Filedes)) { + STRUCT_WINSIZE size; + + errno = 0; + do { + if (ioctl(termp->Filedes, IOCTL_WINSIZE, &size) >= 0) { + *linep = ((sp != 0 && sp->_filtered) + ? 1 + : WINSIZE_ROWS(size)); + *colp = WINSIZE_COLS(size); + T(("SYS screen size: environment LINES = %d COLUMNS = %d", + *linep, *colp)); + break; + } + } while + (errno == EINTR); + } + } +#endif /* HAVE_SIZECHANGE */ + + /* + * Finally, look for environment variables. + * + * Solaris lets users override either dimension with an environment + * variable. + */ + if ((value = _nc_getenv_num("LINES")) > 0) { + *linep = value; + T(("screen size: environment LINES = %d", *linep)); + } + if ((value = _nc_getenv_num("COLUMNS")) > 0) { + *colp = value; + T(("screen size: environment COLUMNS = %d", *colp)); + } + + /* if we can't get dynamic info about the size, use static */ + if (*linep <= 0) { + *linep = (int) lines; + } + if (*colp <= 0) { + *colp = (int) columns; + } + + /* the ultimate fallback, assume fixed 24x80 size */ + if (*linep <= 0) { + *linep = 24; + } + if (*colp <= 0) { + *colp = 80; + } + + /* + * Put the derived values back in the screen-size caps, so + * tigetnum() and tgetnum() will do the right thing. + */ + lines = (short) (*linep); + columns = (short) (*colp); + } + + T(("screen size is %dx%d", *linep, *colp)); + return OK; +} + +static int +drv_getsize(TERMINAL_CONTROL_BLOCK * TCB, int *l, int *c) +{ + AssertTCB(); + assert(l != 0 && c != 0); + *l = lines; + *c = columns; + return OK; +} + +static int +drv_setsize(TERMINAL_CONTROL_BLOCK * TCB, int l, int c) +{ + AssertTCB(); + lines = (short) l; + columns = (short) c; + return OK; +} + +static int +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +{ + SCREEN *sp = TCB->csp; + TERMINAL *_term = (TERMINAL *) TCB; + int result = OK; + + AssertTCB(); + if (setFlag) { + for (;;) { + if (SET_TTY(_term->Filedes, buf) != 0) { + if (errno == EINTR) + continue; + if (errno == ENOTTY) { + if (sp) + sp->_notty = TRUE; + } + result = ERR; + } + break; + } + } else { + for (;;) { + if (GET_TTY(_term->Filedes, buf) != 0) { + if (errno == EINTR) + continue; + result = ERR; + } + break; + } + } + return result; +} + +static int +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + if (progFlag) /* prog mode */ + { + if (defFlag) { + /* def_prog_mode */ + /* + * Turn off the XTABS bit in the tty structure if it was on. + */ + if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { +#ifdef TERMIOS + _term->Nttyb.c_oflag &= (unsigned) ~OFLAGS_TABS; +#else + _term->Nttyb.sg_flags &= (unsigned) ~XTABS; +#endif + code = OK; + } + } else { + /* reset_prog_mode */ + if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + NC_BUFFERED(sp, TRUE); + } + code = OK; + } + } + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + /* + * If XTABS was on, remove the tab and backtab capabilities. + */ + if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { +#ifdef TERMIOS + if (_term->Ottyb.c_oflag & OFLAGS_TABS) + tab = back_tab = NULL; +#else + if (_term->Ottyb.sg_flags & XTABS) + tab = back_tab = NULL; +#endif + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + NC_BUFFERED(sp, FALSE); + } + code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + } + } + return (code); +} + +static void +drv_wrap(SCREEN *sp) +{ + if (sp) { + sp->_mouse_wrap(sp); + NCURSES_SP_NAME(_nc_screen_wrap) (sp); + NCURSES_SP_NAME(_nc_mvcur_wrap) (sp); /* wrap up cursor addressing */ + } +} + +static void +drv_release(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ +} + +# define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode)) + +static void +drv_screen_init(SCREEN *sp) +{ + TERMINAL_CONTROL_BLOCK *TCB = TCBOf(sp); + + AssertTCB(); + + /* + * Check for mismatched graphic-rendition capabilities. Most SVr4 + * terminfo trees contain entries that have rmul or rmso equated to + * sgr0 (Solaris curses copes with those entries). We do this only + * for curses, since many termcap applications assume that + * smso/rmso and smul/rmul are paired, and will not function + * properly if we remove rmso or rmul. Curses applications + * shouldn't be looking at this detail. + */ + sp->_use_rmso = SGR0_TEST(exit_standout_mode); + sp->_use_rmul = SGR0_TEST(exit_underline_mode); + + /* + * Check whether we can optimize scrolling under dumb terminals in + * case we do not have any of these capabilities, scrolling + * optimization will be useless. + */ + sp->_scrolling = ((scroll_forward && scroll_reverse) || + ((parm_rindex || + parm_insert_line || + insert_line) && + (parm_index || + parm_delete_line || + delete_line))); + + NCURSES_SP_NAME(baudrate) (sp); + + NCURSES_SP_NAME(_nc_mvcur_init) (sp); + /* initialize terminal to a sane state */ + NCURSES_SP_NAME(_nc_screen_init) (sp); +} + +static void +drv_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + TERMINAL *trm; + + AssertTCB(); + + trm = (TERMINAL *) TCB; + sp = TCB->csp; + + TCB->info.initcolor = initialize_color; + TCB->info.canchange = can_change; + TCB->info.hascolor = ((VALID_NUMERIC(max_colors) && VALID_NUMERIC(max_pairs) + && (((set_foreground != NULL) + && (set_background != NULL)) + || ((set_a_foreground != NULL) + && (set_a_background != NULL)) + || set_color_pair)) ? TRUE : FALSE); + + TCB->info.caninit = !(exit_ca_mode && non_rev_rmcup); + + TCB->info.maxpairs = VALID_NUMERIC(max_pairs) ? max_pairs : 0; + TCB->info.maxcolors = VALID_NUMERIC(max_colors) ? max_colors : 0; + TCB->info.numlabels = VALID_NUMERIC(num_labels) ? num_labels : 0; + TCB->info.labelwidth = VALID_NUMERIC(label_width) ? label_width : 0; + TCB->info.labelheight = VALID_NUMERIC(label_height) ? label_height : 0; + TCB->info.nocolorvideo = VALID_NUMERIC(no_color_video) ? no_color_video + : 0; + TCB->info.tabsize = VALID_NUMERIC(init_tabs) ? (int) init_tabs : 8; + + TCB->info.defaultPalette = hue_lightness_saturation ? _nc_hls_palette : _nc_cga_palette; + + /* + * If an application calls setupterm() rather than initscr() or + * newterm(), we will not have the def_prog_mode() call in + * _nc_setupscreen(). Do it now anyway, so we can initialize the + * baudrate. + */ + if (isatty(trm->Filedes)) { + TCB->drv->mode(TCB, TRUE, TRUE); + } +} + +#define MAX_PALETTE 8 +#define InPalette(n) ((n) >= 0 && (n) < MAX_PALETTE) + +static void +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, short pair, short f, short b) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if ((initialize_pair != NULL) && InPalette(f) && InPalette(b)) { + const color_t *tp = InfoOf(sp).defaultPalette; + + TR(TRACE_ATTRS, + ("initializing pair: pair = %d, fg=(%d,%d,%d), bg=(%d,%d,%d)", + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); + + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "initialize_pair", + TPARM_7(initialize_pair, + pair, + tp[f].red, tp[f].green, tp[f].blue, + tp[b].red, tp[b].green, tp[b].blue)); + } +} + +static int +default_fg(SCREEN *sp) +{ +#if NCURSES_EXT_FUNCS + return (sp != 0) ? sp->_default_fg : COLOR_WHITE; +#else + return COLOR_WHITE; +#endif +} + +static int +default_bg(SCREEN *sp) +{ +#if NCURSES_EXT_FUNCS + return sp != 0 ? sp->_default_bg : COLOR_BLACK; +#else + return COLOR_BLACK; +#endif +} + +static void +drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + short color, short r, short g, short b) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (initialize_color != NULL) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "initialize_color", + TPARM_4(initialize_color, color, r, g, b)); + } +} + +static void +drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, + short old_pair, + short pair, + bool reverse, + NCURSES_SP_OUTC outc) +{ + SCREEN *sp = TCB->csp; + NCURSES_COLOR_T fg = COLOR_DEFAULT; + NCURSES_COLOR_T bg = COLOR_DEFAULT; + NCURSES_COLOR_T old_fg, old_bg; + + AssertTCB(); + if (sp == 0) + return; + + if (pair < 0 || pair >= COLOR_PAIRS) { + return; + } else if (pair != 0) { + if (set_color_pair) { + TPUTS_TRACE("set_color_pair"); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(set_color_pair, pair), 1, outc); + return; + } else if (sp != 0) { + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, + &bg); + } + } + + if (old_pair >= 0 + && sp != 0 + && NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + old_pair, + &old_fg, + &old_bg) !=ERR) { + if ((isDefaultColor(fg) && !isDefaultColor(old_fg)) + || (isDefaultColor(bg) && !isDefaultColor(old_bg))) { +#if NCURSES_EXT_FUNCS + /* + * A minor optimization - but extension. If "AX" is specified in + * the terminal description, treat it as screen's indicator of ECMA + * SGR 39 and SGR 49, and assume the two sequences are independent. + */ + if (sp->_has_sgr_39_49 + && isDefaultColor(old_bg) + && !isDefaultColor(old_fg)) { + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[39m", 1, outc); + } else if (sp->_has_sgr_39_49 + && isDefaultColor(old_fg) + && !isDefaultColor(old_bg)) { + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx "\033[49m", 1, outc); + } else +#endif + drv_rescol(TCB); + } + } else { + drv_rescol(TCB); + if (old_pair < 0) + return; + } + +#if NCURSES_EXT_FUNCS + if (isDefaultColor(fg)) + fg = (NCURSES_COLOR_T) default_fg(sp); + if (isDefaultColor(bg)) + bg = (NCURSES_COLOR_T) default_bg(sp); +#endif + + if (reverse) { + NCURSES_COLOR_T xx = fg; + fg = bg; + bg = xx; + } + + TR(TRACE_ATTRS, ("setting colors: pair = %d, fg = %d, bg = %d", pair, + fg, bg)); + + if (!isDefaultColor(fg)) { + drv_setcolor(TCB, TRUE, fg, outc); + } + if (!isDefaultColor(bg)) { + drv_setcolor(TCB, FALSE, bg, outc); + } +} + +#define xterm_kmous "\033[M" +static void +init_xterm_mouse(SCREEN *sp) +{ + sp->_mouse_type = M_XTERM; + sp->_mouse_xtermcap = NCURSES_SP_NAME(tigetstr) (NCURSES_SP_ARGx "XM"); + if (!VALID_STRING(sp->_mouse_xtermcap)) + sp->_mouse_xtermcap = "\033[?1000%?%p1%{1}%=%th%el%;"; +} + +static void +drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + /* we know how to recognize mouse events under "xterm" */ + if (sp != 0) { + if (key_mouse != 0) { + if (!strcmp(key_mouse, xterm_kmous) + || strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { + init_xterm_mouse(sp); + } + } else if (strstr(TerminalOf(sp)->type.term_names, "xterm") != 0) { + if (_nc_add_to_try(&(sp->_keytry), xterm_kmous, KEY_MOUSE) == OK) + init_xterm_mouse(sp); + } + } +} + +static int +drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) +{ + int rc = 0; + SCREEN *sp; + + AssertTCB(); + SetSP(); + +#if USE_SYSMOUSE + if ((sp->_mouse_type == M_SYSMOUSE) + && (sp->_sysmouse_head < sp->_sysmouse_tail)) { + rc = TW_MOUSE; + } else +#endif + { + rc = TCBOf(sp)->drv->twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); +#if USE_SYSMOUSE + if ((sp->_mouse_type == M_SYSMOUSE) + && (sp->_sysmouse_head < sp->_sysmouse_tail) + && (rc == 0) + && (errno == EINTR)) { + rc |= TW_MOUSE; + } +#endif + } + return rc; +} + +static int +drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, int yold, int xold, int ynew, int xnew) +{ + SCREEN *sp = TCB->csp; + AssertTCB(); + return TINFO_MVCUR(sp, yold, xold, ynew, xnew); +} + +static void +drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, int labnum, char *text) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (labnum > 0 && labnum <= num_labels) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "plab_norm", + TPARM_2(plab_norm, labnum, text)); + } +} + +static void +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, bool OnFlag) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + if (OnFlag) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_on", label_on); + } else { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "label_off", label_off); + } +} + +static chtype +drv_conattr(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp = TCB->csp; + chtype attrs = A_NORMAL; + + AssertTCB(); + if (enter_alt_charset_mode) + attrs |= A_ALTCHARSET; + + if (enter_blink_mode) + attrs |= A_BLINK; + + if (enter_bold_mode) + attrs |= A_BOLD; + + if (enter_dim_mode) + attrs |= A_DIM; + + if (enter_reverse_mode) + attrs |= A_REVERSE; + + if (enter_standout_mode) + attrs |= A_STANDOUT; + + if (enter_protected_mode) + attrs |= A_PROTECT; + + if (enter_secure_mode) + attrs |= A_INVIS; + + if (enter_underline_mode) + attrs |= A_UNDERLINE; + + if (sp && sp->_coloron) + attrs |= A_COLOR; + + return (attrs); +} + +static void +drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + AssertTCB(); + + clear_screen = 0; + cursor_down = parm_down_cursor = 0; + cursor_address = 0; + cursor_up = parm_up_cursor = 0; + row_address = 0; + cursor_home = carriage_return; +} + +static void +drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map) +{ + SCREEN *sp = TCB->csp; + + AssertTCB(); + assert(sp != 0); + if (ena_acs != NULL) { + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx "ena_acs", ena_acs); + } +#if NCURSES_EXT_FUNCS + /* + * Linux console "supports" the "PC ROM" character set by the coincidence + * that smpch/rmpch and smacs/rmacs have the same values. ncurses has + * no codepage support (see SCO Merge for an example). Outside of the + * values defined in acsc, there are no definitions for the "PC ROM" + * character set (assumed by some applications to be codepage 437), but we + * allow those applications to use those codepoints. + * + * test/blue.c uses this feature. + */ +#define PCH_KLUDGE(a,b) (a != 0 && b != 0 && !strcmp(a,b)) + if (PCH_KLUDGE(enter_pc_charset_mode, enter_alt_charset_mode) && + PCH_KLUDGE(exit_pc_charset_mode, exit_alt_charset_mode)) { + size_t i; + for (i = 1; i < ACS_LEN; ++i) { + if (real_map[i] == 0) { + real_map[i] = i; + if (real_map != fake_map) { + if (sp != 0) + sp->_screen_acs_map[i] = TRUE; + } + } + } + } +#endif + + if (acs_chars != NULL) { + size_t i = 0; + size_t length = strlen(acs_chars); + + while (i + 1 < length) { + if (acs_chars[i] != 0 && UChar(acs_chars[i]) < ACS_LEN) { + real_map[UChar(acs_chars[i])] = UChar(acs_chars[i + 1]) | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[UChar(acs_chars[i])] = TRUE; + } + i += 2; + } + } +#ifdef TRACE + /* Show the equivalent mapping, noting if it does not match the + * given attribute, whether by re-ordering or duplication. + */ + if (USE_TRACEF(TRACE_CALLS)) { + size_t n, m; + char show[ACS_LEN * 2 + 1]; + for (n = 1, m = 0; n < ACS_LEN; n++) { + if (real_map[n] != 0) { + show[m++] = (char) n; + show[m++] = (char) ChCharOf(real_map[n]); + } + } + show[m] = 0; + if (acs_chars == NULL || strcmp(acs_chars, show)) + _tracef("%s acs_chars %s", + (acs_chars == NULL) ? "NULL" : "READ", + _nc_visbuf(acs_chars)); + _tracef("%s acs_chars %s", + (acs_chars == NULL) + ? "NULL" + : (strcmp(acs_chars, show) + ? "DIFF" + : "SAME"), + _nc_visbuf(show)); + + _nc_unlock_global(tracef); + } +#endif /* TRACE */ +} + +#define ENSURE_TINFO(sp) (TCBOf(sp)->drv->isTerminfo) + +NCURSES_EXPORT(void) +_nc_cookie_init(SCREEN *sp) +{ + bool support_cookies = USE_XMC_SUPPORT; + TERMINAL_CONTROL_BLOCK *TCB = (TERMINAL_CONTROL_BLOCK *) (sp->_term); + + if (sp == 0 || !ENSURE_TINFO(sp)) + return; + +#if USE_XMC_SUPPORT + /* + * If we have no magic-cookie support compiled-in, or if it is suppressed + * in the environment, reset the support-flag. + */ + if (magic_cookie_glitch >= 0) { + if (getenv("NCURSES_NO_MAGIC_COOKIE") != 0) { + support_cookies = FALSE; + } + } +#endif + + if (!support_cookies && magic_cookie_glitch >= 0) { + T(("will disable attributes to work w/o magic cookies")); + } + + if (magic_cookie_glitch > 0) { /* tvi, wyse */ + + sp->_xmc_triggers = sp->_ok_attributes & ( + A_STANDOUT | + A_UNDERLINE | + A_REVERSE | + A_BLINK | + A_DIM | + A_BOLD | + A_INVIS | + A_PROTECT + ); +#if 0 + /* + * We "should" treat colors as an attribute. The wyse350 (and its + * clones) appear to be the only ones that have both colors and magic + * cookies. + */ + if (has_colors()) { + sp->_xmc_triggers |= A_COLOR; + } +#endif + sp->_xmc_suppress = sp->_xmc_triggers & (chtype) ~(A_BOLD); + + T(("magic cookie attributes %s", _traceattr(sp->_xmc_suppress))); + /* + * Supporting line-drawing may be possible. But make the regular + * video attributes work first. + */ + acs_chars = ABSENT_STRING; + ena_acs = ABSENT_STRING; + enter_alt_charset_mode = ABSENT_STRING; + exit_alt_charset_mode = ABSENT_STRING; +#if USE_XMC_SUPPORT + /* + * To keep the cookie support simple, suppress all of the optimization + * hooks except for clear_screen and the cursor addressing. + */ + if (support_cookies) { + clr_eol = ABSENT_STRING; + clr_eos = ABSENT_STRING; + set_attributes = ABSENT_STRING; + } +#endif + } else if (magic_cookie_glitch == 0) { /* hpterm */ + } + + /* + * If magic cookies are not supported, cancel the strings that set + * video attributes. + */ + if (!support_cookies && magic_cookie_glitch >= 0) { + magic_cookie_glitch = ABSENT_NUMERIC; + set_attributes = ABSENT_STRING; + enter_blink_mode = ABSENT_STRING; + enter_bold_mode = ABSENT_STRING; + enter_dim_mode = ABSENT_STRING; + enter_reverse_mode = ABSENT_STRING; + enter_standout_mode = ABSENT_STRING; + enter_underline_mode = ABSENT_STRING; + } + + /* initialize normal acs before wide, since we use mapping in the latter */ +#if !USE_WIDEC_SUPPORT + if (_nc_unicode_locale() && _nc_locale_breaks_acs(sp->_term)) { + acs_chars = NULL; + ena_acs = NULL; + enter_alt_charset_mode = NULL; + exit_alt_charset_mode = NULL; + set_attributes = NULL; + } +#endif +} + +static int +drv_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return _nc_timed_wait(sp, mode, milliseconds, timeleft EVENTLIST_2nd(evl)); +} + +static int +drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + unsigned char c2 = 0; + int n; + + AssertTCB(); + assert(buf); + SetSP(); + +# if USE_PTHREADS_EINTR + if ((pthread_self) && (pthread_kill) && (pthread_equal)) + _nc_globals.read_thread = pthread_self(); +# endif + n = read(sp->_ifd, &c2, 1); +#if USE_PTHREADS_EINTR + _nc_globals.read_thread = 0; +#endif + *buf = (int) c2; + return n; +} + +static int +drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ +#if HAVE_NANOSLEEP + { + struct timespec request, remaining; + request.tv_sec = ms / 1000; + request.tv_nsec = (ms % 1000) * 1000000; + while (nanosleep(&request, &remaining) == -1 + && errno == EINTR) { + request = remaining; + } + } +#else + _nc_timed_wait(0, 0, ms, (int *) 0 EVENTLIST_2nd(0)); +#endif + return OK; +} + +static int +__nc_putp(SCREEN *sp, const char *name GCC_UNUSED, const char *value) +{ + int rc = ERR; + + if (value) { + rc = NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx name, value); + } + return rc; +} + +static int +__nc_putp_flush(SCREEN *sp, const char *name, const char *value) +{ + int rc = __nc_putp(sp, name, value); + if (rc != ERR) { + NCURSES_SP_NAME(_nc_flush) (sp); + } + return rc; +} + +static int +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag) +{ + int ret = ERR; + SCREEN *sp; + + AssertTCB(); + + sp = TCB->csp; + + if (sp) { + if (flag) { + (void) __nc_putp_flush(sp, "keypad_xmit", keypad_xmit); + } else if (!flag && keypad_local) { + (void) __nc_putp_flush(sp, "keypad_local", keypad_local); + } + if (flag && !sp->_tried) { + _nc_init_keytry(sp); + sp->_tried = TRUE; + } + ret = OK; + } + + return ret; +} + +static int +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, bool flag) +{ + SCREEN *sp; + int code = ERR; + int count = 0; + char *s; + + AssertTCB(); + SetSP(); + + if (c >= 0) { + unsigned ch = (unsigned) c; + if (flag) { + while ((s = _nc_expand_try(sp->_key_ok, ch, &count, 0)) != 0 + && _nc_remove_key(&(sp->_key_ok), ch)) { + code = _nc_add_to_try(&(sp->_keytry), s, ch); + free(s); + count = 0; + if (code != OK) + break; + } + } else { + while ((s = _nc_expand_try(sp->_keytry, ch, &count, 0)) != 0 + && _nc_remove_key(&(sp->_keytry), ch)) { + code = _nc_add_to_try(&(sp->_key_ok), s, ch); + free(s); + count = 0; + if (code != OK) + break; + } + } + } + return (code); +} + +static bool +drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int key) +{ + bool res = FALSE; + + AssertTCB(); + if (TCB->csp) + res = TINFO_HAS_KEY(TCB->csp, key) == 0 ? FALSE : TRUE; + + return res; +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_TINFO_DRIVER = { + TRUE, + drv_CanHandle, /* CanHandle */ + drv_init, /* init */ + drv_release, /* release */ + drv_size, /* size */ + drv_sgmode, /* sgmode */ + drv_conattr, /* conattr */ + drv_mvcur, /* hwcur */ + drv_mode, /* mode */ + drv_rescol, /* rescol */ + drv_rescolors, /* rescolors */ + drv_setcolor, /* color */ + drv_dobeepflash, /* doBeepOrFlash */ + drv_initpair, /* initpair */ + drv_initcolor, /* initcolor */ + drv_do_color, /* docolor */ + drv_initmouse, /* initmouse */ + drv_testmouse, /* testmouse */ + drv_setfilter, /* setfilter */ + drv_hwlabel, /* hwlabel */ + drv_hwlabelOnOff, /* hwlabelOnOff */ + drv_doupdate, /* update */ + drv_defaultcolors, /* defaultcolors */ + drv_print, /* print */ + drv_getsize, /* getsize */ + drv_setsize, /* setsize */ + drv_initacs, /* initacs */ + drv_screen_init, /* scinit */ + drv_wrap, /* scexit */ + drv_twait, /* twait */ + drv_read, /* read */ + drv_nap, /* nap */ + drv_kpad, /* kpad */ + drv_keyok, /* kyOk */ + drv_kyExist /* kyExist */ +}; diff --git a/contrib/ncurses/ncurses/tinfo/trim_sgr0.c b/contrib/ncurses/ncurses/tinfo/trim_sgr0.c index 80c8f77fbebe..1f99208667ec 100644 --- a/contrib/ncurses/ncurses/tinfo/trim_sgr0.c +++ b/contrib/ncurses/ncurses/tinfo/trim_sgr0.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2005-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2005-2007,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,9 +35,8 @@ #include #include -#include -MODULE_ID("$Id: trim_sgr0.c,v 1.8 2007/04/07 17:14:11 tom Exp $") +MODULE_ID("$Id: trim_sgr0.c,v 1.12 2010/12/25 23:03:57 tom Exp $") #undef CUR #define CUR tp-> @@ -100,8 +99,8 @@ rewrite_sgr(char *s, char *attr) { if (PRESENT(s)) { if (PRESENT(attr)) { - unsigned len_s = strlen(s); - unsigned len_a = strlen(attr); + size_t len_s = strlen(s); + size_t len_a = strlen(attr); if (len_s > len_a && !strncmp(attr, s, len_a)) { unsigned n; @@ -124,8 +123,8 @@ similar_sgr(char *a, char *b) bool result = FALSE; int csi_a = is_csi(a); int csi_b = is_csi(b); - unsigned len_a; - unsigned len_b; + size_t len_a; + size_t len_b; TR(TRACE_DATABASE, ("similar_sgr:\n\t%s\n\t%s", _nc_visbuf2(1, a), @@ -170,13 +169,13 @@ chop_out(char *string, unsigned i, unsigned j) * Returns the number of chars from 'full' that we matched. If any mismatch * occurs, return zero. */ -static int +static unsigned compare_part(const char *part, const char *full) { const char *next_part; const char *next_full; - int used_full = 0; - int used_delay = 0; + unsigned used_full = 0; + unsigned used_delay = 0; while (*part != 0) { if (*part != *full) { @@ -199,7 +198,7 @@ compare_part(const char *part, const char *full) next_part = skip_delay(part); next_full = skip_delay(full); if (next_part != part && next_full != full) { - used_delay += (next_full - full); + used_delay += (unsigned) (next_full - full); full = next_full; part = next_part; continue; @@ -261,10 +260,11 @@ _nc_trim_sgr0(TERMTYPE *tp) k = strlen(exit_alt_charset_mode); if (j > k) { for (i = 0; i <= (j - k); ++i) { - int k2 = compare_part(exit_alt_charset_mode, off + i); + unsigned k2 = compare_part(exit_alt_charset_mode, + off + i); if (k2 != 0) { found = TRUE; - chop_out(off, i, i + k2); + chop_out(off, (unsigned) i, (unsigned) (i + k2)); break; } } @@ -274,18 +274,18 @@ _nc_trim_sgr0(TERMTYPE *tp) * SGR 10 would reset to normal font. */ if (!found) { - if ((i = is_csi(off)) != 0 + if ((i = (size_t) is_csi(off)) != 0 && off[strlen(off) - 1] == 'm') { TR(TRACE_DATABASE, ("looking for SGR 10 in %s", _nc_visbuf(off))); tmp = skip_zero(off + i); if (tmp[0] == '1' && skip_zero(tmp + 1) != tmp + 1) { - i = tmp - off; + i = (size_t) (tmp - off); if (off[i - 1] == ';') i--; - j = skip_zero(tmp + 1) - off; - i = chop_out(off, i, j); + j = (size_t) (skip_zero(tmp + 1) - off); + (void) chop_out(off, (unsigned) i, (unsigned) j); found = TRUE; } } @@ -293,10 +293,10 @@ _nc_trim_sgr0(TERMTYPE *tp) if (!found && (tmp = strstr(end, off)) != 0 && strcmp(end, off) != 0) { - i = tmp - end; + i = (size_t) (tmp - end); j = strlen(off); tmp = strdup(end); - chop_out(tmp, i, j); + chop_out(tmp, (unsigned) i, (unsigned) j); free(off); result = tmp; } diff --git a/contrib/ncurses/ncurses/tinfo/use_screen.c b/contrib/ncurses/ncurses/tinfo/use_screen.c index 6c3b12fb9238..6a0297cebd51 100644 --- a/contrib/ncurses/ncurses/tinfo/use_screen.c +++ b/contrib/ncurses/ncurses/tinfo/use_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: use_screen.c,v 1.6 2008/06/07 19:16:56 tom Exp $") +MODULE_ID("$Id: use_screen.c,v 1.8 2009/10/24 22:40:20 tom Exp $") NCURSES_EXPORT(int) use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) @@ -40,14 +40,14 @@ use_screen(SCREEN *screen, NCURSES_SCREEN_CB func, void *data) SCREEN *save_SP; int code = OK; - T((T_CALLED("use_screen(%p,%p,%p)"), screen, func, data)); + T((T_CALLED("use_screen(%p,%p,%p)"), (void *) screen, func, (void *) data)); /* * FIXME - add a flag so a given thread can check if _it_ has already * recurred through this point, return an error if so. */ _nc_lock_global(curses); - save_SP = SP; + save_SP = CURRENT_SCREEN; set_term(screen); code = func(screen, data); diff --git a/contrib/ncurses/ncurses/tinfo/write_entry.c b/contrib/ncurses/ncurses/tinfo/write_entry.c index b53bb210230d..a86c11267e93 100644 --- a/contrib/ncurses/ncurses/tinfo/write_entry.c +++ b/contrib/ncurses/ncurses/tinfo/write_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,6 @@ #include #include -#include #ifndef S_ISDIR #define S_ISDIR(mode) ((mode & S_IFMT) == S_IFDIR) @@ -54,7 +53,7 @@ #define TRACE_OUT(p) /*nothing */ #endif -MODULE_ID("$Id: write_entry.c,v 1.72 2008/08/03 19:24:00 tom Exp $") +MODULE_ID("$Id: write_entry.c,v 1.78 2010/12/25 23:23:08 tom Exp $") static int total_written; @@ -137,10 +136,12 @@ make_db_path(char *dst, const char *src, unsigned limit) if (_nc_is_dir_path(dst)) { rc = -1; } else { + static const char suffix[] = DBM_SUFFIX; unsigned have = strlen(dst); - if (have > 3 && strcmp(dst + have - 3, DBM_SUFFIX)) { - if (have + 3 <= limit) - strcat(dst, DBM_SUFFIX); + unsigned need = strlen(suffix); + if (have > need && strcmp(dst + have - need, suffix)) { + if (have + need <= limit) + strcat(dst, suffix); else rc = -1; } @@ -171,7 +172,11 @@ make_db_root(const char *path) struct stat statbuf; if ((rc = stat(path, &statbuf)) < 0) { - rc = mkdir(path, 0777); + rc = mkdir(path +#if !defined(__MINGW32__) + ,0777 +#endif + ); } else if (_nc_access(path, R_OK | W_OK | X_OK) < 0) { rc = -1; /* permission denied */ } else if (!(S_ISDIR(statbuf.st_mode))) { @@ -338,6 +343,7 @@ _nc_write_entry(TERMTYPE *const tp) while (*other_names != '\0') { ptr = other_names++; + assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; @@ -357,7 +363,7 @@ _nc_write_entry(TERMTYPE *const tp) start_time = 0; } - if (strlen(first_name) >= sizeof(filename) - 3) + if (strlen(first_name) >= sizeof(filename) - (2 + LEAF_LEN)) _nc_warning("terminal name too long."); sprintf(filename, LEAF_FMT "/%s", first_name[0], first_name); @@ -385,14 +391,13 @@ _nc_write_entry(TERMTYPE *const tp) } while (*other_names != '\0') { ptr = other_names++; - assert(ptr < buffer + sizeof(buffer) - 1); while (*other_names != '|' && *other_names != '\0') other_names++; if (*other_names != '\0') *(other_names++) = '\0'; - if (strlen(ptr) > sizeof(linkname) - 3) { + if (strlen(ptr) > sizeof(linkname) - (2 + LEAF_LEN)) { _nc_warning("terminal alias %s too long.", ptr); continue; } @@ -414,8 +419,12 @@ _nc_write_entry(TERMTYPE *const tp) { int code; #if USE_SYMLINKS - strcpy(symlinkname, "../"); - strncat(symlinkname, filename, sizeof(symlinkname) - 4); + if (first_name[0] == linkname[0]) + strncpy(symlinkname, first_name, sizeof(symlinkname) - 1); + else { + strcpy(symlinkname, "../"); + strncat(symlinkname, filename, sizeof(symlinkname) - 4); + } symlinkname[sizeof(symlinkname) - 1] = '\0'; #endif /* USE_SYMLINKS */ #if HAVE_REMOVE @@ -460,26 +469,26 @@ _nc_write_entry(TERMTYPE *const tp) #endif /* USE_HASHED_DB */ } -static unsigned +static size_t fake_write(char *dst, unsigned *offset, - unsigned limit, + size_t limit, char *src, - unsigned want, - unsigned size) + size_t want, + size_t size) { - int have = (limit - *offset); + size_t have = (limit - *offset); want *= size; if (have > 0) { - if ((int) want > have) + if (want > have) want = have; memcpy(dst + *offset, src, want); - *offset += want; + *offset += (unsigned) want; } else { want = 0; } - return (int) (want / size); + return (want / size); } #define Write(buf, size, count) fake_write(buffer, offset, limit, (char *) buf, count, size) @@ -487,15 +496,16 @@ fake_write(char *dst, #undef LITTLE_ENDIAN /* BSD/OS defines this as a feature macro */ #define HI(x) ((x) / 256) #define LO(x) ((x) % 256) -#define LITTLE_ENDIAN(p, x) (p)[0] = LO(x), (p)[1] = HI(x) +#define LITTLE_ENDIAN(p, x) (p)[0] = (unsigned char)LO(x), \ + (p)[1] = (unsigned char)HI(x) #define WRITE_STRING(str) (Write(str, sizeof(char), strlen(str) + 1) == strlen(str) + 1) static int -compute_offsets(char **Strings, unsigned strmax, short *offsets) +compute_offsets(char **Strings, size_t strmax, short *offsets) { - size_t nextfree = 0; - unsigned i; + int nextfree = 0; + size_t i; for (i = 0; i < strmax; i++) { if (Strings[i] == ABSENT_STRING) { @@ -503,8 +513,8 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } else if (Strings[i] == CANCELLED_STRING) { offsets[i] = -2; } else { - offsets[i] = nextfree; - nextfree += strlen(Strings[i]) + 1; + offsets[i] = (short) nextfree; + nextfree += (int) strlen(Strings[i]) + 1; TRACE_OUT(("put Strings[%d]=%s(%d)", (int) i, _nc_visbuf(Strings[i]), (int) nextfree)); } @@ -513,9 +523,9 @@ compute_offsets(char **Strings, unsigned strmax, short *offsets) } static void -convert_shorts(unsigned char *buf, short *Numbers, unsigned count) +convert_shorts(unsigned char *buf, short *Numbers, size_t count) { - unsigned i; + size_t i; for (i = 0; i < count; i++) { if (Numbers[i] == ABSENT_NUMERIC) { /* HI/LO won't work */ buf[2 * i] = buf[2 * i + 1] = 0377; @@ -524,7 +534,7 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) buf[2 * i + 1] = 0377; } else { LITTLE_ENDIAN(buf + 2 * i, Numbers[i]); - TRACE_OUT(("put Numbers[%d]=%d", i, Numbers[i])); + TRACE_OUT(("put Numbers[%u]=%d", (unsigned) i, Numbers[i])); } } } @@ -536,8 +546,8 @@ convert_shorts(unsigned char *buf, short *Numbers, unsigned count) static unsigned extended_Booleans(TERMTYPE *tp) { - unsigned short result = 0; - unsigned short i; + unsigned result = 0; + unsigned i; for (i = 0; i < tp->ext_Booleans; ++i) { if (tp->Booleans[BOOLCOUNT + i] == TRUE) @@ -549,8 +559,8 @@ extended_Booleans(TERMTYPE *tp) static unsigned extended_Numbers(TERMTYPE *tp) { - unsigned short result = 0; - unsigned short i; + unsigned result = 0; + unsigned i; for (i = 0; i < tp->ext_Numbers; ++i) { if (tp->Numbers[NUMCOUNT + i] != ABSENT_NUMERIC) @@ -567,7 +577,7 @@ extended_Strings(TERMTYPE *tp) for (i = 0; i < tp->ext_Strings; ++i) { if (tp->Strings[STRCOUNT + i] != ABSENT_STRING) - result = (i + 1); + result = (unsigned short) (i + 1); } return result; } @@ -597,7 +607,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) size_t namelen, boolmax, nummax, strmax; char zero = '\0'; size_t i; - short nextfree; + int nextfree; short offsets[MAX_ENTRY_SIZE / 2]; unsigned char buf[MAX_ENTRY_SIZE]; unsigned last_bool = BOOLWRITE; @@ -690,7 +700,7 @@ write_object(TERMTYPE *tp, char *buffer, unsigned *offset, unsigned limit) #if NCURSES_XNAMES if (extended_object(tp)) { - unsigned extcnt = NUM_EXT_NAMES(tp); + unsigned extcnt = (unsigned) NUM_EXT_NAMES(tp); if (even_boundary(nextfree)) return (ERR); diff --git a/contrib/ncurses/ncurses/trace/lib_trace.c b/contrib/ncurses/ncurses/trace/lib_trace.c index 743b1f64f1ae..a726901d4a3a 100644 --- a/contrib/ncurses/ncurses/trace/lib_trace.c +++ b/contrib/ncurses/ncurses/trace/lib_trace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -46,7 +47,7 @@ #include -MODULE_ID("$Id: lib_trace.c,v 1.71 2008/08/23 18:04:29 tom Exp $") +MODULE_ID("$Id: lib_trace.c,v 1.76 2010/12/19 01:21:19 tom Exp $") NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ @@ -56,26 +57,26 @@ NCURSES_EXPORT_VAR(unsigned) _nc_tracing = 0; /* always define this */ NCURSES_EXPORT(const char *) NCURSES_PUBLIC_VAR(_nc_tputs_trace) (void) { - return SP ? SP->_tputs_trace : _nc_prescreen._tputs_trace; + return CURRENT_SCREEN ? CURRENT_SCREEN->_tputs_trace : _nc_prescreen._tputs_trace; } NCURSES_EXPORT(long) NCURSES_PUBLIC_VAR(_nc_outchars) (void) { - return SP ? SP->_outchars : _nc_prescreen._outchars; + return CURRENT_SCREEN ? CURRENT_SCREEN->_outchars : _nc_prescreen._outchars; } NCURSES_EXPORT(void) _nc_set_tputs_trace(const char *s) { - if (SP) - SP->_tputs_trace = s; + if (CURRENT_SCREEN) + CURRENT_SCREEN->_tputs_trace = s; else _nc_prescreen._tputs_trace = s; } NCURSES_EXPORT(void) _nc_count_outchars(long increment) { - if (SP) - SP->_outchars += increment; + if (CURRENT_SCREEN) + CURRENT_SCREEN->_outchars += increment; else _nc_prescreen._outchars += increment; } @@ -95,7 +96,7 @@ trace(const unsigned int tracelevel) const char *mode = _nc_globals.init_trace ? "ab" : "wb"; if (TracePath[0] == '\0') { - int size = sizeof(TracePath) - 12; + size_t size = sizeof(TracePath) - 12; if (getcwd(TracePath, size) == 0) { perror("curses: Can't get working directory"); exit(EXIT_FAILURE); @@ -121,7 +122,7 @@ trace(const unsigned int tracelevel) */ #if HAVE_SETVBUF /* ANSI */ (void) setvbuf(TraceFP, (char *) 0, _IOLBF, 0); -#elif HAVE_SETBUF /* POSIX */ +#elif HAVE_SETBUF /* POSIX */ (void) setbuffer(TraceFP, (char *) 0); #endif _tracef("TRACING NCURSES version %s.%d (tracelevel=%#x)", @@ -183,7 +184,11 @@ _nc_va_tracef(const char *fmt, va_list ap) # if USE_WEAK_SYMBOLS if ((pthread_self)) # endif +#ifdef __MINGW32__ + fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self().p); +#else fprintf(TraceFP, "%#lx:", (long) (void *) pthread_self()); +#endif #endif if (before || after) { int n; @@ -219,6 +224,14 @@ _nc_retrace_bool(NCURSES_BOOL code) return code; } +/* Trace 'char' return-values */ +NCURSES_EXPORT(char) +_nc_retrace_char(char code) +{ + T((T_RETURN("%c"), code)); + return code; +} + /* Trace 'int' return-values */ NCURSES_EXPORT(int) _nc_retrace_int(int code) @@ -271,7 +284,7 @@ _nc_retrace_void_ptr(void *code) NCURSES_EXPORT(SCREEN *) _nc_retrace_sp(SCREEN *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } @@ -279,7 +292,7 @@ _nc_retrace_sp(SCREEN *code) NCURSES_EXPORT(WINDOW *) _nc_retrace_win(WINDOW *code) { - T((T_RETURN("%p"), code)); + T((T_RETURN("%p"), (void *) code)); return code; } diff --git a/contrib/ncurses/ncurses/trace/lib_traceatr.c b/contrib/ncurses/ncurses/trace/lib_traceatr.c index 45a03cea05fe..35ba0d3e6797 100644 --- a/contrib/ncurses/ncurses/trace/lib_traceatr.c +++ b/contrib/ncurses/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Thomas Dickey 1996-on * * and: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer * ****************************************************************************/ /* @@ -37,9 +38,12 @@ */ #include -#include /* acs_chars */ -MODULE_ID("$Id: lib_traceatr.c,v 1.63 2008/08/03 16:24:53 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: lib_traceatr.c,v 1.74 2011/01/22 19:48:01 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -128,11 +132,11 @@ _traceattr2(int bufnum, chtype newmode) for (n = 0; n < SIZEOF(names); n++) { if ((newmode & names[n].val) != 0) { if (result[1] != '\0') - result = _nc_trace_bufcat(bufnum, "|"); + (void) _nc_trace_bufcat(bufnum, "|"); result = _nc_trace_bufcat(bufnum, names[n].name); if (names[n].val == A_COLOR) { - short pairnum = PAIR_NUMBER(newmode); + short pairnum = (short) PairNumber(newmode); #ifdef USE_TERMLIB /* pair_content lives in libncurses */ (void) sprintf(temp, "{%d}", pairnum); @@ -172,6 +176,14 @@ _traceattr(attr_t newmode) } /* Trace 'int' return-values */ +NCURSES_EXPORT(int) +_nc_retrace_int_attr_t(attr_t code) +{ + T((T_RETURN("%s"), _traceattr(code))); + return (int) code; +} + +/* Trace 'attr_t' return-values */ NCURSES_EXPORT(attr_t) _nc_retrace_attr_t(attr_t code) { @@ -186,6 +198,9 @@ _nc_altcharset_name(attr_t attr, chtype ch) unsigned int val; const char *name; } ALT_NAMES; +#if NCURSES_SP_FUNCS + SCREEN *sp = CURRENT_SCREEN; +#endif static const ALT_NAMES names[] = { {'l', "ACS_ULCORNER"}, /* upper left corner */ @@ -225,23 +240,26 @@ _nc_altcharset_name(attr_t attr, chtype ch) const char *result = 0; +#if NCURSES_SP_FUNCS + (void) sp; +#endif if ((attr & A_ALTCHARSET) && (acs_chars != 0)) { char *cp; char *found = 0; - const ALT_NAMES *sp; + const ALT_NAMES *strp; for (cp = acs_chars; cp[0] && cp[1]; cp += 2) { - if (ChCharOf(cp[1]) == ChCharOf(ch)) { + if (ChCharOf(UChar(cp[1])) == ChCharOf(ch)) { found = cp; /* don't exit from loop - there may be redefinitions */ } } if (found != 0) { - ch = ChCharOf(*found); - for (sp = names; sp->val; sp++) - if (sp->val == ch) { - result = sp->name; + ch = ChCharOf(UChar(*found)); + for (strp = names; strp->val; strp++) + if (strp->val == ch) { + result = strp->name; break; } } @@ -260,7 +278,9 @@ _tracechtype2(int bufnum, chtype ch) if ((found = _nc_altcharset_name(ChAttrOf(ch), ch)) != 0) { (void) _nc_trace_bufcat(bufnum, found); } else - (void) _nc_trace_bufcat(bufnum, _nc_tracechar(SP, (int) ChCharOf(ch))); + (void) _nc_trace_bufcat(bufnum, + _nc_tracechar(CURRENT_SCREEN, + (int) ChCharOf(ch))); if (ChAttrOf(ch) != A_NORMAL) { (void) _nc_trace_bufcat(bufnum, " | "); @@ -313,14 +333,17 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) (void) _nc_trace_bufcat(bufnum, "{ "); for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { PUTC_ch = ch->chars[PUTC_i]; - if (PUTC_ch == L'\0') + if (PUTC_ch == L'\0') { + if (PUTC_i == 0) + (void) _nc_trace_bufcat(bufnum, "\\000"); break; - PUTC_n = wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); + } + PUTC_n = (int) wcrtomb(PUTC_buf, ch->chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) { if (PUTC_ch != L'\0') { /* it could not be a multibyte sequence */ (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(SP, + _nc_tracechar(CURRENT_SCREEN, UChar(ch->chars[PUTC_i]))); } break; @@ -329,7 +352,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) if (n) (void) _nc_trace_bufcat(bufnum, ", "); (void) _nc_trace_bufcat(bufnum, - _nc_tracechar(SP, + _nc_tracechar(CURRENT_SCREEN, UChar(PUTC_buf[n]))); } } diff --git a/contrib/ncurses/ncurses/trace/lib_tracebits.c b/contrib/ncurses/ncurses/trace/lib_tracebits.c index cc441b391e5b..d19d0e420acc 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracebits.c +++ b/contrib/ncurses/ncurses/trace/lib_tracebits.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -33,9 +33,8 @@ ****************************************************************************/ #include -#include /* cur_term */ -MODULE_ID("$Id: lib_tracebits.c,v 1.17 2008/08/03 16:09:26 tom Exp $") +MODULE_ID("$Id: lib_tracebits.c,v 1.19 2011/01/09 00:23:03 tom Exp $") #if SVR4_TERMIO && !defined(_POSIX_SOURCE) #define _POSIX_SOURCE @@ -262,5 +261,5 @@ _nc_tracebits(void) return _nc_trace_ttymode(&(cur_term->Nttyb)); } #else -EMPTY_MODULE(_nc_tracebits) +EMPTY_MODULE(_nc_empty_lib_tracebits) #endif /* TRACE */ diff --git a/contrib/ncurses/ncurses/trace/lib_tracechr.c b/contrib/ncurses/ncurses/trace/lib_tracechr.c index 79cf03b4870c..a1f9f5aa2706 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracechr.c +++ b/contrib/ncurses/ncurses/trace/lib_tracechr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_tracechr.c,v 1.19 2008/08/03 15:39:29 tom Exp $") +MODULE_ID("$Id: lib_tracechr.c,v 1.20 2009/04/18 22:48:29 tom Exp $") #ifdef TRACE @@ -52,7 +52,7 @@ _nc_tracechar(SCREEN *sp, int ch) : _nc_globals.tracechr_buf); if (ch > KEY_MIN || ch < 0) { - name = _nc_keyname(sp, ch); + name = safe_keyname(SP_PARM, ch); if (name == 0 || *name == '\0') name = "NULL"; (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -64,7 +64,7 @@ _nc_tracechar(SCREEN *sp, int ch) */ (void) sprintf(MyBuffer, "%#03o", ch); } else { - name = _nc_unctrl(sp, (chtype) ch); + name = safe_unctrl(SP_PARM, (chtype) ch); if (name == 0 || *name == 0) name = "null"; /* shouldn't happen */ (void) sprintf(MyBuffer, "'%.30s' = %#03o", name, ch); @@ -75,7 +75,7 @@ _nc_tracechar(SCREEN *sp, int ch) NCURSES_EXPORT(char *) _tracechar(int ch) { - return _nc_tracechar(SP, ch); + return _nc_tracechar(CURRENT_SCREEN, ch); } #else EMPTY_MODULE(_nc_lib_tracechr) diff --git a/contrib/ncurses/ncurses/trace/lib_tracedmp.c b/contrib/ncurses/ncurses/trace/lib_tracedmp.c index 58732a06c246..c7fcbf2e0d56 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracedmp.c +++ b/contrib/ncurses/ncurses/trace/lib_tracedmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include #include -MODULE_ID("$Id: lib_tracedmp.c,v 1.31 2008/08/16 19:30:56 tom Exp $") +MODULE_ID("$Id: lib_tracedmp.c,v 1.32 2009/04/18 21:01:38 tom Exp $") #ifdef TRACE @@ -68,7 +68,7 @@ _tracedump(const char *name, WINDOW *win) if (width < win->_maxx) ++width; if (++width + 1 > (int) my_length) { - my_length = 2 * (width + 1); + my_length = (unsigned) (2 * (width + 1)); my_buffer = typeRealloc(char, my_length, my_buffer); } @@ -82,7 +82,7 @@ _tracedump(const char *name, WINDOW *win) * we map those to '.' and '?' respectively. */ for (j = 0; j < width; ++j) { - chtype test = CharOf(win->_line[n].text[j]); + chtype test = (chtype) CharOf(win->_line[n].text[j]); ep[j] = (char) ((UChar(test) == test #if USE_WIDEC_SUPPORT && (win->_line[n].text[j].chars[1] == 0) @@ -111,7 +111,7 @@ _tracedump(const char *name, WINDOW *win) if (multicolumn) { ep = my_buffer; for (j = 0; j < width; ++j) { - int test = WidecExt(win->_line[n].text[j]); + chtype test = WidecExt(win->_line[n].text[j]); if (test) { ep[j] = (char) (test + '0'); } else { @@ -153,7 +153,7 @@ _tracedump(const char *name, WINDOW *win) for (i = 0; i < 4; ++i) { const char *hex = " 123456789ABCDEF"; - attr_t mask = (0xf << ((i + 4) * 4)); + attr_t mask = (attr_t) (0xf << ((i + 4) * 4)); haveattrs = FALSE; for (j = 0; j < width; ++j) diff --git a/contrib/ncurses/ncurses/trace/lib_tracemse.c b/contrib/ncurses/ncurses/trace/lib_tracemse.c index 74cc177d51bb..1afd15d2e785 100644 --- a/contrib/ncurses/ncurses/trace/lib_tracemse.c +++ b/contrib/ncurses/ncurses/trace/lib_tracemse.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,23 +38,16 @@ #include -MODULE_ID("$Id: lib_tracemse.c,v 1.15 2008/08/03 15:39:29 tom Exp $") +MODULE_ID("$Id: lib_tracemse.c,v 1.18 2011/01/22 19:48:08 tom Exp $") #ifdef TRACE #define my_buffer sp->tracemse_buf -NCURSES_EXPORT(char *) -_nc_tracemouse(SCREEN *sp, MEVENT const *ep) +static char * +_trace_mmask_t(SCREEN *sp, mmask_t code) { - (void) sprintf(my_buffer, TRACEMSE_FMT, - ep->id, - ep->x, - ep->y, - ep->z, - (unsigned long) ep->bstate); - -#define SHOW(m, s) if ((ep->bstate & m) == m) strcat(strcat(my_buffer, s), ", ") +#define SHOW(m, s) if ((code & m) == m) strcat(strcat(my_buffer, s), ", ") SHOW(BUTTON1_RELEASED, "release-1"); SHOW(BUTTON1_PRESSED, "press-1"); @@ -110,14 +103,37 @@ _nc_tracemouse(SCREEN *sp, MEVENT const *ep) if (my_buffer[strlen(my_buffer) - 1] == ' ') my_buffer[strlen(my_buffer) - 2] = '\0'; + + return (my_buffer); +} + +NCURSES_EXPORT(char *) +_nc_tracemouse(SCREEN *sp, MEVENT const *ep) +{ + (void) sprintf(my_buffer, TRACEMSE_FMT, + ep->id, + ep->x, + ep->y, + ep->z, + (unsigned long) ep->bstate); + + (void) _trace_mmask_t(sp, ep->bstate); (void) strcat(my_buffer, "}"); return (my_buffer); } +NCURSES_EXPORT(mmask_t) +_nc_retrace_mmask_t(SCREEN *sp, mmask_t code) +{ + *my_buffer = '\0'; + T((T_RETURN("{%s}"), _trace_mmask_t(sp, code))); + return code; +} + NCURSES_EXPORT(char *) _tracemouse(MEVENT const *ep) { - return _nc_tracemouse(SP, ep); + return _nc_tracemouse(CURRENT_SCREEN, ep); } #else /* !TRACE */ diff --git a/contrib/ncurses/ncurses/trace/trace_buf.c b/contrib/ncurses/ncurses/trace/trace_buf.c index 6345acc035fc..46baba4796b2 100644 --- a/contrib/ncurses/ncurses/trace/trace_buf.c +++ b/contrib/ncurses/ncurses/trace/trace_buf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,9 @@ #include -MODULE_ID("$Id: trace_buf.c,v 1.14 2008/08/03 15:13:56 tom Exp $") +MODULE_ID("$Id: trace_buf.c,v 1.17 2011/01/22 19:48:16 tom Exp $") + +#ifdef TRACE #define MyList _nc_globals.tracebuf_ptr #define MySize _nc_globals.tracebuf_used @@ -47,7 +49,7 @@ _nc_trace_alloc(int bufnum, size_t want) if (bufnum >= 0) { if ((size_t) (bufnum + 1) > MySize) { - size_t need = (bufnum + 1) * 2; + size_t need = (size_t) (bufnum + 1) * 2; if ((MyList = typeRealloc(TRACEBUF, need, MyList)) != 0) { while (need > MySize) MyList[MySize++].text = 0; @@ -112,3 +114,6 @@ _nc_trace_bufcat(int bufnum, const char *value) } return buffer; } +#else +EMPTY_MODULE(_nc_empty_trace_buf) +#endif /* TRACE */ diff --git a/contrib/ncurses/ncurses/trace/trace_tries.c b/contrib/ncurses/ncurses/trace/trace_tries.c index f813aba15825..d3380131ecac 100644 --- a/contrib/ncurses/ncurses/trace/trace_tries.c +++ b/contrib/ncurses/ncurses/trace/trace_tries.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2009,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,7 +27,7 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1999 * + * Author: Thomas E. Dickey 1999 * ****************************************************************************/ /* * trace_tries.c - Tracing/Debugging buffers (keycode tries-trees) @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: trace_tries.c,v 1.13 2008/08/03 15:43:30 tom Exp $") +MODULE_ID("$Id: trace_tries.c,v 1.16 2011/01/09 00:23:27 tom Exp $") #ifdef TRACE #define my_buffer _nc_globals.tracetry_buf @@ -46,7 +46,7 @@ recur_tries(TRIES * tree, unsigned level) { if (level > my_length) { my_length = (level + 1) * 4; - my_buffer = (unsigned char *) realloc(my_buffer, my_length); + my_buffer = (unsigned char *) _nc_doalloc(my_buffer, my_length); } while (tree != 0) { @@ -67,12 +67,12 @@ NCURSES_EXPORT(void) _nc_trace_tries(TRIES * tree) { my_buffer = typeMalloc(unsigned char, my_length = 80); - _tracef("BEGIN tries %p", tree); + _tracef("BEGIN tries %p", (void *) tree); recur_tries(tree, 0); - _tracef(". . . tries %p", tree); + _tracef(". . . tries %p", (void *) tree); free(my_buffer); } #else -EMPTY_MODULE(_nc_trace_tries) +EMPTY_MODULE(_nc_empty_trace_tries) #endif diff --git a/contrib/ncurses/ncurses/trace/trace_xnames.c b/contrib/ncurses/ncurses/trace/trace_xnames.c index 9b0b5920d814..38a48730ccdc 100644 --- a/contrib/ncurses/ncurses/trace/trace_xnames.c +++ b/contrib/ncurses/ncurses/trace/trace_xnames.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999,2000 Free Software Foundation, Inc. * + * Copyright (c) 1999-2000,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -34,12 +34,11 @@ */ #include -#include -MODULE_ID("$Id: trace_xnames.c,v 1.5 2000/12/10 03:02:45 tom Exp $") +MODULE_ID("$Id: trace_xnames.c,v 1.6 2010/01/23 17:59:27 tom Exp $") NCURSES_EXPORT(void) -_nc_trace_xnames(TERMTYPE * tp GCC_UNUSED) +_nc_trace_xnames(TERMTYPE *tp GCC_UNUSED) { #ifdef TRACE #if NCURSES_XNAMES diff --git a/contrib/ncurses/ncurses/trace/varargs.c b/contrib/ncurses/ncurses/trace/varargs.c index f4ee46710abb..541173d27459 100644 --- a/contrib/ncurses/ncurses/trace/varargs.c +++ b/contrib/ncurses/ncurses/trace/varargs.c @@ -34,7 +34,7 @@ #include -MODULE_ID("$Id: varargs.c,v 1.7 2008/08/03 15:42:49 tom Exp $") +MODULE_ID("$Id: varargs.c,v 1.8 2008/11/16 00:19:59 juergen Exp $") #ifdef TRACE @@ -44,7 +44,7 @@ typedef enum { atUnknown = 0, atInteger, atFloat, atPoint, atString } ARGTYPE; -#define VA_INT(type) ival = va_arg(ap, type) +#define VA_INT(type) ival = (int) va_arg(ap, type) #define VA_FLT(type) fval = va_arg(ap, type) #define VA_PTR(type) pval = (char *)va_arg(ap, type) #define VA_STR(type) sval = va_arg(ap, type) diff --git a/contrib/ncurses/ncurses/trace/visbuf.c b/contrib/ncurses/ncurses/trace/visbuf.c index bf9fb1472003..66da4f4beca3 100644 --- a/contrib/ncurses/ncurses/trace/visbuf.c +++ b/contrib/ncurses/ncurses/trace/visbuf.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,9 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.32 2008/08/04 23:07:39 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.37 2010/05/29 18:51:41 tom Exp $") + +#define NUM_VISBUFS 4 #define NormalLen(len) (size_t) (((size_t)(len) + 1) * 4) #define WideLen(len) (size_t) (((size_t)(len) + 1) * 4 * MB_CUR_MAX) @@ -92,7 +94,7 @@ _nc_vischar(char *tp, unsigned c) static const char * _nc_visbuf2n(int bufnum, const char *buf, int len) { - const char *vbuf; + const char *vbuf = 0; char *tp; int c; @@ -108,9 +110,16 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, NormalLen(len)); #else { - static char *mybuf[4]; - mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); - vbuf = tp = mybuf[bufnum]; + static char *mybuf[NUM_VISBUFS]; + if (bufnum < 0) { + for (c = 0; c < NUM_VISBUFS; ++c) { + FreeAndNull(mybuf[c]); + } + tp = 0; + } else { + mybuf[bufnum] = typeRealloc(char, NormalLen(len), mybuf[bufnum]); + vbuf = tp = mybuf[bufnum]; + } } #endif if (tp != 0) { @@ -119,7 +128,7 @@ _nc_visbuf2n(int bufnum, const char *buf, int len) tp = _nc_vischar(tp, UChar(c)); } *tp++ = D_QUOTE; - *tp++ = '\0'; + *tp = '\0'; } else { vbuf = ("(_nc_visbuf2n failed)"); } @@ -177,7 +186,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) vbuf = tp = _nc_trace_buf(bufnum, WideLen(len)); #else { - static char *mybuf[2]; + static char *mybuf[NUM_VISBUFS]; mybuf[bufnum] = typeRealloc(char, WideLen(len), mybuf[bufnum]); vbuf = tp = mybuf[bufnum]; } @@ -196,7 +205,7 @@ _nc_viswbuf2n(int bufnum, const wchar_t *buf, int len) } } *tp++ = D_QUOTE; - *tp++ = '\0'; + *tp = '\0'; } else { vbuf = ("(_nc_viswbuf2n failed)"); } @@ -229,7 +238,9 @@ _nc_viswibuf(const wint_t *buf) static unsigned mylen; unsigned n; - for (n = 0; buf[n] != 0; ++n) ; + for (n = 0; buf[n] != 0; ++n) { + ; /* empty */ + } if (mylen < ++n) { mylen = n + 80; if (mybuf != 0) @@ -237,8 +248,10 @@ _nc_viswibuf(const wint_t *buf) else mybuf = typeMalloc(wchar_t, mylen); } - for (n = 0; buf[n] != 0; ++n) + for (n = 0; buf[n] != 0; ++n) { mybuf[n] = (wchar_t) buf[n]; + } + mybuf[n] = L'\0'; return _nc_viswbuf2(0, mybuf); } @@ -274,12 +287,12 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } } - result = _nc_trace_bufcat(bufnum, l_brace); - result = _nc_trace_bufcat(bufnum, d_quote); + (void) _nc_trace_bufcat(bufnum, l_brace); + (void) _nc_trace_bufcat(bufnum, d_quote); for (j = first; j <= last; ++j) { found = _nc_altcharset_name(attr, (chtype) CharOf(buf[j])); if (found != 0) { - result = _nc_trace_bufcat(bufnum, found); + (void) _nc_trace_bufcat(bufnum, found); attr &= ~A_ALTCHARSET; } else #if USE_WIDEC_SUPPORT @@ -291,15 +304,19 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) int k; PUTC_ch = buf[j].chars[PUTC_i]; - if (PUTC_ch == L'\0') + if (PUTC_ch == L'\0') { + if (PUTC_i == 0) + (void) _nc_trace_bufcat(bufnum, "\\000"); break; - PUTC_n = (int) wcrtomb(PUTC_buf, buf[j].chars[PUTC_i], &PUT_st); + } + PUTC_n = (int) wcrtomb(PUTC_buf, + buf[j].chars[PUTC_i], &PUT_st); if (PUTC_n <= 0) break; for (k = 0; k < PUTC_n; k++) { char temp[80]; _nc_vischar(temp, UChar(PUTC_buf[k])); - result = _nc_trace_bufcat(bufnum, temp); + (void) _nc_trace_bufcat(bufnum, temp); } } } @@ -311,10 +328,10 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) } #endif /* USE_WIDEC_SUPPORT */ } - result = _nc_trace_bufcat(bufnum, d_quote); + (void) _nc_trace_bufcat(bufnum, d_quote); if (attr != A_NORMAL) { - result = _nc_trace_bufcat(bufnum, " | "); - result = _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); + (void) _nc_trace_bufcat(bufnum, " | "); + (void) _nc_trace_bufcat(bufnum, _traceattr2(bufnum + 20, attr)); } result = _nc_trace_bufcat(bufnum, r_brace); first = last + 1; diff --git a/contrib/ncurses/ncurses/tty/MKexpanded.sh b/contrib/ncurses/ncurses/tty/MKexpanded.sh index bf9acf21aa43..7a5f5993c487 100755 --- a/contrib/ncurses/ncurses/tty/MKexpanded.sh +++ b/contrib/ncurses/ncurses/tty/MKexpanded.sh @@ -1,6 +1,6 @@ #! /bin/sh ############################################################################## -# Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -27,9 +27,9 @@ # authorization. # ############################################################################## # -# Author: Thomas E. Dickey 1997 +# Author: Thomas E. Dickey, 1997-on # -# $Id: MKexpanded.sh,v 1.11 2005/01/02 01:06:40 tom Exp $ +# $Id: MKexpanded.sh,v 1.17 2010/01/23 17:57:43 tom Exp $ # # Script to generate 'expanded.c', a dummy source that contains functions # corresponding to complex macros used in this library. By making functions, @@ -52,8 +52,13 @@ trap "rm -f $TMP" 0 1 2 5 15 cat < -#include + +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #if NCURSES_EXPANDED EOF @@ -68,29 +73,59 @@ cat >$TMP </dev/null | sed -e '1,/^IGNORE$/d' +$preprocessor $TMP 2>/dev/null | \ + sed -e '1,/^IGNORE$/d' -e 's/^@/#/' -e 's/^#if_/#if /' cat < -MODULE_ID("$Id: hardscroll.c,v 1.42 2008/08/03 23:49:30 tom Exp $") +MODULE_ID("$Id: hardscroll.c,v 1.47 2010/04/24 23:46:47 tom Exp $") #if defined(SCROLLDEBUG) || defined(HASHDEBUG) # undef screen_lines -# define screen_lines MAXLINES -NCURSES_EXPORT_VAR(int) -oldnums[MAXLINES]; -# define OLDNUM(n) oldnums[n] +# define screen_lines(sp) MAXLINES +NCURSES_EXPORT_VAR (int) + oldnums[MAXLINES]; +# define OLDNUM(sp,n) oldnums[n] # define _tracef printf # undef TR # define TR(n, a) if (_nc_tracing & (n)) { _tracef a ; putchar('\n'); } -extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; +extern NCURSES_EXPORT_VAR(unsigned) _nc_tracing; #else /* no debug */ /* OLDNUM(n) indicates which line will be shifted to the position n. if OLDNUM(n) == _NEWINDEX, then the line n in new, not shifted from somewhere. */ -NCURSES_EXPORT_VAR(int *) -_nc_oldnums = 0; /* obsolete: keep for ABI compat */ +NCURSES_EXPORT_VAR (int *) + _nc_oldnums = 0; /* obsolete: keep for ABI compat */ # if USE_HASHMAP -# define oldnums SP->_oldnum_list -# define OLDNUM(n) oldnums[n] +# define oldnums(sp) (sp)->_oldnum_list +# define OLDNUM(sp,n) oldnums(sp)[n] # else /* !USE_HASHMAP */ -# define OLDNUM(n) newscr->_line[n].oldindex +# define OLDNUM(sp,n) NewScreen(sp)->_line[n].oldindex # endif /* !USE_HASHMAP */ -#define OLDNUM_SIZE SP->_oldnum_size +#define OLDNUM_SIZE(sp) (sp)->_oldnum_size #endif /* defined(SCROLLDEBUG) || defined(HASHDEBUG) */ NCURSES_EXPORT(void) -_nc_scroll_optimize(void) +NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_DCL0) /* scroll optimization to transform curscr to newscr */ { int i; int start, end, shift; - TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize"))); + TR(TRACE_ICALLS, (T_CALLED("_nc_scroll_optimize(%p)"), (void *) SP_PARM)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) #if USE_HASHMAP /* get enough storage */ - if (OLDNUM_SIZE < screen_lines) { - int *new_oldnums = typeRealloc(int, screen_lines, oldnums); + if (OLDNUM_SIZE(SP_PARM) < screen_lines(SP_PARM)) { + int *new_oldnums = typeRealloc(int, + (size_t) screen_lines(SP_PARM), + oldnums(SP_PARM)); if (!new_oldnums) return; - oldnums = new_oldnums; - OLDNUM_SIZE = screen_lines; + oldnums(SP_PARM) = new_oldnums; + OLDNUM_SIZE(SP_PARM) = screen_lines(SP_PARM); } /* calculate the indices */ - _nc_hash_map(); + NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_ARG); #endif #endif /* !defined(SCROLLDEBUG) && !defined(HASHDEBUG) */ #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE | TRACE_MOVE)) { - _nc_linedump(); + NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_ARG); _nc_unlock_global(tracef); } #endif /* TRACE */ /* pass 1 - from top to bottom scrolling up */ - for (i = 0; i < screen_lines;) { - while (i < screen_lines && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) <= i)) + for (i = 0; i < screen_lines(SP_PARM);) { + while (i < screen_lines(SP_PARM) + && (OLDNUM(SP_PARM, i) == _NEWINDEX || OLDNUM(SP_PARM, i) <= i)) i++; - if (i >= screen_lines) + if (i >= screen_lines(SP_PARM)) break; - shift = OLDNUM(i) - i; /* shift > 0 */ + shift = OLDNUM(SP_PARM, i) - i; /* shift > 0 */ start = i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(SP_PARM) + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) i++; end = i - 1 + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { + if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx + shift, + start, + end, + screen_lines(SP_PARM) - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -238,23 +246,33 @@ _nc_scroll_optimize(void) } /* pass 2 - from bottom to top scrolling down */ - for (i = screen_lines - 1; i >= 0;) { - while (i >= 0 && (OLDNUM(i) == _NEWINDEX || OLDNUM(i) >= i)) + for (i = screen_lines(SP_PARM) - 1; i >= 0;) { + while (i >= 0 + && (OLDNUM(SP_PARM, i) == _NEWINDEX + || OLDNUM(SP_PARM, i) >= i)) { i--; + } if (i < 0) break; - shift = OLDNUM(i) - i; /* shift < 0 */ + shift = OLDNUM(SP_PARM, i) - i; /* shift < 0 */ end = i; i--; - while (i >= 0 && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i == shift) + while (i >= 0 + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) { i--; + } start = i + 1 - (-shift); TR(TRACE_UPDATE | TRACE_MOVE, ("scroll [%d, %d] by %d", start, end, shift)); #if !defined(SCROLLDEBUG) && !defined(HASHDEBUG) - if (_nc_scrolln(shift, start, end, screen_lines - 1) == ERR) { + if (NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_ARGx + shift, + start, + end, + screen_lines(SP_PARM) - 1) == ERR) { TR(TRACE_UPDATE | TRACE_MOVE, ("unable to scroll")); continue; } @@ -263,24 +281,41 @@ _nc_scroll_optimize(void) TR(TRACE_ICALLS, (T_RETURN(""))); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_scroll_optimize(void) +{ + NCURSES_SP_NAME(_nc_scroll_optimize) (CURRENT_SCREEN); +} +#endif + #if defined(TRACE) || defined(SCROLLDEBUG) || defined(HASHDEBUG) NCURSES_EXPORT(void) -_nc_linedump(void) +NCURSES_SP_NAME(_nc_linedump) (NCURSES_SP_DCL0) /* dump the state of the real and virtual oldnum fields */ { int n; char *buf = 0; - size_t want = (screen_lines + 1) * 4; + size_t want = ((size_t) screen_lines(SP_PARM) + 1) * 4; if ((buf = typeMalloc(char, want)) != 0) { - (void) strcpy(buf, "virt"); - for (n = 0; n < screen_lines; n++) - (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(n)); - TR(TRACE_UPDATE | TRACE_MOVE, (buf)); + *buf = '\0'; + for (n = 0; n < screen_lines(SP_PARM); n++) + (void) sprintf(buf + strlen(buf), " %02d", OLDNUM(SP_PARM, n)); + TR(TRACE_UPDATE | TRACE_MOVE, ("virt %s", buf)); free(buf); } } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_linedump(void) +{ + NCURSES_SP_NAME(_nc_linedump) (CURRENT_SCREEN); +} +#endif + #endif /* defined(TRACE) || defined(SCROLLDEBUG) */ #ifdef SCROLLDEBUG diff --git a/contrib/ncurses/ncurses/tty/hashmap.c b/contrib/ncurses/ncurses/tty/hashmap.c index 9b60df62d5cf..b670e1b9691f 100644 --- a/contrib/ncurses/ncurses/tty/hashmap.c +++ b/contrib/ncurses/ncurses/tty/hashmap.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -68,9 +68,12 @@ AUTHOR *****************************************************************************/ #include -#include /* for back_color_erase */ -MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + +MODULE_ID("$Id: hashmap.c,v 1.62 2010/04/24 23:46:07 tom Exp $") #ifdef HASHDEBUG @@ -83,25 +86,25 @@ MODULE_ID("$Id: hashmap.c,v 1.56 2007/10/13 18:47:25 Miroslav.Lichvar Exp $") int oldnums[MAXLINES], reallines[MAXLINES]; static NCURSES_CH_T oldtext[MAXLINES][TEXTWIDTH]; static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; -# define OLDNUM(n) oldnums[n] -# define OLDTEXT(n) oldtext[n] -# define NEWTEXT(m) newtext[m] -# define PENDING(n) 1 +# define OLDNUM(sp,n) oldnums[n] +# define OLDTEXT(sp,n) oldtext[n] +# define NEWTEXT(sp,m) newtext[m] +# define PENDING(sp,n) 1 #else /* !HASHDEBUG */ -# define OLDNUM(n) SP->_oldnum_list[n] -# define OLDTEXT(n) curscr->_line[n].text -# define NEWTEXT(m) newscr->_line[m].text -# define TEXTWIDTH (curscr->_maxx+1) -# define PENDING(n) (newscr->_line[n].firstchar != _NOCHANGE) +# define OLDNUM(sp,n) (sp)->_oldnum_list[n] +# define OLDTEXT(sp,n) CurScreen(sp)->_line[n].text +# define NEWTEXT(sp,m) NewScreen(sp)->_line[m].text +# define TEXTWIDTH(sp) (CurScreen(sp)->_maxx + 1) +# define PENDING(sp,n) (NewScreen(sp)->_line[n].firstchar != _NOCHANGE) #endif /* !HASHDEBUG */ -#define oldhash (SP->oldhash) -#define newhash (SP->newhash) -#define hashtab (SP->hashtab) -#define lines_alloc (SP->hashtab_len) +#define oldhash(sp) ((sp)->oldhash) +#define newhash(sp) ((sp)->newhash) +#define hashtab(sp) ((sp)->hashtab) +#define lines_alloc(sp) ((sp)->hashtab_len) #if USE_WIDEC_SUPPORT #define HASH_VAL(ch) (ch.chars[0]) @@ -112,26 +115,26 @@ static NCURSES_CH_T newtext[MAXLINES][TEXTWIDTH]; static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_INLINE unsigned long -hash(NCURSES_CH_T * text) +hash(SCREEN *sp, NCURSES_CH_T * text) { int i; NCURSES_CH_T ch; unsigned long result = 0; - for (i = TEXTWIDTH; i > 0; i--) { + for (i = TEXTWIDTH(sp); i > 0; i--) { ch = *text++; - result += (result << 5) + HASH_VAL(ch); + result += (result << 5) + (unsigned long) HASH_VAL(ch); } return result; } /* approximate update cost */ static int -update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) +update_cost(SCREEN *sp, NCURSES_CH_T * from, NCURSES_CH_T * to) { int cost = 0; int i; - for (i = TEXTWIDTH; i > 0; i--, from++, to++) + for (i = TEXTWIDTH(sp); i > 0; i--, from++, to++) if (!(CharEq(*from, *to))) cost++; @@ -139,7 +142,7 @@ update_cost(NCURSES_CH_T * from, NCURSES_CH_T * to) } static int -update_cost_from_blank(NCURSES_CH_T * to) +update_cost_from_blank(SCREEN *sp, NCURSES_CH_T * to) { int cost = 0; int i; @@ -148,7 +151,7 @@ update_cost_from_blank(NCURSES_CH_T * to) if (back_color_erase) SetPair(blank, GetPair(stdscr->_nc_bkgd)); - for (i = TEXTWIDTH; i > 0; i--, to++) + for (i = TEXTWIDTH(sp); i > 0; i--, to++) if (!(CharEq(blank, *to))) cost++; @@ -160,14 +163,14 @@ update_cost_from_blank(NCURSES_CH_T * to) * effective. 'blank' indicates whether the line 'to' would become blank. */ static NCURSES_INLINE bool -cost_effective(const int from, const int to, const bool blank) +cost_effective(SCREEN *sp, const int from, const int to, const bool blank) { int new_from; if (from == to) return FALSE; - new_from = OLDNUM(from); + new_from = OLDNUM(sp, from); if (new_from == _NEWINDEX) new_from = from; @@ -175,16 +178,17 @@ cost_effective(const int from, const int to, const bool blank) * On the left side of >= is the cost before moving; * on the right side -- cost after moving. */ - return (((blank ? update_cost_from_blank(NEWTEXT(to)) - : update_cost(OLDTEXT(to), NEWTEXT(to))) - + update_cost(OLDTEXT(new_from), NEWTEXT(from))) - >= ((new_from == from ? update_cost_from_blank(NEWTEXT(from)) - : update_cost(OLDTEXT(new_from), NEWTEXT(from))) - + update_cost(OLDTEXT(from), NEWTEXT(to)))) ? TRUE : FALSE; + return (((blank ? update_cost_from_blank(sp, NEWTEXT(sp, to)) + : update_cost(sp, OLDTEXT(sp, to), NEWTEXT(sp, to))) + + update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) + >= ((new_from == from ? update_cost_from_blank(sp, NEWTEXT(sp, from)) + : update_cost(sp, OLDTEXT(sp, new_from), NEWTEXT(sp, from))) + + update_cost(sp, OLDTEXT(sp, from), NEWTEXT(sp, to)))) + ? TRUE : FALSE; } static void -grow_hunks(void) +grow_hunks(SCREEN *sp) { int start, end, shift; int back_limit, forward_limit; /* limits for cells to fill */ @@ -200,35 +204,36 @@ grow_hunks(void) back_ref_limit = 0; i = 0; - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) i++; - for (; i < screen_lines; i = next_hunk) { + for (; i < screen_lines(sp); i = next_hunk) { start = i; - shift = OLDNUM(i) - i; + shift = OLDNUM(sp, i) - i; /* get forward limit */ i = start + 1; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(sp) + && OLDNUM(sp, i) != _NEWINDEX + && OLDNUM(sp, i) - i == shift) i++; end = i; - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + while (i < screen_lines(sp) && OLDNUM(sp, i) == _NEWINDEX) i++; next_hunk = i; forward_limit = i; - if (i >= screen_lines || OLDNUM(i) >= i) + if (i >= screen_lines(sp) || OLDNUM(sp, i) >= i) forward_ref_limit = i; else - forward_ref_limit = OLDNUM(i); + forward_ref_limit = OLDNUM(sp, i); i = start - 1; /* grow back */ if (shift < 0) back_limit = back_ref_limit + (-shift); while (i >= back_limit) { - if (newhash[i] == oldhash[i + shift] - || cost_effective(i + shift, i, shift < 0)) { - OLDNUM(i) = i + shift; + if (newhash(sp)[i] == oldhash(sp)[i + shift] + || cost_effective(sp, i + shift, i, shift < 0)) { + OLDNUM(sp, i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (backward continuation)", i, i + shift)); @@ -246,9 +251,9 @@ grow_hunks(void) if (shift > 0) forward_limit = forward_ref_limit - shift; while (i < forward_limit) { - if (newhash[i] == oldhash[i + shift] - || cost_effective(i + shift, i, shift > 0)) { - OLDNUM(i) = i + shift; + if (newhash(sp)[i] == oldhash(sp)[i + shift] + || cost_effective(sp, i + shift, i, shift > 0)) { + OLDNUM(sp, i) = i + shift; TR(TRACE_UPDATE | TRACE_MOVE, ("connected new line %d to old line %d (forward continuation)", i, i + shift)); @@ -268,51 +273,54 @@ grow_hunks(void) } NCURSES_EXPORT(void) -_nc_hash_map(void) +NCURSES_SP_NAME(_nc_hash_map) (NCURSES_SP_DCL0) { - HASHMAP *sp; + HASHMAP *hsp; register int i; int start, shift, size; - if (screen_lines > lines_alloc) { - if (hashtab) - free(hashtab); - hashtab = typeMalloc(HASHMAP, (screen_lines + 1) * 2); - if (!hashtab) { - if (oldhash) { - FreeAndNull(oldhash); + if (screen_lines(SP_PARM) > lines_alloc(SP_PARM)) { + if (hashtab(SP_PARM)) + free(hashtab(SP_PARM)); + hashtab(SP_PARM) = typeMalloc(HASHMAP, + ((size_t) screen_lines(SP_PARM) + 1) * 2); + if (!hashtab(SP_PARM)) { + if (oldhash(SP_PARM)) { + FreeAndNull(oldhash(SP_PARM)); } - lines_alloc = 0; + lines_alloc(SP_PARM) = 0; return; } - lines_alloc = screen_lines; + lines_alloc(SP_PARM) = screen_lines(SP_PARM); } - if (oldhash && newhash) { + if (oldhash(SP_PARM) && newhash(SP_PARM)) { /* re-hash only changed lines */ - for (i = 0; i < screen_lines; i++) { - if (PENDING(i)) - newhash[i] = hash(NEWTEXT(i)); + for (i = 0; i < screen_lines(SP_PARM); i++) { + if (PENDING(SP_PARM, i)) + newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); } } else { /* re-hash all */ - if (oldhash == 0) - oldhash = typeCalloc(unsigned long, (unsigned) screen_lines); - if (newhash == 0) - newhash = typeCalloc(unsigned long, (unsigned) screen_lines); - if (!oldhash || !newhash) + if (oldhash(SP_PARM) == 0) + oldhash(SP_PARM) = typeCalloc(unsigned long, + (size_t) screen_lines(SP_PARM)); + if (newhash(SP_PARM) == 0) + newhash(SP_PARM) = typeCalloc(unsigned long, + (size_t) screen_lines(SP_PARM)); + if (!oldhash(SP_PARM) || !newhash(SP_PARM)) return; /* malloc failure */ - for (i = 0; i < screen_lines; i++) { - newhash[i] = hash(NEWTEXT(i)); - oldhash[i] = hash(OLDTEXT(i)); + for (i = 0; i < screen_lines(SP_PARM); i++) { + newhash(SP_PARM)[i] = hash(SP_PARM, NEWTEXT(SP_PARM, i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } } #ifdef HASH_VERIFY - for (i = 0; i < screen_lines; i++) { - if (newhash[i] != hash(NEWTEXT(i))) + for (i = 0; i < screen_lines(SP_PARM); i++) { + if (newhash(SP_PARM)[i] != hash(SP_PARM, NEWTEXT(SP_PARM, i))) fprintf(stderr, "error in newhash[%d]\n", i); - if (oldhash[i] != hash(OLDTEXT(i))) + if (oldhash(SP_PARM)[i] != hash(SP_PARM, OLDTEXT(SP_PARM, i))) fprintf(stderr, "error in oldhash[%d]\n", i); } #endif @@ -320,28 +328,30 @@ _nc_hash_map(void) /* * Set up and count line-hash values. */ - memset(hashtab, '\0', sizeof(*hashtab) * (screen_lines + 1) * 2); - for (i = 0; i < screen_lines; i++) { - unsigned long hashval = oldhash[i]; + memset(hashtab(SP_PARM), '\0', + sizeof(*(hashtab(SP_PARM))) + * ((size_t) screen_lines(SP_PARM) + 1) * 2); + for (i = 0; i < screen_lines(SP_PARM); i++) { + unsigned long hashval = oldhash(SP_PARM)[i]; - for (sp = hashtab; sp->hashval; sp++) - if (sp->hashval == hashval) + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->hashval == hashval) break; - sp->hashval = hashval; /* in case this is a new entry */ - sp->oldcount++; - sp->oldindex = i; + hsp->hashval = hashval; /* in case this is a new entry */ + hsp->oldcount++; + hsp->oldindex = i; } - for (i = 0; i < screen_lines; i++) { - unsigned long hashval = newhash[i]; + for (i = 0; i < screen_lines(SP_PARM); i++) { + unsigned long hashval = newhash(SP_PARM)[i]; - for (sp = hashtab; sp->hashval; sp++) - if (sp->hashval == hashval) + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->hashval == hashval) break; - sp->hashval = hashval; /* in case this is a new entry */ - sp->newcount++; - sp->newindex = i; + hsp->hashval = hashval; /* in case this is a new entry */ + hsp->newcount++; + hsp->newindex = i; - OLDNUM(i) = _NEWINDEX; /* initialize old indices array */ + OLDNUM(SP_PARM, i) = _NEWINDEX; /* initialize old indices array */ } /* @@ -351,16 +361,16 @@ _nc_hash_map(void) * extending hunks by cost_effective. Otherwise, it does not * have any side effects. */ - for (sp = hashtab; sp->hashval; sp++) - if (sp->oldcount == 1 && sp->newcount == 1 - && sp->oldindex != sp->newindex) { + for (hsp = hashtab(SP_PARM); hsp->hashval; hsp++) + if (hsp->oldcount == 1 && hsp->newcount == 1 + && hsp->oldindex != hsp->newindex) { TR(TRACE_UPDATE | TRACE_MOVE, ("new line %d is hash-identical to old line %d (unique)", - sp->newindex, sp->oldindex)); - OLDNUM(sp->newindex) = sp->oldindex; + hsp->newindex, hsp->oldindex)); + OLDNUM(SP_PARM, hsp->newindex) = hsp->oldindex; } - grow_hunks(); + grow_hunks(SP_PARM); /* * Eliminate bad or impossible shifts -- this includes removing @@ -368,58 +378,83 @@ _nc_hash_map(void) * those which are to be moved too far, they are likely to destroy * more than carry. */ - for (i = 0; i < screen_lines;) { - while (i < screen_lines && OLDNUM(i) == _NEWINDEX) + for (i = 0; i < screen_lines(SP_PARM);) { + while (i < screen_lines(SP_PARM) && OLDNUM(SP_PARM, i) == _NEWINDEX) i++; - if (i >= screen_lines) + if (i >= screen_lines(SP_PARM)) break; start = i; - shift = OLDNUM(i) - i; + shift = OLDNUM(SP_PARM, i) - i; i++; - while (i < screen_lines && OLDNUM(i) != _NEWINDEX && OLDNUM(i) - i - == shift) + while (i < screen_lines(SP_PARM) + && OLDNUM(SP_PARM, i) != _NEWINDEX + && OLDNUM(SP_PARM, i) - i == shift) i++; size = i - start; if (size < 3 || size + min(size / 8, 2) < abs(shift)) { while (start < i) { - OLDNUM(start) = _NEWINDEX; + OLDNUM(SP_PARM, start) = _NEWINDEX; start++; } } } /* After clearing invalid hunks, try grow the rest. */ - grow_hunks(); + grow_hunks(SP_PARM); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_hash_map(void) +{ + NCURSES_SP_NAME(_nc_hash_map) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_make_oldhash) (NCURSES_SP_DCLx int i) +{ + if (oldhash(SP_PARM)) + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_make_oldhash(int i) { - if (oldhash) - oldhash[i] = hash(OLDTEXT(i)); + NCURSES_SP_NAME(_nc_make_oldhash) (CURRENT_SCREEN, i); } +#endif NCURSES_EXPORT(void) -_nc_scroll_oldhash(int n, int top, int bot) +NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_DCLx int n, int top, int bot) { size_t size; int i; - if (!oldhash) + if (!oldhash(SP_PARM)) return; - size = sizeof(*oldhash) * (bot - top + 1 - abs(n)); + size = sizeof(*(oldhash(SP_PARM))) * (size_t) (bot - top + 1 - abs(n)); if (n > 0) { - memmove(oldhash + top, oldhash + top + n, size); + memmove(oldhash(SP_PARM) + top, oldhash(SP_PARM) + top + n, size); for (i = bot; i > bot - n; i--) - oldhash[i] = hash(OLDTEXT(i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } else { - memmove(oldhash + top - n, oldhash + top, size); + memmove(oldhash(SP_PARM) + top - n, oldhash(SP_PARM) + top, size); for (i = top; i < top - n; i++) - oldhash[i] = hash(OLDTEXT(i)); + oldhash(SP_PARM)[i] = hash(SP_PARM, OLDTEXT(SP_PARM, i)); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_scroll_oldhash(int n, int top, int bot) +{ + NCURSES_SP_NAME(_nc_scroll_oldhash) (CURRENT_SCREEN, n, top, bot); +} +#endif + #ifdef HASHDEBUG static void usage(void) diff --git a/contrib/ncurses/ncurses/tty/lib_mvcur.c b/contrib/ncurses/ncurses/tty/lib_mvcur.c index 8e66fa3bf64c..ad41f8dd72d8 100644 --- a/contrib/ncurses/ncurses/tty/lib_mvcur.c +++ b/contrib/ncurses/ncurses/tty/lib_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -109,8 +110,8 @@ * LONG_DIST and (b) further inward from the right or left edge than LONG_DIST, * we'll consider nonlocal. */ -#define NOT_LOCAL(fy, fx, ty, tx) ((tx > LONG_DIST) \ - && (tx < screen_columns - 1 - LONG_DIST) \ +#define NOT_LOCAL(sp, fy, fx, ty, tx) ((tx > LONG_DIST) \ + && (tx < screen_columns(sp) - 1 - LONG_DIST) \ && (abs(ty-fy) + abs(tx-fx) > LONG_DIST)) /**************************************************************************** @@ -152,13 +153,21 @@ */ #include -#include #include -MODULE_ID("$Id: lib_mvcur.c,v 1.113 2008/08/16 19:30:58 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define WANT_CHAR(y, x) SP->_newscr->_line[y].text[x] /* desired state */ -#define BAUDRATE cur_term->_baudrate /* bits per second */ +MODULE_ID("$Id: lib_mvcur.c,v 1.126 2011/01/22 19:48:21 tom Exp $") + +#define WANT_CHAR(sp, y, x) NewScreen(sp)->_line[y].text[x] /* desired state */ + +#if NCURSES_SP_FUNCS +#define BAUDRATE(sp) sp->_term->_baudrate /* bits per second */ +#else +#define BAUDRATE(sp) cur_term->_baudrate /* bits per second */ +#endif #if defined(MAIN) || defined(NCURSES_TEST) #include @@ -169,7 +178,7 @@ static float diff; #define OPT_SIZE 512 -static int normalized_cost(const char *const cap, int affcnt); +static int normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt); /**************************************************************************** * @@ -179,34 +188,34 @@ static int normalized_cost(const char *const cap, int affcnt); #ifdef TRACE static int -trace_cost_of(const char *capname, const char *cap, int affcnt) +trace_cost_of(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) { - int result = _nc_msec_cost(cap, affcnt); + int result = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("CostOf %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define CostOf(cap,affcnt) trace_cost_of(#cap,cap,affcnt); +#define CostOf(cap,affcnt) trace_cost_of(NCURSES_SP_ARGx #cap, cap, affcnt) static int -trace_normalized_cost(const char *capname, const char *cap, int affcnt) +trace_normalized_cost(NCURSES_SP_DCLx const char *capname, const char *cap, int affcnt) { - int result = normalized_cost(cap, affcnt); + int result = normalized_cost(NCURSES_SP_ARGx cap, affcnt); TR(TRACE_CHARPUT | TRACE_MOVE, ("NormalizedCost %s %d %s", capname, result, _nc_visbuf(cap))); return result; } -#define NormalizedCost(cap,affcnt) trace_normalized_cost(#cap,cap,affcnt); +#define NormalizedCost(cap,affcnt) trace_normalized_cost(NCURSES_SP_ARGx #cap, cap, affcnt) #else -#define CostOf(cap,affcnt) _nc_msec_cost(cap,affcnt); -#define NormalizedCost(cap,affcnt) normalized_cost(cap,affcnt); +#define CostOf(cap,affcnt) NCURSES_SP_NAME(_nc_msec_cost)(NCURSES_SP_ARGx cap, affcnt) +#define NormalizedCost(cap,affcnt) normalized_cost(NCURSES_SP_ARGx cap, affcnt) #endif NCURSES_EXPORT(int) -_nc_msec_cost(const char *const cap, int affcnt) +NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_DCLx const char *const cap, int affcnt) /* compute the cost of a given operation */ { if (cap == 0) @@ -222,53 +231,68 @@ _nc_msec_cost(const char *const cap, int affcnt) for (cp += 2; *cp != '>'; cp++) { if (isdigit(UChar(*cp))) - number = number * 10 + (*cp - '0'); + number = number * 10 + (float) (*cp - '0'); else if (*cp == '*') - number *= affcnt; + number *= (float) affcnt; else if (*cp == '.' && (*++cp != '>') && isdigit(UChar(*cp))) - number += (*cp - '0') / 10.0; + number += (float) ((*cp - '0') / 10.0); } #if NCURSES_NO_PADDING - if (!GetNoPadding(SP)) + if (!GetNoPadding(SP_PARM)) #endif cum_cost += number * 10; - } else - cum_cost += SP->_char_padding; + } else if (SP_PARM) { + cum_cost += (float) SP_PARM->_char_padding; + } } return ((int) cum_cost); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_msec_cost(const char *const cap, int affcnt) +{ + return NCURSES_SP_NAME(_nc_msec_cost) (CURRENT_SCREEN, cap, affcnt); +} +#endif + static int -normalized_cost(const char *const cap, int affcnt) +normalized_cost(NCURSES_SP_DCLx const char *const cap, int affcnt) /* compute the effective character-count for an operation (round up) */ { - int cost = _nc_msec_cost(cap, affcnt); + int cost = NCURSES_SP_NAME(_nc_msec_cost) (NCURSES_SP_ARGx cap, affcnt); if (cost != INFINITY) - cost = (cost + SP->_char_padding - 1) / SP->_char_padding; + cost = (cost + SP_PARM->_char_padding - 1) / SP_PARM->_char_padding; return cost; } static void -reset_scroll_region(void) +reset_scroll_region(NCURSES_SP_DCL0) /* Set the scroll-region to a known state (the default) */ { if (change_scroll_region) { - TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, screen_lines - 1)); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "change_scroll_region", + TPARM_2(change_scroll_region, + 0, screen_lines(SP_PARM) - 1)); } } NCURSES_EXPORT(void) -_nc_mvcur_resume(void) +NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_DCL0) /* what to do at initialization time and after each shellout */ { + if (SP_PARM && !IsTermInfo(SP_PARM)) + return; + /* initialize screen for cursor access */ if (enter_ca_mode) { - TPUTS_TRACE("enter_ca_mode"); - putp(enter_ca_mode); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "enter_ca_mode", + enter_ca_mode); } /* @@ -280,53 +304,63 @@ _nc_mvcur_resume(void) * they know the screen size. This is useful when you're running * a vt100 emulation through xterm. */ - reset_scroll_region(); - SP->_cursrow = SP->_curscol = -1; + reset_scroll_region(NCURSES_SP_ARG); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; /* restore cursor shape */ - if (SP->_cursor != -1) { - int cursor = SP->_cursor; - SP->_cursor = -1; - curs_set(cursor); + if (SP_PARM->_cursor != -1) { + int cursor = SP_PARM->_cursor; + SP_PARM->_cursor = -1; + NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx cursor); } } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_init(void) +_nc_mvcur_resume(void) +{ + NCURSES_SP_NAME(_nc_mvcur_resume) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_mvcur_init) (NCURSES_SP_DCL0) /* initialize the cost structure */ { - if (isatty(fileno(SP->_ofp))) - SP->_char_padding = ((BAUDBYTE * 1000 * 10) - / (BAUDRATE > 0 ? BAUDRATE : 9600)); + if (SP_PARM->_ofp && isatty(fileno(SP_PARM->_ofp))) + SP_PARM->_char_padding = ((BAUDBYTE * 1000 * 10) + / (BAUDRATE(SP_PARM) > 0 + ? BAUDRATE(SP_PARM) + : 9600)); else - SP->_char_padding = 1; /* must be nonzero */ - if (SP->_char_padding <= 0) - SP->_char_padding = 1; /* must be nonzero */ - TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP->_char_padding)); + SP_PARM->_char_padding = 1; /* must be nonzero */ + if (SP_PARM->_char_padding <= 0) + SP_PARM->_char_padding = 1; /* must be nonzero */ + TR(TRACE_CHARPUT | TRACE_MOVE, ("char_padding %d msecs", SP_PARM->_char_padding)); /* non-parameterized local-motion strings */ - SP->_cr_cost = CostOf(carriage_return, 0); - SP->_home_cost = CostOf(cursor_home, 0); - SP->_ll_cost = CostOf(cursor_to_ll, 0); + SP_PARM->_cr_cost = CostOf(carriage_return, 0); + SP_PARM->_home_cost = CostOf(cursor_home, 0); + SP_PARM->_ll_cost = CostOf(cursor_to_ll, 0); #if USE_HARD_TABS if (getenv("NCURSES_NO_HARD_TABS") == 0) { - SP->_ht_cost = CostOf(tab, 0); - SP->_cbt_cost = CostOf(back_tab, 0); + SP_PARM->_ht_cost = CostOf(tab, 0); + SP_PARM->_cbt_cost = CostOf(back_tab, 0); } else { - SP->_ht_cost = INFINITY; - SP->_cbt_cost = INFINITY; + SP_PARM->_ht_cost = INFINITY; + SP_PARM->_cbt_cost = INFINITY; } #endif /* USE_HARD_TABS */ - SP->_cub1_cost = CostOf(cursor_left, 0); - SP->_cuf1_cost = CostOf(cursor_right, 0); - SP->_cud1_cost = CostOf(cursor_down, 0); - SP->_cuu1_cost = CostOf(cursor_up, 0); + SP_PARM->_cub1_cost = CostOf(cursor_left, 0); + SP_PARM->_cuf1_cost = CostOf(cursor_right, 0); + SP_PARM->_cud1_cost = CostOf(cursor_down, 0); + SP_PARM->_cuu1_cost = CostOf(cursor_up, 0); - SP->_smir_cost = CostOf(enter_insert_mode, 0); - SP->_rmir_cost = CostOf(exit_insert_mode, 0); - SP->_ip_cost = 0; + SP_PARM->_smir_cost = CostOf(enter_insert_mode, 0); + SP_PARM->_rmir_cost = CostOf(exit_insert_mode, 0); + SP_PARM->_ip_cost = 0; if (insert_padding) { - SP->_ip_cost = CostOf(insert_padding, 0); + SP_PARM->_ip_cost = CostOf(insert_padding, 0); } /* @@ -335,7 +369,7 @@ _nc_mvcur_init(void) * can treat it like absolute screen addressing. This seems to be true * for all cursor_mem_address terminal types in the terminfo database. */ - SP->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; + SP_PARM->_address_cursor = cursor_address ? cursor_address : cursor_mem_address; /* * Parametrized local-motion strings. This static cost computation @@ -361,40 +395,43 @@ _nc_mvcur_init(void) * All these averages depend on the assumption that all parameter values * are equally probable. */ - SP->_cup_cost = CostOf(TPARM_2(SP->_address_cursor, 23, 23), 1); - SP->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); - SP->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); - SP->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); - SP->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); - SP->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); - SP->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); + SP_PARM->_cup_cost = CostOf(TPARM_2(SP_PARM->_address_cursor, 23, 23), 1); + SP_PARM->_cub_cost = CostOf(TPARM_1(parm_left_cursor, 23), 1); + SP_PARM->_cuf_cost = CostOf(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_cud_cost = CostOf(TPARM_1(parm_down_cursor, 23), 1); + SP_PARM->_cuu_cost = CostOf(TPARM_1(parm_up_cursor, 23), 1); + SP_PARM->_hpa_cost = CostOf(TPARM_1(column_address, 23), 1); + SP_PARM->_vpa_cost = CostOf(TPARM_1(row_address, 23), 1); /* non-parameterized screen-update strings */ - SP->_ed_cost = NormalizedCost(clr_eos, 1); - SP->_el_cost = NormalizedCost(clr_eol, 1); - SP->_el1_cost = NormalizedCost(clr_bol, 1); - SP->_dch1_cost = NormalizedCost(delete_character, 1); - SP->_ich1_cost = NormalizedCost(insert_character, 1); + SP_PARM->_ed_cost = NormalizedCost(clr_eos, 1); + SP_PARM->_el_cost = NormalizedCost(clr_eol, 1); + SP_PARM->_el1_cost = NormalizedCost(clr_bol, 1); + SP_PARM->_dch1_cost = NormalizedCost(delete_character, 1); + SP_PARM->_ich1_cost = NormalizedCost(insert_character, 1); /* * If this is a bce-terminal, we want to bias the choice so we use clr_eol * rather than spaces at the end of a line. */ if (back_color_erase) - SP->_el_cost = 0; + SP_PARM->_el_cost = 0; /* parameterized screen-update strings */ - SP->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); - SP->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); - SP->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); - SP->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); + SP_PARM->_dch_cost = NormalizedCost(TPARM_1(parm_dch, 23), 1); + SP_PARM->_ich_cost = NormalizedCost(TPARM_1(parm_ich, 23), 1); + SP_PARM->_ech_cost = NormalizedCost(TPARM_1(erase_chars, 23), 1); + SP_PARM->_rep_cost = NormalizedCost(TPARM_2(repeat_char, ' ', 23), 1); - SP->_cup_ch_cost = NormalizedCost(TPARM_2(SP->_address_cursor, 23, 23), 1); - SP->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); - SP->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); - SP->_inline_cost = min(SP->_cup_ch_cost, - min(SP->_hpa_ch_cost, - SP->_cuf_ch_cost)); + SP_PARM->_cup_ch_cost = NormalizedCost( + TPARM_2(SP_PARM->_address_cursor, + 23, 23), + 1); + SP_PARM->_hpa_ch_cost = NormalizedCost(TPARM_1(column_address, 23), 1); + SP_PARM->_cuf_ch_cost = NormalizedCost(TPARM_1(parm_right_cursor, 23), 1); + SP_PARM->_inline_cost = min(SP_PARM->_cup_ch_cost, + min(SP_PARM->_hpa_ch_cost, + SP_PARM->_cuf_ch_cost)); /* * If save_cursor is used within enter_ca_mode, we should not use it for @@ -411,30 +448,42 @@ _nc_mvcur_init(void) } /* - * A different, possibly better way to arrange this would be to set - * SP->_endwin = TRUE at window initialization time and let this be + * A different, possibly better way to arrange this would be to set the + * SCREEN's _endwin to TRUE at window initialization time and let this be * called by doupdate's return-from-shellout code. */ - _nc_mvcur_resume(); + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); } +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) -_nc_mvcur_wrap(void) +_nc_mvcur_init(void) +{ + NCURSES_SP_NAME(_nc_mvcur_init) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_mvcur_wrap) (NCURSES_SP_DCL0) /* wrap up cursor-addressing mode */ { /* leave cursor at screen bottom */ - mvcur(-1, -1, screen_lines - 1, 0); + TINFO_MVCUR(NCURSES_SP_ARGx -1, -1, screen_lines(SP_PARM) - 1, 0); + + if (!SP_PARM || !IsTermInfo(SP_PARM)) + return; /* set cursor to normal mode */ - if (SP->_cursor != -1) { - int cursor = SP->_cursor; - curs_set(1); - SP->_cursor = cursor; + if (SP_PARM->_cursor != -1) { + int cursor = SP_PARM->_cursor; + NCURSES_SP_NAME(curs_set) (NCURSES_SP_ARGx 1); + SP_PARM->_cursor = cursor; } if (exit_ca_mode) { - TPUTS_TRACE("exit_ca_mode"); - putp(exit_ca_mode); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "exit_ca_mode", + exit_ca_mode); } /* * Reset terminal's tab counter. There's a long-time bug that @@ -444,9 +493,17 @@ _nc_mvcur_wrap(void) * escape sequences that reset things as column positions. * Utter a \r to reset this invisibly. */ - _nc_outch('\r'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_mvcur_wrap(void) +{ + NCURSES_SP_NAME(_nc_mvcur_wrap) (CURRENT_SCREEN); +} +#endif + /**************************************************************************** * * Optimized cursor movement @@ -459,7 +516,7 @@ _nc_mvcur_wrap(void) static NCURSES_INLINE int repeated_append(string_desc * target, int total, int num, int repeat, const char *src) { - size_t need = repeat * strlen(src); + size_t need = (size_t) repeat * strlen(src); if (need < target->s_size) { while (repeat-- > 0) { @@ -486,8 +543,13 @@ repeated_append(string_desc * target, int total, int num, int repeat, const char #define LASTTAB(fr) ((fr > 0) ? ((fr - 1) / init_tabs) * init_tabs : -1) static int -relative_move(string_desc * target, int from_y, int from_x, int to_y, int - to_x, bool ovw) +relative_move(NCURSES_SP_DCLx + string_desc * target, + int from_y, + int from_x, + int to_y, + int to_x, + bool ovw) /* move via local motions (cuu/cuu1/cud/cud1/cub1/cub/cuf1/cuf/vpa/hpa) */ { string_desc save; @@ -500,38 +562,38 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (row_address != 0 && _nc_safe_strcat(target, TPARM_1(row_address, to_y))) { - vcost = SP->_vpa_cost; + vcost = SP_PARM->_vpa_cost; } if (to_y > from_y) { n = (to_y - from_y); if (parm_down_cursor - && SP->_cud_cost < vcost + && SP_PARM->_cud_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_down_cursor, n))) { - vcost = SP->_cud_cost; + vcost = SP_PARM->_cud_cost; } if (cursor_down - && (*cursor_down != '\n' || SP->_nl) - && (n * SP->_cud1_cost < vcost)) { + && (*cursor_down != '\n' || SP_PARM->_nl) + && (n * SP_PARM->_cud1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP->_cud1_cost, n, cursor_down); + SP_PARM->_cud1_cost, n, cursor_down); } } else { /* (to_y < from_y) */ n = (from_y - to_y); if (parm_up_cursor - && SP->_cuu_cost < vcost + && SP_PARM->_cuu_cost < vcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_up_cursor, n))) { - vcost = SP->_cuu_cost; + vcost = SP_PARM->_cuu_cost; } - if (cursor_up && (n * SP->_cuu1_cost < vcost)) { + if (cursor_up && (n * SP_PARM->_cuu1_cost < vcost)) { vcost = repeated_append(_nc_str_copy(target, &save), 0, - SP->_cuu1_cost, n, cursor_up); + SP_PARM->_cuu1_cost, n, cursor_up); } } @@ -550,17 +612,17 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int if (column_address && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(column_address, to_x))) { - hcost = SP->_hpa_cost; + hcost = SP_PARM->_hpa_cost; } if (to_x > from_x) { n = to_x - from_x; if (parm_right_cursor - && SP->_cuf_cost < hcost + && SP_PARM->_cuf_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_right_cursor, n))) { - hcost = SP->_cuf_cost; + hcost = SP_PARM->_cuf_cost; } if (cursor_right) { @@ -575,7 +637,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int for (fr = from_x; (nxt = NEXTTAB(fr)) <= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP->_ht_cost, 1, tab); + SP_PARM->_ht_cost, 1, tab); if (lhcost == INFINITY) break; } @@ -599,7 +661,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int && n < (int) check.s_size && vcost == 0 && str[0] == '\0') { - int wanted = CharOf(WANT_CHAR(to_y, from_x)); + int wanted = CharOf(WANT_CHAR(SP_PARM, to_y, from_x)); if (is8bits(wanted) && isdigit(wanted)) ovw = FALSE; } @@ -616,8 +678,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) { - NCURSES_CH_T ch = WANT_CHAR(to_y, from_x + i); - if (!SameAttrOf(ch, SCREEN_ATTRS(SP)) + NCURSES_CH_T ch = WANT_CHAR(SP_PARM, to_y, from_x + i); + if (!SameAttrOf(ch, SCREEN_ATTRS(SP_PARM)) #if USE_WIDEC_SUPPORT || !Charable(ch) #endif @@ -631,13 +693,13 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int int i; for (i = 0; i < n; i++) - *check.s_tail++ = (char) CharOf(WANT_CHAR(to_y, + *check.s_tail++ = (char) CharOf(WANT_CHAR(SP_PARM, to_y, from_x + i)); *check.s_tail = '\0'; - check.s_size -= n; - lhcost += n * SP->_char_padding; + check.s_size -= (size_t) n; + lhcost += n * SP_PARM->_char_padding; } else { - lhcost = repeated_append(&check, lhcost, SP->_cuf1_cost, + lhcost = repeated_append(&check, lhcost, SP_PARM->_cuf1_cost, n, cursor_right); } @@ -650,10 +712,10 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int n = from_x - to_x; if (parm_left_cursor - && SP->_cub_cost < hcost + && SP_PARM->_cub_cost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), TPARM_1(parm_left_cursor, n))) { - hcost = SP->_cub_cost; + hcost = SP_PARM->_cub_cost; } if (cursor_left) { @@ -667,7 +729,8 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int for (fr = from_x; (nxt = LASTTAB(fr)) >= to_x; fr = nxt) { lhcost = repeated_append(&check, lhcost, - SP->_cbt_cost, 1, back_tab); + SP_PARM->_cbt_cost, + 1, back_tab); if (lhcost == INFINITY) break; } @@ -676,7 +739,9 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int } #endif /* USE_HARD_TABS */ - lhcost = repeated_append(&check, lhcost, SP->_cub1_cost, n, cursor_left); + lhcost = repeated_append(&check, lhcost, + SP_PARM->_cub1_cost, + n, cursor_left); if (lhcost < hcost && _nc_safe_strcat(_nc_str_copy(target, &save), str)) { @@ -705,7 +770,7 @@ relative_move(string_desc * target, int from_y, int from_x, int to_y, int */ static NCURSES_INLINE int -onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) +onscreen_mvcur(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew, bool ovw) /* onscreen move from (yold, xold) to (ynew, xnew) */ { string_desc result; @@ -723,9 +788,9 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) #define InitResult _nc_str_init(&result, buffer, sizeof(buffer)) /* tactic #0: use direct cursor addressing */ - if (_nc_safe_strcpy(InitResult, TPARM_2(SP->_address_cursor, ynew, xnew))) { + if (_nc_safe_strcpy(InitResult, TPARM_2(SP_PARM->_address_cursor, ynew, xnew))) { tactic = 0; - usecost = SP->_cup_cost; + usecost = SP_PARM->_cup_cost; #if defined(TRACE) || defined(NCURSES_TEST) if (!(_nc_optimize_enable & OPTIMIZE_MVCUR)) @@ -740,7 +805,7 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) * (like, say, local-movement \n getting mapped to some obscure * character because A_ALTCHARSET is on). */ - if (yold == -1 || xold == -1 || NOT_LOCAL(yold, xold, ynew, xnew)) { + if (yold == -1 || xold == -1 || NOT_LOCAL(SP_PARM, yold, xold, ynew, xnew)) { #if defined(MAIN) || defined(NCURSES_TEST) if (!profiling) { (void) fputs("nonlocal\n", stderr); @@ -754,8 +819,10 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) #ifndef NO_OPTIMIZE /* tactic #1: use local movement */ if (yold != -1 && xold != -1 - && ((newcost = relative_move(NullResult, yold, xold, ynew, xnew, - ovw)) != INFINITY) + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold, xold, + ynew, xnew, ovw)) != INFINITY) && newcost < usecost) { tactic = 1; usecost = newcost; @@ -763,42 +830,51 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) /* tactic #2: use carriage-return + local movement */ if (yold != -1 && carriage_return - && ((newcost = relative_move(NullResult, yold, 0, ynew, xnew, ovw)) - != INFINITY) - && SP->_cr_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_cr_cost + newcost < usecost) { tactic = 2; - usecost = SP->_cr_cost + newcost; + usecost = SP_PARM->_cr_cost + newcost; } /* tactic #3: use home-cursor + local movement */ if (cursor_home - && ((newcost = relative_move(NullResult, 0, 0, ynew, xnew, ovw)) != INFINITY) - && SP->_home_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + 0, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_home_cost + newcost < usecost) { tactic = 3; - usecost = SP->_home_cost + newcost; + usecost = SP_PARM->_home_cost + newcost; } /* tactic #4: use home-down + local movement */ if (cursor_to_ll - && ((newcost = relative_move(NullResult, screen_lines - 1, 0, ynew, - xnew, ovw)) != INFINITY) - && SP->_ll_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + screen_lines(SP_PARM) - 1, 0, + ynew, xnew, ovw)) != INFINITY) + && SP_PARM->_ll_cost + newcost < usecost) { tactic = 4; - usecost = SP->_ll_cost + newcost; + usecost = SP_PARM->_ll_cost + newcost; } /* * tactic #5: use left margin for wrap to right-hand side, * unless strange wrap behavior indicated by xenl might hose us. */ - t5_cr_cost = (xold > 0 ? SP->_cr_cost : 0); + t5_cr_cost = (xold > 0 ? SP_PARM->_cr_cost : 0); if (auto_left_margin && !eat_newline_glitch && yold > 0 && cursor_left - && ((newcost = relative_move(NullResult, yold - 1, screen_columns - - 1, ynew, xnew, ovw)) != INFINITY) - && t5_cr_cost + SP->_cub1_cost + newcost < usecost) { + && ((newcost = relative_move(NCURSES_SP_ARGx + NullResult, + yold - 1, screen_columns(SP_PARM) - 1, + ynew, xnew, ovw)) != INFINITY) + && t5_cr_cost + SP_PARM->_cub1_cost + newcost < usecost) { tactic = 5; - usecost = t5_cr_cost + SP->_cub1_cost + newcost; + usecost = t5_cr_cost + SP_PARM->_cub1_cost + newcost; } /* @@ -808,26 +884,39 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) InitResult; switch (tactic) { case 1: - (void) relative_move(&result, yold, xold, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold, xold, + ynew, xnew, ovw); break; case 2: (void) _nc_safe_strcpy(&result, carriage_return); - (void) relative_move(&result, yold, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold, 0, + ynew, xnew, ovw); break; case 3: (void) _nc_safe_strcpy(&result, cursor_home); - (void) relative_move(&result, 0, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, 0, 0, + ynew, xnew, ovw); break; case 4: (void) _nc_safe_strcpy(&result, cursor_to_ll); - (void) relative_move(&result, screen_lines - 1, 0, ynew, xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + screen_lines(SP_PARM) - 1, 0, + ynew, xnew, ovw); break; case 5: if (xold > 0) (void) _nc_safe_strcat(&result, carriage_return); (void) _nc_safe_strcat(&result, cursor_left); - (void) relative_move(&result, yold - 1, screen_columns - 1, ynew, - xnew, ovw); + (void) relative_move(NCURSES_SP_ARGx + &result, + yold - 1, screen_columns(SP_PARM) - 1, + ynew, xnew, ovw); break; } #endif /* !NO_OPTIMIZE */ @@ -845,25 +934,26 @@ onscreen_mvcur(int yold, int xold, int ynew, int xnew, bool ovw) if (usecost != INFINITY) { TPUTS_TRACE("mvcur"); - tputs(buffer, 1, _nc_outch); - SP->_cursrow = ynew; - SP->_curscol = xnew; + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + buffer, 1, NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_cursrow = ynew; + SP_PARM->_curscol = xnew; return (OK); } else return (ERR); } NCURSES_EXPORT(int) -mvcur(int yold, int xold, int ynew, int xnew) +TINFO_MVCUR(NCURSES_SP_DCLx int yold, int xold, int ynew, int xnew) /* optimized cursor move from (yold, xold) to (ynew, xnew) */ { NCURSES_CH_T oldattr; int code; - TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("mvcur(%d,%d,%d,%d)"), - yold, xold, ynew, xnew)); + TR(TRACE_CALLS | TRACE_MOVE, (T_CALLED("_nc_tinfo_mvcur(%p,%d,%d,%d,%d)"), + (void *) SP_PARM, yold, xold, ynew, xnew)); - if (SP == 0) { + if (SP_PARM == 0) { code = ERR; } else if (yold == ynew && xold == xnew) { code = OK; @@ -874,9 +964,9 @@ mvcur(int yold, int xold, int ynew, int xnew) * column position implied by wraparound or the lack thereof and * rolling up the screen to get ynew on the screen. */ - if (xnew >= screen_columns) { - ynew += xnew / screen_columns; - xnew %= screen_columns; + if (xnew >= screen_columns(SP_PARM)) { + ynew += xnew / screen_columns(SP_PARM); + xnew %= screen_columns(SP_PARM); } /* @@ -884,38 +974,40 @@ mvcur(int yold, int xold, int ynew, int xnew) * character set -- these have a strong tendency to screw up the CR & * LF used for local character motions! */ - oldattr = SCREEN_ATTRS(SP); + oldattr = SCREEN_ATTRS(SP_PARM); if ((AttrOf(oldattr) & A_ALTCHARSET) || (AttrOf(oldattr) && !move_standout_mode)) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(A_NORMAL, 0); + (void) VIDATTR(SP_PARM, A_NORMAL, 0); } - if (xold >= screen_columns) { + if (xold >= screen_columns(SP_PARM)) { int l; - if (SP->_nl) { - l = (xold + 1) / screen_columns; + if (SP_PARM->_nl) { + l = (xold + 1) / screen_columns(SP_PARM); yold += l; - if (yold >= screen_lines) - l -= (yold - screen_lines - 1); + if (yold >= screen_lines(SP_PARM)) + l -= (yold - screen_lines(SP_PARM) - 1); if (l > 0) { if (carriage_return) { - TPUTS_TRACE("carriage_return"); - putp(carriage_return); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "carriage_return", + carriage_return); } else - _nc_outch('\r'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\r'); xold = 0; while (l > 0) { if (newline) { - TPUTS_TRACE("newline"); - putp(newline); + NCURSES_SP_NAME(_nc_putp) (NCURSES_SP_ARGx + "newline", + newline); } else - _nc_outch('\n'); + NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_ARGx '\n'); l--; } } @@ -929,27 +1021,35 @@ mvcur(int yold, int xold, int ynew, int xnew) } } - if (yold > screen_lines - 1) - yold = screen_lines - 1; - if (ynew > screen_lines - 1) - ynew = screen_lines - 1; + if (yold > screen_lines(SP_PARM) - 1) + yold = screen_lines(SP_PARM) - 1; + if (ynew > screen_lines(SP_PARM) - 1) + ynew = screen_lines(SP_PARM) - 1; /* destination location is on screen now */ - code = onscreen_mvcur(yold, xold, ynew, xnew, TRUE); + code = onscreen_mvcur(NCURSES_SP_ARGx yold, xold, ynew, xnew, TRUE); /* * Restore attributes if we disabled them before moving. */ - if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP))) { + if (!SameAttrOf(oldattr, SCREEN_ATTRS(SP_PARM))) { TR(TRACE_CHARPUT, ("turning on (%#lx) %s after move", (unsigned long) AttrOf(oldattr), _traceattr(AttrOf(oldattr)))); - (void) VIDATTR(AttrOf(oldattr), GetPair(oldattr)); + (void) VIDATTR(SP_PARM, AttrOf(oldattr), GetPair(oldattr)); } } returnCode(code); } +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +mvcur(int yold, int xold, int ynew, int xnew) +{ + return NCURSES_SP_NAME(mvcur) (CURRENT_SCREEN, yold, xold, ynew, xnew); +} +#endif + #if defined(TRACE) || defined(NCURSES_TEST) NCURSES_EXPORT_VAR(int) _nc_optimize_enable = OPTIMIZE_ALL; #endif @@ -1212,25 +1312,25 @@ main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED) speeds[i], overhead, totalest); } } else if (buf[0] == 'c') { - (void) printf("char padding: %d\n", SP->_char_padding); - (void) printf("cr cost: %d\n", SP->_cr_cost); - (void) printf("cup cost: %d\n", SP->_cup_cost); - (void) printf("home cost: %d\n", SP->_home_cost); - (void) printf("ll cost: %d\n", SP->_ll_cost); + (void) printf("char padding: %d\n", CURRENT_SCREEN->_char_padding); + (void) printf("cr cost: %d\n", CURRENT_SCREEN->_cr_cost); + (void) printf("cup cost: %d\n", CURRENT_SCREEN->_cup_cost); + (void) printf("home cost: %d\n", CURRENT_SCREEN->_home_cost); + (void) printf("ll cost: %d\n", CURRENT_SCREEN->_ll_cost); #if USE_HARD_TABS - (void) printf("ht cost: %d\n", SP->_ht_cost); - (void) printf("cbt cost: %d\n", SP->_cbt_cost); + (void) printf("ht cost: %d\n", CURRENT_SCREEN->_ht_cost); + (void) printf("cbt cost: %d\n", CURRENT_SCREEN->_cbt_cost); #endif /* USE_HARD_TABS */ - (void) printf("cub1 cost: %d\n", SP->_cub1_cost); - (void) printf("cuf1 cost: %d\n", SP->_cuf1_cost); - (void) printf("cud1 cost: %d\n", SP->_cud1_cost); - (void) printf("cuu1 cost: %d\n", SP->_cuu1_cost); - (void) printf("cub cost: %d\n", SP->_cub_cost); - (void) printf("cuf cost: %d\n", SP->_cuf_cost); - (void) printf("cud cost: %d\n", SP->_cud_cost); - (void) printf("cuu cost: %d\n", SP->_cuu_cost); - (void) printf("hpa cost: %d\n", SP->_hpa_cost); - (void) printf("vpa cost: %d\n", SP->_vpa_cost); + (void) printf("cub1 cost: %d\n", CURRENT_SCREEN->_cub1_cost); + (void) printf("cuf1 cost: %d\n", CURRENT_SCREEN->_cuf1_cost); + (void) printf("cud1 cost: %d\n", CURRENT_SCREEN->_cud1_cost); + (void) printf("cuu1 cost: %d\n", CURRENT_SCREEN->_cuu1_cost); + (void) printf("cub cost: %d\n", CURRENT_SCREEN->_cub_cost); + (void) printf("cuf cost: %d\n", CURRENT_SCREEN->_cuf_cost); + (void) printf("cud cost: %d\n", CURRENT_SCREEN->_cud_cost); + (void) printf("cuu cost: %d\n", CURRENT_SCREEN->_cuu_cost); + (void) printf("hpa cost: %d\n", CURRENT_SCREEN->_hpa_cost); + (void) printf("vpa cost: %d\n", CURRENT_SCREEN->_vpa_cost); } else if (buf[0] == 'x' || buf[0] == 'q') break; else diff --git a/contrib/ncurses/ncurses/tty/lib_tstp.c b/contrib/ncurses/ncurses/tty/lib_tstp.c index 06c8411caa4d..70f805a2ad5e 100644 --- a/contrib/ncurses/ncurses/tty/lib_tstp.c +++ b/contrib/ncurses/ncurses/tty/lib_tstp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -46,7 +46,7 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$Id: lib_tstp.c,v 1.37 2008/05/03 16:24:56 tom Exp $") +MODULE_ID("$Id: lib_tstp.c,v 1.41 2010/05/15 21:31:12 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -59,16 +59,20 @@ static const char * signal_name(int sig) { switch (sig) { +#ifdef SIGALRM case SIGALRM: return "SIGALRM"; +#endif #ifdef SIGCONT case SIGCONT: return "SIGCONT"; #endif case SIGINT: return "SIGINT"; +#ifdef SIGQUIT case SIGQUIT: return "SIGQUIT"; +#endif case SIGTERM: return "SIGTERM"; #ifdef SIGTSTP @@ -136,6 +140,7 @@ signal_name(int sig) static void tstp(int dummy GCC_UNUSED) { + SCREEN *sp = CURRENT_SCREEN; sigset_t mask, omask; sigaction_t act, oact; @@ -154,11 +159,11 @@ tstp(int dummy GCC_UNUSED) * parent was stopped before us, and we would likely pick up the * settings already modified by the shell. */ - if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */ + if (sp != 0 && !sp->_endwin) /* don't do this if we're not in curses */ #if HAVE_TCGETPGRP if (tcgetpgrp(STDIN_FILENO) == getpgrp()) #endif - def_prog_mode(); + NCURSES_SP_NAME(def_prog_mode) (NCURSES_SP_ARG); /* * Block window change and timer signals. The latter @@ -166,7 +171,9 @@ tstp(int dummy GCC_UNUSED) * to repaint the screen. */ (void) sigemptyset(&mask); +#ifdef SIGALRM (void) sigaddset(&mask, SIGALRM); +#endif #if USE_SIGWINCH (void) sigaddset(&mask, SIGWINCH); #endif @@ -185,7 +192,7 @@ tstp(int dummy GCC_UNUSED) * End window mode, which also resets the terminal state to the * original (pre-curses) modes. */ - endwin(); + NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); /* Unblock SIGTSTP. */ (void) sigemptyset(&mask); @@ -212,19 +219,19 @@ tstp(int dummy GCC_UNUSED) T(("SIGCONT received")); sigaction(SIGTSTP, &oact, NULL); - flushinp(); + NCURSES_SP_NAME(flushinp) (NCURSES_SP_ARG); /* * If the user modified the tty state while suspended, he wants * those changes to stick. So save the new "default" terminal state. */ - def_shell_mode(); + NCURSES_SP_NAME(def_shell_mode) (NCURSES_SP_ARG); /* * This relies on the fact that doupdate() will restore the * program-mode tty state, and issue enter_ca_mode if need be. */ - doupdate(); + NCURSES_SP_NAME(doupdate) (NCURSES_SP_ARG); /* Reset the signals. */ (void) sigprocmask(SIG_SETMASK, &omask, NULL); @@ -234,6 +241,8 @@ tstp(int dummy GCC_UNUSED) static void cleanup(int sig) { + SCREEN *sp = CURRENT_SCREEN; + /* * Actually, doing any sort of I/O from within an signal handler is * "unsafe". But we'll _try_ to clean up the screen and terminal @@ -241,7 +250,10 @@ cleanup(int sig) */ if (!_nc_globals.cleanup_nested++ && (sig == SIGINT - || sig == SIGQUIT)) { +#ifdef SIGQUIT + || sig == SIGQUIT +#endif + )) { #if HAVE_SIGACTION || HAVE_SIGVEC sigaction_t act; sigemptyset(&act.sa_mask); @@ -257,12 +269,12 @@ cleanup(int sig) if (scan->_ofp != 0 && isatty(fileno(scan->_ofp))) { scan->_cleanup = TRUE; - scan->_outch = _nc_outch; + scan->_outch = NCURSES_SP_NAME(_nc_outch); } set_term(scan); - endwin(); - if (SP) - SP->_endwin = FALSE; /* in case we have an atexit! */ + NCURSES_SP_NAME(endwin) (NCURSES_SP_ARG); + if (sp) + sp->_endwin = FALSE; /* in case we have an atexit! */ } } } @@ -274,6 +286,13 @@ static void sigwinch(int sig GCC_UNUSED) { _nc_globals.have_sigwinch = 1; +# if USE_PTHREADS_EINTR + if (_nc_globals.read_thread) { + if (!pthread_equal(pthread_self(), _nc_globals.read_thread)) + pthread_kill(_nc_globals.read_thread, SIGWINCH); + _nc_globals.read_thread = 0; + } +# endif } #endif /* USE_SIGWINCH */ diff --git a/contrib/ncurses/ncurses/tty/lib_twait.c b/contrib/ncurses/ncurses/tty/lib_twait.c index 16d12edbbe3c..329ec29a019f 100644 --- a/contrib/ncurses/ncurses/tty/lib_twait.c +++ b/contrib/ncurses/ncurses/tty/lib_twait.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -65,10 +65,12 @@ # include # endif #endif - +#ifdef __MINGW32__ +# include +#endif #undef CUR -MODULE_ID("$Id: lib_twait.c,v 1.59 2008/08/30 20:08:19 tom Exp $") +MODULE_ID("$Id: lib_twait.c,v 1.61 2010/12/25 23:43:58 tom Exp $") static long _nc_gettime(TimeType * t0, bool first) @@ -124,15 +126,27 @@ _nc_eventlist_timeout(_nc_eventlist * evl) } #endif /* NCURSES_WGETCH_EVENTS */ +#if (USE_FUNC_POLL || HAVE_SELECT) +# define MAYBE_UNUSED +#else +# define MAYBE_UNUSED GCC_UNUSED +#endif + +#if (USE_FUNC_POLL || HAVE_SELECT) +# define MAYBE_UNUSED +#else +# define MAYBE_UNUSED GCC_UNUSED +#endif + /* * Wait a specified number of milliseconds, returning nonzero if the timer * didn't expire before there is activity on the specified file descriptors. * The file-descriptors are specified by the mode: - * 0 - none (absolute time) - * 1 - ncurses' normal input-descriptor - * 2 - mouse descriptor, if any - * 3 - either input or mouse. - * + * TW_NONE 0 - none (absolute time) + * TW_INPUT 1 - ncurses' normal input-descriptor + * TW_MOUSE 2 - mouse descriptor, if any + * TW_ANY 3 - either input or mouse. + * TW_EVENT 4 - * Experimental: if NCURSES_WGETCH_EVENTS is defined, (mode & 4) determines * whether to pay attention to evl argument. If set, the smallest of * millisecond and of timeout of evl is taken. @@ -143,16 +157,18 @@ _nc_eventlist_timeout(_nc_eventlist * evl) * descriptors. */ NCURSES_EXPORT(int) -_nc_timed_wait(SCREEN *sp, - int mode, +_nc_timed_wait(SCREEN *sp MAYBE_UNUSED, + int mode MAYBE_UNUSED, int milliseconds, int *timeleft EVENTLIST_2nd(_nc_eventlist * evl)) { - int fd; int count; - int result = 0; + int result = TW_NONE; TimeType t0; +#if (USE_FUNC_POLL || HAVE_SELECT) + int fd; +#endif #ifdef NCURSES_WGETCH_EVENTS int timeout_is_event = 0; @@ -174,7 +190,7 @@ _nc_timed_wait(SCREEN *sp, milliseconds, mode)); #ifdef NCURSES_WGETCH_EVENTS - if (mode & 4) { + if (mode & TW_EVENT) { int event_delay = _nc_eventlist_timeout(evl); if (event_delay >= 0 @@ -193,7 +209,7 @@ _nc_timed_wait(SCREEN *sp, count = 0; #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) + if ((mode & TW_EVENT) && evl) evl->result_flags = 0; #endif @@ -201,23 +217,23 @@ _nc_timed_wait(SCREEN *sp, memset(fd_list, 0, sizeof(fd_list)); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) + if ((mode & TW_EVENT) && evl) fds = typeMalloc(struct pollfd, MIN_FDS + evl->count); #endif - if (mode & 1) { + if (mode & TW_INPUT) { fds[count].fd = sp->_ifd; fds[count].events = POLLIN; count++; } - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0) { fds[count].fd = fd; fds[count].events = POLLIN; count++; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -234,7 +250,7 @@ _nc_timed_wait(SCREEN *sp, result = poll(fds, (unsigned) count, milliseconds); #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { int c; if (!result) @@ -276,8 +292,8 @@ _nc_timed_wait(SCREEN *sp, * * FIXME: this assumes mode&1 if milliseconds < 0 (see lib_getch.c). */ - result = 0; - if (mode & 1) { + result = TW_NONE; + if (mode & TW_INPUT) { int step = (milliseconds < 0) ? 0 : 5000; bigtime_t d; bigtime_t useconds = milliseconds * 1000; @@ -313,17 +329,17 @@ _nc_timed_wait(SCREEN *sp, */ FD_ZERO(&set); - if (mode & 1) { + if (mode & TW_INPUT) { FD_SET(sp->_ifd, &set); count = sp->_ifd + 1; } - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0) { FD_SET(fd, &set); count = max(fd, count) + 1; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -346,7 +362,7 @@ _nc_timed_wait(SCREEN *sp, } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl) { + if ((mode & TW_EVENT) && evl) { evl->result_flags = 0; for (n = 0; n < evl->count; ++n) { _nc_event *ev = evl->events[n]; @@ -370,7 +386,7 @@ _nc_timed_wait(SCREEN *sp, returntime = _nc_gettime(&t0, FALSE); if (milliseconds >= 0) - milliseconds -= (returntime - starttime); + milliseconds -= (int) (returntime - starttime); #ifdef NCURSES_WGETCH_EVENTS if (evl) { @@ -428,22 +444,22 @@ _nc_timed_wait(SCREEN *sp, } } #elif defined(__BEOS__) - result = 1; /* redundant, but simple */ + result = TW_INPUT; /* redundant, but simple */ #elif HAVE_SELECT - if ((mode & 2) + if ((mode & TW_MOUSE) && (fd = sp->_mouse_fd) >= 0 && FD_ISSET(fd, &set)) - result |= 2; - if ((mode & 1) + result |= TW_MOUSE; + if ((mode & TW_INPUT) && FD_ISSET(sp->_ifd, &set)) - result |= 1; + result |= TW_INPUT; #endif } else result = 0; } #ifdef NCURSES_WGETCH_EVENTS - if ((mode & 4) && evl && evl->result_flags) - result |= 4; + if ((mode & TW_EVENT) && evl && evl->result_flags) + result |= TW_EVENT; #endif return (result); diff --git a/contrib/ncurses/ncurses/tty/lib_vidattr.c b/contrib/ncurses/ncurses/tty/lib_vidattr.c index ac2a74f08e01..9656b3c70ee6 100644 --- a/contrib/ncurses/ncurses/tty/lib_vidattr.c +++ b/contrib/ncurses/ncurses/tty/lib_vidattr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,7 +29,8 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * - * and: Thomas E. Dickey 1996 on * + * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /* @@ -63,11 +64,16 @@ */ #include -#include -MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) +MODULE_ID("$Id: lib_vidattr.c,v 1.61 2010/06/05 22:22:04 tom Exp $") + +#define doPut(mode) \ + TPUTS_TRACE(#mode); \ + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -78,40 +84,49 @@ MODULE_ID("$Id: lib_vidattr.c,v 1.49 2007/06/30 21:58:04 tom Exp $") /* if there is no current screen, assume we *can* do color */ #define SetColorsIf(why,old_attr) \ if (can_color && (why)) { \ - int old_pair = PAIR_NUMBER(old_attr); \ + int old_pair = PairNumber(old_attr); \ TR(TRACE_ATTRS, ("old pair = %d -- new pair = %d", old_pair, pair)); \ if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - _nc_do_color(old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color)(NCURSES_SP_ARGx \ + (short) old_pair, \ + (short) pair, \ + reverse, outc); \ } \ } #define PreviousAttr _nc_prescreen.previous_attr NCURSES_EXPORT(int) -vidputs(chtype newmode, int (*outc) (int)) +NCURSES_SP_NAME(vidputs) (NCURSES_SP_DCLx + chtype newmode, + NCURSES_SP_OUTC outc) { attr_t turn_on, turn_off; int pair; bool reverse = FALSE; - bool can_color = (SP == 0 || SP->_coloron); + bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); + bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); #else #define fix_pair0 FALSE #endif newmode &= A_ATTRIBUTES; - T((T_CALLED("vidputs(%s)"), _traceattr(newmode))); + + T((T_CALLED("vidputs(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); + + if (!IsTermInfo(SP_PARM)) + returnCode(ERR); /* this allows us to go on whether or not newterm() has been called */ - if (SP) - PreviousAttr = AttrOf(SCREEN_ATTRS(SP)); + if (SP_PARM) + PreviousAttr = AttrOf(SCREEN_ATTRS(SP_PARM)); TR(TRACE_ATTRS, ("previous attribute was %s", _traceattr(PreviousAttr))); - if ((SP != 0) + if ((SP_PARM != 0) && (magic_cookie_glitch > 0)) { #if USE_XMC_SUPPORT static const chtype table[] = @@ -135,7 +150,7 @@ vidputs(chtype newmode, int (*outc) (int)) * the terminfo max_attributes value. */ for (n = 0; n < SIZEOF(table); ++n) { - if ((table[n] & SP->_ok_attributes) == 0) { + if ((table[n] & SP_PARM->_ok_attributes) == 0) { newmode &= ~table[n]; } else if ((table[n] & newmode) != 0) { if (used++ >= limit) { @@ -148,7 +163,7 @@ vidputs(chtype newmode, int (*outc) (int)) } } #else - newmode &= ~(SP->_xmc_suppress); + newmode &= ~(SP_PARM->_xmc_suppress); #endif TR(TRACE_ATTRS, ("suppressed attribute is %s", _traceattr(newmode))); } @@ -172,7 +187,7 @@ vidputs(chtype newmode, int (*outc) (int)) * A_ALTCHARSET (256) down 2 to line up. We use the NCURSES_BITS * macro so this will work properly for the wide-character layout. */ - unsigned value = no_color_video; + unsigned value = (unsigned) no_color_video; attr_t mask = NCURSES_BITS((value & 63) | ((value & 192) << 1) | ((value & 256) >> 2), 8); @@ -188,7 +203,7 @@ vidputs(chtype newmode, int (*outc) (int)) if (newmode == PreviousAttr) returnCode(OK); - pair = PAIR_NUMBER(newmode); + pair = PairNumber(newmode); if (reverse) { newmode &= ~A_REVERSE; @@ -208,10 +223,10 @@ vidputs(chtype newmode, int (*outc) (int)) if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -222,16 +237,18 @@ vidputs(chtype newmode, int (*outc) (int)) } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - tputs(tparm(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + tparm(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), + 1, outc); PreviousAttr &= ALL_BUT_COLOR; } SetColorsIf((pair != 0) || fix_pair0, PreviousAttr); @@ -241,11 +258,11 @@ vidputs(chtype newmode, int (*outc) (int)) TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -282,28 +299,53 @@ vidputs(chtype newmode, int (*outc) (int)) if (reverse) newmode |= A_REVERSE; - if (SP) - SetAttr(SCREEN_ATTRS(SP), newmode); + if (SP_PARM) + SetAttr(SCREEN_ATTRS(SP_PARM), newmode); else PreviousAttr = newmode; returnCode(OK); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +vidputs(chtype newmode, NCURSES_OUTC outc) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vidputs) (CURRENT_SCREEN, + newmode, + _nc_outc_wrapper); +} +#endif + +NCURSES_EXPORT(int) +NCURSES_SP_NAME(vidattr) (NCURSES_SP_DCLx chtype newmode) +{ + T((T_CALLED("vidattr(%p,%s)"), (void *) SP_PARM, _traceattr(newmode))); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx + newmode, + NCURSES_SP_NAME(_nc_outch))); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(int) vidattr(chtype newmode) { - T((T_CALLED("vidattr(%s)"), _traceattr(newmode))); - - returnCode(vidputs(newmode, _nc_outch)); + return NCURSES_SP_NAME(vidattr) (CURRENT_SCREEN, newmode); } +#endif NCURSES_EXPORT(chtype) -termattrs(void) +NCURSES_SP_NAME(termattrs) (NCURSES_SP_DCL0) { chtype attrs = A_NORMAL; - T((T_CALLED("termattrs()"))); + T((T_CALLED("termattrs(%p)"), (void *) SP_PARM)); +#ifdef USE_TERM_DRIVER + if (HasTerminal(SP_PARM)) + attrs = CallDriver(SP_PARM, conattr); +#else + if (enter_alt_charset_mode) attrs |= A_ALTCHARSET; @@ -331,8 +373,17 @@ termattrs(void) if (enter_underline_mode) attrs |= A_UNDERLINE; - if (SP->_coloron) + if (SP_PARM->_coloron) attrs |= A_COLOR; - returnChar(attrs); +#endif + returnChtype(attrs); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(chtype) +termattrs(void) +{ + return NCURSES_SP_NAME(termattrs) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/ncurses/tty/tty_update.c b/contrib/ncurses/ncurses/tty/tty_update.c index 6a3a0c8e9341..f0d2369c18d6 100644 --- a/contrib/ncurses/ncurses/tty/tty_update.c +++ b/contrib/ncurses/ncurses/tty/tty_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -30,6 +30,7 @@ * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * * and: Thomas E. Dickey 1996-on * + * and: Juergen Pfeifer 2009 * ****************************************************************************/ /*----------------------------------------------------------------- @@ -38,12 +39,16 @@ * * The routine doupdate() and its dependents. * All physical output is concentrated here (except _nc_outch() - * in lib_tputs.c). + * in lib_tputs.c). * *-----------------------------------------------------------------*/ #include +#ifndef CUR +#define CUR SP_TERMTYPE +#endif + #if defined __HAIKU__ && defined __BEOS__ #undef __BEOS__ #endif @@ -76,9 +81,8 @@ #endif #include -#include -MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.264 2010/12/19 01:21:02 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -91,7 +95,7 @@ MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $") */ #define CHECK_INTERVAL 5 -#define FILL_BCE() (SP->_coloron && !SP->_default_color && !back_color_erase) +#define FILL_BCE(sp) (sp->_coloron && !sp->_default_color && !back_color_erase) static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); static NCURSES_CH_T normal = NewChar(BLANK_TEXT); @@ -103,13 +107,23 @@ static NCURSES_CH_T normal = NewChar(BLANK_TEXT); */ /* #define POSITION_DEBUG */ -static NCURSES_INLINE NCURSES_CH_T ClrBlank(WINDOW *win); +static NCURSES_INLINE NCURSES_CH_T ClrBlank(NCURSES_SP_DCLx WINDOW *win); + +#if NCURSES_SP_FUNCS +static int ClrBottom(SCREEN *, int total); +static void ClearScreen(SCREEN *, NCURSES_CH_T blank); +static void ClrUpdate(SCREEN *); +static void DelChar(SCREEN *, int count); +static void InsStr(SCREEN *, NCURSES_CH_T * line, int count); +static void TransformLine(SCREEN *, int const lineno); +#else static int ClrBottom(int total); static void ClearScreen(NCURSES_CH_T blank); static void ClrUpdate(void); static void DelChar(int count); static void InsStr(NCURSES_CH_T * line, int count); static void TransformLine(int const lineno); +#endif #ifdef POSITION_DEBUG /**************************************************************************** @@ -119,7 +133,7 @@ static void TransformLine(int const lineno); ****************************************************************************/ static void -position_check(int expected_y, int expected_x, char *legend) +position_check(NCURSES_SP_DCLx int expected_y, int expected_x, char *legend) /* check to see if the real cursor position matches the virtual */ { char buf[20]; @@ -129,10 +143,10 @@ position_check(int expected_y, int expected_x, char *legend) if (!_nc_tracing || (expected_y < 0 && expected_x < 0)) return; - _nc_flush(); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); memset(buf, '\0', sizeof(buf)); - putp("\033[6n"); /* only works on ANSI-compatibles */ - _nc_flush(); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx "\033[6n"); /* only works on ANSI-compatibles */ + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); *(s = buf) = 0; do { int ask = sizeof(buf) - 1 - (s - buf); @@ -152,8 +166,12 @@ position_check(int expected_y, int expected_x, char *legend) if (expected_y < 0) expected_y = y - 1; if (y - 1 != expected_y || x - 1 != expected_x) { - beep(); - tputs(tparm("\033[%d;%dH", expected_y + 1, expected_x + 1), 1, _nc_outch); + NCURSES_SP_NAME(beep) (NCURSES_SP_ARG); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + tparm("\033[%d;%dH", + expected_y + 1, + expected_x + 1), + 1, NCURSES_SP_NAME(_nc_outch)); _tracef("position seen (%d, %d) doesn't match expected one (%d, %d) in %s", y - 1, x - 1, expected_y, expected_x, legend); } else { @@ -162,7 +180,7 @@ position_check(int expected_y, int expected_x, char *legend) } } #else -#define position_check(expected_y, expected_x, legend) /* nothing */ +#define position_check(sp, expected_y, expected_x, legend) /* nothing */ #endif /* POSITION_DEBUG */ /**************************************************************************** @@ -172,19 +190,22 @@ position_check(int expected_y, int expected_x, char *legend) ****************************************************************************/ static NCURSES_INLINE void -GoTo(int const row, int const col) +GoTo(NCURSES_SP_DCLx int const row, int const col) { - TR(TRACE_MOVE, ("GoTo(%d, %d) from (%d, %d)", - row, col, SP->_cursrow, SP->_curscol)); + TR(TRACE_MOVE, ("GoTo(%p, %d, %d) from (%d, %d)", + (void *) SP_PARM, row, col, SP_PARM->_cursrow, SP_PARM->_curscol)); - position_check(SP->_cursrow, SP->_curscol, "GoTo"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo"); - mvcur(SP->_cursrow, SP->_curscol, row, col); - position_check(SP->_cursrow, SP->_curscol, "GoTo2"); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + row, col); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "GoTo2"); } static NCURSES_INLINE void -PutAttrChar(CARG_CH_T ch) +PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) { int chlen = 1; NCURSES_CH_T my_ch; @@ -194,7 +215,7 @@ PutAttrChar(CARG_CH_T ch) TR(TRACE_CHARPUT, ("PutAttrChar(%s) at (%d, %d)", _tracech_t(ch), - SP->_cursrow, SP->_curscol)); + SP_PARM->_cursrow, SP_PARM->_curscol)); #if USE_WIDEC_SUPPORT /* * If this is not a valid character, there is nothing more to do. @@ -224,12 +245,12 @@ PutAttrChar(CARG_CH_T ch) */ if (is8bits(CharOf(CHDEREF(ch))) && (isprint(CharOf(CHDEREF(ch))) - || (SP->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) - || (SP->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) + || (SP_PARM->_legacy_coding > 0 && CharOf(CHDEREF(ch)) >= 160) + || (SP_PARM->_legacy_coding > 1 && CharOf(CHDEREF(ch)) >= 128) || (AttrOf(attr) & A_ALTCHARSET && ((CharOfD(ch) < ACS_LEN - && SP->_acs_map != 0 - && SP->_acs_map[CharOfD(ch)] != 0) + && SP_PARM->_acs_map != 0 + && SP_PARM->_acs_map[CharOfD(ch)] != 0) || (CharOfD(ch) >= 128))))) { ; } else { @@ -241,7 +262,7 @@ PutAttrChar(CARG_CH_T ch) #endif if ((AttrOf(attr) & A_ALTCHARSET) - && SP->_acs_map != 0 + && SP_PARM->_acs_map != 0 && CharOfD(ch) < ACS_LEN) { my_ch = CHDEREF(ch); /* work around const param */ #if USE_WIDEC_SUPPORT @@ -251,8 +272,8 @@ PutAttrChar(CARG_CH_T ch) * character, and uses the wide-character mapping when we expect the * normal one to be broken (by mis-design ;-). */ - if (SP->_screen_acs_fix - && SP->_screen_acs_map[CharOf(my_ch)]) { + if (SP_PARM->_screen_acs_fix + && SP_PARM->_screen_acs_map[CharOf(my_ch)]) { RemAttr(attr, A_ALTCHARSET); my_ch = _nc_wacs[CharOf(my_ch)]; } @@ -265,9 +286,9 @@ PutAttrChar(CARG_CH_T ch) */ if (AttrOf(attr) & A_ALTCHARSET) { int j = CharOfD(ch); - chtype temp = UChar(SP->_acs_map[j]); + chtype temp = UChar(SP_PARM->_acs_map[j]); - if (!(SP->_screen_acs_map[j])) { + if (!(SP_PARM->_screen_acs_map[j])) { RemAttr(attr, A_ALTCHARSET); if (temp == 0) temp = ' '; @@ -282,28 +303,28 @@ PutAttrChar(CARG_CH_T ch) ch = CHREF(tilde); } - UpdateAttrs(attr); + UpdateAttrs(SP_PARM, attr); #if !USE_WIDEC_SUPPORT /* FIXME - we do this special case for signal handling, should see how to * make it work for wide characters. */ - if (SP->_outch != 0) { - SP->_outch(UChar(ch)); + if (SP_PARM->_outch != 0) { + SP_PARM->_outch(NCURSES_SP_ARGx UChar(ch)); } else #endif { - PUTC(CHDEREF(ch), SP->_ofp); /* macro's fastest... */ + PUTC(CHDEREF(ch), SP_PARM->_ofp); /* macro's fastest... */ COUNT_OUTCHARS(1); } - SP->_curscol += chlen; + SP_PARM->_curscol += chlen; if (char_padding) { TPUTS_TRACE("char_padding"); - putp(char_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx char_padding); } } static bool -check_pending(void) +check_pending(NCURSES_SP_DCL0) /* check for pending input */ { bool have_pending = FALSE; @@ -313,13 +334,13 @@ check_pending(void) * have the refreshing slow down drastically (or stop) if there's an * unread character available. */ - if (SP->_fifohold != 0) + if (SP_PARM->_fifohold != 0) return FALSE; - if (SP->_checkfd >= 0) { + if (SP_PARM->_checkfd >= 0) { #if USE_FUNC_POLL struct pollfd fds[1]; - fds[0].fd = SP->_checkfd; + fds[0].fd = SP_PARM->_checkfd; fds[0].events = POLLIN; if (poll(fds, 1, 0) > 0) { have_pending = TRUE; @@ -347,43 +368,52 @@ check_pending(void) ktimeout.tv_usec = 0; FD_ZERO(&fdset); - FD_SET(SP->_checkfd, &fdset); - if (select(SP->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { + FD_SET(SP_PARM->_checkfd, &fdset); + if (select(SP_PARM->_checkfd + 1, &fdset, NULL, NULL, &ktimeout) != 0) { have_pending = TRUE; } #endif } if (have_pending) { - SP->_fifohold = 5; - _nc_flush(); + SP_PARM->_fifohold = 5; + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); } return FALSE; } /* put char at lower right corner */ static void -PutCharLR(const ARG_CH_T ch) +PutCharLR(NCURSES_SP_DCLx const ARG_CH_T ch) { if (!auto_right_margin) { /* we can put the char directly */ - PutAttrChar(ch); + PutAttrChar(NCURSES_SP_ARGx ch); } else if (enter_am_mode && exit_am_mode) { /* we can suppress automargin */ TPUTS_TRACE("exit_am_mode"); - putp(exit_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_am_mode); - PutAttrChar(ch); - SP->_curscol--; - position_check(SP->_cursrow, SP->_curscol, "exit_am_mode"); + PutAttrChar(NCURSES_SP_ARGx ch); + SP_PARM->_curscol--; + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "exit_am_mode"); TPUTS_TRACE("enter_am_mode"); - putp(enter_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_am_mode); } else if ((enter_insert_mode && exit_insert_mode) || insert_character || parm_ich) { - GoTo(screen_lines - 1, screen_columns - 2); - PutAttrChar(ch); - GoTo(screen_lines - 1, screen_columns - 2); - InsStr(newscr->_line[screen_lines - 1].text + screen_columns - 2, 1); + GoTo(NCURSES_SP_ARGx + screen_lines(SP_PARM) - 1, + screen_columns(SP_PARM) - 2); + PutAttrChar(NCURSES_SP_ARGx ch); + GoTo(NCURSES_SP_ARGx + screen_lines(SP_PARM) - 1, + screen_columns(SP_PARM) - 2); + InsStr(NCURSES_SP_ARGx + NewScreen(SP_PARM)->_line[screen_lines(SP_PARM) - 1].text + + screen_columns(SP_PARM) - 2, 1); } } @@ -391,7 +421,7 @@ PutCharLR(const ARG_CH_T ch) * Wrap the cursor position, i.e., advance to the beginning of the next line. */ static void -wrap_cursor(void) +wrap_cursor(NCURSES_SP_DCL0) { if (eat_newline_glitch) { /* @@ -407,40 +437,45 @@ wrap_cursor(void) * it's safe to just tell the code that the cursor is in hyperspace and * let the next mvcur() call straighten things out. */ - SP->_curscol = -1; - SP->_cursrow = -1; + SP_PARM->_curscol = -1; + SP_PARM->_cursrow = -1; } else if (auto_right_margin) { - SP->_curscol = 0; - SP->_cursrow++; + SP_PARM->_curscol = 0; + SP_PARM->_cursrow++; /* * We've actually moved - but may have to work around problems with * video attributes not working. */ - if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP))) { + if (!move_standout_mode && AttrOf(SCREEN_ATTRS(SP_PARM))) { TR(TRACE_CHARPUT, ("turning off (%#lx) %s before wrapping", - (unsigned long) AttrOf(SCREEN_ATTRS(SP)), - _traceattr(AttrOf(SCREEN_ATTRS(SP))))); - (void) VIDATTR(A_NORMAL, 0); + (unsigned long) AttrOf(SCREEN_ATTRS(SP_PARM)), + _traceattr(AttrOf(SCREEN_ATTRS(SP_PARM))))); + (void) VIDATTR(SP_PARM, A_NORMAL, 0); } } else { - SP->_curscol--; + SP_PARM->_curscol--; } - position_check(SP->_cursrow, SP->_curscol, "wrap_cursor"); + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "wrap_cursor"); } static NCURSES_INLINE void -PutChar(const ARG_CH_T ch) +PutChar(NCURSES_SP_DCLx const ARG_CH_T ch) /* insert character, handling automargin stuff */ { - if (SP->_cursrow == screen_lines - 1 && SP->_curscol == screen_columns - 1) - PutCharLR(ch); - else - PutAttrChar(ch); + if (SP_PARM->_cursrow == screen_lines(SP_PARM) - 1 && + SP_PARM->_curscol == screen_columns(SP_PARM) - 1) { + PutCharLR(NCURSES_SP_ARGx ch); + } else { + PutAttrChar(NCURSES_SP_ARGx ch); + } - if (SP->_curscol >= screen_columns) - wrap_cursor(); + if (SP_PARM->_curscol >= screen_columns(SP_PARM)) + wrap_cursor(NCURSES_SP_ARG); - position_check(SP->_cursrow, SP->_curscol, "PutChar"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "PutChar"); } /* @@ -450,19 +485,21 @@ PutChar(const ARG_CH_T ch) * or can be output by clearing (A_COLOR in case of bce-terminal) are excluded. */ static NCURSES_INLINE bool -can_clear_with(ARG_CH_T ch) +can_clear_with(NCURSES_SP_DCLx ARG_CH_T ch) { - if (!back_color_erase && SP->_coloron) { + if (!back_color_erase && SP_PARM->_coloron) { #if NCURSES_EXT_FUNCS int pair; - if (!SP->_default_color) + if (!SP_PARM->_default_color) return FALSE; - if (SP->_default_fg != C_MASK || SP->_default_bg != C_MASK) + if (SP_PARM->_default_fg != C_MASK || SP_PARM->_default_bg != C_MASK) return FALSE; if ((pair = GetPair(CHDEREF(ch))) != 0) { short fg, bg; - pair_content(pair, &fg, &bg); + NCURSES_SP_NAME(pair_content) (NCURSES_SP_ARGx + (short) pair, + &fg, &bg); if (fg != C_MASK || bg != C_MASK) return FALSE; } @@ -488,7 +525,7 @@ can_clear_with(ARG_CH_T ch) * This code is optimized using ech and rep. */ static int -EmitRange(const NCURSES_CH_T * ntext, int num) +EmitRange(NCURSES_SP_DCLx const NCURSES_CH_T * ntext, int num) { int i; @@ -500,13 +537,13 @@ EmitRange(const NCURSES_CH_T * ntext, int num) NCURSES_CH_T ntext0; while (num > 1 && !CharEq(ntext[0], ntext[1])) { - PutChar(CHREF(ntext[0])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[0])); ntext++; num--; } ntext0 = ntext[0]; if (num == 1) { - PutChar(CHREF(ntext0)); + PutChar(NCURSES_SP_ARGx CHREF(ntext0)); return 0; } runcount = 2; @@ -523,10 +560,11 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * which it would be marginally advantageous. */ if (erase_chars - && runcount > SP->_ech_cost + SP->_cup_ch_cost - && can_clear_with(CHREF(ntext0))) { - UpdateAttrs(ntext0); - putp(TPARM_1(erase_chars, runcount)); + && runcount > SP_PARM->_ech_cost + SP_PARM->_cup_ch_cost + && can_clear_with(NCURSES_SP_ARGx CHREF(ntext0))) { + UpdateAttrs(SP_PARM, ntext0); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_1(erase_chars, runcount)); /* * If this is the last part of the given interval, @@ -534,27 +572,34 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * last update on the line. */ if (runcount < num) { - GoTo(SP->_cursrow, SP->_curscol + runcount); + GoTo(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol + runcount); } else { return 1; /* cursor stays in the middle */ } - } else if (repeat_char && runcount > SP->_rep_cost) { - bool wrap_possible = (SP->_curscol + runcount >= screen_columns); + } else if (repeat_char && runcount > SP_PARM->_rep_cost) { + bool wrap_possible = (SP_PARM->_curscol + runcount >= + screen_columns(SP_PARM)); int rep_count = runcount; if (wrap_possible) rep_count--; - UpdateAttrs(ntext0); - tputs(TPARM_2(repeat_char, CharOf(ntext0), rep_count), - rep_count, _nc_outch); - SP->_curscol += rep_count; + UpdateAttrs(SP_PARM, ntext0); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(repeat_char, + CharOf(ntext0), + rep_count), + rep_count, + NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_curscol += rep_count; if (wrap_possible) - PutChar(CHREF(ntext0)); + PutChar(NCURSES_SP_ARGx CHREF(ntext0)); } else { for (i = 0; i < runcount; i++) - PutChar(CHREF(ntext[i])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); } ntext += runcount; num -= runcount; @@ -563,7 +608,7 @@ EmitRange(const NCURSES_CH_T * ntext, int num) } for (i = 0; i < num; i++) - PutChar(CHREF(ntext[i])); + PutChar(NCURSES_SP_ARGx CHREF(ntext[i])); return 0; } @@ -576,39 +621,43 @@ EmitRange(const NCURSES_CH_T * ntext, int num) * Returns: same as EmitRange */ static int -PutRange(const NCURSES_CH_T * otext, +PutRange(NCURSES_SP_DCLx + const NCURSES_CH_T * otext, const NCURSES_CH_T * ntext, int row, int first, int last) { int i, j, same; - TR(TRACE_CHARPUT, ("PutRange(%p, %p, %d, %d, %d)", - otext, ntext, row, first, last)); + TR(TRACE_CHARPUT, ("PutRange(%p, %p, %p, %d, %d, %d)", + (void *) SP_PARM, + (const void *) otext, + (const void *) ntext, + row, first, last)); if (otext != ntext - && (last - first + 1) > SP->_inline_cost) { + && (last - first + 1) > SP_PARM->_inline_cost) { for (j = first, same = 0; j <= last; j++) { if (!same && isWidecExt(otext[j])) continue; if (CharEq(otext[j], ntext[j])) { same++; } else { - if (same > SP->_inline_cost) { - EmitRange(ntext + first, j - same - first); - GoTo(row, first = j); + if (same > SP_PARM->_inline_cost) { + EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); + GoTo(NCURSES_SP_ARGx row, first = j); } same = 0; } } - i = EmitRange(ntext + first, j - same - first); + i = EmitRange(NCURSES_SP_ARGx ntext + first, j - same - first); /* * Always return 1 for the next GoTo() after a PutRange() if we found * identical characters at end of interval */ return (same == 0 ? i : 1); } - return EmitRange(ntext + first, last - first + 1); + return EmitRange(NCURSES_SP_ARGx ntext + first, last - first + 1); } /* leave unbracketed here so 'indent' works */ @@ -618,7 +667,7 @@ PutRange(const NCURSES_CH_T * otext, if_USE_SCROLL_HINTS(win->_line[row].oldindex = row) NCURSES_EXPORT(int) -doupdate(void) +TINFO_DOUPDATE(NCURSES_SP_DCL0) { int i; int nonempty; @@ -626,30 +675,49 @@ doupdate(void) struct tms before, after; #endif /* USE_TRACE_TIMES */ - T((T_CALLED("doupdate()"))); + T((T_CALLED("_nc_tinfo:doupdate(%p)"), (void *) SP_PARM)); - if (curscr == 0 - || newscr == 0) +#if !USE_REENTRANT + /* + * It is "legal" but unlikely that an application could assign a new + * value to one of the standard windows. Check for that possibility + * and try to recover. + * + * We do not allow applications to assign new values in the reentrant + * model. + */ +#define SyncScreens(internal,exported) \ + if (internal == 0) internal = exported; \ + if (internal != exported) exported = internal + + SyncScreens(CurScreen(SP_PARM), curscr); + SyncScreens(NewScreen(SP_PARM), newscr); + SyncScreens(StdScreen(SP_PARM), stdscr); +#endif + + if (CurScreen(SP_PARM) == 0 + || NewScreen(SP_PARM) == 0 + || StdScreen(SP_PARM) == 0) returnCode(ERR); #ifdef TRACE if (USE_TRACEF(TRACE_UPDATE)) { - if (curscr->_clear) + if (CurScreen(SP_PARM)->_clear) _tracef("curscr is clear"); else - _tracedump("curscr", curscr); - _tracedump("newscr", newscr); + _tracedump("curscr", CurScreen(SP_PARM)); + _tracedump("newscr", NewScreen(SP_PARM)); _nc_unlock_global(tracef); } #endif /* TRACE */ _nc_signal_handler(FALSE); - if (SP->_fifohold) - SP->_fifohold--; + if (SP_PARM->_fifohold) + SP_PARM->_fifohold--; #if USE_SIZECHANGE - if (SP->_endwin || _nc_handle_sigwinch(SP)) { + if (SP_PARM->_endwin || _nc_handle_sigwinch(SP_PARM)) { /* * This is a transparent extension: XSI does not address it, * and applications need not know that ncurses can do it. @@ -658,20 +726,20 @@ doupdate(void) * (this can happen in an xterm, for example), and resize the * ncurses data structures accordingly. */ - _nc_update_screensize(SP); + _nc_update_screensize(SP_PARM); } #endif - if (SP->_endwin) { + if (SP_PARM->_endwin) { T(("coming back from shell mode")); - reset_prog_mode(); + NCURSES_SP_NAME(reset_prog_mode) (NCURSES_SP_ARG); - _nc_mvcur_resume(); - _nc_screen_resume(); - SP->_mouse_resume(SP); + NCURSES_SP_NAME(_nc_mvcur_resume) (NCURSES_SP_ARG); + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); + SP_PARM->_mouse_resume(SP_PARM); - SP->_endwin = FALSE; + SP_PARM->_endwin = FALSE; } #if USE_TRACE_TIMES /* zero the metering machinery */ @@ -695,11 +763,11 @@ doupdate(void) int j, k; attr_t rattr = A_NORMAL; - for (i = 0; i < screen_lines; i++) { - for (j = 0; j < screen_columns; j++) { + for (i = 0; i < screen_lines(SP_PARM); i++) { + for (j = 0; j < screen_columns(SP_PARM); j++) { bool failed = FALSE; - NCURSES_CH_T *thisline = newscr->_line[i].text; - attr_t thisattr = AttrOf(thisline[j]) & SP->_xmc_triggers; + NCURSES_CH_T *thisline = NewScreen(SP_PARM)->_line[i].text; + attr_t thisattr = AttrOf(thisline[j]) & SP_PARM->_xmc_triggers; attr_t turnon = thisattr & ~rattr; /* is an attribute turned on here? */ @@ -717,8 +785,8 @@ doupdate(void) * there's enough room to set the attribute before the first * non-blank in the run. */ -#define SAFE(a) (!((a) & SP->_xmc_triggers)) - if (ISBLANK(thisline[j]) && SAFE(turnon)) { +#define SAFE(scr,a) (!((a) & (scr)->_xmc_triggers)) + if (ISBLANK(thisline[j]) && SAFE(SP_PARM, turnon)) { RemAttr(thisline[j], turnon); continue; } @@ -727,14 +795,14 @@ doupdate(void) for (k = 1; k <= magic_cookie_glitch; k++) { if (j - k < 0 || !ISBLANK(thisline[j - k]) - || !SAFE(AttrOf(thisline[j - k]))) { + || !SAFE(SP_PARM, AttrOf(thisline[j - k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at start in %d,%d%s%s", i, j - k, (ISBLANK(thisline[j - k]) ? "" : ":nonblank"), - (SAFE(AttrOf(thisline[j - k])) + (SAFE(SP_PARM, AttrOf(thisline[j - k])) ? "" : ":unsafe"))); break; @@ -745,10 +813,11 @@ doupdate(void) int m, n = j; /* find end of span, if it's onscreen */ - for (m = i; m < screen_lines; m++) { - for (; n < screen_columns; n++) { - attr_t testattr = AttrOf(newscr->_line[m].text[n]); - if ((testattr & SP->_xmc_triggers) == rattr) { + for (m = i; m < screen_lines(SP_PARM); m++) { + for (; n < screen_columns(SP_PARM); n++) { + attr_t testattr = + AttrOf(NewScreen(SP_PARM)->_line[m].text[n]); + if ((testattr & SP_PARM->_xmc_triggers) == rattr) { end_onscreen = TRUE; TR(TRACE_ATTRS, ("Range attributed with %s ends at (%d, %d)", @@ -764,7 +833,8 @@ doupdate(void) foundit:; if (end_onscreen) { - NCURSES_CH_T *lastline = newscr->_line[m].text; + NCURSES_CH_T *lastline = + NewScreen(SP_PARM)->_line[m].text; /* * If there are safely-attributed blanks at the end of @@ -773,15 +843,15 @@ doupdate(void) */ while (n >= 0 && ISBLANK(lastline[n]) - && SAFE(AttrOf(lastline[n]))) { + && SAFE(SP_PARM, AttrOf(lastline[n]))) { RemAttr(lastline[n--], turnon); } /* check that there's enough room at end of span */ for (k = 1; k <= magic_cookie_glitch; k++) { - if (n + k >= screen_columns + if (n + k >= screen_columns(SP_PARM) || !ISBLANK(lastline[n + k]) - || !SAFE(AttrOf(lastline[n + k]))) { + || !SAFE(SP_PARM, AttrOf(lastline[n + k]))) { failed = TRUE; TR(TRACE_ATTRS, ("No room at end in %d,%d%s%s", @@ -789,7 +859,7 @@ doupdate(void) (ISBLANK(lastline[n + k]) ? "" : ":nonblank"), - (SAFE(AttrOf(lastline[n + k])) + (SAFE(SP_PARM, AttrOf(lastline[n + k])) ? "" : ":unsafe"))); break; @@ -806,12 +876,12 @@ doupdate(void) _traceattr(turnon), i, j)); /* turn off new attributes over span */ - for (p = i; p < screen_lines; p++) { - for (; q < screen_columns; q++) { + for (p = i; p < screen_lines(SP_PARM); p++) { + for (; q < screen_columns(SP_PARM); q++) { attr_t testattr = AttrOf(newscr->_line[p].text[q]); - if ((testattr & SP->_xmc_triggers) == rattr) + if ((testattr & SP_PARM->_xmc_triggers) == rattr) goto foundend; - RemAttr(newscr->_line[p].text[q], turnon); + RemAttr(NewScreen(SP_PARM)->_line[p].text[q], turnon); } q = 0; } @@ -837,7 +907,7 @@ doupdate(void) /* show altered highlights after magic-cookie check */ if (USE_TRACEF(TRACE_UPDATE)) { _tracef("After magic-cookie check..."); - _tracedump("newscr", newscr); + _tracedump("newscr", NewScreen(SP_PARM)); _nc_unlock_global(tracef); } #endif /* TRACE */ @@ -845,23 +915,23 @@ doupdate(void) #endif /* USE_XMC_SUPPORT */ nonempty = 0; - if (curscr->_clear || newscr->_clear) { /* force refresh ? */ - ClrUpdate(); - curscr->_clear = FALSE; /* reset flag */ - newscr->_clear = FALSE; /* reset flag */ + if (CurScreen(SP_PARM)->_clear || NewScreen(SP_PARM)->_clear) { /* force refresh ? */ + ClrUpdate(NCURSES_SP_ARG); + CurScreen(SP_PARM)->_clear = FALSE; /* reset flag */ + NewScreen(SP_PARM)->_clear = FALSE; /* reset flag */ } else { int changedlines = CHECK_INTERVAL; - if (check_pending()) + if (check_pending(NCURSES_SP_ARG)) goto cleanup; - nonempty = min(screen_lines, newscr->_maxy + 1); + nonempty = min(screen_lines(SP_PARM), NewScreen(SP_PARM)->_maxy + 1); - if (SP->_scrolling) { - _nc_scroll_optimize(); + if (SP_PARM->_scrolling) { + NCURSES_SP_NAME(_nc_scroll_optimize) (NCURSES_SP_ARG); } - nonempty = ClrBottom(nonempty); + nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); TR(TRACE_UPDATE, ("Transforming lines, nonempty %d", nonempty)); for (i = 0; i < nonempty; i++) { @@ -869,7 +939,7 @@ doupdate(void) * Here is our line-breakout optimization. */ if (changedlines == CHECK_INTERVAL) { - if (check_pending()) + if (check_pending(NCURSES_SP_ARG)) goto cleanup; changedlines = 0; } @@ -880,35 +950,35 @@ doupdate(void) * is normally set by _nc_scroll_window in the * vertical-movement optimization code, */ - if (newscr->_line[i].firstchar != _NOCHANGE - || curscr->_line[i].firstchar != _NOCHANGE) { - TransformLine(i); + if (NewScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE + || CurScreen(SP_PARM)->_line[i].firstchar != _NOCHANGE) { + TransformLine(NCURSES_SP_ARGx i); changedlines++; } /* mark line changed successfully */ - if (i <= newscr->_maxy) { - MARK_NOCHANGE(newscr, i); + if (i <= NewScreen(SP_PARM)->_maxy) { + MARK_NOCHANGE(NewScreen(SP_PARM), i); } - if (i <= curscr->_maxy) { - MARK_NOCHANGE(curscr, i); + if (i <= CurScreen(SP_PARM)->_maxy) { + MARK_NOCHANGE(CurScreen(SP_PARM), i); } } } /* put everything back in sync */ - for (i = nonempty; i <= newscr->_maxy; i++) { - MARK_NOCHANGE(newscr, i); + for (i = nonempty; i <= NewScreen(SP_PARM)->_maxy; i++) { + MARK_NOCHANGE(NewScreen(SP_PARM), i); } - for (i = nonempty; i <= curscr->_maxy; i++) { - MARK_NOCHANGE(curscr, i); + for (i = nonempty; i <= CurScreen(SP_PARM)->_maxy; i++) { + MARK_NOCHANGE(CurScreen(SP_PARM), i); } - if (!newscr->_leaveok) { - curscr->_curx = newscr->_curx; - curscr->_cury = newscr->_cury; + if (!NewScreen(SP_PARM)->_leaveok) { + CurScreen(SP_PARM)->_curx = NewScreen(SP_PARM)->_curx; + CurScreen(SP_PARM)->_cury = NewScreen(SP_PARM)->_cury; - GoTo(curscr->_cury, curscr->_curx); + GoTo(NCURSES_SP_ARGx CurScreen(SP_PARM)->_cury, CurScreen(SP_PARM)->_curx); } cleanup: @@ -921,10 +991,10 @@ doupdate(void) #if USE_XMC_SUPPORT if (magic_cookie_glitch != 0) #endif - UpdateAttrs(normal); + UpdateAttrs(SP_PARM, normal); - _nc_flush(); - WINDOW_ATTRS(curscr) = WINDOW_ATTRS(newscr); + NCURSES_SP_NAME(_nc_flush) (NCURSES_SP_ARG); + WINDOW_ATTRS(CurScreen(SP_PARM)) = WINDOW_ATTRS(NewScreen(SP_PARM)); #if USE_TRACE_TIMES (void) times(&after); @@ -940,6 +1010,14 @@ doupdate(void) returnCode(OK); } +#if NCURSES_SP_FUNCS && !defined(USE_TERM_DRIVER) +NCURSES_EXPORT(int) +doupdate(void) +{ + return TINFO_DOUPDATE(CURRENT_SCREEN); +} +#endif + /* * ClrBlank(win) * @@ -951,14 +1029,14 @@ doupdate(void) * in the wbkgd() call. Assume 'stdscr' for this case. */ #define BCE_ATTRS (A_NORMAL|A_COLOR) -#define BCE_BKGD(win) (((win) == curscr ? stdscr : (win))->_nc_bkgd) +#define BCE_BKGD(sp,win) (((win) == CurScreen(sp) ? StdScreen(sp) : (win))->_nc_bkgd) static NCURSES_INLINE NCURSES_CH_T -ClrBlank(WINDOW *win) +ClrBlank(NCURSES_SP_DCLx WINDOW *win) { NCURSES_CH_T blank = blankchar; if (back_color_erase) - AddAttr(blank, (AttrOf(BCE_BKGD(win)) & BCE_ATTRS)); + AddAttr(blank, (AttrOf(BCE_BKGD(SP_PARM, win)) & BCE_ATTRS)); return blank; } @@ -970,23 +1048,24 @@ ClrBlank(WINDOW *win) */ static void -ClrUpdate(void) +ClrUpdate(NCURSES_SP_DCL0) { - int i; - NCURSES_CH_T blank = ClrBlank(stdscr); - int nonempty = min(screen_lines, newscr->_maxy + 1); - TR(TRACE_UPDATE, (T_CALLED("ClrUpdate"))); + if (0 != SP_PARM) { + int i; + NCURSES_CH_T blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); + int nonempty = min(screen_lines(SP_PARM), + NewScreen(SP_PARM)->_maxy + 1); - ClearScreen(blank); + ClearScreen(NCURSES_SP_ARGx blank); - TR(TRACE_UPDATE, ("updating screen from scratch")); + TR(TRACE_UPDATE, ("updating screen from scratch")); - nonempty = ClrBottom(nonempty); - - for (i = 0; i < nonempty; i++) - TransformLine(i); + nonempty = ClrBottom(NCURSES_SP_ARGx nonempty); + for (i = 0; i < nonempty; i++) + TransformLine(NCURSES_SP_ARGx i); + } TR(TRACE_UPDATE, (T_RETURN(""))); } @@ -997,35 +1076,36 @@ ClrUpdate(void) */ static void -ClrToEOL(NCURSES_CH_T blank, bool needclear) +ClrToEOL(NCURSES_SP_DCLx NCURSES_CH_T blank, bool needclear) { int j; - if (curscr != 0 - && SP->_cursrow >= 0) { - for (j = SP->_curscol; j < screen_columns; j++) { - if (j >= 0) { - NCURSES_CH_T *cp = &(curscr->_line[SP->_cursrow].text[j]); + if (SP_PARM != 0) { + if (CurScreen(SP_PARM) != 0 + && SP_PARM->_cursrow >= 0) { + for (j = SP_PARM->_curscol; j < screen_columns(SP_PARM); j++) { + if (j >= 0) { + NCURSES_CH_T *cp = + &(CurScreen(SP_PARM)->_line[SP_PARM->_cursrow].text[j]); - if (!CharEq(*cp, blank)) { - *cp = blank; - needclear = TRUE; + if (!CharEq(*cp, blank)) { + *cp = blank; + needclear = TRUE; + } } } } - } else { - needclear = TRUE; } - if (needclear) { - UpdateAttrs(blank); + if (needclear && (SP_PARM != 0)) { + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); - if (clr_eol && SP->_el_cost <= (screen_columns - SP->_curscol)) { - putp(clr_eol); + if (clr_eol && SP_PARM->_el_cost <= (screen_columns(SP_PARM) - SP_PARM->_curscol)) { + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } else { - int count = (screen_columns - SP->_curscol); + int count = (screen_columns(SP_PARM) - SP_PARM->_curscol); while (count-- > 0) - PutChar(CHREF(blank)); + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } } @@ -1037,23 +1117,29 @@ ClrToEOL(NCURSES_CH_T blank, bool needclear) */ static void -ClrToEOS(NCURSES_CH_T blank) +ClrToEOS(NCURSES_SP_DCLx NCURSES_CH_T blank) { int row, col; - row = SP->_cursrow; - col = SP->_curscol; + if (0 == SP_PARM) + return; - UpdateAttrs(blank); + row = SP_PARM->_cursrow; + col = SP_PARM->_curscol; + + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eos"); - tputs(clr_eos, screen_lines - row, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + clr_eos, + screen_lines(SP_PARM) - row, + NCURSES_SP_NAME(_nc_outch)); - while (col < screen_columns) - curscr->_line[row].text[col++] = blank; + while (col < screen_columns(SP_PARM)) + CurScreen(SP_PARM)->_line[row].text[col++] = blank; - for (row++; row < screen_lines; row++) { - for (col = 0; col < screen_columns; col++) - curscr->_line[row].text[col] = blank; + for (row++; row < screen_lines(SP_PARM); row++) { + for (col = 0; col < screen_columns(SP_PARM); col++) + CurScreen(SP_PARM)->_line[row].text[col] = blank; } } @@ -1065,26 +1151,26 @@ ClrToEOS(NCURSES_CH_T blank) * screen, checking if each is blank, and one or more are changed. */ static int -ClrBottom(int total) +ClrBottom(NCURSES_SP_DCLx int total) { int row; int col; int top = total; - int last = min(screen_columns, newscr->_maxx + 1); - NCURSES_CH_T blank = newscr->_line[total - 1].text[last - 1]; + int last = min(screen_columns(SP_PARM), NewScreen(SP_PARM)->_maxx + 1); + NCURSES_CH_T blank = NewScreen(SP_PARM)->_line[total - 1].text[last - 1]; bool ok; - if (clr_eos && can_clear_with(CHREF(blank))) { + if (clr_eos && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { for (row = total - 1; row >= 0; row--) { for (col = 0, ok = TRUE; ok && col < last; col++) { - ok = (CharEq(newscr->_line[row].text[col], blank)); + ok = (CharEq(NewScreen(SP_PARM)->_line[row].text[col], blank)); } if (!ok) break; for (col = 0; ok && col < last; col++) { - ok = (CharEq(curscr->_line[row].text[col], blank)); + ok = (CharEq(CurScreen(SP_PARM)->_line[row].text[col], blank)); } if (!ok) top = row; @@ -1092,11 +1178,11 @@ ClrBottom(int total) /* don't use clr_eos for just one line if clr_eol available */ if (top < total) { - GoTo(top, 0); - ClrToEOS(blank); - if (SP->oldhash && SP->newhash) { - for (row = top; row < screen_lines; row++) - SP->oldhash[row] = SP->newhash[row]; + GoTo(NCURSES_SP_ARGx top, 0); + ClrToEOS(NCURSES_SP_ARGx blank); + if (SP_PARM->oldhash && SP_PARM->newhash) { + for (row = top; row < screen_lines(SP_PARM); row++) + SP_PARM->oldhash[row] = SP_PARM->newhash[row]; } } } @@ -1105,22 +1191,22 @@ ClrBottom(int total) #if USE_XMC_SUPPORT #if USE_WIDEC_SUPPORT -#define check_xmc_transition(a, b) \ - ((((a)->attr ^ (b)->attr) & ~((a)->attr) & SP->_xmc_triggers) != 0) -#define xmc_turn_on(a,b) check_xmc_transition(&(a), &(b)) +#define check_xmc_transition(sp, a, b) \ + ((((a)->attr ^ (b)->attr) & ~((a)->attr) & (sp)->_xmc_triggers) != 0) +#define xmc_turn_on(sp,a,b) check_xmc_transition(sp,&(a), &(b)) #else -#define xmc_turn_on(a,b) ((((a)^(b)) & ~(a) & SP->_xmc_triggers) != 0) +#define xmc_turn_on(sp,a,b) ((((a)^(b)) & ~(a) & (sp)->_xmc_triggers) != 0) #endif -#define xmc_new(r,c) newscr->_line[r].text[c] -#define xmc_turn_off(a,b) xmc_turn_on(b,a) +#define xmc_new(sp,r,c) NewScreen(sp)->_line[r].text[c] +#define xmc_turn_off(sp,a,b) xmc_turn_on(sp,b,a) #endif /* USE_XMC_SUPPORT */ /* ** TransformLine(lineno) ** ** Transform the given line in curscr to the one in newscr, using -** Insert/Delete Character if _nc_idcok && has_ic(). +** Insert/Delete Character if idcok && has_ic(). ** ** firstChar = position of first different character in line ** oLastChar = position of last different character in old line @@ -1135,19 +1221,19 @@ ClrBottom(int total) */ static void -TransformLine(int const lineno) +TransformLine(NCURSES_SP_DCLx int const lineno) { int firstChar, oLastChar, nLastChar; - NCURSES_CH_T *newLine = newscr->_line[lineno].text; - NCURSES_CH_T *oldLine = curscr->_line[lineno].text; + NCURSES_CH_T *newLine = NewScreen(SP_PARM)->_line[lineno].text; + NCURSES_CH_T *oldLine = CurScreen(SP_PARM)->_line[lineno].text; int n; bool attrchanged = FALSE; - TR(TRACE_UPDATE, (T_CALLED("TransformLine(%d)"), lineno)); + TR(TRACE_UPDATE, (T_CALLED("TransformLine(%p, %d)"), (void *) SP_PARM, lineno)); /* copy new hash value to old one */ - if (SP->oldhash && SP->newhash) - SP->oldhash[lineno] = SP->newhash[lineno]; + if (SP_PARM->oldhash && SP_PARM->newhash) + SP_PARM->oldhash[lineno] = SP_PARM->newhash[lineno]; /* * If we have colors, there is the possibility of having two color pairs @@ -1155,19 +1241,20 @@ TransformLine(int const lineno) * for this case, and update the old line with the new line's colors when * they are equivalent. */ - if (SP->_coloron) { + if (SP_PARM->_coloron) { int oldPair; int newPair; - for (n = 0; n < screen_columns; n++) { + for (n = 0; n < screen_columns(SP_PARM); n++) { if (!CharEq(newLine[n], oldLine[n])) { oldPair = GetPair(oldLine[n]); newPair = GetPair(newLine[n]); if (oldPair != newPair && unColor(oldLine[n]) == unColor(newLine[n])) { - if (oldPair < COLOR_PAIRS - && newPair < COLOR_PAIRS - && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) { + if (oldPair < SP_PARM->_pair_limit + && newPair < SP_PARM->_pair_limit + && (SP_PARM->_color_pairs[oldPair] == + SP_PARM->_color_pairs[newPair])) { SetPair(oldLine[n], GetPair(newLine[n])); } } @@ -1177,7 +1264,7 @@ TransformLine(int const lineno) if (ceol_standout_glitch && clr_eol) { firstChar = 0; - while (firstChar < screen_columns) { + while (firstChar < screen_columns(SP_PARM)) { if (!SameAttrOf(newLine[firstChar], oldLine[firstChar])) { attrchanged = TRUE; break; @@ -1189,9 +1276,13 @@ TransformLine(int const lineno) firstChar = 0; if (attrchanged) { /* we may have to disregard the whole line */ - GoTo(lineno, firstChar); - ClrToEOL(ClrBlank(curscr), FALSE); - PutRange(oldLine, newLine, lineno, 0, (screen_columns - 1)); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + ClrToEOL(NCURSES_SP_ARGx + ClrBlank(NCURSES_SP_ARGx + CurScreen(SP_PARM)), FALSE); + PutRange(NCURSES_SP_ARGx + oldLine, newLine, lineno, 0, + screen_columns(SP_PARM) - 1); #if USE_XMC_SUPPORT /* @@ -1206,8 +1297,8 @@ TransformLine(int const lineno) * following operation. */ } else if (magic_cookie_glitch > 0) { - GoTo(lineno, firstChar); - for (n = 0; n < screen_columns; n++) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); + for (n = 0; n < screen_columns(SP_PARM); n++) { int m = n + magic_cookie_glitch; /* check for turn-on: @@ -1216,26 +1307,30 @@ TransformLine(int const lineno) */ if (ISBLANK(newLine[n]) && ((n > 0 - && xmc_turn_on(newLine[n - 1], newLine[n])) + && xmc_turn_on(SP_PARM, newLine[n - 1], newLine[n])) || (n == 0 && lineno > 0 - && xmc_turn_on(xmc_new(lineno - 1, screen_columns - 1), + && xmc_turn_on(SP_PARM, + xmc_new(SP_PARM, lineno - 1, + screen_columns(SP_PARM) - 1), newLine[n])))) { n = m; } - PutChar(CHREF(newLine[n])); + PutChar(NCURSES_SP_ARGx CHREF(newLine[n])); /* check for turn-off: * If we are writing an attributed non-blank, where the * next cell is blank, and not attributed. */ if (!ISBLANK(newLine[n]) - && ((n + 1 < screen_columns - && xmc_turn_off(newLine[n], newLine[n + 1])) - || (n + 1 >= screen_columns - && lineno + 1 < screen_lines - && xmc_turn_off(newLine[n], xmc_new(lineno + 1, 0))))) { + && ((n + 1 < screen_columns(SP_PARM) + && xmc_turn_off(SP_PARM, newLine[n], newLine[n + 1])) + || (n + 1 >= screen_columns(SP_PARM) + && lineno + 1 < screen_lines(SP_PARM) + && xmc_turn_off(SP_PARM, + newLine[n], + xmc_new(SP_PARM, lineno + 1, 0))))) { n = m; } @@ -1246,38 +1341,42 @@ TransformLine(int const lineno) /* it may be cheap to clear leading whitespace with clr_bol */ blank = newLine[0]; - if (clr_bol && can_clear_with(CHREF(blank))) { + if (clr_bol && can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { int oFirstChar, nFirstChar; - for (oFirstChar = 0; oFirstChar < screen_columns; oFirstChar++) + for (oFirstChar = 0; + oFirstChar < screen_columns(SP_PARM); + oFirstChar++) if (!CharEq(oldLine[oFirstChar], blank)) break; - for (nFirstChar = 0; nFirstChar < screen_columns; nFirstChar++) + for (nFirstChar = 0; + nFirstChar < screen_columns(SP_PARM); + nFirstChar++) if (!CharEq(newLine[nFirstChar], blank)) break; if (nFirstChar == oFirstChar) { firstChar = nFirstChar; /* find the first differing character */ - while (firstChar < screen_columns + while (firstChar < screen_columns(SP_PARM) && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } else if (oFirstChar > nFirstChar) { firstChar = nFirstChar; } else { /* oFirstChar < nFirstChar */ firstChar = oFirstChar; - if (SP->_el1_cost < nFirstChar - oFirstChar) { - if (nFirstChar >= screen_columns - && SP->_el_cost <= SP->_el1_cost) { - GoTo(lineno, 0); - UpdateAttrs(blank); + if (SP_PARM->_el1_cost < nFirstChar - oFirstChar) { + if (nFirstChar >= screen_columns(SP_PARM) + && SP_PARM->_el_cost <= SP_PARM->_el1_cost) { + GoTo(NCURSES_SP_ARGx lineno, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eol"); - putp(clr_eol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } else { - GoTo(lineno, nFirstChar - 1); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx lineno, nFirstChar - 1); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_bol"); - putp(clr_bol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_bol); } while (firstChar < nFirstChar) @@ -1286,64 +1385,81 @@ TransformLine(int const lineno) } } else { /* find the first differing character */ - while (firstChar < screen_columns + while (firstChar < screen_columns(SP_PARM) && CharEq(newLine[firstChar], oldLine[firstChar])) firstChar++; } /* if there wasn't one, we're done */ - if (firstChar >= screen_columns) { + if (firstChar >= screen_columns(SP_PARM)) { TR(TRACE_UPDATE, (T_RETURN(""))); return; } - blank = newLine[screen_columns - 1]; + blank = newLine[screen_columns(SP_PARM) - 1]; - if (!can_clear_with(CHREF(blank))) { + if (!can_clear_with(NCURSES_SP_ARGx CHREF(blank))) { /* find the last differing character */ - nLastChar = screen_columns - 1; + nLastChar = screen_columns(SP_PARM) - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], oldLine[nLastChar])) nLastChar--; if (nLastChar >= firstChar) { - GoTo(lineno, firstChar); - PutRange(oldLine, newLine, lineno, firstChar, nLastChar); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + nLastChar); memcpy(oldLine + firstChar, newLine + firstChar, - (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); + (unsigned) (nLastChar - firstChar + 1) * sizeof(NCURSES_CH_T)); } TR(TRACE_UPDATE, (T_RETURN(""))); return; } /* find last non-blank character on old line */ - oLastChar = screen_columns - 1; + oLastChar = screen_columns(SP_PARM) - 1; while (oLastChar > firstChar && CharEq(oldLine[oLastChar], blank)) oLastChar--; /* find last non-blank character on new line */ - nLastChar = screen_columns - 1; + nLastChar = screen_columns(SP_PARM) - 1; while (nLastChar > firstChar && CharEq(newLine[nLastChar], blank)) nLastChar--; if ((nLastChar == firstChar) - && (SP->_el_cost < (oLastChar - nLastChar))) { - GoTo(lineno, firstChar); + && (SP_PARM->_el_cost < (oLastChar - nLastChar))) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); if (!CharEq(newLine[firstChar], blank)) - PutChar(CHREF(newLine[firstChar])); - ClrToEOL(blank, FALSE); + PutChar(NCURSES_SP_ARGx CHREF(newLine[firstChar])); + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else if ((nLastChar != oLastChar) && (!CharEq(newLine[nLastChar], oldLine[oLastChar]) - || !(_nc_idcok && has_ic()))) { - GoTo(lineno, firstChar); - if ((oLastChar - nLastChar) > SP->_el_cost) { - if (PutRange(oldLine, newLine, lineno, firstChar, nLastChar)) - GoTo(lineno, nLastChar + 1); - ClrToEOL(blank, FALSE); + || !(SP_PARM->_nc_sp_idcok + && NCURSES_SP_NAME(has_ic) (NCURSES_SP_ARG)))) { + GoTo(NCURSES_SP_ARGx lineno, firstChar); + if ((oLastChar - nLastChar) > SP_PARM->_el_cost) { + if (PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + nLastChar)) { + GoTo(NCURSES_SP_ARGx lineno, nLastChar + 1); + } + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { n = max(nLastChar, oLastChar); - PutRange(oldLine, newLine, lineno, firstChar, n); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + n); } } else { int nLastNonblank = nLastChar; @@ -1364,8 +1480,13 @@ TransformLine(int const lineno) n = min(oLastChar, nLastChar); if (n >= firstChar) { - GoTo(lineno, firstChar); - PutRange(oldLine, newLine, lineno, firstChar, n); + GoTo(NCURSES_SP_ARGx lineno, firstChar); + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + firstChar, + n); } if (oLastChar < nLastChar) { @@ -1376,21 +1497,26 @@ TransformLine(int const lineno) --oLastChar; } #endif - GoTo(lineno, n + 1); + GoTo(NCURSES_SP_ARGx lineno, n + 1); if ((nLastChar < nLastNonblank) - || InsCharCost(nLastChar - oLastChar) > (m - n)) { - PutRange(oldLine, newLine, lineno, n + 1, m); + || InsCharCost(SP_PARM, nLastChar - oLastChar) > (m - n)) { + PutRange(NCURSES_SP_ARGx + oldLine, + newLine, + lineno, + n + 1, + m); } else { - InsStr(&newLine[n + 1], nLastChar - oLastChar); + InsStr(NCURSES_SP_ARGx &newLine[n + 1], nLastChar - oLastChar); } } else if (oLastChar > nLastChar) { - GoTo(lineno, n + 1); - if (DelCharCost(oLastChar - nLastChar) - > SP->_el_cost + nLastNonblank - (n + 1)) { - if (PutRange(oldLine, newLine, lineno, + GoTo(NCURSES_SP_ARGx lineno, n + 1); + if (DelCharCost(SP_PARM, oLastChar - nLastChar) + > SP_PARM->_el_cost + nLastNonblank - (n + 1)) { + if (PutRange(NCURSES_SP_ARGx oldLine, newLine, lineno, n + 1, nLastNonblank)) - GoTo(lineno, nLastNonblank + 1); - ClrToEOL(blank, FALSE); + GoTo(NCURSES_SP_ARGx lineno, nLastNonblank + 1); + ClrToEOL(NCURSES_SP_ARGx blank, FALSE); } else { /* * The delete-char sequence will @@ -1400,18 +1526,18 @@ TransformLine(int const lineno) * setting the video attributes from * the last character on the row. */ - UpdateAttrs(blank); - DelChar(oLastChar - nLastChar); + UpdateAttrs(SP_PARM, blank); + DelChar(NCURSES_SP_ARGx oLastChar - nLastChar); } } } } /* update the code's internal representation */ - if (screen_columns > firstChar) + if (screen_columns(SP_PARM) > firstChar) memcpy(oldLine + firstChar, newLine + firstChar, - (screen_columns - firstChar) * sizeof(NCURSES_CH_T)); + (unsigned) (screen_columns(SP_PARM) - firstChar) * sizeof(NCURSES_CH_T)); TR(TRACE_UPDATE, (T_RETURN(""))); return; } @@ -1424,7 +1550,7 @@ TransformLine(int const lineno) */ static void -ClearScreen(NCURSES_CH_T blank) +ClearScreen(NCURSES_SP_DCLx NCURSES_CH_T blank) { int i, j; bool fast_clear = (clear_screen || clr_eos || clr_eol); @@ -1432,9 +1558,13 @@ ClearScreen(NCURSES_CH_T blank) TR(TRACE_UPDATE, ("ClearScreen() called")); #if NCURSES_EXT_FUNCS - if (SP->_coloron - && !SP->_default_color) { - _nc_do_color(GET_SCREEN_PAIR(SP), 0, FALSE, _nc_outch); + if (SP_PARM->_coloron + && !SP_PARM->_default_color) { + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx + (short) GET_SCREEN_PAIR(SP_PARM), + 0, + FALSE, + NCURSES_SP_NAME(_nc_outch)); if (!back_color_erase) { fast_clear = FALSE; } @@ -1443,42 +1573,46 @@ ClearScreen(NCURSES_CH_T blank) if (fast_clear) { if (clear_screen) { - UpdateAttrs(blank); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clear_screen"); - putp(clear_screen); - SP->_cursrow = SP->_curscol = 0; - position_check(SP->_cursrow, SP->_curscol, "ClearScreen"); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clear_screen); + SP_PARM->_cursrow = SP_PARM->_curscol = 0; + position_check(SP_PARM, + SP_PARM->_cursrow, + SP_PARM->_curscol, + "ClearScreen"); } else if (clr_eos) { - SP->_cursrow = SP->_curscol = -1; - GoTo(0, 0); - - UpdateAttrs(blank); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; + GoTo(NCURSES_SP_ARGx 0, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("clr_eos"); - tputs(clr_eos, screen_lines, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + clr_eos, + screen_lines(SP_PARM), + NCURSES_SP_NAME(_nc_outch)); } else if (clr_eol) { - SP->_cursrow = SP->_curscol = -1; - - UpdateAttrs(blank); - for (i = 0; i < screen_lines; i++) { - GoTo(i, 0); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; + UpdateAttrs(SP_PARM, blank); + for (i = 0; i < screen_lines(SP_PARM); i++) { + GoTo(NCURSES_SP_ARGx i, 0); TPUTS_TRACE("clr_eol"); - putp(clr_eol); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx clr_eol); } - GoTo(0, 0); + GoTo(NCURSES_SP_ARGx 0, 0); } } else { - UpdateAttrs(blank); - for (i = 0; i < screen_lines; i++) { - GoTo(i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + UpdateAttrs(SP_PARM, blank); + for (i = 0; i < screen_lines(SP_PARM); i++) { + GoTo(NCURSES_SP_ARGx i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } - GoTo(0, 0); + GoTo(NCURSES_SP_ARGx 0, 0); } - for (i = 0; i < screen_lines; i++) { - for (j = 0; j < screen_columns; j++) - curscr->_line[i].text[j] = blank; + for (i = 0; i < screen_lines(SP_PARM); i++) { + for (j = 0; j < screen_columns(SP_PARM); j++) + CurScreen(SP_PARM)->_line[i].text[j] = blank; } TR(TRACE_UPDATE, ("screen cleared")); @@ -1492,49 +1626,54 @@ ClearScreen(NCURSES_CH_T blank) */ static void -InsStr(NCURSES_CH_T * line, int count) +InsStr(NCURSES_SP_DCLx NCURSES_CH_T * line, int count) { - TR(TRACE_UPDATE, ("InsStr(%p,%d) called", line, count)); + TR(TRACE_UPDATE, ("InsStr(%p, %p,%d) called", + (void *) SP_PARM, + (void *) line, count)); /* Prefer parm_ich as it has the smallest cost - no need to shift * the whole line on each character. */ /* The order must match that of InsCharCost. */ if (parm_ich) { TPUTS_TRACE("parm_ich"); - tputs(TPARM_1(parm_ich, count), count, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(parm_ich, count), + count, + NCURSES_SP_NAME(_nc_outch)); while (count) { - PutAttrChar(CHREF(*line)); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); line++; count--; } } else if (enter_insert_mode && exit_insert_mode) { TPUTS_TRACE("enter_insert_mode"); - putp(enter_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx enter_insert_mode); while (count) { - PutAttrChar(CHREF(*line)); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - putp(insert_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); } line++; count--; } TPUTS_TRACE("exit_insert_mode"); - putp(exit_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); } else { while (count) { TPUTS_TRACE("insert_character"); - putp(insert_character); - PutAttrChar(CHREF(*line)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_character); + PutAttrChar(NCURSES_SP_ARGx CHREF(*line)); if (insert_padding) { TPUTS_TRACE("insert_padding"); - putp(insert_padding); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_padding); } line++; count--; } } - position_check(SP->_cursrow, SP->_curscol, "InsStr"); + position_check(SP_PARM, SP_PARM->_cursrow, SP_PARM->_curscol, "InsStr"); } /* @@ -1545,22 +1684,25 @@ InsStr(NCURSES_CH_T * line, int count) */ static void -DelChar(int count) +DelChar(NCURSES_SP_DCLx int count) { int n; - TR(TRACE_UPDATE, ("DelChar(%d) called, position = (%ld,%ld)", - count, - (long) newscr->_cury, - (long) newscr->_curx)); + TR(TRACE_UPDATE, ("DelChar(%p, %d) called, position = (%ld,%ld)", + (void *) SP_PARM, count, + (long) NewScreen(SP_PARM)->_cury, + (long) NewScreen(SP_PARM)->_curx)); if (parm_dch) { TPUTS_TRACE("parm_dch"); - tputs(TPARM_1(parm_dch, count), count, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_1(parm_dch, count), + count, + NCURSES_SP_NAME(_nc_outch)); } else { for (n = 0; n < count; n++) { TPUTS_TRACE("delete_character"); - putp(delete_character); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_character); } } } @@ -1599,54 +1741,66 @@ DelChar(int count) /* Try to scroll up assuming given csr (miny, maxy). Returns ERR on failure */ static int -scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T blank) +scroll_csr_forward(NCURSES_SP_DCLx + int n, + int top, + int bot, + int miny, + int maxy, + NCURSES_CH_T blank) { int i; if (n == 1 && scroll_forward && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("scroll_forward"); - putp(scroll_forward); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); } else if (n == 1 && delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } else if (parm_index && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_index"); - tputs(TPARM_2(parm_index, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_index, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (parm_delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_delete_line"); - tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_delete_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (scroll_forward && top == miny && bot == maxy) { - GoTo(bot, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx bot, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_forward"); - putp(scroll_forward); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_forward); } } else if (delete_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE()) { + if (FILL_BCE(SP_PARM)) { int j; for (i = 0; i < n; i++) { - GoTo(bot - i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + GoTo(NCURSES_SP_ARGx bot - i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } #endif @@ -1656,55 +1810,66 @@ scroll_csr_forward(int n, int top, int bot, int miny, int maxy, NCURSES_CH_T bla /* Try to scroll down assuming given csr (miny, maxy). Returns ERR on failure */ /* n > 0 */ static int -scroll_csr_backward(int n, int top, int bot, int miny, int maxy, +scroll_csr_backward(NCURSES_SP_DCLx + int n, + int top, + int bot, + int miny, + int maxy, NCURSES_CH_T blank) { int i; if (n == 1 && scroll_reverse && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("scroll_reverse"); - putp(scroll_reverse); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); } else if (n == 1 && insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } else if (parm_rindex && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_rindex"); - tputs(TPARM_2(parm_rindex, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_rindex, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (parm_insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); TPUTS_TRACE("parm_insert_line"); - tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_insert_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else if (scroll_reverse && top == miny && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("scroll_reverse"); - putp(scroll_reverse); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx scroll_reverse); } } else if (insert_line && bot == maxy) { - GoTo(top, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx top, 0); + UpdateAttrs(SP_PARM, blank); for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } } else return ERR; #if NCURSES_EXT_FUNCS - if (FILL_BCE()) { + if (FILL_BCE(SP_PARM)) { int j; for (i = 0; i < n; i++) { - GoTo(top + i, 0); - for (j = 0; j < screen_columns; j++) - PutChar(CHREF(blank)); + GoTo(NCURSES_SP_ARGx top + i, 0); + for (j = 0; j < screen_columns(SP_PARM); j++) + PutChar(NCURSES_SP_ARGx CHREF(blank)); } } #endif @@ -1714,40 +1879,46 @@ scroll_csr_backward(int n, int top, int bot, int miny, int maxy, /* scroll by using delete_line at del and insert_line at ins */ /* n > 0 */ static int -scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) +scroll_idl(NCURSES_SP_DCLx int n, int del, int ins, NCURSES_CH_T blank) { int i; if (!((parm_delete_line || delete_line) && (parm_insert_line || insert_line))) return ERR; - GoTo(del, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx del, 0); + UpdateAttrs(SP_PARM, blank); if (n == 1 && delete_line) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } else if (parm_delete_line) { TPUTS_TRACE("parm_delete_line"); - tputs(TPARM_2(parm_delete_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_delete_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else { /* if (delete_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("delete_line"); - putp(delete_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx delete_line); } } - GoTo(ins, 0); - UpdateAttrs(blank); + GoTo(NCURSES_SP_ARGx ins, 0); + UpdateAttrs(SP_PARM, blank); if (n == 1 && insert_line) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } else if (parm_insert_line) { TPUTS_TRACE("parm_insert_line"); - tputs(TPARM_2(parm_insert_line, n, 0), n, _nc_outch); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_2(parm_insert_line, n, 0), + n, + NCURSES_SP_NAME(_nc_outch)); } else { /* if (insert_line) */ for (i = 0; i < n; i++) { TPUTS_TRACE("insert_line"); - putp(insert_line); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx insert_line); } } @@ -1763,15 +1934,25 @@ scroll_idl(int n, int del, int ins, NCURSES_CH_T blank) * save/restore cursor capabilities if the terminal has them. */ NCURSES_EXPORT(int) -_nc_scrolln(int n, int top, int bot, int maxy) +NCURSES_SP_NAME(_nc_scrolln) (NCURSES_SP_DCLx + int n, + int top, + int bot, + int maxy) /* scroll region from top to bot by n lines */ { - NCURSES_CH_T blank = ClrBlank(stdscr); + NCURSES_CH_T blank; int i; bool cursor_saved = FALSE; int res; - TR(TRACE_MOVE, ("mvcur_scrolln(%d, %d, %d, %d)", n, top, bot, maxy)); + TR(TRACE_MOVE, ("_nc_scrolln(%p, %d, %d, %d, %d)", + (void *) SP_PARM, n, top, bot, maxy)); + + if (!IsValidScreen(SP_PARM)) + return (ERR); + + blank = ClrBlank(NCURSES_SP_ARGx StdScreen(SP_PARM)); #if USE_XMC_SUPPORT /* @@ -1787,34 +1968,36 @@ _nc_scrolln(int n, int top, int bot, int maxy) * Explicitly clear if stuff pushed off top of region might * be saved by the terminal. */ - res = scroll_csr_forward(n, top, bot, 0, maxy, blank); + res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { if ((((n == 1 && scroll_forward) || parm_index) - && (SP->_cursrow == bot || SP->_cursrow == bot - 1)) + && (SP_PARM->_cursrow == bot || SP_PARM->_cursrow == bot - 1)) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - putp(save_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); } TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, top, bot)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - putp(restore_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); } else { - SP->_cursrow = SP->_curscol = -1; + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - res = scroll_csr_forward(n, top, bot, top, bot, blank); + res = scroll_csr_forward(NCURSES_SP_ARGx n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, maxy)); - SP->_cursrow = SP->_curscol = -1; + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, 0, maxy)); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - if (res == ERR && _nc_idlok) - res = scroll_idl(n, top, bot - n + 1, blank); + if (res == ERR && SP_PARM->_nc_sp_idlok) + res = scroll_idl(NCURSES_SP_ARGx n, top, bot - n + 1, blank); /* * Clear the newly shifted-in text. @@ -1823,44 +2006,49 @@ _nc_scrolln(int n, int top, int bot, int maxy) && (non_dest_scroll_region || (memory_below && bot == maxy))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); if (bot == maxy && clr_eos) { - GoTo(bot - n + 1, 0); - ClrToEOS(blank2); + GoTo(NCURSES_SP_ARGx bot - n + 1, 0); + ClrToEOS(NCURSES_SP_ARGx blank2); } else { for (i = 0; i < n; i++) { - GoTo(bot - i, 0); - ClrToEOL(blank2, FALSE); + GoTo(NCURSES_SP_ARGx bot - i, 0); + ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); } } } } else { /* (n < 0) - scroll down (backward) */ - res = scroll_csr_backward(-n, top, bot, 0, maxy, blank); + res = scroll_csr_backward(NCURSES_SP_ARGx -n, top, bot, 0, maxy, blank); if (res == ERR && change_scroll_region) { - if (top != 0 && (SP->_cursrow == top || SP->_cursrow == top - 1) + if (top != 0 + && (SP_PARM->_cursrow == top || + SP_PARM->_cursrow == top - 1) && save_cursor && restore_cursor) { cursor_saved = TRUE; TPUTS_TRACE("save_cursor"); - putp(save_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx save_cursor); } TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, top, bot)); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, top, bot)); if (cursor_saved) { TPUTS_TRACE("restore_cursor"); - putp(restore_cursor); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx restore_cursor); } else { - SP->_cursrow = SP->_curscol = -1; + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - res = scroll_csr_backward(-n, top, bot, top, bot, blank); + res = scroll_csr_backward(NCURSES_SP_ARGx + -n, top, bot, top, bot, blank); TPUTS_TRACE("change_scroll_region"); - putp(TPARM_2(change_scroll_region, 0, maxy)); - SP->_cursrow = SP->_curscol = -1; + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + TPARM_2(change_scroll_region, 0, maxy)); + SP_PARM->_cursrow = SP_PARM->_curscol = -1; } - if (res == ERR && _nc_idlok) - res = scroll_idl(-n, bot + n + 1, top, blank); + if (res == ERR && SP_PARM->_nc_sp_idlok) + res = scroll_idl(NCURSES_SP_ARGx -n, bot + n + 1, top, blank); /* * Clear the newly shifted-in text. @@ -1869,8 +2057,8 @@ _nc_scrolln(int n, int top, int bot, int maxy) && (non_dest_scroll_region || (memory_above && top == 0))) { static const NCURSES_CH_T blank2 = NewChar(BLANK_TEXT); for (i = 0; i < -n; i++) { - GoTo(i + top, 0); - ClrToEOL(blank2, FALSE); + GoTo(NCURSES_SP_ARGx i + top, 0); + ClrToEOL(NCURSES_SP_ARGx blank2, FALSE); } } } @@ -1878,99 +2066,163 @@ _nc_scrolln(int n, int top, int bot, int maxy) if (res == ERR) return (ERR); - _nc_scroll_window(curscr, n, top, bot, blank); + _nc_scroll_window(CurScreen(SP_PARM), n, + (NCURSES_SIZE_T) top, + (NCURSES_SIZE_T) bot, + blank); /* shift hash values too - they can be reused */ - _nc_scroll_oldhash(n, top, bot); + NCURSES_SP_NAME(_nc_scroll_oldhash) (NCURSES_SP_ARGx n, top, bot); return (OK); } -NCURSES_EXPORT(void) -_nc_screen_resume(void) +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +_nc_scrolln(int n, int top, int bot, int maxy) { + return NCURSES_SP_NAME(_nc_scrolln) (CURRENT_SCREEN, n, top, bot, maxy); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_DCL0) +{ + assert(SP_PARM); + /* make sure terminal is in a sane known state */ - SetAttr(SCREEN_ATTRS(SP), A_NORMAL); - newscr->_clear = TRUE; + SetAttr(SCREEN_ATTRS(SP_PARM), A_NORMAL); + NewScreen(SP_PARM)->_clear = TRUE; /* reset color pairs and definitions */ - if (SP->_coloron || SP->_color_defs) - _nc_reset_colors(); + if (SP_PARM->_coloron || SP_PARM->_color_defs) + NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); /* restore user-defined colors, if any */ - if (SP->_color_defs < 0) { + if (SP_PARM->_color_defs < 0) { int n; - SP->_color_defs = -(SP->_color_defs); - for (n = 0; n < SP->_color_defs; ++n) { - if (SP->_color_table[n].init) { - init_color(n, - SP->_color_table[n].r, - SP->_color_table[n].g, - SP->_color_table[n].b); + SP_PARM->_color_defs = -(SP_PARM->_color_defs); + for (n = 0; n < SP_PARM->_color_defs; ++n) { + if (SP_PARM->_color_table[n].init) { + NCURSES_SP_NAME(init_color) (NCURSES_SP_ARGx + (short) n, + SP_PARM->_color_table[n].r, + SP_PARM->_color_table[n].g, + SP_PARM->_color_table[n].b); } } } if (exit_attribute_mode) - putp(exit_attribute_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_attribute_mode); else { /* turn off attributes */ if (exit_alt_charset_mode) - putp(exit_alt_charset_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_alt_charset_mode); if (exit_standout_mode) - putp(exit_standout_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_standout_mode); if (exit_underline_mode) - putp(exit_underline_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_underline_mode); } if (exit_insert_mode) - putp(exit_insert_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx exit_insert_mode); if (enter_am_mode && exit_am_mode) - putp(auto_right_margin ? enter_am_mode : exit_am_mode); + NCURSES_SP_NAME(putp) (NCURSES_SP_ARGx + (auto_right_margin + ? enter_am_mode + : exit_am_mode)); } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_screen_resume(void) +{ + NCURSES_SP_NAME(_nc_screen_resume) (CURRENT_SCREEN); +} +#endif + +NCURSES_EXPORT(void) +NCURSES_SP_NAME(_nc_screen_init) (NCURSES_SP_DCL0) +{ + NCURSES_SP_NAME(_nc_screen_resume) (NCURSES_SP_ARG); +} + +#if NCURSES_SP_FUNCS NCURSES_EXPORT(void) _nc_screen_init(void) { - _nc_screen_resume(); + NCURSES_SP_NAME(_nc_screen_init) (CURRENT_SCREEN); } +#endif /* wrap up screen handling */ NCURSES_EXPORT(void) -_nc_screen_wrap(void) +NCURSES_SP_NAME(_nc_screen_wrap) (NCURSES_SP_DCL0) { - UpdateAttrs(normal); + if (SP_PARM == 0) + return; + + UpdateAttrs(SP_PARM, normal); #if NCURSES_EXT_FUNCS - if (SP->_coloron - && !SP->_default_color) { + if (SP_PARM->_coloron + && !SP_PARM->_default_color) { static const NCURSES_CH_T blank = NewChar(BLANK_TEXT); - SP->_default_color = TRUE; - _nc_do_color(-1, 0, FALSE, _nc_outch); - SP->_default_color = FALSE; + SP_PARM->_default_color = TRUE; + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx + -1, + 0, + FALSE, + NCURSES_SP_NAME(_nc_outch)); + SP_PARM->_default_color = FALSE; - mvcur(SP->_cursrow, SP->_curscol, screen_lines - 1, 0); + TINFO_MVCUR(NCURSES_SP_ARGx + SP_PARM->_cursrow, + SP_PARM->_curscol, + screen_lines(SP_PARM) - 1, + 0); - ClrToEOL(blank, TRUE); + ClrToEOL(NCURSES_SP_ARGx blank, TRUE); } #endif - if (SP->_color_defs) { - _nc_reset_colors(); + if (SP_PARM->_color_defs) { + NCURSES_SP_NAME(_nc_reset_colors) (NCURSES_SP_ARG); } } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_screen_wrap(void) +{ + NCURSES_SP_NAME(_nc_screen_wrap) (CURRENT_SCREEN); +} +#endif + #if USE_XMC_SUPPORT NCURSES_EXPORT(void) -_nc_do_xmc_glitch(attr_t previous) +NCURSES_SP_NAME(_nc_do_xmc_glitch) (NCURSES_SP_DCLx attr_t previous) { - attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP))); + if (SP_PARM != 0) { + attr_t chg = XMC_CHANGES(previous ^ AttrOf(SCREEN_ATTRS(SP_PARM))); - while (chg != 0) { - if (chg & 1) { - SP->_curscol += magic_cookie_glitch; - if (SP->_curscol >= SP->_columns) - wrap_cursor(); - TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", SP->_cursrow, SP->_curscol)); + while (chg != 0) { + if (chg & 1) { + SP_PARM->_curscol += magic_cookie_glitch; + if (SP_PARM->_curscol >= SP_PARM->_columns) + wrap_cursor(NCURSES_SP_ARG); + TR(TRACE_UPDATE, ("bumped to %d,%d after cookie", + SP_PARM->_cursrow, SP_PARM->_curscol)); + } + chg >>= 1; } - chg >>= 1; } } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +_nc_do_xmc_glitch(attr_t previous) +{ + NCURSES_SP_NAME(_nc_do_xmc_glitch) (CURRENT_SCREEN, previous); +} +#endif + #endif /* USE_XMC_SUPPORT */ diff --git a/contrib/ncurses/ncurses/wcwidth.h b/contrib/ncurses/ncurses/wcwidth.h new file mode 100644 index 000000000000..61e822ad679f --- /dev/null +++ b/contrib/ncurses/ncurses/wcwidth.h @@ -0,0 +1,309 @@ +/* + * This is an implementation of wcwidth() and wcswidth() (defined in + * IEEE Std 1002.1-2001) for Unicode. + * + * http://www.opengroup.org/onlinepubs/007904975/functions/wcwidth.html + * http://www.opengroup.org/onlinepubs/007904975/functions/wcswidth.html + * + * In fixed-width output devices, Latin characters all occupy a single + * "cell" position of equal width, whereas ideographic CJK characters + * occupy two such cells. Interoperability between terminal-line + * applications and (teletype-style) character terminals using the + * UTF-8 encoding requires agreement on which character should advance + * the cursor by how many cell positions. No established formal + * standards exist at present on which Unicode character shall occupy + * how many cell positions on character terminals. These routines are + * a first attempt of defining such behavior based on simple rules + * applied to data provided by the Unicode Consortium. + * + * For some graphical characters, the Unicode standard explicitly + * defines a character-cell width via the definition of the East Asian + * FullWidth (F), Wide (W), Half-width (H), and Narrow (Na) classes. + * In all these cases, there is no ambiguity about which width a + * terminal shall use. For characters in the East Asian Ambiguous (A) + * class, the width choice depends purely on a preference of backward + * compatibility with either historic CJK or Western practice. + * Choosing single-width for these characters is easy to justify as + * the appropriate long-term solution, as the CJK practice of + * displaying these characters as double-width comes from historic + * implementation simplicity (8-bit encoded characters were displayed + * single-width and 16-bit ones double-width, even for Greek, + * Cyrillic, etc.) and not any typographic considerations. + * + * Much less clear is the choice of width for the Not East Asian + * (Neutral) class. Existing practice does not dictate a width for any + * of these characters. It would nevertheless make sense + * typographically to allocate two character cells to characters such + * as for instance EM SPACE or VOLUME INTEGRAL, which cannot be + * represented adequately with a single-width glyph. The following + * routines at present merely assign a single-cell width to all + * neutral characters, in the interest of simplicity. This is not + * entirely satisfactory and should be reconsidered before + * establishing a formal standard in this area. At the moment, the + * decision which Not East Asian (Neutral) characters should be + * represented by double-width glyphs cannot yet be answered by + * applying a simple rule from the Unicode database content. Setting + * up a proper standard for the behavior of UTF-8 character terminals + * will require a careful analysis not only of each Unicode character, + * but also of each presentation form, something the author of these + * routines has avoided to do so far. + * + * http://www.unicode.org/unicode/reports/tr11/ + * + * Markus Kuhn -- 2007-05-26 (Unicode 5.0) + * + * Permission to use, copy, modify, and distribute this software + * for any purpose and without fee is hereby granted. The author + * disclaims all warranties with regard to this software. + * + * Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c + */ + +#include + +struct interval { + int first; + int last; +}; + +/* auxiliary function for binary search in interval table */ +static int bisearch(wchar_t ucs, const struct interval *table, int max) { + int min = 0; + int mid; + + if (ucs < table[0].first || ucs > table[max].last) + return 0; + while (max >= min) { + mid = (min + max) / 2; + if (ucs > table[mid].last) + min = mid + 1; + else if (ucs < table[mid].first) + max = mid - 1; + else + return 1; + } + + return 0; +} + + +/* The following two functions define the column width of an ISO 10646 + * character as follows: + * + * - The null character (U+0000) has a column width of 0. + * + * - Other C0/C1 control characters and DEL will lead to a return + * value of -1. + * + * - Non-spacing and enclosing combining characters (general + * category code Mn or Me in the Unicode database) have a + * column width of 0. + * + * - SOFT HYPHEN (U+00AD) has a column width of 1. + * + * - Other format characters (general category code Cf in the Unicode + * database) and ZERO WIDTH SPACE (U+200B) have a column width of 0. + * + * - Hangul Jamo medial vowels and final consonants (U+1160-U+11FF) + * have a column width of 0. + * + * - Spacing characters in the East Asian Wide (W) or East Asian + * Full-width (F) category as defined in Unicode Technical + * Report #11 have a column width of 2. + * + * - All remaining characters (including all printable + * ISO 8859-1 and WGL4 characters, Unicode control characters, + * etc.) have a column width of 1. + * + * This implementation assumes that wchar_t characters are encoded + * in ISO 10646. + */ + +int mk_wcwidth(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of non-spacing characters */ + /* generated by "uniset +cat=Me +cat=Mn +cat=Cf -00AD +1160-11FF +200B c" */ + static const struct interval combining[] = { + { 0x0300, 0x036F }, { 0x0483, 0x0486 }, { 0x0488, 0x0489 }, + { 0x0591, 0x05BD }, { 0x05BF, 0x05BF }, { 0x05C1, 0x05C2 }, + { 0x05C4, 0x05C5 }, { 0x05C7, 0x05C7 }, { 0x0600, 0x0603 }, + { 0x0610, 0x0615 }, { 0x064B, 0x065E }, { 0x0670, 0x0670 }, + { 0x06D6, 0x06E4 }, { 0x06E7, 0x06E8 }, { 0x06EA, 0x06ED }, + { 0x070F, 0x070F }, { 0x0711, 0x0711 }, { 0x0730, 0x074A }, + { 0x07A6, 0x07B0 }, { 0x07EB, 0x07F3 }, { 0x0901, 0x0902 }, + { 0x093C, 0x093C }, { 0x0941, 0x0948 }, { 0x094D, 0x094D }, + { 0x0951, 0x0954 }, { 0x0962, 0x0963 }, { 0x0981, 0x0981 }, + { 0x09BC, 0x09BC }, { 0x09C1, 0x09C4 }, { 0x09CD, 0x09CD }, + { 0x09E2, 0x09E3 }, { 0x0A01, 0x0A02 }, { 0x0A3C, 0x0A3C }, + { 0x0A41, 0x0A42 }, { 0x0A47, 0x0A48 }, { 0x0A4B, 0x0A4D }, + { 0x0A70, 0x0A71 }, { 0x0A81, 0x0A82 }, { 0x0ABC, 0x0ABC }, + { 0x0AC1, 0x0AC5 }, { 0x0AC7, 0x0AC8 }, { 0x0ACD, 0x0ACD }, + { 0x0AE2, 0x0AE3 }, { 0x0B01, 0x0B01 }, { 0x0B3C, 0x0B3C }, + { 0x0B3F, 0x0B3F }, { 0x0B41, 0x0B43 }, { 0x0B4D, 0x0B4D }, + { 0x0B56, 0x0B56 }, { 0x0B82, 0x0B82 }, { 0x0BC0, 0x0BC0 }, + { 0x0BCD, 0x0BCD }, { 0x0C3E, 0x0C40 }, { 0x0C46, 0x0C48 }, + { 0x0C4A, 0x0C4D }, { 0x0C55, 0x0C56 }, { 0x0CBC, 0x0CBC }, + { 0x0CBF, 0x0CBF }, { 0x0CC6, 0x0CC6 }, { 0x0CCC, 0x0CCD }, + { 0x0CE2, 0x0CE3 }, { 0x0D41, 0x0D43 }, { 0x0D4D, 0x0D4D }, + { 0x0DCA, 0x0DCA }, { 0x0DD2, 0x0DD4 }, { 0x0DD6, 0x0DD6 }, + { 0x0E31, 0x0E31 }, { 0x0E34, 0x0E3A }, { 0x0E47, 0x0E4E }, + { 0x0EB1, 0x0EB1 }, { 0x0EB4, 0x0EB9 }, { 0x0EBB, 0x0EBC }, + { 0x0EC8, 0x0ECD }, { 0x0F18, 0x0F19 }, { 0x0F35, 0x0F35 }, + { 0x0F37, 0x0F37 }, { 0x0F39, 0x0F39 }, { 0x0F71, 0x0F7E }, + { 0x0F80, 0x0F84 }, { 0x0F86, 0x0F87 }, { 0x0F90, 0x0F97 }, + { 0x0F99, 0x0FBC }, { 0x0FC6, 0x0FC6 }, { 0x102D, 0x1030 }, + { 0x1032, 0x1032 }, { 0x1036, 0x1037 }, { 0x1039, 0x1039 }, + { 0x1058, 0x1059 }, { 0x1160, 0x11FF }, { 0x135F, 0x135F }, + { 0x1712, 0x1714 }, { 0x1732, 0x1734 }, { 0x1752, 0x1753 }, + { 0x1772, 0x1773 }, { 0x17B4, 0x17B5 }, { 0x17B7, 0x17BD }, + { 0x17C6, 0x17C6 }, { 0x17C9, 0x17D3 }, { 0x17DD, 0x17DD }, + { 0x180B, 0x180D }, { 0x18A9, 0x18A9 }, { 0x1920, 0x1922 }, + { 0x1927, 0x1928 }, { 0x1932, 0x1932 }, { 0x1939, 0x193B }, + { 0x1A17, 0x1A18 }, { 0x1B00, 0x1B03 }, { 0x1B34, 0x1B34 }, + { 0x1B36, 0x1B3A }, { 0x1B3C, 0x1B3C }, { 0x1B42, 0x1B42 }, + { 0x1B6B, 0x1B73 }, { 0x1DC0, 0x1DCA }, { 0x1DFE, 0x1DFF }, + { 0x200B, 0x200F }, { 0x202A, 0x202E }, { 0x2060, 0x2063 }, + { 0x206A, 0x206F }, { 0x20D0, 0x20EF }, { 0x302A, 0x302F }, + { 0x3099, 0x309A }, { 0xA806, 0xA806 }, { 0xA80B, 0xA80B }, + { 0xA825, 0xA826 }, { 0xFB1E, 0xFB1E }, { 0xFE00, 0xFE0F }, + { 0xFE20, 0xFE23 }, { 0xFEFF, 0xFEFF }, { 0xFFF9, 0xFFFB }, + { 0x10A01, 0x10A03 }, { 0x10A05, 0x10A06 }, { 0x10A0C, 0x10A0F }, + { 0x10A38, 0x10A3A }, { 0x10A3F, 0x10A3F }, { 0x1D167, 0x1D169 }, + { 0x1D173, 0x1D182 }, { 0x1D185, 0x1D18B }, { 0x1D1AA, 0x1D1AD }, + { 0x1D242, 0x1D244 }, { 0xE0001, 0xE0001 }, { 0xE0020, 0xE007F }, + { 0xE0100, 0xE01EF } + }; + + /* test for 8-bit control characters */ + if (ucs == 0) + return 0; + if (ucs < 32 || (ucs >= 0x7f && ucs < 0xa0)) + return -1; + + /* binary search in table of non-spacing characters */ + if (bisearch(ucs, combining, + sizeof(combining) / sizeof(struct interval) - 1)) + return 0; + + /* if we arrive here, ucs is not a combining or C0/C1 control character */ + + return 1 + + (ucs >= 0x1100 && + (ucs <= 0x115f || /* Hangul Jamo init. consonants */ + ucs == 0x2329 || ucs == 0x232a || + (ucs >= 0x2e80 && ucs <= 0xa4cf && + ucs != 0x303f) || /* CJK ... Yi */ + (ucs >= 0xac00 && ucs <= 0xd7a3) || /* Hangul Syllables */ + (ucs >= 0xf900 && ucs <= 0xfaff) || /* CJK Compatibility Ideographs */ + (ucs >= 0xfe10 && ucs <= 0xfe19) || /* Vertical forms */ + (ucs >= 0xfe30 && ucs <= 0xfe6f) || /* CJK Compatibility Forms */ + (ucs >= 0xff00 && ucs <= 0xff60) || /* Fullwidth Forms */ + (ucs >= 0xffe0 && ucs <= 0xffe6) || + (ucs >= 0x20000 && ucs <= 0x2fffd) || + (ucs >= 0x30000 && ucs <= 0x3fffd))); +} + + +int mk_wcswidth(const wchar_t *pwcs, size_t n) +{ + int w, width = 0; + + for (;*pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth(*pwcs)) < 0) + return -1; + else + width += w; + + return width; +} + + +/* + * The following functions are the same as mk_wcwidth() and + * mk_wcswidth(), except that spacing characters in the East Asian + * Ambiguous (A) category as defined in Unicode Technical Report #11 + * have a column width of 2. This variant might be useful for users of + * CJK legacy encodings who want to migrate to UCS without changing + * the traditional terminal character-width behaviour. It is not + * otherwise recommended for general use. + */ +int mk_wcwidth_cjk(wchar_t ucs) +{ + /* sorted list of non-overlapping intervals of East Asian Ambiguous + * characters, generated by "uniset +WIDTH-A -cat=Me -cat=Mn -cat=Cf c" */ + static const struct interval ambiguous[] = { + { 0x00A1, 0x00A1 }, { 0x00A4, 0x00A4 }, { 0x00A7, 0x00A8 }, + { 0x00AA, 0x00AA }, { 0x00AE, 0x00AE }, { 0x00B0, 0x00B4 }, + { 0x00B6, 0x00BA }, { 0x00BC, 0x00BF }, { 0x00C6, 0x00C6 }, + { 0x00D0, 0x00D0 }, { 0x00D7, 0x00D8 }, { 0x00DE, 0x00E1 }, + { 0x00E6, 0x00E6 }, { 0x00E8, 0x00EA }, { 0x00EC, 0x00ED }, + { 0x00F0, 0x00F0 }, { 0x00F2, 0x00F3 }, { 0x00F7, 0x00FA }, + { 0x00FC, 0x00FC }, { 0x00FE, 0x00FE }, { 0x0101, 0x0101 }, + { 0x0111, 0x0111 }, { 0x0113, 0x0113 }, { 0x011B, 0x011B }, + { 0x0126, 0x0127 }, { 0x012B, 0x012B }, { 0x0131, 0x0133 }, + { 0x0138, 0x0138 }, { 0x013F, 0x0142 }, { 0x0144, 0x0144 }, + { 0x0148, 0x014B }, { 0x014D, 0x014D }, { 0x0152, 0x0153 }, + { 0x0166, 0x0167 }, { 0x016B, 0x016B }, { 0x01CE, 0x01CE }, + { 0x01D0, 0x01D0 }, { 0x01D2, 0x01D2 }, { 0x01D4, 0x01D4 }, + { 0x01D6, 0x01D6 }, { 0x01D8, 0x01D8 }, { 0x01DA, 0x01DA }, + { 0x01DC, 0x01DC }, { 0x0251, 0x0251 }, { 0x0261, 0x0261 }, + { 0x02C4, 0x02C4 }, { 0x02C7, 0x02C7 }, { 0x02C9, 0x02CB }, + { 0x02CD, 0x02CD }, { 0x02D0, 0x02D0 }, { 0x02D8, 0x02DB }, + { 0x02DD, 0x02DD }, { 0x02DF, 0x02DF }, { 0x0391, 0x03A1 }, + { 0x03A3, 0x03A9 }, { 0x03B1, 0x03C1 }, { 0x03C3, 0x03C9 }, + { 0x0401, 0x0401 }, { 0x0410, 0x044F }, { 0x0451, 0x0451 }, + { 0x2010, 0x2010 }, { 0x2013, 0x2016 }, { 0x2018, 0x2019 }, + { 0x201C, 0x201D }, { 0x2020, 0x2022 }, { 0x2024, 0x2027 }, + { 0x2030, 0x2030 }, { 0x2032, 0x2033 }, { 0x2035, 0x2035 }, + { 0x203B, 0x203B }, { 0x203E, 0x203E }, { 0x2074, 0x2074 }, + { 0x207F, 0x207F }, { 0x2081, 0x2084 }, { 0x20AC, 0x20AC }, + { 0x2103, 0x2103 }, { 0x2105, 0x2105 }, { 0x2109, 0x2109 }, + { 0x2113, 0x2113 }, { 0x2116, 0x2116 }, { 0x2121, 0x2122 }, + { 0x2126, 0x2126 }, { 0x212B, 0x212B }, { 0x2153, 0x2154 }, + { 0x215B, 0x215E }, { 0x2160, 0x216B }, { 0x2170, 0x2179 }, + { 0x2190, 0x2199 }, { 0x21B8, 0x21B9 }, { 0x21D2, 0x21D2 }, + { 0x21D4, 0x21D4 }, { 0x21E7, 0x21E7 }, { 0x2200, 0x2200 }, + { 0x2202, 0x2203 }, { 0x2207, 0x2208 }, { 0x220B, 0x220B }, + { 0x220F, 0x220F }, { 0x2211, 0x2211 }, { 0x2215, 0x2215 }, + { 0x221A, 0x221A }, { 0x221D, 0x2220 }, { 0x2223, 0x2223 }, + { 0x2225, 0x2225 }, { 0x2227, 0x222C }, { 0x222E, 0x222E }, + { 0x2234, 0x2237 }, { 0x223C, 0x223D }, { 0x2248, 0x2248 }, + { 0x224C, 0x224C }, { 0x2252, 0x2252 }, { 0x2260, 0x2261 }, + { 0x2264, 0x2267 }, { 0x226A, 0x226B }, { 0x226E, 0x226F }, + { 0x2282, 0x2283 }, { 0x2286, 0x2287 }, { 0x2295, 0x2295 }, + { 0x2299, 0x2299 }, { 0x22A5, 0x22A5 }, { 0x22BF, 0x22BF }, + { 0x2312, 0x2312 }, { 0x2460, 0x24E9 }, { 0x24EB, 0x254B }, + { 0x2550, 0x2573 }, { 0x2580, 0x258F }, { 0x2592, 0x2595 }, + { 0x25A0, 0x25A1 }, { 0x25A3, 0x25A9 }, { 0x25B2, 0x25B3 }, + { 0x25B6, 0x25B7 }, { 0x25BC, 0x25BD }, { 0x25C0, 0x25C1 }, + { 0x25C6, 0x25C8 }, { 0x25CB, 0x25CB }, { 0x25CE, 0x25D1 }, + { 0x25E2, 0x25E5 }, { 0x25EF, 0x25EF }, { 0x2605, 0x2606 }, + { 0x2609, 0x2609 }, { 0x260E, 0x260F }, { 0x2614, 0x2615 }, + { 0x261C, 0x261C }, { 0x261E, 0x261E }, { 0x2640, 0x2640 }, + { 0x2642, 0x2642 }, { 0x2660, 0x2661 }, { 0x2663, 0x2665 }, + { 0x2667, 0x266A }, { 0x266C, 0x266D }, { 0x266F, 0x266F }, + { 0x273D, 0x273D }, { 0x2776, 0x277F }, { 0xE000, 0xF8FF }, + { 0xFFFD, 0xFFFD }, { 0xF0000, 0xFFFFD }, { 0x100000, 0x10FFFD } + }; + + /* binary search in table of non-spacing characters */ + if (bisearch(ucs, ambiguous, + sizeof(ambiguous) / sizeof(struct interval) - 1)) + return 2; + + return mk_wcwidth(ucs); +} + + +int mk_wcswidth_cjk(const wchar_t *pwcs, size_t n) +{ + int w, width = 0; + + for (;*pwcs && n-- > 0; pwcs++) + if ((w = mk_wcwidth_cjk(*pwcs)) < 0) + return -1; + else + width += w; + + return width; +} diff --git a/contrib/ncurses/ncurses/widechar/lib_add_wch.c b/contrib/ncurses/ncurses/widechar/lib_add_wch.c index 93b41bb4930c..38d3130a54c4 100644 --- a/contrib/ncurses/ncurses/widechar/lib_add_wch.c +++ b/contrib/ncurses/ncurses/widechar/lib_add_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2004-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,39 +35,387 @@ #include -MODULE_ID("$Id: lib_add_wch.c,v 1.6 2006/12/02 21:19:17 tom Exp $") +#if HAVE_WCTYPE_H +#include +#endif + +MODULE_ID("$Id: lib_add_wch.c,v 1.12 2011/03/22 09:31:15 Petr.Pavlu Exp $") + +/* clone/adapt lib_addch.c */ +static const cchar_t blankchar = NewChar(BLANK_TEXT); + +/* + * Ugly microtweaking alert. Everything from here to end of module is + * likely to be speed-critical -- profiling data sure says it is! + * Most of the important screen-painting functions are shells around + * wadd_wch(). So we make every effort to reduce function-call overhead + * by inlining stuff, even at the cost of making wrapped copies for + * export. Also we supply some internal versions that don't call the + * window sync hook, for use by string-put functions. + */ + +/* Return bit mask for clearing color pair number if given ch has color */ +#define COLOR_MASK(ch) (~(attr_t)((ch) & A_COLOR ? A_COLOR : 0)) + +static NCURSES_INLINE cchar_t +render_char(WINDOW *win, cchar_t ch) +/* compute a rendition of the given char correct for the current context */ +{ + attr_t a = WINDOW_ATTRS(win); + int pair = GetPair(ch); + + if (ISBLANK(ch) + && AttrOf(ch) == A_NORMAL + && pair == 0) { + /* color/pair in attrs has precedence over bkgrnd */ + ch = win->_nc_bkgd; + SetAttr(ch, a | AttrOf(win->_nc_bkgd)); + if ((pair = GET_WINDOW_PAIR(win)) == 0) + pair = GetPair(win->_nc_bkgd); + SetPair(ch, pair); + } else { + /* color in attrs has precedence over bkgrnd */ + a |= AttrOf(win->_nc_bkgd) & COLOR_MASK(a); + /* color in ch has precedence */ + if (pair == 0) { + if ((pair = GET_WINDOW_PAIR(win)) == 0) + pair = GetPair(win->_nc_bkgd); + } + AddAttr(ch, (a & COLOR_MASK(AttrOf(ch)))); + SetPair(ch, pair); + } + + TR(TRACE_VIRTPUT, + ("render_char bkg %s (%d), attrs %s (%d) -> ch %s (%d)", + _tracech_t2(1, CHREF(win->_nc_bkgd)), + GetPair(win->_nc_bkgd), + _traceattr(WINDOW_ATTRS(win)), + GET_WINDOW_PAIR(win), + _tracech_t2(3, CHREF(ch)), + GetPair(ch))); + + return (ch); +} + +/* check if position is legal; if not, return error */ +#ifndef NDEBUG /* treat this like an assertion */ +#define CHECK_POSITION(win, x, y) \ + if (y > win->_maxy \ + || x > win->_maxx \ + || y < 0 \ + || x < 0) { \ + TR(TRACE_VIRTPUT, ("Alert! Win=%p _curx = %d, _cury = %d " \ + "(_maxx = %d, _maxy = %d)", win, x, y, \ + win->_maxx, win->_maxy)); \ + return(ERR); \ + } +#else +#define CHECK_POSITION(win, x, y) /* nothing */ +#endif + +static bool +newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T * ypos) +{ + bool result = FALSE; + + if (*ypos >= win->_regtop && *ypos == win->_regbottom) { + *ypos = win->_regbottom; + result = TRUE; + } else { + *ypos = (NCURSES_SIZE_T) (*ypos + 1); + } + return result; +} + +/* + * The _WRAPPED flag is useful only for telling an application that we've just + * wrapped the cursor. We don't do anything with this flag except set it when + * wrapping, and clear it whenever we move the cursor. If we try to wrap at + * the lower-right corner of a window, we cannot move the cursor (since that + * wouldn't be legal). So we return an error (which is what SVr4 does). + * Unlike SVr4, we can successfully add a character to the lower-right corner + * (Solaris 2.6 does this also, however). + */ +static int +wrap_to_next_line(WINDOW *win) +{ + win->_flags |= _WRAPPED; + if (newline_forces_scroll(win, &(win->_cury))) { + win->_curx = win->_maxx; + if (!win->_scroll) + return (ERR); + scroll(win); + } + win->_curx = 0; + return (OK); +} + +static int wadd_wch_literal(WINDOW *, cchar_t); +/* + * Fill the given number of cells with blanks using the current background + * rendition. This saves/restores the current x-position. + */ +static void +fill_cells(WINDOW *win, int count) +{ + cchar_t blank = blankchar; + int save_x = win->_curx; + int save_y = win->_cury; + + while (count-- > 0) { + if (wadd_wch_literal(win, blank) == ERR) + break; + } + win->_curx = (NCURSES_SIZE_T) save_x; + win->_cury = (NCURSES_SIZE_T) save_y; +} + +static int +wadd_wch_literal(WINDOW *win, cchar_t ch) +{ + int x; + int y; + struct ldat *line; + + x = win->_curx; + y = win->_cury; + + CHECK_POSITION(win, x, y); + + ch = render_char(win, ch); + + line = win->_line + y; + + CHANGED_CELL(line, x); + + /* + * Non-spacing characters are added to the current cell. + * + * Spacing characters that are wider than one column require some display + * adjustments. + */ + { + int len = wcwidth(CharOf(ch)); + int i; + int j; + wchar_t *chars; + + if (len == 0) { /* non-spacing */ + if ((x > 0 && y >= 0) + || (win->_maxx >= 0 && win->_cury >= 1)) { + if (x > 0 && y >= 0) + chars = (win->_line[y].text[x - 1].chars); + else + chars = (win->_line[y - 1].text[win->_maxx].chars); + for (i = 0; i < CCHARW_MAX; ++i) { + if (chars[i] == 0) { + TR(TRACE_VIRTPUT, + ("added non-spacing %d: %x", + x, (int) CharOf(ch))); + chars[i] = CharOf(ch); + break; + } + } + } + goto testwrapping; + } else if (len > 1) { /* multi-column characters */ + /* + * Check if the character will fit on the current line. If it does + * not fit, fill in the remainder of the line with blanks. and + * move to the next line. + */ + if (len > win->_maxx + 1) { + TR(TRACE_VIRTPUT, ("character will not fit")); + return ERR; + } else if (x + len > win->_maxx + 1) { + int count = win->_maxx + 1 - x; + TR(TRACE_VIRTPUT, ("fill %d remaining cells", count)); + fill_cells(win, count); + if (wrap_to_next_line(win) == ERR) + return ERR; + x = win->_curx; + y = win->_cury; + line = win->_line + y; + } + /* + * Check for cells which are orphaned by adding this character, set + * those to blanks. + * + * FIXME: this actually could fill j-i cells, more complicated to + * setup though. + */ + for (i = 0; i < len; ++i) { + if (isWidecBase(win->_line[y].text[x + i])) { + break; + } else if (isWidecExt(win->_line[y].text[x + i])) { + for (j = i; x + j <= win->_maxx; ++j) { + if (!isWidecExt(win->_line[y].text[x + j])) { + TR(TRACE_VIRTPUT, ("fill %d orphan cells", j)); + fill_cells(win, j); + break; + } + } + break; + } + } + /* + * Finally, add the cells for this character. + */ + for (i = 0; i < len; ++i) { + cchar_t value = ch; + SetWidecExt(value, i); + TR(TRACE_VIRTPUT, ("multicolumn %d:%d (%d,%d)", + i + 1, len, + win->_begy + y, win->_begx + x)); + line->text[x] = value; + CHANGED_CELL(line, x); + ++x; + } + goto testwrapping; + } + } + + /* + * Single-column characters. + */ + line->text[x++] = ch; + /* + * This label is used only for wide-characters. + */ + testwrapping: + + TR(TRACE_VIRTPUT, ("cell (%ld, %ld..%d) = %s", + (long) win->_cury, (long) win->_curx, x - 1, + _tracech_t(CHREF(ch)))); + + if (x > win->_maxx) { + return wrap_to_next_line(win); + } + win->_curx = (NCURSES_SIZE_T) x; + return OK; +} + +static NCURSES_INLINE int +wadd_wch_nosync(WINDOW *win, cchar_t ch) +/* the workhorse function -- add a character to the given window */ +{ + NCURSES_SIZE_T x, y; + wchar_t *s; + int tabsize = 8; +#if USE_REENTRANT + SCREEN *sp = _nc_screen_of(win); +#endif + + /* + * If we are using the alternate character set, forget about locale. + * Otherwise, if the locale claims the code is printable, treat it that + * way. + */ + if ((AttrOf(ch) & A_ALTCHARSET) + || iswprint((wint_t) CharOf(ch))) + return wadd_wch_literal(win, ch); + + /* + * Handle carriage control and other codes that are not printable, or are + * known to expand to more than one character according to unctrl(). + */ + x = win->_curx; + y = win->_cury; + + switch (CharOf(ch)) { + case '\t': +#if USE_REENTRANT + tabsize = *ptrTabsize(sp); +#else + tabsize = TABSIZE; +#endif + x = (NCURSES_SIZE_T) (x + (tabsize - (x % tabsize))); + /* + * Space-fill the tab on the bottom line so that we'll get the + * "correct" cursor position. + */ + if ((!win->_scroll && (y == win->_regbottom)) + || (x <= win->_maxx)) { + cchar_t blank = blankchar; + AddAttr(blank, AttrOf(ch)); + while (win->_curx < x) { + if (wadd_wch_literal(win, blank) == ERR) + return (ERR); + } + break; + } else { + wclrtoeol(win); + win->_flags |= _WRAPPED; + if (newline_forces_scroll(win, &y)) { + x = win->_maxx; + if (win->_scroll) { + scroll(win); + x = 0; + } + } else { + x = 0; + } + } + break; + case '\n': + wclrtoeol(win); + if (newline_forces_scroll(win, &y)) { + if (win->_scroll) + scroll(win); + else + return (ERR); + } + /* FALLTHRU */ + case '\r': + x = 0; + win->_flags &= ~_WRAPPED; + break; + case '\b': + if (x == 0) + return (OK); + x--; + win->_flags &= ~_WRAPPED; + break; + default: + if ((s = wunctrl(&ch)) != 0) { + while (*s) { + cchar_t sch; + SetChar(sch, *s++, AttrOf(ch)); + if_EXT_COLORS(SetPair(sch, GetPair(ch))); + if (wadd_wch_literal(win, sch) == ERR) + return ERR; + } + return OK; + } + return ERR; + } + + win->_curx = x; + win->_cury = y; + + return OK; +} + +/* + * The versions below call _nc_synchook(). We wanted to avoid this in the + * version exported for string puts; they'll call _nc_synchook once at end + * of run. + */ + +/* These are actual entry points */ NCURSES_EXPORT(int) wadd_wch(WINDOW *win, const cchar_t *wch) { - PUTC_DATA; - int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), win, - _tracech_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wadd_wch(%p, %s)"), + (void *) win, + _tracecchar_t(wch))); - if (win != 0) { - PUTC_INIT; - for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { - attr_t attrs = (wch->attr & A_ATTRIBUTES); - - if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') - break; - if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { - code = ERR; - if (is8bits(PUTC_ch)) - code = waddch(win, UChar(PUTC_ch) | attrs); - break; - } - for (n = 0; n < PUTC_n; n++) { - if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { - break; - } - } - if (code == ERR) - break; - } + if (win && (wadd_wch_nosync(win, *wch) != ERR)) { + _nc_synchook(win); + code = OK; } TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); @@ -77,37 +425,19 @@ wadd_wch(WINDOW *win, const cchar_t *wch) NCURSES_EXPORT(int) wecho_wchar(WINDOW *win, const cchar_t *wch) { - PUTC_DATA; - int n; int code = ERR; - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wecho_wchar(%p, %s)"), win, - _tracech_t(wch))); + TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_CALLED("wechochar(%p, %s)"), + (void *) win, + _tracecchar_t(wch))); - if (win != 0) { - PUTC_INIT; - for (PUTC_i = 0; PUTC_i < CCHARW_MAX; ++PUTC_i) { - attr_t attrs = (wch->attr & A_ATTRIBUTES); - - if ((PUTC_ch = wch->chars[PUTC_i]) == L'\0') - break; - if ((PUTC_n = wcrtomb(PUTC_buf, PUTC_ch, &PUT_st)) <= 0) { - code = ERR; - if (is8bits(PUTC_ch)) - code = waddch(win, UChar(PUTC_ch) | attrs); - break; - } - for (n = 0; n < PUTC_n; n++) { - if ((code = waddch(win, UChar(PUTC_buf[n]) | attrs)) == ERR) { - break; - } - } - if (code == ERR) - break; - } - wrefresh(win); + if (win && (wadd_wch_nosync(win, *wch) != ERR)) { + bool save_immed = win->_immed; + win->_immed = TRUE; + _nc_synchook(win); + win->_immed = save_immed; + code = OK; } - TR(TRACE_VIRTPUT | TRACE_CCALLS, (T_RETURN("%d"), code)); return (code); } diff --git a/contrib/ncurses/ncurses/widechar/lib_box_set.c b/contrib/ncurses/ncurses/widechar/lib_box_set.c index 35fce46d8d40..585c94963b0f 100644 --- a/contrib/ncurses/ncurses/widechar/lib_box_set.c +++ b/contrib/ncurses/ncurses/widechar/lib_box_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2003,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_box_set.c,v 1.4 2003/12/06 18:02:13 tom Exp $") +MODULE_ID("$Id: lib_box_set.c,v 1.5 2009/10/24 22:36:56 tom Exp $") NCURSES_EXPORT(int) wborder_set(WINDOW *win, @@ -53,7 +53,7 @@ wborder_set(WINDOW *win, NCURSES_CH_T wls, wrs, wts, wbs, wtl, wtr, wbl, wbr; T((T_CALLED("wborder(%p,%s,%s,%s,%s,%s,%s,%s,%s)"), - win, + (void *) win, _tracech_t2(1, ls), _tracech_t2(2, rs), _tracech_t2(3, ts), diff --git a/contrib/ncurses/ncurses/widechar/lib_cchar.c b/contrib/ncurses/ncurses/widechar/lib_cchar.c index b4a0c37a285f..c61c79529db7 100644 --- a/contrib/ncurses/ncurses/widechar/lib_cchar.c +++ b/contrib/ncurses/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.12 2007/05/12 19:03:06 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.20 2010/12/25 23:46:26 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -50,15 +50,15 @@ setcchar(cchar_t *wcval, short color_pair, const void *opts) { - int i; - int len; + unsigned i; + unsigned len; int code = OK; TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"), - wcval, _nc_viswbuf(wch), + (void *) wcval, _nc_viswbuf(wch), (unsigned long) attrs, color_pair, opts)); - len = wcslen(wch); + len = (unsigned) wcslen(wch); if (opts != NULL || (len > 1 && wcwidth(wch[0]) < 0)) { code = ERR; @@ -80,7 +80,7 @@ setcchar(cchar_t *wcval, memset(wcval, 0, sizeof(*wcval)); if (len != 0) { - SetAttr(*wcval, attrs | COLOR_PAIR(color_pair)); + SetAttr(*wcval, attrs | (attr_t) ColorPair(color_pair)); SetPair(CHDEREF(wcval), color_pair); memcpy(&wcval->chars, wch, len * sizeof(wchar_t)); TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len, @@ -104,20 +104,28 @@ getcchar(const cchar_t *wcval, int code = ERR; TR(TRACE_CCALLS, (T_CALLED("getcchar(%p,%p,%p,%p,%p)"), - wcval, wch, attrs, color_pair, opts)); + (const void *) wcval, + (void *) wch, + (void *) attrs, + (void *) color_pair, + opts)); if (opts == NULL) { - len = (wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) - ? wp - wcval->chars - : CCHARW_MAX; + len = ((wp = wmemchr(wcval->chars, L'\0', CCHARW_MAX)) + ? (int) (wp - wcval->chars) + : CCHARW_MAX); if (wch == NULL) { - code = len; + /* + * If the value is a null, set the length to 1. + * If the value is not a null, return the length plus 1 for null. + */ + code = (len < CCHARW_MAX) ? (len + 1) : CCHARW_MAX; } else if (attrs == 0 || color_pair == 0) { code = ERR; } else if (len >= 0) { *attrs = AttrOf(*wcval) & A_ATTRIBUTES; - *color_pair = GetPair(*wcval); + *color_pair = (short) GetPair(*wcval); wmemcpy(wch, wcval->chars, (unsigned) len); wch[len] = L'\0'; code = OK; diff --git a/contrib/ncurses/ncurses/widechar/lib_erasewchar.c b/contrib/ncurses/ncurses/widechar/lib_erasewchar.c index 7d6455370ff9..a4ee93ffa428 100644 --- a/contrib/ncurses/ncurses/widechar/lib_erasewchar.c +++ b/contrib/ncurses/ncurses/widechar/lib_erasewchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,7 +32,7 @@ #include -MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") +MODULE_ID("$Id: lib_erasewchar.c,v 1.2 2010/07/24 11:35:12 tom Exp $") /* * erasewchar() @@ -42,7 +42,7 @@ MODULE_ID("$Id: lib_erasewchar.c,v 1.1 2002/05/11 20:38:06 tom Exp $") */ NCURSES_EXPORT(int) -erasewchar(wchar_t * wch) +erasewchar(wchar_t *wch) { int value; int result = ERR; @@ -63,7 +63,7 @@ erasewchar(wchar_t * wch) */ NCURSES_EXPORT(int) -killwchar(wchar_t * wch) +killwchar(wchar_t *wch) { int value; int result = ERR; diff --git a/contrib/ncurses/ncurses/widechar/lib_get_wch.c b/contrib/ncurses/ncurses/widechar/lib_get_wch.c index 6cf3129f2d18..32033df2ff9b 100644 --- a/contrib/ncurses/ncurses/widechar/lib_get_wch.c +++ b/contrib/ncurses/ncurses/widechar/lib_get_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -40,22 +40,7 @@ #include #include -MODULE_ID("$Id: lib_get_wch.c,v 1.17 2008/08/16 19:22:55 tom Exp $") - -#if HAVE_MBTOWC && HAVE_MBLEN -#define reset_mbytes(state) mblen(NULL, 0), mbtowc(NULL, NULL, 0) -#define count_mbytes(buffer,length,state) mblen(buffer,length) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbtowc(&wch, buffer, length) -#define state_unused -#elif HAVE_MBRTOWC && HAVE_MBRLEN -#define reset_mbytes(state) init_mb(state) -#define count_mbytes(buffer,length,state) mbrlen(buffer,length,&state) -#define check_mbytes(wch,buffer,length,state) \ - (int) mbrtowc(&wch, buffer, length, &state) -#else -make an error -#endif +MODULE_ID("$Id: lib_get_wch.c,v 1.22 2010/08/28 21:00:35 tom Exp $") NCURSES_EXPORT(int) wget_wch(WINDOW *win, wint_t *result) @@ -65,13 +50,13 @@ wget_wch(WINDOW *win, wint_t *result) char buffer[(MB_LEN_MAX * 9) + 1]; /* allow some redundant shifts */ int status; size_t count = 0; - unsigned long value; + int value = 0; wchar_t wch; #ifndef state_unused mbstate_t state; #endif - T((T_CALLED("wget_wch(%p)"), win)); + T((T_CALLED("wget_wch(%p)"), (void *) win)); /* * We can get a stream of single-byte characters and KEY_xxx codes from @@ -95,12 +80,12 @@ wget_wch(WINDOW *win, wint_t *result) * whether the improvement would be worth the effort. */ if (count != 0) { - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); code = ERR; } break; } else if (count + 1 >= sizeof(buffer)) { - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); code = ERR; break; } else { @@ -111,7 +96,7 @@ wget_wch(WINDOW *win, wint_t *result) reset_mbytes(state); if (check_mbytes(wch, buffer, count, state) != status) { code = ERR; /* the two calls should match */ - _nc_ungetch(sp, (int) value); + safe_ungetch(SP_PARM, value); } value = wch; break; @@ -121,8 +106,8 @@ wget_wch(WINDOW *win, wint_t *result) } else { code = ERR; } - *result = value; + *result = (wint_t) value; _nc_unlock_global(curses); - T(("result %#lo", value)); + T(("result %#o", value)); returnCode(code); } diff --git a/contrib/ncurses/ncurses/widechar/lib_get_wstr.c b/contrib/ncurses/ncurses/widechar/lib_get_wstr.c index baa70a5a53f9..0b450211b2c3 100644 --- a/contrib/ncurses/ncurses/widechar/lib_get_wstr.c +++ b/contrib/ncurses/ncurses/widechar/lib_get_wstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,9 +38,8 @@ */ #include -#include -MODULE_ID("$Id: lib_get_wstr.c,v 1.10 2008/08/16 19:25:33 tom Exp $") +MODULE_ID("$Id: lib_get_wstr.c,v 1.12 2009/10/24 22:38:11 tom Exp $") static int wadd_wint(WINDOW *win, wint_t *src) @@ -96,7 +95,7 @@ wgetn_wstr(WINDOW *win, wint_t *str, int maxlen) wint_t ch; int y, x, code; - T((T_CALLED("wgetn_wstr(%p,%p, %d)"), win, str, maxlen)); + T((T_CALLED("wgetn_wstr(%p,%p, %d)"), (void *) win, (void *) str, maxlen)); if (!win) returnCode(ERR); diff --git a/contrib/ncurses/ncurses/widechar/lib_hline_set.c b/contrib/ncurses/ncurses/widechar/lib_hline_set.c index 43175de83464..da92b834f1c3 100644 --- a/contrib/ncurses/ncurses/widechar/lib_hline_set.c +++ b/contrib/ncurses/ncurses/widechar/lib_hline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_hline_set.c,v 1.2 2002/03/23 21:35:34 tom Exp $") +MODULE_ID("$Id: lib_hline_set.c,v 1.4 2010/12/19 01:45:03 tom Exp $") NCURSES_EXPORT(int) -whline_set(WINDOW *win, const cchar_t * ch, int n) +whline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T start; - NCURSES_SIZE_T end; + int start; + int end; - T((T_CALLED("whline_set(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("whline_set(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { struct ldat *line = &(win->_line[win->_cury]); diff --git a/contrib/ncurses/ncurses/widechar/lib_in_wch.c b/contrib/ncurses/ncurses/widechar/lib_in_wch.c index 5cd92e382de4..b2396508ba25 100644 --- a/contrib/ncurses/ncurses/widechar/lib_in_wch.c +++ b/contrib/ncurses/ncurses/widechar/lib_in_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2006,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_in_wch.c,v 1.4 2006/09/03 15:41:22 tom Exp $") +MODULE_ID("$Id: lib_in_wch.c,v 1.5 2009/10/24 22:37:55 tom Exp $") NCURSES_EXPORT(int) win_wch(WINDOW *win, cchar_t *wcval) @@ -47,7 +47,7 @@ win_wch(WINDOW *win, cchar_t *wcval) int row, col; int code = OK; - TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), win, wcval)); + TR(TRACE_CCALLS, (T_CALLED("win_wch(%p,%p)"), (void *) win, (void *) wcval)); if (win != 0 && wcval != 0) { getyx(win, row, col); diff --git a/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c b/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c index e9f0646ea66a..57cc2ca6e73f 100644 --- a/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c +++ b/contrib/ncurses/ncurses/widechar/lib_in_wchnstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2004-2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2007,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,14 +39,14 @@ #include -MODULE_ID("$Id: lib_in_wchnstr.c,v 1.7 2007/02/11 01:00:00 tom Exp $") +MODULE_ID("$Id: lib_in_wchnstr.c,v 1.8 2009/10/24 22:37:48 tom Exp $") NCURSES_EXPORT(int) win_wchnstr(WINDOW *win, cchar_t *wchstr, int n) { int code = OK; - T((T_CALLED("win_wchnstr(%p,%p,%d)"), win, wchstr, n)); + T((T_CALLED("win_wchnstr(%p,%p,%d)"), (void *) win, (void *) wchstr, n)); if (win != 0 && wchstr != 0) { NCURSES_CH_T *src; diff --git a/contrib/ncurses/ncurses/widechar/lib_ins_wch.c b/contrib/ncurses/ncurses/widechar/lib_ins_wch.c index c3d0420e53b8..1eee8a3ec016 100644 --- a/contrib/ncurses/ncurses/widechar/lib_ins_wch.c +++ b/contrib/ncurses/ncurses/widechar/lib_ins_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2003,2005 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,39 +39,44 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.8 2005/12/03 20:24:19 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.16 2010/12/19 01:34:04 tom Exp $") /* * Insert the given character, updating the current location to simplify * inserting a string. */ -static int +NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *win, const cchar_t *wch) { int cells = wcwidth(CharOf(CHDEREF(wch))); int cell; + int code = OK; - if (cells <= 0) - cells = 1; + if (cells < 0) { + code = winsch(win, (chtype) CharOf(CHDEREF(wch))); + } else { + if (cells == 0) + cells = 1; - if (win->_curx <= win->_maxx) { - struct ldat *line = &(win->_line[win->_cury]); - NCURSES_CH_T *end = &(line->text[win->_curx]); - NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); - NCURSES_CH_T *temp2 = temp1 - cells; + if (win->_curx <= win->_maxx) { + struct ldat *line = &(win->_line[win->_cury]); + NCURSES_CH_T *end = &(line->text[win->_curx]); + NCURSES_CH_T *temp1 = &(line->text[win->_maxx]); + NCURSES_CH_T *temp2 = temp1 - cells; - CHANGED_TO_EOL(line, win->_curx, win->_maxx); - while (temp1 > end) - *temp1-- = *temp2--; + CHANGED_TO_EOL(line, win->_curx, win->_maxx); + while (temp1 > end) + *temp1-- = *temp2--; - *temp1 = _nc_render(win, *wch); - for (cell = 1; cell < cells; ++cell) { - SetWidecExt(temp1[cell], cell); + *temp1 = _nc_render(win, *wch); + for (cell = 1; cell < cells; ++cell) { + SetWidecExt(temp1[cell], cell); + } + + win->_curx++; } - - win->_curx++; } - return OK; + return code; } NCURSES_EXPORT(int) @@ -81,7 +86,7 @@ wins_wch(WINDOW *win, const cchar_t *wch) NCURSES_SIZE_T ox; int code = ERR; - T((T_CALLED("wins_wch(%p, %s)"), win, _tracecchar_t(wch))); + T((T_CALLED("wins_wch(%p, %s)"), (void *) win, _tracecchar_t(wch))); if (win != 0) { oy = win->_cury; @@ -104,20 +109,23 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T ox; const wchar_t *cp; - T((T_CALLED("wins_nwstr(%p,%s,%d)"), win, _nc_viswbufn(wstr, n), n)); + T((T_CALLED("wins_nwstr(%p,%s,%d)"), + (void *) win, _nc_viswbufn(wstr, n), n)); if (win != 0 && wstr != 0) { if (n < 1) - n = wcslen(wstr); + n = (int) wcslen(wstr); code = OK; if (n > 0) { + SCREEN *sp = _nc_screen_of(win); + oy = win->_cury; ox = win->_curx; for (cp = wstr; *cp && ((cp - wstr) < n); cp++) { int len = wcwidth(*cp); - if (len != 1 || !is8bits(*cp)) { + if ((len >= 0 && len != 1) || !is7bits(*cp)) { cchar_t tmp_cchar; wchar_t tmp_wchar = *cp; memset(&tmp_cchar, 0, sizeof(tmp_cchar)); @@ -129,7 +137,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) code = _nc_insert_wch(win, &tmp_cchar); } else { /* tabs, other ASCII stuff */ - code = _nc_insert_ch(win, (chtype) (*cp)); + code = _nc_insert_ch(sp, win, (chtype) (*cp)); } if (code != OK) break; diff --git a/contrib/ncurses/ncurses/widechar/lib_inwstr.c b/contrib/ncurses/ncurses/widechar/lib_inwstr.c index 2207a5f5d19f..4cf7182ae061 100644 --- a/contrib/ncurses/ncurses/widechar/lib_inwstr.c +++ b/contrib/ncurses/ncurses/widechar/lib_inwstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2004 Free Software Foundation, Inc. * + * Copyright (c) 2002-2004,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_inwstr.c,v 1.4 2004/10/23 20:41:28 tom Exp $") +MODULE_ID("$Id: lib_inwstr.c,v 1.5 2009/10/24 22:37:29 tom Exp $") NCURSES_EXPORT(int) winnwstr(WINDOW *win, wchar_t *wstr, int n) @@ -50,7 +50,7 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n) cchar_t *text; wchar_t wch; - T((T_CALLED("winnwstr(%p,%p,%d)"), win, wstr, n)); + T((T_CALLED("winnwstr(%p,%p,%d)"), (void *) win, (void *) wstr, n)); if (wstr != 0) { if (win) { getyx(win, row, col); @@ -93,7 +93,7 @@ NCURSES_EXPORT(int) winwstr(WINDOW *win, wchar_t *wstr) { int result = OK; - T((T_CALLED("winwstr(%p,%p)"), win, wstr)); + T((T_CALLED("winwstr(%p,%p)"), (void *) win, (void *) wstr)); if (winnwstr(win, wstr, CCHARW_MAX * (win->_maxx - win->_curx + 1)) == ERR) result = ERR; returnCode(result); diff --git a/contrib/ncurses/ncurses/widechar/lib_pecho_wchar.c b/contrib/ncurses/ncurses/widechar/lib_pecho_wchar.c index e61277574311..b6da7a865698 100644 --- a/contrib/ncurses/ncurses/widechar/lib_pecho_wchar.c +++ b/contrib/ncurses/ncurses/widechar/lib_pecho_wchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2004 Free Software Foundation, Inc. * + * Copyright (c) 2004,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,12 +32,12 @@ #include -MODULE_ID("$Id: lib_pecho_wchar.c,v 1.1 2004/01/03 21:42:01 tom Exp $") +MODULE_ID("$Id: lib_pecho_wchar.c,v 1.2 2009/10/24 22:43:32 tom Exp $") NCURSES_EXPORT(int) -pecho_wchar(WINDOW *pad, const cchar_t * wch) +pecho_wchar(WINDOW *pad, const cchar_t *wch) { - T((T_CALLED("pecho_wchar(%p, %s)"), pad, _tracech_t(wch))); + T((T_CALLED("pecho_wchar(%p, %s)"), (void *) pad, _tracech_t(wch))); if (pad == 0) returnCode(ERR); diff --git a/contrib/ncurses/ncurses/widechar/lib_unget_wch.c b/contrib/ncurses/ncurses/widechar/lib_unget_wch.c index bb2c4a084b15..7a626a9eee84 100644 --- a/contrib/ncurses/ncurses/widechar/lib_unget_wch.c +++ b/contrib/ncurses/ncurses/widechar/lib_unget_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.10 2008/06/07 14:50:37 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.14 2010/07/24 11:35:21 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -55,24 +55,24 @@ _nc_wcrtomb(char *target, wchar_t source, mbstate_t * state) const wchar_t *tempp = temp; temp[0] = source; temp[1] = 0; - result = wcsrtombs(NULL, &tempp, 0, state); + result = (int) wcsrtombs(NULL, &tempp, 0, state); } else { - result = wcrtomb(target, source, state); + result = (int) wcrtomb(target, source, state); } if (!isEILSEQ(result) && (result == 0)) result = 1; - return result; + return (size_t) result; } NCURSES_EXPORT(int) -unget_wch(const wchar_t wch) +NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) { int result = OK; mbstate_t state; size_t length; int n; - T((T_CALLED("unget_wch(%#lx)"), (unsigned long) wch)); + T((T_CALLED("unget_wch(%p, %#lx)"), (void *) SP_PARM, (unsigned long) wch)); init_mb(state); length = _nc_wcrtomb(0, wch, &state); @@ -83,10 +83,12 @@ unget_wch(const wchar_t wch) if ((string = (char *) malloc(length)) != 0) { init_mb(state); - wcrtomb(string, wch, &state); + /* ignore the result, since we already validated the character */ + IGNORE_RC((int) wcrtomb(string, wch, &state)); for (n = (int) (length - 1); n >= 0; --n) { - if (_nc_ungetch(SP, string[n]) != OK) { + if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx + UChar(string[n])) !=OK) { result = ERR; break; } @@ -101,3 +103,11 @@ unget_wch(const wchar_t wch) returnCode(result); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +unget_wch(const wchar_t wch) +{ + return NCURSES_SP_NAME(unget_wch) (CURRENT_SCREEN, wch); +} +#endif diff --git a/contrib/ncurses/ncurses/widechar/lib_vid_attr.c b/contrib/ncurses/ncurses/widechar/lib_vid_attr.c index 1dc679e6d907..e4cf093a1f6b 100644 --- a/contrib/ncurses/ncurses/widechar/lib_vid_attr.c +++ b/contrib/ncurses/ncurses/widechar/lib_vid_attr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,11 +31,14 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") +#ifndef CUR +#define CUR SP_TERMTYPE +#endif -#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc) +MODULE_ID("$Id: lib_vid_attr.c,v 1.14 2010/12/19 01:44:24 tom Exp $") + +#define doPut(mode) TPUTS_TRACE(#mode); NCURSES_SP_NAME(tputs)(NCURSES_SP_ARGx mode, 1, outc) #define TurnOn(mask,mode) \ if ((turn_on & mask) && mode) { doPut(mode); } @@ -50,14 +53,22 @@ MODULE_ID("$Id: lib_vid_attr.c,v 1.5 2007/06/30 22:03:02 tom Exp $") if ((pair != old_pair) \ || (fix_pair0 && (pair == 0)) \ || (reverse ^ ((old_attr & A_REVERSE) != 0))) { \ - _nc_do_color(old_pair, pair, reverse, outc); \ + NCURSES_SP_NAME(_nc_do_color) (NCURSES_SP_ARGx \ + old_pair, pair, \ + reverse, outc); \ } \ } -#define set_color(mode, pair) mode &= ALL_BUT_COLOR; mode |= COLOR_PAIR(pair) +#define set_color(mode, pair) \ + mode &= ALL_BUT_COLOR; \ + mode |= (attr_t) ColorPair(pair) NCURSES_EXPORT(int) -vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) +NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx + attr_t newmode, + short pair, + void *opts GCC_UNUSED, + NCURSES_SP_OUTC outc) { #if NCURSES_EXT_COLORS static attr_t previous_attr = A_NORMAL; @@ -65,9 +76,9 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) attr_t turn_on, turn_off; bool reverse = FALSE; - bool can_color = (SP == 0 || SP->_coloron); + bool can_color = (SP_PARM == 0 || SP_PARM->_coloron); #if NCURSES_EXT_FUNCS - bool fix_pair0 = (SP != 0 && SP->_coloron && !SP->_default_color); + bool fix_pair0 = (SP_PARM != 0 && SP_PARM->_coloron && !SP_PARM->_default_color); #else #define fix_pair0 FALSE #endif @@ -76,18 +87,18 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); /* this allows us to go on whether or not newterm() has been called */ - if (SP) { - previous_attr = AttrOf(SCREEN_ATTRS(SP)); - previous_pair = GetPair(SCREEN_ATTRS(SP)); + if (SP_PARM) { + previous_attr = AttrOf(SCREEN_ATTRS(SP_PARM)); + previous_pair = GetPair(SCREEN_ATTRS(SP_PARM)); } TR(TRACE_ATTRS, ("previous attribute was %s, %d", _traceattr(previous_attr), previous_pair)); #if !USE_XMC_SUPPORT - if ((SP != 0) + if ((SP_PARM != 0) && (magic_cookie_glitch > 0)) - newmode &= ~(SP->_xmc_suppress); + newmode &= ~(SP_PARM->_xmc_suppress); #endif /* @@ -144,10 +155,10 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) if (exit_attribute_mode) { doPut(exit_attribute_mode); } else { - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } } @@ -159,16 +170,18 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) } else if (set_attributes) { if (turn_on || turn_off) { TPUTS_TRACE("set_attributes"); - tputs(TPARM_9(set_attributes, - (newmode & A_STANDOUT) != 0, - (newmode & A_UNDERLINE) != 0, - (newmode & A_REVERSE) != 0, - (newmode & A_BLINK) != 0, - (newmode & A_DIM) != 0, - (newmode & A_BOLD) != 0, - (newmode & A_INVIS) != 0, - (newmode & A_PROTECT) != 0, - (newmode & A_ALTCHARSET) != 0), 1, outc); + NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx + TPARM_9(set_attributes, + (newmode & A_STANDOUT) != 0, + (newmode & A_UNDERLINE) != 0, + (newmode & A_REVERSE) != 0, + (newmode & A_BLINK) != 0, + (newmode & A_DIM) != 0, + (newmode & A_BOLD) != 0, + (newmode & A_INVIS) != 0, + (newmode & A_PROTECT) != 0, + (newmode & A_ALTCHARSET) != 0), + 1, outc); previous_attr &= ALL_BUT_COLOR; previous_pair = 0; } @@ -179,11 +192,11 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) TurnOff(A_ALTCHARSET, exit_alt_charset_mode); - if (!SP || SP->_use_rmul) { + if (!SP_PARM || SP_PARM->_use_rmul) { TurnOff(A_UNDERLINE, exit_underline_mode); } - if (!SP || SP->_use_rmso) { + if (!SP_PARM || SP_PARM->_use_rmso) { TurnOff(A_STANDOUT, exit_standout_mode); } @@ -221,9 +234,9 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) if (reverse) newmode |= A_REVERSE; - if (SP) { - SetAttr(SCREEN_ATTRS(SP), newmode); - SetPair(SCREEN_ATTRS(SP), pair); + if (SP_PARM) { + SetAttr(SCREEN_ATTRS(SP_PARM), newmode); + SetPair(SCREEN_ATTRS(SP_PARM), pair); } else { previous_attr = newmode; previous_pair = pair; @@ -233,29 +246,60 @@ vid_puts(attr_t newmode, short pair, void *opts GCC_UNUSED, int (*outc) (int)) #else T((T_CALLED("vid_puts(%s,%d)"), _traceattr(newmode), pair)); set_color(newmode, pair); - returnCode(vidputs(newmode, outc)); + returnCode(NCURSES_SP_NAME(vidputs) (NCURSES_SP_ARGx newmode, outc)); #endif } +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) +vid_puts(attr_t newmode, + short pair, + void *opts GCC_UNUSED, + NCURSES_OUTC outc) +{ + SetSafeOutcWrapper(outc); + return NCURSES_SP_NAME(vid_puts) (CURRENT_SCREEN, + newmode, + pair, + opts, + _nc_outc_wrapper); +} +#endif + #undef vid_attr NCURSES_EXPORT(int) +NCURSES_SP_NAME(vid_attr) (NCURSES_SP_DCLx + attr_t newmode, + short pair, + void *opts) +{ + T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); + returnCode(NCURSES_SP_NAME(vid_puts) (NCURSES_SP_ARGx + newmode, + pair, + opts, + NCURSES_SP_NAME(_nc_outch))); +} + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(int) vid_attr(attr_t newmode, short pair, void *opts) { - T((T_CALLED("vid_attr(%s,%d)"), _traceattr(newmode), pair)); - returnCode(vid_puts(newmode, pair, opts, _nc_outch)); + return NCURSES_SP_NAME(vid_attr) (CURRENT_SCREEN, newmode, pair, opts); } +#endif /* * This implementation uses the same mask values for A_xxx and WA_xxx, so * we can use termattrs() for part of the logic. */ NCURSES_EXPORT(attr_t) -term_attrs(void) +NCURSES_SP_NAME(term_attrs) (NCURSES_SP_DCL0) { attr_t attrs; T((T_CALLED("term_attrs()"))); - attrs = termattrs(); + attrs = SP_PARM ? NCURSES_SP_NAME(termattrs) (NCURSES_SP_ARG) : 0; /* these are only supported for wide-character mode */ if (enter_horizontal_hl_mode) @@ -273,3 +317,11 @@ term_attrs(void) returnAttr(attrs); } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(attr_t) +term_attrs(void) +{ + return NCURSES_SP_NAME(term_attrs) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/ncurses/widechar/lib_vline_set.c b/contrib/ncurses/ncurses/widechar/lib_vline_set.c index af42df1f24ab..917caac44b44 100644 --- a/contrib/ncurses/ncurses/widechar/lib_vline_set.c +++ b/contrib/ncurses/ncurses/widechar/lib_vline_set.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,16 +39,16 @@ #include -MODULE_ID("$Id: lib_vline_set.c,v 1.2 2002/03/23 21:36:01 tom Exp $") +MODULE_ID("$Id: lib_vline_set.c,v 1.4 2010/12/19 01:50:50 tom Exp $") NCURSES_EXPORT(int) -wvline_set(WINDOW *win, const cchar_t * ch, int n) +wvline_set(WINDOW *win, const cchar_t *ch, int n) { int code = ERR; - NCURSES_SIZE_T row, col; - NCURSES_SIZE_T end; + int row, col; + int end; - T((T_CALLED("wvline(%p,%s,%d)"), win, _tracecchar_t(ch), n)); + T((T_CALLED("wvline(%p,%s,%d)"), (void *) win, _tracecchar_t(ch), n)); if (win) { NCURSES_CH_T wch; diff --git a/contrib/ncurses/ncurses/widechar/lib_wacs.c b/contrib/ncurses/ncurses/widechar/lib_wacs.c index fe893b4d2f8b..5a16e457e091 100644 --- a/contrib/ncurses/ncurses/widechar/lib_wacs.c +++ b/contrib/ncurses/ncurses/widechar/lib_wacs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2006 Free Software Foundation, Inc. * + * Copyright (c) 2002-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -31,9 +31,8 @@ ****************************************************************************/ #include -#include -MODULE_ID("$Id: lib_wacs.c,v 1.7 2006/12/17 15:16:17 tom Exp $") +MODULE_ID("$Id: lib_wacs.c,v 1.10 2010/12/19 01:43:19 tom Exp $") NCURSES_EXPORT_VAR(cchar_t) * _nc_wacs = 0; @@ -42,7 +41,7 @@ _nc_init_wacs(void) { /* *INDENT-OFF* */ static const struct { - int map; + unsigned map; int value[2]; } table[] = { /* VT100 symbols */ @@ -80,6 +79,30 @@ _nc_init_wacs(void) { '{', { '*', 0x03c0 }}, /* greek pi */ { '|', { '!', 0x2260 }}, /* not-equal */ { '}', { 'f', 0x00a3 }}, /* pound-sterling symbol */ + /* thick-line-drawing */ + { 'L', { '+', 0x250f }}, /* upper left corner */ + { 'M', { '+', 0x2517 }}, /* lower left corner */ + { 'K', { '+', 0x2513 }}, /* upper right corner */ + { 'J', { '+', 0x251b }}, /* lower right corner */ + { 'T', { '+', 0x2523 }}, /* tee pointing left */ + { 'U', { '+', 0x252b }}, /* tee pointing right */ + { 'V', { '+', 0x253b }}, /* tee pointing up */ + { 'W', { '+', 0x2533 }}, /* tee pointing down */ + { 'Q', { '-', 0x2501 }}, /* horizontal line */ + { 'X', { '|', 0x2503 }}, /* vertical line */ + { 'N', { '+', 0x254b }}, /* large plus or crossover */ + /* double-line-drawing */ + { 'C', { '+', 0x2554 }}, /* upper left corner */ + { 'D', { '+', 0x255a }}, /* lower left corner */ + { 'B', { '+', 0x2557 }}, /* upper right corner */ + { 'A', { '+', 0x255d }}, /* lower right corner */ + { 'G', { '+', 0x2563 }}, /* tee pointing left */ + { 'F', { '+', 0x2560 }}, /* tee pointing right */ + { 'H', { '+', 0x2569 }}, /* tee pointing up */ + { 'I', { '+', 0x2566 }}, /* tee pointing down */ + { 'R', { '-', 0x2550 }}, /* horizontal line */ + { 'Y', { '|', 0x2551 }}, /* vertical line */ + { 'E', { '+', 0x256c }}, /* large plus or crossover */ }; /* *INDENT-ON* */ diff --git a/contrib/ncurses/ncurses/widechar/lib_wunctrl.c b/contrib/ncurses/ncurses/widechar/lib_wunctrl.c index be2259acdcff..50958e44c7bb 100644 --- a/contrib/ncurses/ncurses/widechar/lib_wunctrl.c +++ b/contrib/ncurses/ncurses/widechar/lib_wunctrl.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2005,2007 Free Software Foundation, Inc. * + * Copyright (c) 2001-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,21 +35,31 @@ #include -MODULE_ID("$Id: lib_wunctrl.c,v 1.12 2007/06/12 20:22:32 tom Exp $") +MODULE_ID("$Id: lib_wunctrl.c,v 1.14 2010/12/19 01:42:15 tom Exp $") NCURSES_EXPORT(wchar_t *) -wunctrl(cchar_t *wc) +NCURSES_SP_NAME(wunctrl) (NCURSES_SP_DCLx cchar_t *wc) { - static wchar_t str[CCHARW_MAX + 1], *sp; + static wchar_t str[CCHARW_MAX + 1], *wsp; if (Charable(*wc)) { - const char *p = unctrl((unsigned) _nc_to_char((wint_t) CharOf(*wc))); + const char *p = + NCURSES_SP_NAME(unctrl) (NCURSES_SP_ARGx + (unsigned) _nc_to_char((wint_t)CharOf(*wc))); - for (sp = str; *p; ++p) { - *sp++ = _nc_to_widechar(*p); + for (wsp = str; *p; ++p) { + *wsp++ = (wchar_t) _nc_to_widechar(*p); } - *sp = 0; + *wsp = 0; return str; } else return wc->chars; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(wchar_t *) +wunctrl(cchar_t *wc) +{ + return NCURSES_SP_NAME(wunctrl) (CURRENT_SCREEN, wc); +} +#endif diff --git a/contrib/ncurses/ncurses/win32con/gettimeofday.c b/contrib/ncurses/ncurses/win32con/gettimeofday.c new file mode 100644 index 000000000000..e1ef3401de34 --- /dev/null +++ b/contrib/ncurses/ncurses/win32con/gettimeofday.c @@ -0,0 +1,51 @@ +/**************************************************************************** + * Copyright (c) 2008,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +#define WINVER 0x0501 + +#include + +#include + +MODULE_ID("$Id: gettimeofday.c,v 1.2 2010/01/16 15:18:51 tom Exp $") + +#define JAN1970 116444736000000000LL /* the value for 01/01/1970 00:00 */ + +int +gettimeofday(struct timeval *tv, void *tz GCC_UNUSED) +{ + union { + FILETIME ft; + long long since1601; /* time since 1 Jan 1601 in 100ns units */ + } data; + + GetSystemTimeAsFileTime(&data.ft); + tv->tv_usec = (long) ((data.since1601 / 10LL) % 1000000LL); + tv->tv_sec = (long) ((data.since1601 - JAN1970) / 10000000LL); + return (0); +} diff --git a/contrib/ncurses/ncurses/win32con/wcwidth.c b/contrib/ncurses/ncurses/win32con/wcwidth.c new file mode 100644 index 000000000000..cdef64a23c0e --- /dev/null +++ b/contrib/ncurses/ncurses/win32con/wcwidth.c @@ -0,0 +1,50 @@ +/**************************************************************************** + * Copyright (c) 2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ +#include + +MODULE_ID("$Id: wcwidth.c,v 1.2 2010/08/07 20:52:43 tom Exp $") + +#if USE_WIDEC_SUPPORT +#define mk_wcwidth(ucs) _nc_wcwidth(ucs) +#define mk_wcswidth(pwcs, n) _nc_wcswidth(pwcs, n) +#define mk_wcwidth_cjk(ucs) _nc_wcwidth_cjk(ucs) +#define mk_wcswidth_cjk(pwcs, n) _nc_wcswidth_cjk(pwcs, n) + +extern int mk_wcwidth(wchar_t); +extern int mk_wcswidth(const wchar_t *, size_t); +extern int mk_wcwidth_cjk(wchar_t); +extern int mk_wcswidth_cjk(const wchar_t *, size_t); + +#include +#else +void _nc_empty_wcwidth(void); +void +_nc_empty_wcwidth(void) +{ +} +#endif diff --git a/contrib/ncurses/ncurses/win32con/win_driver.c b/contrib/ncurses/ncurses/win32con/win_driver.c new file mode 100644 index 000000000000..c214639cd4df --- /dev/null +++ b/contrib/ncurses/ncurses/win32con/win_driver.c @@ -0,0 +1,1241 @@ +/**************************************************************************** + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Juergen Pfeifer * + * * + ****************************************************************************/ + +/* + * TODO - GetMousePos(POINT * result) from ntconio.c + * TODO - implement nodelay + */ + +#include +#define CUR my_term.type. + +MODULE_ID("$Id: win_driver.c,v 1.10 2010/12/25 19:28:21 tom Exp $") + +#define WINMAGIC NCDRV_MAGIC(NCDRV_WINCONSOLE) + +#define AssertTCB() assert(TCB!=0 && TCB->magic==WINMAGIC) +#define SetSP() assert(TCB->csp!=0); sp = TCB->csp + +#define GenMap(vKey,key) MAKELONG(key, vKey) + +static const LONG keylist[] = +{ + GenMap(VK_PRIOR, KEY_PPAGE), + GenMap(VK_NEXT, KEY_NPAGE), + GenMap(VK_END, KEY_END), + GenMap(VK_HOME, KEY_HOME), + GenMap(VK_LEFT, KEY_LEFT), + GenMap(VK_UP, KEY_UP), + GenMap(VK_RIGHT, KEY_RIGHT), + GenMap(VK_DOWN, KEY_DOWN), + GenMap(VK_DELETE, KEY_DC), + GenMap(VK_INSERT, KEY_IC) +}; +#define N_INI ((int)(sizeof(keylist)/sizeof(keylist[0]))) +#define FKEYS 24 +#define MAPSIZE (FKEYS + N_INI) +#define NUMPAIRS 64 + +typedef struct props { + CONSOLE_SCREEN_BUFFER_INFO SBI; + bool progMode; + DWORD map[MAPSIZE]; + DWORD rmap[MAPSIZE]; + WORD pairs[NUMPAIRS]; +} Properties; + +#define PropOf(TCB) ((Properties*)TCB->prop) + +int +_nc_mingw_ioctl(int fd GCC_UNUSED, + long int request GCC_UNUSED, + struct termios *arg GCC_UNUSED) +{ + return 0; + endwin(); + fprintf(stderr, "TERMINFO currently not supported on Windows.\n"); + exit(1); +} + +static WORD +MapColor(bool fore, int color) +{ + static const int _cmap[] = + {0, 4, 2, 6, 1, 5, 3, 7}; + int a; + if (color < 0 || color > 7) + a = fore ? 7 : 0; + else + a = _cmap[color]; + if (!fore) + a = a << 4; + return (WORD) a; +} + +static WORD +MapAttr(TERMINAL_CONTROL_BLOCK * TCB, WORD res, chtype ch) +{ + if (ch & A_COLOR) { + int p; + SCREEN *sp; + + AssertTCB(); + SetSP(); + p = PairNumber(ch); + if (p > 0 && p < NUMPAIRS && TCB != 0 && sp != 0) { + WORD a; + a = PropOf(TCB)->pairs[p]; + res = (res & 0xff00) | a; + } + } + + if (ch & A_REVERSE) + res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4))); + + if (ch & A_STANDOUT) + res = ((res & 0xff00) | (((res & 0x07) << 4) | ((res & 0x70) >> 4)) + | BACKGROUND_INTENSITY); + + if (ch & A_BOLD) + res |= FOREGROUND_INTENSITY; + + if (ch & A_DIM) + res |= BACKGROUND_INTENSITY; + + return res; +} + +static BOOL +con_write(TERMINAL_CONTROL_BLOCK * TCB, int y, int x, chtype *str, int n) +{ + CHAR_INFO ci[n]; + COORD loc, siz; + SMALL_RECT rec; + int i; + chtype ch; + SCREEN *sp; + + AssertTCB(); + + if (TCB == 0 || InvalidConsoleHandle(TCB->hdl)) + return FALSE; + + SetSP(); + + for (i = 0; i < n; i++) { + ch = str[i]; + ci[i].Char.AsciiChar = ChCharOf(ch); + ci[i].Attributes = MapAttr(TCB, + PropOf(TCB)->SBI.wAttributes, + ChAttrOf(ch)); + if (ChAttrOf(ch) & A_ALTCHARSET) { + if (sp->_acs_map) + ci[i].Char.AsciiChar = + ChCharOf(NCURSES_SP_NAME(_nc_acs_char) (sp, ChCharOf(ch))); + } + } + + loc.X = (short) 0; + loc.Y = (short) 0; + siz.X = (short) n; + siz.Y = 1; + + rec.Left = (short) x; + rec.Top = (short) y; + rec.Right = (short) (x + n - 1); + rec.Bottom = rec.Top; + + return WriteConsoleOutput(TCB->hdl, ci, siz, loc, &rec); +} + +#define MARK_NOCHANGE(win,row) \ + win->_line[row].firstchar = _NOCHANGE; \ + win->_line[row].lastchar = _NOCHANGE + +static int +drv_doupdate(TERMINAL_CONTROL_BLOCK * TCB) +{ + int y, nonempty, n, x0, x1, Width, Height; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + Width = screen_columns(sp); + Height = screen_lines(sp); + nonempty = min(Height, NewScreen(sp)->_maxy + 1); + + if ((CurScreen(sp)->_clear || NewScreen(sp)->_clear)) { + int x; + chtype empty[Width]; + + for (x = 0; x < Width; x++) + empty[x] = ' '; + + for (y = 0; y < nonempty; y++) { + con_write(TCB, y, 0, empty, Width); + memcpy(empty, + CurScreen(sp)->_line[y].text, + Width * sizeof(chtype)); + } + CurScreen(sp)->_clear = FALSE; + NewScreen(sp)->_clear = FALSE; + touchwin(NewScreen(sp)); + } + + for (y = 0; y < nonempty; y++) { + x0 = NewScreen(sp)->_line[y].firstchar; + if (x0 != _NOCHANGE) { + x1 = NewScreen(sp)->_line[y].lastchar; + n = x1 - x0 + 1; + if (n > 0) { + memcpy(CurScreen(sp)->_line[y].text + x0, + NewScreen(sp)->_line[y].text + x0, + n * sizeof(chtype)); + con_write(TCB, + y, + x0, + ((chtype *) CurScreen(sp)->_line[y].text) + x0, n); + + /* mark line changed successfully */ + if (y <= NewScreen(sp)->_maxy) { + MARK_NOCHANGE(NewScreen(sp), y); + } + if (y <= CurScreen(sp)->_maxy) { + MARK_NOCHANGE(CurScreen(sp), y); + } + } + } + } + + /* put everything back in sync */ + for (y = nonempty; y <= NewScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(NewScreen(sp), y); + } + for (y = nonempty; y <= CurScreen(sp)->_maxy; y++) { + MARK_NOCHANGE(CurScreen(sp), y); + } + + if (!NewScreen(sp)->_leaveok) { + CurScreen(sp)->_curx = NewScreen(sp)->_curx; + CurScreen(sp)->_cury = NewScreen(sp)->_cury; + + TCB->drv->hwcur(TCB, 0, 0, CurScreen(sp)->_cury, CurScreen(sp)->_curx); + } + SetConsoleActiveScreenBuffer(TCB->hdl); + return OK; +} + +static bool +drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, + const char *tname, + int *errret GCC_UNUSED) +{ + bool code = FALSE; + + T((T_CALLED("win32con::drv_CanHandle(%p)"), TCB)); + + assert(TCB != 0); + assert(tname != 0); + + TCB->magic = WINMAGIC; + if (*tname == 0 || *tname == 0) { + code = TRUE; + } else { + TERMINAL my_term; + int status; + + code = FALSE; +#if (USE_DATABASE || USE_TERMCAP) + status = _nc_setup_tinfo(tname, &my_term.type); +#else + status = TGETENT_NO; +#endif + if (status != TGETENT_YES) { + const TERMTYPE *fallback = _nc_fallback(tname); + + if (fallback) { + my_term.type = *fallback; + status = TGETENT_YES; + } else if (!strcmp(tname, "unknown")) { + code = TRUE; + } + } + if (status == TGETENT_YES) { + if (generic_type || hard_copy) + code = TRUE; + } + } + + if (code) { + if ((TCB->term.type.Booleans) == 0) { + _nc_init_entry(&(TCB->term.type)); + } + } + + returnBool(code); +} + +static int +drv_dobeepflash(TERMINAL_CONTROL_BLOCK * TCB, + bool beepFlag GCC_UNUSED) +{ + SCREEN *sp; + int res = ERR; + + AssertTCB(); + SetSP(); + + return res; +} + +static int +drv_print(TERMINAL_CONTROL_BLOCK * TCB, + char *data GCC_UNUSED, + int len GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return ERR; +} + +static int +drv_defaultcolors(TERMINAL_CONTROL_BLOCK * TCB, + int fg GCC_UNUSED, + int bg GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + SetSP(); + + return (code); +} + +static void +drv_setcolor(TERMINAL_CONTROL_BLOCK * TCB, + bool fore, + int color, + int (*outc) (SCREEN *, int) GCC_UNUSED) +{ + AssertTCB(); + + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + WORD a = MapColor(fore, color); + a = ((PropOf(TCB)->SBI.wAttributes) & (fore ? 0xfff8 : 0xff8f)) | a; + SetConsoleTextAttribute(TCB->hdl, a); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + } +} + +static bool +drv_rescol(TERMINAL_CONTROL_BLOCK * TCB) +{ + bool res = FALSE; + + AssertTCB(); + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + WORD a = FOREGROUND_BLUE | FOREGROUND_RED | FOREGROUND_GREEN; + SetConsoleTextAttribute(TCB->hdl, a); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + res = TRUE; + } + return res; +} + +static bool +drv_rescolors(TERMINAL_CONTROL_BLOCK * TCB) +{ + int result = FALSE; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + return result; +} + +static int +drv_size(TERMINAL_CONTROL_BLOCK * TCB, int *Lines, int *Cols) +{ + AssertTCB(); + + if (TCB == NULL || Lines == NULL || Cols == NULL || InvalidConsoleHandle(TCB->hdl)) + return ERR; + + *Lines = (int) (PropOf(TCB)->SBI.dwSize.Y); + *Cols = (int) (PropOf(TCB)->SBI.dwSize.X); + return OK; +} + +static int +drv_setsize(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, + int l GCC_UNUSED, + int c GCC_UNUSED) +{ + AssertTCB(); + return ERR; +} + +static int +drv_sgmode(TERMINAL_CONTROL_BLOCK * TCB, bool setFlag, TTY * buf) +{ + DWORD dwFlag = 0; + tcflag_t iflag; + tcflag_t lflag; + + AssertTCB(); + + if (TCB == 0 || buf == NULL) + return ERR; + + if (setFlag) { + iflag = buf->c_iflag; + lflag = buf->c_lflag; + + GetConsoleMode(TCB->inp, &dwFlag); + + if (lflag & ICANON) + dwFlag |= ENABLE_LINE_INPUT; + else + dwFlag &= ~ENABLE_LINE_INPUT; + + if (lflag & ECHO) + dwFlag |= ENABLE_ECHO_INPUT; + else + dwFlag &= ~ENABLE_ECHO_INPUT; + + if (iflag & BRKINT) + dwFlag |= ENABLE_PROCESSED_INPUT; + else + dwFlag &= ~ENABLE_PROCESSED_INPUT; + + dwFlag |= ENABLE_MOUSE_INPUT; + + buf->c_iflag = iflag; + buf->c_lflag = lflag; + SetConsoleMode(TCB->inp, dwFlag); + TCB->term.Nttyb = *buf; + } else { + iflag = TCB->term.Nttyb.c_iflag; + lflag = TCB->term.Nttyb.c_lflag; + GetConsoleMode(TCB->inp, &dwFlag); + + if (dwFlag & ENABLE_LINE_INPUT) + lflag |= ICANON; + else + lflag &= ~ICANON; + + if (dwFlag & ENABLE_ECHO_INPUT) + lflag |= ECHO; + else + lflag &= ~ECHO; + + if (dwFlag & ENABLE_PROCESSED_INPUT) + iflag |= BRKINT; + else + iflag &= ~BRKINT; + + TCB->term.Nttyb.c_iflag = iflag; + TCB->term.Nttyb.c_lflag = lflag; + + *buf = TCB->term.Nttyb; + } + return OK; +} + +static int +drv_mode(TERMINAL_CONTROL_BLOCK * TCB, bool progFlag, bool defFlag) +{ + SCREEN *sp; + TERMINAL *_term = (TERMINAL *) TCB; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + PropOf(TCB)->progMode = progFlag; + SetConsoleActiveScreenBuffer(progFlag ? TCB->hdl : TCB->out); + + if (progFlag) /* prog mode */ { + if (defFlag) { + if ((drv_sgmode(TCB, FALSE, &(_term->Nttyb)) == OK)) { + _term->Nttyb.c_oflag &= ~OFLAGS_TABS; + code = OK; + } + } else { + /* reset_prog_mode */ + if (drv_sgmode(TCB, TRUE, &(_term->Nttyb)) == OK) { + if (sp) { + if (sp->_keypad_on) + _nc_keypad(sp, TRUE); + NC_BUFFERED(sp, TRUE); + } + code = OK; + } + } + } else { /* shell mode */ + if (defFlag) { + /* def_shell_mode */ + if (drv_sgmode(TCB, FALSE, &(_term->Ottyb)) == OK) { + code = OK; + } + } else { + /* reset_shell_mode */ + if (sp) { + _nc_keypad(sp, FALSE); + NCURSES_SP_NAME(_nc_flush) (sp); + NC_BUFFERED(sp, FALSE); + } + code = drv_sgmode(TCB, TRUE, &(_term->Ottyb)); + } + } + + return (code); +} + +static void +drv_screen_init(SCREEN *sp GCC_UNUSED) +{ +} + +static void +drv_wrap(SCREEN *sp GCC_UNUSED) +{ +} + +static int +rkeycompare(const void *el1, const void *el2) +{ + WORD key1 = (LOWORD((*((const LONG *) el1)))) & 0x7fff; + WORD key2 = (LOWORD((*((const LONG *) el2)))) & 0x7fff; + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +keycompare(const void *el1, const void *el2) +{ + WORD key1 = HIWORD((*((const LONG *) el1))); + WORD key2 = HIWORD((*((const LONG *) el2))); + + return ((key1 < key2) ? -1 : ((key1 == key2) ? 0 : 1)); +} + +static int +MapKey(TERMINAL_CONTROL_BLOCK * TCB, WORD vKey) +{ + WORD nKey = 0; + void *res; + LONG key = GenMap(vKey, 0); + int code = -1; + + AssertTCB(); + + res = bsearch(&key, + PropOf(TCB)->map, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + keycompare); + if (res) { + key = *((LONG *) res); + nKey = LOWORD(key); + code = (int) (nKey & 0x7fff); + if (nKey & 0x8000) + code = -code; + } + return code; +} + +static void +drv_release(TERMINAL_CONTROL_BLOCK * TCB) +{ + T((T_CALLED("win32con::drv_release(%p)"), TCB)); + + AssertTCB(); + if (TCB->prop) + free(TCB->prop); + + returnVoid; +} + +static void +drv_init(TERMINAL_CONTROL_BLOCK * TCB) +{ + DWORD num_buttons; + + T((T_CALLED("win32con::drv_init(%p)"), TCB)); + + AssertTCB(); + + if (TCB) { + BOOL b = AllocConsole(); + WORD a; + int i; + + if (!b) + b = AttachConsole(ATTACH_PARENT_PROCESS); + + TCB->inp = GetStdHandle(STD_INPUT_HANDLE); + TCB->out = GetStdHandle(STD_OUTPUT_HANDLE); + + if (getenv("NCGDB")) + TCB->hdl = TCB->out; + else + TCB->hdl = CreateConsoleScreenBuffer(GENERIC_READ | GENERIC_WRITE, + 0, + NULL, + CONSOLE_TEXTMODE_BUFFER, + NULL); + + if (!InvalidConsoleHandle(TCB->hdl)) { + TCB->prop = typeCalloc(Properties, 1); + GetConsoleScreenBufferInfo(TCB->hdl, &(PropOf(TCB)->SBI)); + } + + TCB->info.initcolor = TRUE; + TCB->info.canchange = FALSE; + TCB->info.hascolor = TRUE; + TCB->info.caninit = TRUE; + + TCB->info.maxpairs = NUMPAIRS; + TCB->info.maxcolors = 8; + TCB->info.numlabels = 0; + TCB->info.labelwidth = 0; + TCB->info.labelheight = 0; + TCB->info.nocolorvideo = 1; + TCB->info.tabsize = 8; + + if (GetNumberOfConsoleMouseButtons(&num_buttons)) { + T(("mouse has %ld buttons", num_buttons)); + TCB->info.numbuttons = num_buttons; + } else { + TCB->info.numbuttons = 1; + } + + TCB->info.defaultPalette = _nc_cga_palette; + + for (i = 0; i < (N_INI + FKEYS); i++) { + if (i < N_INI) + PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = keylist[i]; + else + PropOf(TCB)->rmap[i] = PropOf(TCB)->map[i] = + GenMap((VK_F1 + (i - N_INI)), (KEY_F(1) + (i - N_INI))); + } + qsort(PropOf(TCB)->map, + (size_t) (MAPSIZE), + sizeof(keylist[0]), + keycompare); + qsort(PropOf(TCB)->rmap, + (size_t) (MAPSIZE), + sizeof(keylist[0]), + rkeycompare); + + a = MapColor(true, COLOR_WHITE) | MapColor(false, COLOR_BLACK); + for (i = 0; i < NUMPAIRS; i++) + PropOf(TCB)->pairs[i] = a; + } + returnVoid; +} + +static void +drv_initpair(TERMINAL_CONTROL_BLOCK * TCB, + short pair, + short f, + short b) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if ((pair > 0) && (pair < NUMPAIRS) && (f >= 0) && (f < 8) + && (b >= 0) && (b < 8)) { + PropOf(TCB)->pairs[pair] = MapColor(true, f) | MapColor(false, b); + } +} + +static void +drv_initcolor(TERMINAL_CONTROL_BLOCK * TCB, + short color GCC_UNUSED, + short r GCC_UNUSED, + short g GCC_UNUSED, + short b GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_do_color(TERMINAL_CONTROL_BLOCK * TCB, + short old_pair GCC_UNUSED, + short pair GCC_UNUSED, + bool reverse GCC_UNUSED, + int (*outc) (SCREEN *, int) GCC_UNUSED +) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_initmouse(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); + + sp->_mouse_type = M_TERM_DRIVER; +} + +static int +drv_testmouse(TERMINAL_CONTROL_BLOCK * TCB, int delay) +{ + int rc = 0; + SCREEN *sp; + + AssertTCB(); + SetSP(); + + if (sp->_drv_mouse_head < sp->_drv_mouse_tail) { + rc = TW_MOUSE; + } else { + rc = TCBOf(sp)->drv->twait(TCBOf(sp), + TWAIT_MASK, + delay, + (int *) 0 + EVENTLIST_2nd(evl)); + } + + return rc; +} + +static int +drv_mvcur(TERMINAL_CONTROL_BLOCK * TCB, + int yold GCC_UNUSED, int xold GCC_UNUSED, + int y, int x) +{ + int ret = ERR; + if (TCB && !InvalidConsoleHandle(TCB->hdl)) { + COORD loc; + loc.X = (short) x; + loc.Y = (short) y; + SetConsoleCursorPosition(TCB->hdl, loc); + ret = OK; + } + return ret; +} + +static void +drv_hwlabel(TERMINAL_CONTROL_BLOCK * TCB, + int labnum GCC_UNUSED, + char *text GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_hwlabelOnOff(TERMINAL_CONTROL_BLOCK * TCB, + bool OnFlag GCC_UNUSED) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static chtype +drv_conattr(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED) +{ + chtype res = A_NORMAL; + res |= (A_BOLD | A_DIM | A_REVERSE | A_STANDOUT | A_COLOR); + return res; +} + +static void +drv_setfilter(TERMINAL_CONTROL_BLOCK * TCB) +{ + SCREEN *sp; + + AssertTCB(); + SetSP(); +} + +static void +drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, + chtype *real_map GCC_UNUSED, + chtype *fake_map GCC_UNUSED) +{ +#define DATA(a,b) { a, b } + static struct { + int acs_code; + int use_code; + } table[] = { + DATA('a', 0xb1), /* ACS_CKBOARD */ + DATA('f', 0xf8), /* ACS_DEGREE */ + DATA('g', 0xf1), /* ACS_PLMINUS */ + DATA('j', 0xd9), /* ACS_LRCORNER */ + DATA('l', 0xda), /* ACS_ULCORNER */ + DATA('k', 0xbf), /* ACS_URCORNER */ + DATA('m', 0xc0), /* ACS_LLCORNER */ + DATA('n', 0xc5), /* ACS_PLUS */ + DATA('q', 0xc4), /* ACS_HLINE */ + DATA('t', 0xc3), /* ACS_LTEE */ + DATA('u', 0xb4), /* ACS_RTEE */ + DATA('v', 0xc1), /* ACS_BTEE */ + DATA('w', 0xc2), /* ACS_TTEE */ + DATA('x', 0xb3), /* ACS_VLINE */ + DATA('y', 0xf3), /* ACS_LEQUAL */ + DATA('z', 0xf2), /* ACS_GEQUAL */ + DATA('0', 0xdb), /* ACS_BLOCK */ + DATA('{', 0xe3), /* ACS_PI */ + DATA('}', 0x9c), /* ACS_STERLING */ + DATA(',', 0xae), /* ACS_LARROW */ + DATA('+', 0xaf), /* ACS_RARROW */ + DATA('~', 0xf9), /* ACS_BULLET */ + }; +#undef DATA + unsigned n; + + SCREEN *sp; + AssertTCB(); + SetSP(); + + for (n = 0; n < SIZEOF(table); ++n) { + real_map[table[n].acs_code] = table[n].use_code | A_ALTCHARSET; + if (sp != 0) + sp->_screen_acs_map[table[n].acs_code] = TRUE; + } +} + +static ULONGLONG +tdiff(FILETIME fstart, FILETIME fend) +{ + ULARGE_INTEGER ustart; + ULARGE_INTEGER uend; + ULONGLONG diff; + + ustart.LowPart = fstart.dwLowDateTime; + ustart.HighPart = fstart.dwHighDateTime; + uend.LowPart = fend.dwLowDateTime; + uend.HighPart = fend.dwHighDateTime; + + diff = (uend.QuadPart - ustart.QuadPart) / 10000; + return diff; +} + +static int +Adjust(int milliseconds, int diff) +{ + if (milliseconds == INFINITY) + return milliseconds; + milliseconds -= diff; + if (milliseconds < 0) + milliseconds = 0; + return milliseconds; +} + +#define BUTTON_MASK (FROM_LEFT_1ST_BUTTON_PRESSED | \ + FROM_LEFT_2ND_BUTTON_PRESSED | \ + FROM_LEFT_3RD_BUTTON_PRESSED | \ + FROM_LEFT_4TH_BUTTON_PRESSED | \ + RIGHTMOST_BUTTON_PRESSED) + +static int +decode_mouse(TERMINAL_CONTROL_BLOCK * TCB, int mask) +{ + SCREEN *sp; + int result = 0; + + AssertTCB(); + SetSP(); + + if (mask & FROM_LEFT_1ST_BUTTON_PRESSED) + result |= BUTTON1_PRESSED; + if (mask & FROM_LEFT_2ND_BUTTON_PRESSED) + result |= BUTTON2_PRESSED; + if (mask & FROM_LEFT_3RD_BUTTON_PRESSED) + result |= BUTTON3_PRESSED; + if (mask & FROM_LEFT_4TH_BUTTON_PRESSED) + result |= BUTTON4_PRESSED; + + if (mask & RIGHTMOST_BUTTON_PRESSED) { + switch (TCB->info.numbuttons) { + case 1: + result |= BUTTON1_PRESSED; + break; + case 2: + result |= BUTTON2_PRESSED; + break; + case 3: + result |= BUTTON3_PRESSED; + break; + case 4: + result |= BUTTON4_PRESSED; + break; + } + } + + return result; +} + +static int +drv_twait(TERMINAL_CONTROL_BLOCK * TCB, + int mode, + int milliseconds, + int *timeleft + EVENTLIST_2nd(_nc_eventlist * evl)) +{ + SCREEN *sp; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead = 0, rc = -1; + int code = 0; + FILETIME fstart; + FILETIME fend; + int diff; + bool isImmed = (milliseconds == 0); + +#define CONSUME() ReadConsoleInput(TCB->inp,&inp_rec,1,&nRead) + + AssertTCB(); + SetSP(); + + TR(TRACE_IEVENT, ("start twait: %d milliseconds, mode: %d", + milliseconds, mode)); + + if (milliseconds < 0) + milliseconds = INFINITY; + + memset(&inp_rec, 0, sizeof(inp_rec)); + + while (true) { + GetSystemTimeAsFileTime(&fstart); + rc = WaitForSingleObject(TCB->inp, milliseconds); + GetSystemTimeAsFileTime(&fend); + diff = (int) tdiff(fstart, fend); + milliseconds = Adjust(milliseconds, diff); + + if (!isImmed && milliseconds == 0) + break; + + if (rc == WAIT_OBJECT_0) { + if (mode) { + b = GetNumberOfConsoleInputEvents(TCB->inp, &nRead); + if (b && nRead > 0) { + b = PeekConsoleInput(TCB->inp, &inp_rec, 1, &nRead); + if (b && nRead > 0) { + switch (inp_rec.EventType) { + case KEY_EVENT: + if (mode & TW_INPUT) { + WORD vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + char ch = inp_rec.Event.KeyEvent.uChar.AsciiChar; + + if (inp_rec.Event.KeyEvent.bKeyDown) { + if (0 == ch) { + int nKey = MapKey(TCB, vk); + if ((nKey < 0) || FALSE == sp->_keypad_on) { + CONSUME(); + continue; + } + } + code = TW_INPUT; + goto end; + } else { + CONSUME(); + } + } + continue; + case MOUSE_EVENT: + if (decode_mouse(TCB, + (inp_rec.Event.MouseEvent.dwButtonState + & BUTTON_MASK)) == 0) { + CONSUME(); + } else if (mode & TW_MOUSE) { + code = TW_MOUSE; + goto end; + } + continue; + default: + SetConsoleActiveScreenBuffer(!PropOf(TCB)->progMode ? + TCB->hdl : TCB->out); + continue; + } + } + } + } + continue; + } else { + if (rc != WAIT_TIMEOUT) { + code = -1; + break; + } else { + code = 0; + break; + } + } + } + end: + + TR(TRACE_IEVENT, ("end twait: returned %d (%d), remaining time %d msec", + code, errno, milliseconds)); + + if (timeleft) + *timeleft = milliseconds; + + return code; +} + +static bool +handle_mouse(TERMINAL_CONTROL_BLOCK * TCB, MOUSE_EVENT_RECORD mer) +{ + SCREEN *sp; + MEVENT work; + bool result = FALSE; + + AssertTCB(); + SetSP(); + + sp->_drv_mouse_old_buttons = sp->_drv_mouse_new_buttons; + sp->_drv_mouse_new_buttons = mer.dwButtonState & BUTTON_MASK; + + /* + * We're only interested if the button is pressed or released. + * FIXME: implement continuous event-tracking. + */ + if (sp->_drv_mouse_new_buttons != sp->_drv_mouse_old_buttons) { + + memset(&work, 0, sizeof(work)); + + if (sp->_drv_mouse_new_buttons) { + + work.bstate |= decode_mouse(TCB, sp->_drv_mouse_new_buttons); + + } else { + + /* cf: BUTTON_PRESSED, BUTTON_RELEASED */ + work.bstate |= (decode_mouse(TCB, sp->_drv_mouse_old_buttons) >> 1); + + result = TRUE; + } + + work.x = mer.dwMousePosition.X; + work.y = mer.dwMousePosition.Y; + + sp->_drv_mouse_fifo[sp->_drv_mouse_tail] = work; + sp->_drv_mouse_tail += 1; + } + + return result; +} + +static int +drv_read(TERMINAL_CONTROL_BLOCK * TCB, int *buf) +{ + SCREEN *sp; + int n = 1; + INPUT_RECORD inp_rec; + BOOL b; + DWORD nRead; + WORD vk; + WORD sc; + + AssertTCB(); + assert(buf); + SetSP(); + + memset(&inp_rec, 0, sizeof(inp_rec)); + + T((T_CALLED("win32con::drv_read(%p)"), TCB)); + while ((b = ReadConsoleInput(TCB->inp, &inp_rec, 1, &nRead))) { + if (b && nRead > 0) { + if (inp_rec.EventType == KEY_EVENT) { + if (!inp_rec.Event.KeyEvent.bKeyDown) + continue; + *buf = (int) inp_rec.Event.KeyEvent.uChar.AsciiChar; + vk = inp_rec.Event.KeyEvent.wVirtualKeyCode; + sc = inp_rec.Event.KeyEvent.wVirtualScanCode; + if (*buf == 0) { + if (sp->_keypad_on) { + *buf = MapKey(TCB, vk); + if (0 > (*buf)) + continue; + else + break; + } else + continue; + } else { /* *buf != 0 */ + break; + } + } else if (inp_rec.EventType == MOUSE_EVENT) { + if (handle_mouse(TCB, inp_rec.Event.MouseEvent)) { + *buf = KEY_MOUSE; + break; + } + } + continue; + } + } + returnCode(n); +} + +static int +drv_nap(TERMINAL_CONTROL_BLOCK * TCB GCC_UNUSED, int ms) +{ + Sleep(ms); + return OK; +} + +static bool +drv_kyExist(TERMINAL_CONTROL_BLOCK * TCB, int keycode) +{ + SCREEN *sp; + WORD nKey; + void *res; + bool found = FALSE; + LONG key = GenMap(0, (WORD) keycode); + + AssertTCB(); + SetSP(); + + AssertTCB(); + + res = bsearch(&key, + PropOf(TCB)->rmap, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + rkeycompare); + if (res) { + key = *((LONG *) res); + nKey = LOWORD(key); + if (!(nKey & 0x8000)) + found = TRUE; + } + return found; +} + +static int +drv_kpad(TERMINAL_CONTROL_BLOCK * TCB, bool flag GCC_UNUSED) +{ + SCREEN *sp; + int code = ERR; + + AssertTCB(); + sp = TCB->csp; + + if (sp) { + code = OK; + } + return code; +} + +static int +drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int keycode, bool flag) +{ + int code = ERR; + SCREEN *sp; + WORD nKey; + WORD vKey; + void *res; + LONG key = GenMap(0, (WORD) keycode); + + AssertTCB(); + SetSP(); + + if (sp) { + res = bsearch(&key, + PropOf(TCB)->rmap, + (size_t) (N_INI + FKEYS), + sizeof(keylist[0]), + rkeycompare); + if (res) { + key = *((LONG *) res); + vKey = HIWORD(key); + nKey = (LOWORD(key)) & 0x7fff; + if (!flag) + nKey |= 0x8000; + *(LONG *) res = GenMap(vKey, nKey); + } + } + return code; +} + +NCURSES_EXPORT_VAR (TERM_DRIVER) _nc_WIN_DRIVER = { + FALSE, + drv_CanHandle, /* CanHandle */ + drv_init, /* init */ + drv_release, /* release */ + drv_size, /* size */ + drv_sgmode, /* sgmode */ + drv_conattr, /* conattr */ + drv_mvcur, /* hwcur */ + drv_mode, /* mode */ + drv_rescol, /* rescol */ + drv_rescolors, /* rescolors */ + drv_setcolor, /* color */ + drv_dobeepflash, /* DoBeepFlash */ + drv_initpair, /* initpair */ + drv_initcolor, /* initcolor */ + drv_do_color, /* docolor */ + drv_initmouse, /* initmouse */ + drv_testmouse, /* testmouse */ + drv_setfilter, /* setfilter */ + drv_hwlabel, /* hwlabel */ + drv_hwlabelOnOff, /* hwlabelOnOff */ + drv_doupdate, /* update */ + drv_defaultcolors, /* defaultcolors */ + drv_print, /* print */ + drv_size, /* getsize */ + drv_setsize, /* setsize */ + drv_initacs, /* initacs */ + drv_screen_init, /* scinit */ + drv_wrap, /* scexit */ + drv_twait, /* twait */ + drv_read, /* read */ + drv_nap, /* nap */ + drv_kpad, /* kpad */ + drv_keyok, /* kyOk */ + drv_kyExist /* kyExist */ +}; diff --git a/contrib/ncurses/panel/Makefile.in b/contrib/ncurses/panel/Makefile.in index 89dbeeac9009..f0f0a4922bd0 100644 --- a/contrib/ncurses/panel/Makefile.in +++ b/contrib/ncurses/panel/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $ +# $Id: Makefile.in,v 1.58 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile x = @EXEEXT@ @@ -64,6 +65,7 @@ LIBTOOL_COMPILE = @LIB_COMPILE@ LIBTOOL_LINK = @LIB_LINK@ LIBTOOL_INSTALL = @LIB_INSTALL@ LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ +LT_UNDEF = @LT_UNDEF@ INSTALL = @INSTALL@ INSTALL_LIB = @INSTALL@ @INSTALL_LIB@ @@ -71,11 +73,14 @@ INSTALL_PROG = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ AR = @AR@ -AR_OPTS = @AR_OPTS@ +ARFLAGS = @ARFLAGS@ AWK = @AWK@ LD = @LD@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -125,7 +130,7 @@ sources: $(AUTO_SRC) $(DESTDIR)$(bindir) \ $(DESTDIR)$(libdir) : - sh $(srcdir)/../mkdirs.sh $@ + mkdir -p $@ # make a copy to simplify include-paths while still keeping panel's include # file in this directory. @@ -133,15 +138,15 @@ $(DESTDIR)$(libdir) : -rm -f $@ cp $(srcdir)/panel.h $@ -PANEL_PRIV_H = \ +HEADER_DEPS = \ $(srcdir)/panel.priv.h \ $(srcdir)/panel.h tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace diff --git a/contrib/ncurses/panel/llib-lpanel b/contrib/ncurses/panel/llib-lpanel index de49c234ecaa..85371ec73e06 100644 --- a/contrib/ncurses/panel/llib-lpanel +++ b/contrib/ncurses/panel/llib-lpanel @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 1997,2002,2005 * + * Author: Thomas E. Dickey 1997,2005,2010 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include "panel.priv.h" +#include #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,6 +77,11 @@ void _nc_Touchline( /* ./p_above.c */ +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -84,6 +89,11 @@ PANEL *panel_above( /* ./p_below.c */ +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -157,6 +167,11 @@ int top_panel( /* ./p_update.c */ +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + #undef update_panels void update_panels(void) { /* void */ } diff --git a/contrib/ncurses/panel/llib-lpanelt b/contrib/ncurses/panel/llib-lpanelt new file mode 100644 index 000000000000..8fcd42c9b6de --- /dev/null +++ b/contrib/ncurses/panel/llib-lpanelt @@ -0,0 +1,197 @@ +/**************************************************************************** + * Copyright (c) 2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2010 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include + +#undef _nc_retrace_panel +PANEL *_nc_retrace_panel( + PANEL *pan) + { return(*(PANEL **)0); } + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/contrib/ncurses/panel/llib-lpaneltw b/contrib/ncurses/panel/llib-lpaneltw new file mode 100644 index 000000000000..1d3cd8d84c8f --- /dev/null +++ b/contrib/ncurses/panel/llib-lpaneltw @@ -0,0 +1,197 @@ +/**************************************************************************** + * Copyright (c) 2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2010 * + ****************************************************************************/ +/* LINTLIBRARY */ + +/* ./panel.c */ + +#include + +#undef _nc_retrace_panel +PANEL *_nc_retrace_panel( + PANEL *pan) + { return(*(PANEL **)0); } + +#undef _nc_my_visbuf +const char *_nc_my_visbuf( + const void *ptr) + { return(*(const char **)0); } + +#undef _nc_dPanel +void _nc_dPanel( + const char *text, + const PANEL *pan) + { /* void */ } + +#undef _nc_dStack +void _nc_dStack( + const char *fmt, + int num, + const PANEL *pan) + { /* void */ } + +#undef _nc_Wnoutrefresh +void _nc_Wnoutrefresh( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchpan +void _nc_Touchpan( + const PANEL *pan) + { /* void */ } + +#undef _nc_Touchline +void _nc_Touchline( + const PANEL *pan, + int start, + int count) + { /* void */ } + +/* ./p_above.c */ + +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_above +PANEL *panel_above( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_below.c */ + +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + +#undef panel_below +PANEL *panel_below( + const PANEL *pan) + { return(*(PANEL **)0); } + +/* ./p_bottom.c */ + +#undef bottom_panel +int bottom_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_delete.c */ + +#undef del_panel +int del_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hide.c */ + +#undef hide_panel +int hide_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_hidden.c */ + +#undef panel_hidden +int panel_hidden( + const PANEL *pan) + { return(*(int *)0); } + +/* ./p_move.c */ + +#undef move_panel +int move_panel( + PANEL *pan, + int starty, + int startx) + { return(*(int *)0); } + +/* ./p_new.c */ + +#undef new_panel +PANEL *new_panel( + WINDOW *win) + { return(*(PANEL **)0); } + +/* ./p_replace.c */ + +#undef replace_panel +int replace_panel( + PANEL *pan, + WINDOW *win) + { return(*(int *)0); } + +/* ./p_show.c */ + +#undef show_panel +int show_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_top.c */ + +#undef top_panel +int top_panel( + PANEL *pan) + { return(*(int *)0); } + +/* ./p_update.c */ + +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + +#undef update_panels +void update_panels(void) + { /* void */ } + +/* ./p_user.c */ + +#undef set_panel_userptr +int set_panel_userptr( + PANEL *pan, + void *uptr) + { return(*(int *)0); } + +#undef panel_userptr +void *panel_userptr( + const PANEL *pan) + { return(*(void **)0); } + +/* ./p_win.c */ + +#undef panel_window +WINDOW *panel_window( + const PANEL *pan) + { return(*(WINDOW **)0); } diff --git a/contrib/ncurses/panel/llib-lpanelw b/contrib/ncurses/panel/llib-lpanelw index 48bd1e0db5a7..503b34345ba8 100644 --- a/contrib/ncurses/panel/llib-lpanelw +++ b/contrib/ncurses/panel/llib-lpanelw @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002,2005 Free Software Foundation, Inc. * + * Copyright (c) 2002-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -27,13 +27,13 @@ ****************************************************************************/ /**************************************************************************** - * Author: Thomas E. Dickey 2002,2005 * + * Author: Thomas E. Dickey 2002-2005,2010 * ****************************************************************************/ /* LINTLIBRARY */ /* ./panel.c */ -#include "panel.priv.h" +#include #undef _nc_retrace_panel PANEL *_nc_retrace_panel( @@ -77,6 +77,11 @@ void _nc_Touchline( /* ./p_above.c */ +#undef ground_panel +PANEL *ground_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_above PANEL *panel_above( const PANEL *pan) @@ -84,6 +89,11 @@ PANEL *panel_above( /* ./p_below.c */ +#undef ceiling_panel +PANEL *ceiling_panel( + SCREEN *sp) + { return(*(PANEL **)0); } + #undef panel_below PANEL *panel_below( const PANEL *pan) @@ -157,6 +167,11 @@ int top_panel( /* ./p_update.c */ +#undef update_panels_sp +void update_panels_sp( + SCREEN *sp) + { /* void */ } + #undef update_panels void update_panels(void) { /* void */ } diff --git a/contrib/ncurses/panel/modules b/contrib/ncurses/panel/modules index d0f7a796678f..cd3f545630f7 100644 --- a/contrib/ncurses/panel/modules +++ b/contrib/ncurses/panel/modules @@ -1,6 +1,6 @@ -# $Id: modules,v 1.9 2006/12/24 00:53:17 tom Exp $ +# $Id: modules,v 1.10 2010/01/23 16:31:16 tom Exp $ ############################################################################## -# Copyright (c) 1998,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-2006,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -32,20 +32,20 @@ @ base # Library objects -panel lib $(srcdir) $(PANEL_PRIV_H) -p_above lib $(srcdir) $(PANEL_PRIV_H) -p_below lib $(srcdir) $(PANEL_PRIV_H) -p_bottom lib $(srcdir) $(PANEL_PRIV_H) -p_delete lib $(srcdir) $(PANEL_PRIV_H) -p_hide lib $(srcdir) $(PANEL_PRIV_H) -p_hidden lib $(srcdir) $(PANEL_PRIV_H) -p_move lib $(srcdir) $(PANEL_PRIV_H) -p_new lib $(srcdir) $(PANEL_PRIV_H) -p_replace lib $(srcdir) $(PANEL_PRIV_H) -p_show lib $(srcdir) $(PANEL_PRIV_H) -p_top lib $(srcdir) $(PANEL_PRIV_H) -p_update lib $(srcdir) $(PANEL_PRIV_H) -p_user lib $(srcdir) $(PANEL_PRIV_H) -p_win lib $(srcdir) $(PANEL_PRIV_H) +panel lib $(srcdir) $(HEADER_DEPS) +p_above lib $(srcdir) $(HEADER_DEPS) +p_below lib $(srcdir) $(HEADER_DEPS) +p_bottom lib $(srcdir) $(HEADER_DEPS) +p_delete lib $(srcdir) $(HEADER_DEPS) +p_hide lib $(srcdir) $(HEADER_DEPS) +p_hidden lib $(srcdir) $(HEADER_DEPS) +p_move lib $(srcdir) $(HEADER_DEPS) +p_new lib $(srcdir) $(HEADER_DEPS) +p_replace lib $(srcdir) $(HEADER_DEPS) +p_show lib $(srcdir) $(HEADER_DEPS) +p_top lib $(srcdir) $(HEADER_DEPS) +p_update lib $(srcdir) $(HEADER_DEPS) +p_user lib $(srcdir) $(HEADER_DEPS) +p_win lib $(srcdir) $(HEADER_DEPS) # vile:makemode diff --git a/contrib/ncurses/panel/p_above.c b/contrib/ncurses/panel/p_above.c index 32495f627f2d..8bbf1bc21cea 100644 --- a/contrib/ncurses/panel/p_above.c +++ b/contrib/ncurses/panel/p_above.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,24 +29,56 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_above.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_above.c,v 1.6 2005/02/19 16:44:57 tom Exp $") +MODULE_ID("$Id: p_above.c,v 1.8 2010/01/23 21:22:15 tom Exp $") + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(PANEL *) +ground_panel(SCREEN * sp) +{ + T((T_CALLED("ground_panel(%p)"), sp)); + if (sp) + { + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + + if (_nc_bottom_panel) /* this is the pseudo panel */ + returnPanel(_nc_bottom_panel->above); + else + returnPanel(0); + } + else + { + if (0 == CURRENT_SCREEN) + returnPanel(0); + else + returnPanel(ground_panel(CURRENT_SCREEN)); + } +} +#endif NCURSES_EXPORT(PANEL *) panel_above(const PANEL * pan) { - T((T_CALLED("panel_above(%p)"), pan)); - if (!pan) + PANEL *result; + + T((T_CALLED("panel_above(%p)"), (const void *)pan)); + if (pan) + result = pan->above; + else { +#if NCURSES_SP_FUNCS + result = ground_panel(CURRENT_SCREEN); +#else /* if top and bottom are equal, we have no or only the pseudo panel; if not, we return the panel above the pseudo panel */ - returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above); + result = EMPTY_STACK()? (PANEL *) 0 : _nc_bottom_panel->above; +#endif } - else - returnPanel(pan->above); + returnPanel(result); } diff --git a/contrib/ncurses/panel/p_below.c b/contrib/ncurses/panel/p_below.c index c4b241015f5b..f276ef959da5 100644 --- a/contrib/ncurses/panel/p_below.c +++ b/contrib/ncurses/panel/p_below.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,26 +29,57 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_below.c */ #include "panel.priv.h" -MODULE_ID("$Id: p_below.c,v 1.6 2005/02/19 16:45:10 tom Exp $") +MODULE_ID("$Id: p_below.c,v 1.8 2010/01/23 21:22:15 tom Exp $") +#if NCURSES_SP_FUNCS NCURSES_EXPORT(PANEL *) -panel_below(const PANEL * pan) +ceiling_panel(SCREEN * sp) { - T((T_CALLED("panel_below(%p)"), pan)); - if (!pan) + T((T_CALLED("ceiling_panel(%p)"), sp)); + if (sp) { + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + /* if top and bottom are equal, we have no or only the pseudo panel */ returnPanel(EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel); } else { - /* we must not return the pseudo panel */ - returnPanel(Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below); + if (0 == CURRENT_SCREEN) + returnPanel(0); + else + returnPanel(ceiling_panel(CURRENT_SCREEN)); } } +#endif + +NCURSES_EXPORT(PANEL *) +panel_below(const PANEL * pan) +{ + PANEL *result; + + T((T_CALLED("panel_below(%p)"), (const void *)pan)); + if (pan) + { + GetHook(pan); + /* we must not return the pseudo panel */ + result = Is_Pseudo(pan->below) ? (PANEL *) 0 : pan->below; + } + else + { +#if NCURSES_SP_FUNCS + result = ceiling_panel(CURRENT_SCREEN); +#else + /* if top and bottom are equal, we have no or only the pseudo panel */ + result = EMPTY_STACK()? (PANEL *) 0 : _nc_top_panel; +#endif + } + returnPanel(result); +} diff --git a/contrib/ncurses/panel/p_bottom.c b/contrib/ncurses/panel/p_bottom.c index b861fd9b2ce7..db814415375c 100644 --- a/contrib/ncurses/panel/p_bottom.c +++ b/contrib/ncurses/panel/p_bottom.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_bottom.c @@ -36,16 +37,17 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_bottom.c,v 1.11 2005/02/19 16:38:16 tom Exp $") +MODULE_ID("$Id: p_bottom.c,v 1.13 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) bottom_panel(PANEL * pan) { int err = OK; - T((T_CALLED("bottom_panel(%p)"), pan)); + T((T_CALLED("bottom_panel(%p)"), (void *)pan)); if (pan) { + GetHook(pan); if (!Is_Bottom(pan)) { diff --git a/contrib/ncurses/panel/p_delete.c b/contrib/ncurses/panel/p_delete.c index 24ee26b4ff23..39b055377c16 100644 --- a/contrib/ncurses/panel/p_delete.c +++ b/contrib/ncurses/panel/p_delete.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1999,2008 * ****************************************************************************/ /* p_delete.c @@ -36,19 +37,22 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_delete.c,v 1.8 2005/02/19 16:38:45 tom Exp $") +MODULE_ID("$Id: p_delete.c,v 1.10 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) del_panel(PANEL * pan) { int err = OK; - T((T_CALLED("del_panel(%p)"), pan)); + T((T_CALLED("del_panel(%p)"), (void *)pan)); if (pan) { dBug(("--> del_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); - free((void *)pan); + { + GetHook(pan); + HIDE_PANEL(pan, err, OK); + free((void *)pan); + } } else err = ERR; diff --git a/contrib/ncurses/panel/p_hidden.c b/contrib/ncurses/panel/p_hidden.c index 624c07dae0ba..01b69b91d919 100644 --- a/contrib/ncurses/panel/p_hidden.c +++ b/contrib/ncurses/panel/p_hidden.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_hidden.c @@ -36,13 +37,18 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hidden.c,v 1.7 2005/02/19 16:39:17 tom Exp $") +MODULE_ID("$Id: p_hidden.c,v 1.9 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(int) panel_hidden(const PANEL * pan) { - T((T_CALLED("panel_hidden(%p)"), pan)); - if (!pan) - returnCode(ERR); - returnCode(IS_LINKED(pan) ? FALSE : TRUE); + int rc = ERR; + + T((T_CALLED("panel_hidden(%p)"), (const void *)pan)); + if (pan) + { + GetHook(pan); + rc = (IS_LINKED(pan) ? FALSE : TRUE); + } + returnCode(rc); } diff --git a/contrib/ncurses/panel/p_hide.c b/contrib/ncurses/panel/p_hide.c index 08d8853a201c..7b780d464e16 100644 --- a/contrib/ncurses/panel/p_hide.c +++ b/contrib/ncurses/panel/p_hide.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,23 +36,27 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_hide.c,v 1.9 2005/02/19 16:39:41 tom Exp $") +MODULE_ID("$Id: p_hide.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) hide_panel(register PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("hide_panel(%p)"), pan)); - if (!pan) - returnCode(ERR); + T((T_CALLED("hide_panel(%p)"), (void *)pan)); - dBug(("--> hide_panel %s", USER_PTR(pan->user))); - dStack("", 1, pan); + if (pan) + { + GetHook(pan); - HIDE_PANEL(pan, err, ERR); + dBug(("--> hide_panel %s", USER_PTR(pan->user))); + dStack("", 1, pan); - dStack("", 9, pan); + HIDE_PANEL(pan, err, ERR); + err = OK; + + dStack("", 9, pan); + } returnCode(err); } diff --git a/contrib/ncurses/panel/p_move.c b/contrib/ncurses/panel/p_move.c index 3818e8cba860..adae64583220 100644 --- a/contrib/ncurses/panel/p_move.c +++ b/contrib/ncurses/panel/p_move.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2009 * ****************************************************************************/ /* p_move.c @@ -36,21 +37,24 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_move.c,v 1.9 2005/02/19 16:46:49 tom Exp $") +MODULE_ID("$Id: p_move.c,v 1.11 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(int) move_panel(PANEL * pan, int starty, int startx) { - T((T_CALLED("move_panel(%p,%d,%d)"), pan, starty, startx)); + int rc = ERR; - if (!pan) - returnCode(ERR); + T((T_CALLED("move_panel(%p,%d,%d)"), (void *)pan, starty, startx)); - if (IS_LINKED(pan)) + if (pan) { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); + GetHook(pan); + if (IS_LINKED(pan)) + { + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); + } + rc = mvwin(pan->win, starty, startx); } - - returnCode(mvwin(pan->win, starty, startx)); + returnCode(rc); } diff --git a/contrib/ncurses/panel/p_new.c b/contrib/ncurses/panel/p_new.c index 2719316888e0..235336c22f51 100644 --- a/contrib/ncurses/panel/p_new.c +++ b/contrib/ncurses/panel/p_new.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -38,7 +38,7 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_new.c,v 1.10 2008/08/04 18:25:48 tom Exp $") +MODULE_ID("$Id: p_new.c,v 1.16 2010/01/23 21:22:16 tom Exp $") #ifdef TRACE static char *stdscr_id; @@ -50,20 +50,27 @@ static char *new_id; Establish the pseudo panel for stdscr if necessary. --------------------------------------------------------------------------*/ static PANEL * -root_panel(void) +root_panel(NCURSES_SP_DCL0) { +#if NCURSES_SP_FUNCS + struct panelhook *ph = NCURSES_SP_NAME(_nc_panelhook) (sp); + +#elif NO_LEAKS + struct panelhook *ph = _nc_panelhook(); +#endif + if (_nc_stdscr_pseudo_panel == (PANEL *) 0) { - assert(stdscr && !_nc_bottom_panel && !_nc_top_panel); + assert(SP_PARM && SP_PARM->_stdscr && !_nc_bottom_panel && !_nc_top_panel); #if NO_LEAKS - _nc_panelhook()->destroy = del_panel; + ph->destroy = del_panel; #endif - _nc_stdscr_pseudo_panel = (PANEL *) malloc(sizeof(PANEL)); + _nc_stdscr_pseudo_panel = typeMalloc(PANEL, 1); if (_nc_stdscr_pseudo_panel != 0) { PANEL *pan = _nc_stdscr_pseudo_panel; - WINDOW *win = stdscr; + WINDOW *win = SP_PARM->_stdscr; pan->win = win; pan->below = (PANEL *) 0; @@ -86,16 +93,18 @@ new_panel(WINDOW *win) { PANEL *pan = (PANEL *) 0; - T((T_CALLED("new_panel(%p)"), win)); + GetWindowHook(win); + + T((T_CALLED("new_panel(%p)"), (void *)win)); if (!win) returnPanel(pan); if (!_nc_stdscr_pseudo_panel) - (void)root_panel(); + (void)root_panel(NCURSES_SP_ARG); assert(_nc_stdscr_pseudo_panel); - if (!(win->_flags & _ISPAD) && (pan = (PANEL *) malloc(sizeof(PANEL)))) + if (!(win->_flags & _ISPAD) && (pan = typeMalloc(PANEL, 1))) { pan->win = win; pan->above = (PANEL *) 0; diff --git a/contrib/ncurses/panel/p_replace.c b/contrib/ncurses/panel/p_replace.c index 5d0d295c8b17..d3733ed22e2f 100644 --- a/contrib/ncurses/panel/p_replace.c +++ b/contrib/ncurses/panel/p_replace.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,23 +36,25 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_replace.c,v 1.9 2005/02/19 16:41:31 tom Exp $") +MODULE_ID("$Id: p_replace.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) replace_panel(PANEL * pan, WINDOW *win) { - T((T_CALLED("replace_panel(%p,%p)"), pan, win)); + int rc = ERR; - if (!pan) - returnCode(ERR); + T((T_CALLED("replace_panel(%p,%p)"), (void *)pan, (void *)win)); - if (IS_LINKED(pan)) + if (pan) { - Touchpan(pan); - PANEL_UPDATE(pan, (PANEL *) 0); + GetHook(pan); + if (IS_LINKED(pan)) + { + Touchpan(pan); + PANEL_UPDATE(pan, (PANEL *) 0); + } + pan->win = win; + rc = OK; } - - pan->win = win; - - returnCode(OK); + returnCode(rc); } diff --git a/contrib/ncurses/panel/p_show.c b/contrib/ncurses/panel/p_show.c index 35eee237b958..d5b09bd94260 100644 --- a/contrib/ncurses/panel/p_show.c +++ b/contrib/ncurses/panel/p_show.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,34 +36,37 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_show.c,v 1.11 2005/02/19 16:42:02 tom Exp $") +MODULE_ID("$Id: p_show.c,v 1.13 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) show_panel(PANEL * pan) { - int err = OK; + int err = ERR; - T((T_CALLED("show_panel(%p)"), pan)); + T((T_CALLED("show_panel(%p)"), (void *)pan)); - if (!pan) - returnCode(ERR); + if (pan) + { + GetHook(pan); - if (Is_Top(pan)) - returnCode(OK); + if (Is_Top(pan)) + returnCode(OK); - dBug(("--> show_panel %s", USER_PTR(pan->user))); + dBug(("--> show_panel %s", USER_PTR(pan->user))); - HIDE_PANEL(pan, err, OK); + HIDE_PANEL(pan, err, OK); - dStack("", 1, pan); - assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); + dStack("", 1, pan); + assert(_nc_bottom_panel == _nc_stdscr_pseudo_panel); - _nc_top_panel->above = pan; - pan->below = _nc_top_panel; - pan->above = (PANEL *) 0; - _nc_top_panel = pan; + _nc_top_panel->above = pan; + pan->below = _nc_top_panel; + pan->above = (PANEL *) 0; + _nc_top_panel = pan; - dStack("", 9, pan); + err = OK; - returnCode(OK); + dStack("", 9, pan); + } + returnCode(err); } diff --git a/contrib/ncurses/panel/p_top.c b/contrib/ncurses/panel/p_top.c index 8bd1d9fb3fec..fdcdee9afcdc 100644 --- a/contrib/ncurses/panel/p_top.c +++ b/contrib/ncurses/panel/p_top.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_top.c,v 1.5 2005/02/19 16:42:23 tom Exp $") +MODULE_ID("$Id: p_top.c,v 1.6 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(int) top_panel(PANEL * pan) { - T((T_CALLED("top_panel(%p)"), pan)); + T((T_CALLED("top_panel(%p)"), (void *)pan)); returnCode(show_panel(pan)); } diff --git a/contrib/ncurses/panel/p_update.c b/contrib/ncurses/panel/p_update.c index 5967718160ff..a2f45063cf5c 100644 --- a/contrib/ncurses/panel/p_update.c +++ b/contrib/ncurses/panel/p_update.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1997-1999,2008 * ****************************************************************************/ /* p_update.c @@ -36,28 +37,42 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_update.c,v 1.9 2005/02/19 16:49:47 tom Exp $") +MODULE_ID("$Id: p_update.c,v 1.11 2010/01/23 21:22:16 tom Exp $") NCURSES_EXPORT(void) -update_panels(void) +NCURSES_SP_NAME(update_panels) (NCURSES_SP_DCL0) { PANEL *pan; - T((T_CALLED("update_panels()"))); + T((T_CALLED("update_panels(%p)"), (void *)SP_PARM)); dBug(("--> update_panels")); - pan = _nc_bottom_panel; - while (pan && pan->above) - { - PANEL_UPDATE(pan, pan->above); - pan = pan->above; - } - pan = _nc_bottom_panel; - while (pan) + if (SP_PARM) { - Wnoutrefresh(pan); - pan = pan->above; + GetScreenHook(SP_PARM); + + pan = _nc_bottom_panel; + while (pan && pan->above) + { + PANEL_UPDATE(pan, pan->above); + pan = pan->above; + } + + pan = _nc_bottom_panel; + while (pan) + { + Wnoutrefresh(pan); + pan = pan->above; + } } returnVoid; } + +#if NCURSES_SP_FUNCS +NCURSES_EXPORT(void) +update_panels(void) +{ + NCURSES_SP_NAME(update_panels) (CURRENT_SCREEN); +} +#endif diff --git a/contrib/ncurses/panel/p_user.c b/contrib/ncurses/panel/p_user.c index ffa25f85ae12..deb5bdf7e4c5 100644 --- a/contrib/ncurses/panel/p_user.c +++ b/contrib/ncurses/panel/p_user.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,12 +36,12 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_user.c,v 1.6 2005/02/19 16:52:44 tom Exp $") +MODULE_ID("$Id: p_user.c,v 1.8 2010/01/23 23:18:35 tom Exp $") NCURSES_EXPORT(int) set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) { - T((T_CALLED("set_panel_userptr(%p,%p)"), pan, uptr)); + T((T_CALLED("set_panel_userptr(%p,%p)"), (void *)pan, (NCURSES_CONST void *)uptr)); if (!pan) returnCode(ERR); pan->user = uptr; @@ -51,6 +51,6 @@ set_panel_userptr(PANEL * pan, NCURSES_CONST void *uptr) NCURSES_EXPORT(NCURSES_CONST void *) panel_userptr(const PANEL * pan) { - T((T_CALLED("panel_userptr(%p)"), pan)); + T((T_CALLED("panel_userptr(%p)"), (const void *)pan)); returnCVoidPtr(pan ? pan->user : (NCURSES_CONST void *)0); } diff --git a/contrib/ncurses/panel/p_win.c b/contrib/ncurses/panel/p_win.c index e7d2cea8e3fe..6643d5c2671f 100644 --- a/contrib/ncurses/panel/p_win.c +++ b/contrib/ncurses/panel/p_win.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2005,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,11 +36,11 @@ */ #include "panel.priv.h" -MODULE_ID("$Id: p_win.c,v 1.5 2005/02/19 16:44:16 tom Exp $") +MODULE_ID("$Id: p_win.c,v 1.6 2010/01/23 21:22:15 tom Exp $") NCURSES_EXPORT(WINDOW *) panel_window(const PANEL * pan) { - T((T_CALLED("panel_window(%p)"), pan)); + T((T_CALLED("panel_window(%p)"), (const void *)pan)); returnWin(pan ? pan->win : (WINDOW *)0); } diff --git a/contrib/ncurses/panel/panel.c b/contrib/ncurses/panel/panel.c index 16a8083d64b2..96cbbab77400 100644 --- a/contrib/ncurses/panel/panel.c +++ b/contrib/ncurses/panel/panel.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2004,2005 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,12 +29,14 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1996-1999,2008 * + * and: Thomas E. Dickey * ****************************************************************************/ /* panel.c -- implementation of panels library, some core routines */ #include "panel.priv.h" -MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") +MODULE_ID("$Id: panel.c,v 1.25 2010/01/23 21:22:16 tom Exp $") /*+------------------------------------------------------------------------- _nc_retrace_panel (pan) @@ -43,7 +45,7 @@ MODULE_ID("$Id: panel.c,v 1.23 2005/02/19 18:04:31 tom Exp $") NCURSES_EXPORT(PANEL *) _nc_retrace_panel(PANEL * pan) { - T((T_RETURN("%p"), pan)); + T((T_RETURN("%p"), (void *)pan)); return pan; } #endif @@ -91,6 +93,8 @@ _nc_dStack(const char *fmt, int num, const PANEL * pan) { char s80[80]; + GetPanelHook(pan); + sprintf(s80, fmt, num, pan); _tracef("%s b=%s t=%s", s80, (_nc_bottom_panel) ? USER_PTR(_nc_bottom_panel->user) : "--", diff --git a/contrib/ncurses/panel/panel.h b/contrib/ncurses/panel/panel.h index 1e02091d97f2..6ed2061d1ff8 100644 --- a/contrib/ncurses/panel/panel.h +++ b/contrib/ncurses/panel/panel.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2006 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -29,9 +29,10 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1995 * * and: Eric S. Raymond * + * and: Juergen Pfeifer 1996-1999,2008 * ****************************************************************************/ -/* $Id: panel.h,v 1.10 2006/05/27 19:49:40 tom Exp $ */ +/* $Id: panel.h,v 1.11 2009/04/11 19:50:40 tom Exp $ */ /* panel.h -- interface file for panels library */ @@ -68,6 +69,13 @@ extern NCURSES_EXPORT(int) move_panel (PANEL *, int, int); extern NCURSES_EXPORT(int) replace_panel (PANEL *,WINDOW *); extern NCURSES_EXPORT(int) panel_hidden (const PANEL *); +#if NCURSES_SP_FUNCS +extern NCURSES_EXPORT(PANEL *) ground_panel(SCREEN *); +extern NCURSES_EXPORT(PANEL *) ceiling_panel(SCREEN *); + +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(update_panels) (SCREEN*); +#endif + #if defined(__cplusplus) } #endif diff --git a/contrib/ncurses/panel/panel.priv.h b/contrib/ncurses/panel/panel.priv.h index 4fb8144e1b77..ce4f98937fc9 100644 --- a/contrib/ncurses/panel/panel.priv.h +++ b/contrib/ncurses/panel/panel.priv.h @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ -/* $Id: panel.priv.h,v 1.22 2008/09/27 22:36:11 tom Exp $ */ +/* $Id: panel.priv.h,v 1.23 2009/04/11 20:33:55 tom Exp $ */ #ifndef NCURSES_PANEL_PRIV_H #define NCURSES_PANEL_PRIV_H 1 @@ -39,9 +39,11 @@ #include #include -#include "curses.priv.h" +struct screen; /* forward declaration */ + +#include "curses.priv.h" /* includes nc_panel.h */ #include "panel.h" -#include + #if USE_RCS_IDS # define MODULE_ID(id) static const char Ident[] = id; @@ -83,14 +85,38 @@ # define Touchline(pan,start,count) touchline((pan)->win,start,count) #endif -#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel -#define _nc_top_panel _nc_panelhook()->top_panel -#define _nc_bottom_panel _nc_panelhook()->bottom_panel +#if NCURSES_SP_FUNCS +#define GetScreenHook(sp) \ + struct panelhook* ph = NCURSES_SP_NAME(_nc_panelhook)(sp) +#define GetPanelHook(pan) \ + GetScreenHook(_nc_screen_of((pan)->win)) +#define GetWindowHook(win) \ + SCREEN* sp = _nc_screen_of(win); \ + GetScreenHook(sp) +#define GetHook(pan) SCREEN* sp = _nc_screen_of(pan->win); \ + GetScreenHook(sp) -#define EMPTY_STACK() (_nc_top_panel==_nc_bottom_panel) -#define Is_Bottom(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above==(p))) -#define Is_Top(p) (((p)!=(PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel==(p))) -#define Is_Pseudo(p) ((p) && ((p)==_nc_bottom_panel)) +#define _nc_stdscr_pseudo_panel ((ph)->stdscr_pseudo_panel) +#define _nc_top_panel ((ph)->top_panel) +#define _nc_bottom_panel ((ph)->bottom_panel) + +#else /* !NCURSES_SP_FUNCS */ + +#define GetScreenHook(sp) /* nothing */ +#define GetPanelHook(pan) /* nothing */ +#define GetWindowHook(win) /* nothing */ +#define GetHook(pan) /* nothing */ + +#define _nc_stdscr_pseudo_panel _nc_panelhook()->stdscr_pseudo_panel +#define _nc_top_panel _nc_panelhook()->top_panel +#define _nc_bottom_panel _nc_panelhook()->bottom_panel + +#endif /* NCURSES_SP_FUNCS */ + +#define EMPTY_STACK() (_nc_top_panel == _nc_bottom_panel) +#define Is_Bottom(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_bottom_panel->above == (p))) +#define Is_Top(p) (((p) != (PANEL*)0) && !EMPTY_STACK() && (_nc_top_panel == (p))) +#define Is_Pseudo(p) (((p) != (PANEL*)0) && ((p) == _nc_bottom_panel)) /*+------------------------------------------------------------------------- IS_LINKED(pan) - check to see if panel is in the stack @@ -122,7 +148,7 @@ ix2 = (PENDX(pan1) < PENDX(pan2)) ? PENDX(pan1) : PENDX(pan2);\ iy1 = (PSTARTY(pan1) < PSTARTY(pan2)) ? PSTARTY(pan2) : PSTARTY(pan1);\ iy2 = (PENDY(pan1) < PENDY(pan2)) ? PENDY(pan1) : PENDY(pan2);\ - assert((ix1<=ix2) && (iy1<=iy2));\ + assert((ix1<=ix2) && (iy1<=iy2)) /*+------------------------------------------------------------------------- @@ -136,12 +162,12 @@ { PANEL* pan2 = ((panstart) ? (panstart) : _nc_bottom_panel);\ while(pan2) {\ if ((pan2 != pan) && PANELS_OVERLAPPED(pan,pan2)) {\ - int y,ix1,ix2,iy1,iy2;\ - COMPUTE_INTERSECTION(pan,pan2,ix1,ix2,iy1,iy2);\ + int y, ix1, ix2, iy1, iy2;\ + COMPUTE_INTERSECTION(pan, pan2, ix1, ix2, iy1, iy2);\ for(y = iy1; y <= iy2; y++) {\ if (is_linetouched(pan->win,y - PSTARTY(pan))) {\ struct ldat* line = &(pan2->win->_line[y - PSTARTY(pan2)]);\ - CHANGED_RANGE(line,ix1-PSTARTX(pan2),ix2-PSTARTX(pan2));\ + CHANGED_RANGE(line, ix1 - PSTARTX(pan2), ix2 - PSTARTX(pan2));\ }\ }\ }\ @@ -180,4 +206,9 @@ err = err_if_unlinked;\ } +#if NCURSES_SP_FUNCS +/* These may become later renamed and part of panel.h and the public API */ +extern NCURSES_EXPORT(void) NCURSES_SP_NAME(_nc_update_panels)(SCREEN*); +#endif + #endif /* NCURSES_PANEL_PRIV_H */ diff --git a/contrib/ncurses/progs/Makefile.in b/contrib/ncurses/progs/Makefile.in index 886fd5be2465..bdb8a0f04898 100644 --- a/contrib/ncurses/progs/Makefile.in +++ b/contrib/ncurses/progs/Makefile.in @@ -1,6 +1,6 @@ -# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $ +# $Id: Makefile.in,v 1.85 2010/11/27 21:45:27 tom Exp $ ############################################################################## -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -43,6 +43,7 @@ .SUFFIXES: SHELL = /bin/sh +VPATH = @srcdir@ THIS = Makefile CF_MFLAGS = @cf_cv_makeflags@ @@ -76,6 +77,9 @@ transform = @program_transform_name@ AWK = @AWK@ LN_S = @LN_S@ +CTAGS = @CTAGS@ +ETAGS = @ETAGS@ + CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ @@ -124,7 +128,7 @@ AUTO_SRC = \ transform.h # tic relies on direct access to the terminfo database -GET_PROGS = infocmp$x clear$x tput$x tset$x toe$x +GET_PROGS = infocmp$x clear$x tabs$x tput$x tset$x toe$x PUT_PROGS = @MAKE_TERMINFO@ tic$x PROGS = $(PUT_PROGS) $(GET_PROGS) @@ -159,6 +163,7 @@ actual_infocmp = `echo infocmp$x| $(TRANSFORM)` actual_infotocap = `echo infotocap$x| $(TRANSFORM)` actual_init = `echo init$x| $(TRANSFORM)` actual_reset = `echo reset$x| $(TRANSFORM)` +actual_tabs = `echo tabs$x| $(TRANSFORM)` actual_tic = `echo tic$x| $(TRANSFORM)` actual_toe = `echo toe$x| $(TRANSFORM)` actual_tput = `echo tput$x| $(TRANSFORM)` @@ -171,10 +176,16 @@ define_init = `echo init| $(TRANSFORM)` define_reset = `echo reset| $(TRANSFORM)` transform.h : - echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >$@ - echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ - echo "#define PROG_RESET \"$(define_reset)\"" >>$@ - echo "#define PROG_INIT \"$(define_init)\"" >>$@ + echo "#ifndef __TRANSFORM_H" >$@ + echo "#define __TRANSFORM_H 1" >>$@ + echo "#include " >>$@ + echo "extern bool same_program(const char *, const char *);" >>$@ + -sh -c 'if test -n "$x" ; then echo "#define SUFFIX_IGNORED \"$x\"">>$@; fi' + echo "#define PROG_CAPTOINFO \"$(define_captoinfo)\"" >>$@ + echo "#define PROG_INFOTOCAP \"$(define_infotocap)\"" >>$@ + echo "#define PROG_RESET \"$(define_reset)\"" >>$@ + echo "#define PROG_INIT \"$(define_init)\"" >>$@ + echo "#endif /* __TRANSFORM_H */" >>$@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ $(LIBTOOL_INSTALL) $(INSTALL_PROG) tic$x $(DESTDIR)$(bindir)/$(actual_tic) @@ -187,6 +198,7 @@ install.progs: $(AUTO_SRC) $(PROGS) $(DESTDIR)$(bindir) @MAKE_TERMINFO@ (cd $(DESTDIR)$(bindir) && $(LN_S) $(actual_tic) $(actual_captoinfo)) $(LIBTOOL_INSTALL) $(INSTALL_PROG) infocmp$x $(DESTDIR)$(bindir)/$(actual_infocmp) $(LIBTOOL_INSTALL) $(INSTALL_PROG) clear$x $(DESTDIR)$(bindir)/$(actual_clear) + $(LIBTOOL_INSTALL) $(INSTALL_PROG) tabs$x $(DESTDIR)$(bindir)/$(actual_tabs) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tput$x $(DESTDIR)$(bindir)/$(actual_tput) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tset$x $(DESTDIR)$(bindir)/$(actual_tset) @echo "linking $(actual_reset) to $(actual_tset)" @@ -200,12 +212,13 @@ uninstall.progs: @MAKE_TERMINFO@ -@rm -f $(DESTDIR)$(bindir)/$(actual_infotocap) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_infocmp) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_clear) + -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tabs) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tput) -@$(LIBTOOL_CLEAN) rm -f $(DESTDIR)$(bindir)/$(actual_tset) -@rm -f $(DESTDIR)$(bindir)/$(actual_reset) $(DESTDIR)$(bindir) : - sh $(srcdir)/../mkdirs.sh $@ + mkdir -p $@ # # Utilities normally built by make all start here @@ -213,7 +226,8 @@ $(DESTDIR)$(bindir) : DEPS_TIC = \ $(MODEL)/tic$o \ - $(MODEL)/dump_entry$o + $(MODEL)/dump_entry$o \ + $(MODEL)/transform$o tic$x: $(DEPS_TIC) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TIC) $(LDFLAGS_TIC) -o $@ @@ -230,8 +244,15 @@ DEPS_CLEAR = \ clear$x: $(DEPS_CLEAR) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_CLEAR) $(LDFLAGS_TINFO) -o $@ +DEPS_TABS = \ + $(MODEL)/tabs$o + +tabs$x: $(DEPS_TABS) $(DEPS_TABS) + @ECHO_LINK@ $(LINK) $(DEPS_TABS) $(LDFLAGS_TINFO) -o $@ + DEPS_TPUT = \ - $(MODEL)/tput$o + $(MODEL)/tput$o \ + $(MODEL)/transform$o tput$x: $(DEPS_TPUT) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TPUT) $(LDFLAGS_TINFO) -o $@ @@ -244,7 +265,8 @@ infocmp$x: $(DEPS_INFOCMP) $(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_INFOCMP) $(LDFLAGS_TIC) -o $@ DEPS_TSET = \ - $(MODEL)/tset$o + $(MODEL)/tset$o \ + $(MODEL)/transform$o tset$x: $(DEPS_TSET) $(DEPS_CURSES) transform.h @ECHO_LINK@ $(LINK) $(DEPS_TSET) $(LDFLAGS_TINFO) -o $@ @@ -257,10 +279,10 @@ termsort.c: $(srcdir)/MKtermsort.sh # tags: - ctags *.[ch] + $(CTAGS) *.[ch] @MAKE_UPPER_TAGS@TAGS: -@MAKE_UPPER_TAGS@ etags *.[ch] +@MAKE_UPPER_TAGS@ $(ETAGS) *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.ln *.atac trace @@ -289,6 +311,7 @@ lint: @MAKE_TERMINFO@ $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/toe.c $(srcdir)/dump_entry.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/clear.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/infocmp.c $(srcdir)/dump_entry.c $(LINT_LIBS) + $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tabs.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tput.c $(LINT_LIBS) $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/tset.c $(srcdir)/dump_entry.c $(LINT_LIBS) diff --git a/contrib/ncurses/progs/dump_entry.c b/contrib/ncurses/progs/dump_entry.c index bd2422008bf7..485bbbd91d64 100644 --- a/contrib/ncurses/progs/dump_entry.c +++ b/contrib/ncurses/progs/dump_entry.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.88 2008/08/04 12:36:12 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.89 2010/05/01 22:04:08 tom Exp $") #define INDENT 8 #define DISCARD(string) string = ABSENT_STRING @@ -1040,7 +1040,7 @@ dump_entry(TERMTYPE *tterm, save_sgr = set_attributes; - if (((len = FMT_ENTRY()) > critlen) + if ((FMT_ENTRY() > critlen) && limited) { save_tterm = *tterm; @@ -1049,7 +1049,7 @@ dump_entry(TERMTYPE *tterm, critlen); suppress_untranslatable = TRUE; } - if ((len = FMT_ENTRY()) > critlen) { + if (FMT_ENTRY() > critlen) { /* * We pick on sgr because it's a nice long string capability that * is really just an optimization hack. Another good candidate is @@ -1075,7 +1075,7 @@ dump_entry(TERMTYPE *tterm, critlen); } changed = TRUE; - if ((len = FMT_ENTRY()) <= critlen) + if (FMT_ENTRY() <= critlen) break; } } @@ -1086,7 +1086,7 @@ dump_entry(TERMTYPE *tterm, critlen); changed = TRUE; } - if (!changed || ((len = FMT_ENTRY()) > critlen)) { + if (!changed || (FMT_ENTRY() > critlen)) { if (purged_acs(tterm)) { acs_chars = ABSENT_STRING; SHOW_WHY("# (acsc removed to fit entry within %d bytes)\n", @@ -1094,7 +1094,7 @@ dump_entry(TERMTYPE *tterm, changed = TRUE; } } - if (!changed || ((len = FMT_ENTRY()) > critlen)) { + if (!changed || (FMT_ENTRY() > critlen)) { int oldversion = tversion; tversion = V_BSD; @@ -1130,7 +1130,7 @@ dump_entry(TERMTYPE *tterm, } else if (!version_filter(STRING, STR_IDX(acs_chars))) { save_tterm = *tterm; if (purged_acs(tterm)) { - len = FMT_ENTRY(); + (void) FMT_ENTRY(); } *tterm = save_tterm; } diff --git a/contrib/ncurses/progs/infocmp.c b/contrib/ncurses/progs/infocmp.c index 84989ffc63d4..2af9cb50b1d7 100644 --- a/contrib/ncurses/progs/infocmp.c +++ b/contrib/ncurses/progs/infocmp.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -42,7 +42,7 @@ #include -MODULE_ID("$Id: infocmp.c,v 1.103 2008/08/16 22:04:56 tom Exp $") +MODULE_ID("$Id: infocmp.c,v 1.105 2010/05/01 22:04:08 tom Exp $") #define L_CURL "{" #define R_CURL "}" @@ -894,8 +894,6 @@ file_comparison(int argc, char *argv[]) (void) printf("The following entries are equivalent:\n"); for (qp = heads[0]; qp; qp = qp->next) { - rp = qp->crosslinks[0]; - if (qp->ncrosslinks == 1) { rp = qp->crosslinks[0]; @@ -1255,6 +1253,15 @@ terminal_env(void) * ***************************************************************************/ +#if NO_LEAKS +#define MAIN_LEAKS() \ + free(myargv); \ + free(tfile); \ + free(tname) +#else +#define MAIN_LEAKS() /* nothing */ +#endif + int main(int argc, char *argv[]) { @@ -1514,6 +1521,7 @@ main(int argc, char *argv[]) #else (void) fprintf(stderr, "%s: terminfo files not supported\n", _nc_progname); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); #endif } else { @@ -1526,7 +1534,6 @@ main(int argc, char *argv[]) status = _nc_read_entry(tname[termcount], tfile[termcount], &entries[termcount].tterm); - directory = TERMINFO; /* for error message */ } if (status <= 0) { @@ -1534,6 +1541,7 @@ main(int argc, char *argv[]) "%s: couldn't open terminfo file %s.\n", _nc_progname, tfile[termcount]); + MAIN_LEAKS(); ExitProgram(EXIT_FAILURE); } repair_acsc(&entries[termcount].tterm); @@ -1642,11 +1650,7 @@ main(int argc, char *argv[]) else file_comparison(argc - optind, argv + optind); -#if NO_LEAKS - free(myargv); - free(tfile); - free(tname); -#endif + MAIN_LEAKS(); ExitProgram(EXIT_SUCCESS); } diff --git a/contrib/ncurses/progs/modules b/contrib/ncurses/progs/modules index 3b4f3b602369..55d7a9fb9694 100644 --- a/contrib/ncurses/progs/modules +++ b/contrib/ncurses/progs/modules @@ -1,7 +1,7 @@ -# $Id: modules,v 1.13 2006/12/24 00:53:21 tom Exp $ +# $Id: modules,v 1.17 2010/01/23 17:47:23 tom Exp $ # Program modules (some are in ncurses lib!) ############################################################################## -# Copyright (c) 1998-2005,2006 Free Software Foundation, Inc. # +# Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # @@ -34,10 +34,12 @@ @ base clear progs $(srcdir) $(HEADER_DEPS) tic progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h -toe progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h +toe progs $(srcdir) $(HEADER_DEPS) $(INCDIR)/hashed_db.h dump_entry progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h ../include/parametrized.h $(INCDIR)/capdefaults.c termsort.c infocmp progs $(srcdir) $(HEADER_DEPS) $(srcdir)/dump_entry.h -tput progs $(srcdir) $(HEADER_DEPS) transform.h termsort.c +tabs progs $(srcdir) $(HEADER_DEPS) +tput progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h termsort.c tset progs $(srcdir) $(HEADER_DEPS) transform.h $(srcdir)/dump_entry.h ../include/termcap.h +transform progs $(srcdir) $(HEADER_DEPS) transform.h # vile:makemode diff --git a/contrib/ncurses/progs/tabs.c b/contrib/ncurses/progs/tabs.c new file mode 100644 index 000000000000..b59c9086d8d3 --- /dev/null +++ b/contrib/ncurses/progs/tabs.c @@ -0,0 +1,510 @@ +/**************************************************************************** + * Copyright (c) 2008-2009,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey 2008 * + ****************************************************************************/ + +/* + * tabs.c -- set terminal hard-tabstops + */ + +#define USE_LIBTINFO +#include + +MODULE_ID("$Id: tabs.c,v 1.19 2010/10/23 22:26:01 tom Exp $") + +static void usage(void) GCC_NORETURN; + +static int max_cols; + +static int +putch(int c) +{ + return putchar(c); +} + +static void +do_tabs(int *tab_list) +{ + int last = 1; + int stop; + + putchar('\r'); + while ((stop = *tab_list++) > 0) { + if (last < stop) { + while (last++ < stop) { + if (last > max_cols) + break; + putchar(' '); + } + } + if (stop <= max_cols) { + tputs(tparm(set_tab, stop), 1, putch); + last = stop; + } else { + break; + } + } + putchar('\n'); +} + +static int * +decode_tabs(const char *tab_list) +{ + int *result = typeCalloc(int, strlen(tab_list) + (unsigned) max_cols); + int n = 0; + int value = 0; + int prior = 0; + int ch; + + if (result != 0) { + while ((ch = *tab_list++) != '\0') { + if (isdigit(UChar(ch))) { + value *= 10; + value += (ch - '0'); + } else if (ch == ',') { + result[n] = value + prior; + if (n > 0 && result[n] <= result[n - 1]) { + fprintf(stderr, + "tab-stops are not in increasing order: %d %d\n", + value, result[n - 1]); + free(result); + result = 0; + break; + } + ++n; + value = 0; + prior = 0; + } else if (ch == '+') { + if (n) + prior = result[n - 1]; + } + } + } + + if (result != 0) { + /* + * If there is only one value, then it is an option such as "-8". + */ + if ((n == 0) && (value > 0)) { + int step = value; + while (n < max_cols - 1) { + result[n++] = value; + value += step; + } + } + + /* + * Add the last value, if any. + */ + result[n++] = value + prior; + result[n] = 0; + } + return result; +} + +static void +print_ruler(int *tab_list) +{ + int last = 0; + int stop; + int n; + + /* first print a readable ruler */ + for (n = 0; n < max_cols; n += 10) { + int ch = 1 + (n / 10); + char buffer[20]; + sprintf(buffer, "----+----%c", + ((ch < 10) + ? (ch + '0') + : (ch + 'A' - 10))); + printf("%.*s", ((max_cols - n) > 10) ? 10 : (max_cols - n), buffer); + } + putchar('\n'); + + /* now, print '*' for each stop */ + for (n = 0, last = 0; (tab_list[n] > 0) && (last < max_cols); ++n) { + stop = tab_list[n]; + while (++last < stop) { + if (last <= max_cols) { + putchar('-'); + } else { + break; + } + } + if (last <= max_cols) { + putchar('*'); + last = stop; + } else { + break; + } + } + while (++last <= max_cols) + putchar('-'); + putchar('\n'); +} + +/* + * Write an '*' on each tabstop, to demonstrate whether it lines up with the + * ruler. + */ +static void +write_tabs(int *tab_list) +{ + int stop; + + while ((stop = *tab_list++) > 0 && stop <= max_cols) { + fputs((stop == 1) ? "*" : "\t*", stdout); + }; + /* also show a tab _past_ the stops */ + if (stop < max_cols) + fputs("\t+", stdout); + putchar('\n'); +} + +/* + * Trim leading/trailing blanks, as well as blanks after a comma. + * Convert embedded blanks to commas. + */ +static char * +trimmed_tab_list(const char *source) +{ + char *result = strdup(source); + int ch, j, k, last; + + if (result != 0) { + for (j = k = last = 0; result[j] != 0; ++j) { + ch = UChar(result[j]); + if (isspace(ch)) { + if (last == '\0') { + continue; + } else if (isdigit(last) || last == ',') { + ch = ','; + } + } else if (ch == ',') { + ; + } else { + if (last == ',') + result[k++] = (char) last; + result[k++] = (char) ch; + } + last = ch; + } + result[k] = '\0'; + } + return result; +} + +static bool +comma_is_needed(const char *source) +{ + bool result = FALSE; + + if (source != 0) { + unsigned len = strlen(source); + if (len != 0) + result = (source[len - 1] != ','); + } else { + result = FALSE; + } + return result; +} + +/* + * Add a command-line parameter to the tab-list. It can be blank- or comma- + * separated (or a mixture). For simplicity, empty tabs are ignored, e.g., + * tabs 1,,6,11 + * tabs 1,6,11 + * are treated the same. + */ +static const char * +add_to_tab_list(char **append, const char *value) +{ + char *result = *append; + char *copied = trimmed_tab_list(value); + + if (copied != 0 && *copied != '\0') { + const char *comma = ","; + unsigned need = 1 + strlen(copied); + + if (*copied == ',') + comma = ""; + else if (!comma_is_needed(*append)) + comma = ""; + + need += strlen(comma); + if (*append != 0) + need += strlen(*append); + + result = malloc(need); + if (result != 0) { + *result = '\0'; + if (*append != 0) { + strcpy(result, *append); + free(*append); + } + strcat(result, comma); + strcat(result, copied); + } + + *append = result; + } + return result; +} + +/* + * Check for illegal characters in the tab-list. + */ +static bool +legal_tab_list(const char *program, const char *tab_list) +{ + bool result = TRUE; + + if (tab_list != 0 && *tab_list != '\0') { + if (comma_is_needed(tab_list)) { + int n, ch; + for (n = 0; tab_list[n] != '\0'; ++n) { + ch = UChar(tab_list[n]); + if (!(isdigit(ch) || ch == ',' || ch == '+')) { + fprintf(stderr, + "%s: unexpected character found '%c'\n", + program, ch); + result = FALSE; + break; + } + } + } else { + fprintf(stderr, "%s: trailing comma found '%s'\n", program, tab_list); + result = FALSE; + } + } else { + fprintf(stderr, "%s: no tab-list given\n", program); + result = FALSE; + } + return result; +} + +static void +usage(void) +{ + static const char *msg[] = + { + "Usage: tabs [options] [tabstop-list]" + ,"" + ,"Options:" + ," -0 reset tabs" + ," -8 set tabs to standard interval" + ," -a Assembler, IBM S/370, first format" + ," -a2 Assembler, IBM S/370, second format" + ," -c COBOL, normal format" + ," -c2 COBOL compact format" + ," -c3 COBOL compact format extended" + ," -d debug (show ruler with expected/actual tab positions)" + ," -f FORTRAN" + ," -n no-op (do not modify terminal settings)" + ," -p PL/I" + ," -s SNOBOL" + ," -u UNIVAC 1100 Assembler" + ," -T name use terminal type 'name'" + ,"" + ,"A tabstop-list is an ordered list of column numbers, e.g., 1,11,21" + ,"or 1,+10,+10 which is the same." + }; + unsigned n; + + fflush(stdout); + for (n = 0; n < SIZEOF(msg); ++n) { + fprintf(stderr, "%s\n", msg[n]); + } + ExitProgram(EXIT_FAILURE); +} + +int +main(int argc, char *argv[]) +{ + int rc = EXIT_FAILURE; + bool debug = FALSE; + bool no_op = FALSE; + int n, ch; + NCURSES_CONST char *term_name = 0; + const char *mar_list = 0; /* ignored */ + char *append = 0; + const char *tab_list = 0; + + if ((term_name = getenv("TERM")) == 0) + term_name = "ansi+tabs"; + + /* cannot use getopt, since some options are two-character */ + for (n = 1; n < argc; ++n) { + char *option = argv[n]; + switch (option[0]) { + case '-': + while ((ch = *++option) != '\0') { + switch (ch) { + case 'a': + switch (*option) { + case '\0': + tab_list = "1,10,16,36,72"; + /* Assembler, IBM S/370, first format */ + break; + case '2': + tab_list = "1,10,16,40,72"; + /* Assembler, IBM S/370, second format */ + break; + default: + usage(); + } + break; + case 'c': + switch (*option) { + case '\0': + tab_list = "1,8,12,16,20,55"; + /* COBOL, normal format */ + break; + case '2': + tab_list = "1,6,10,14,49"; + /* COBOL compact format */ + break; + case '3': + tab_list = "1,6,10,14,18,22,26,30,34,38,42,46,50,54,58,62,67"; + /* COBOL compact format extended */ + break; + default: + usage(); + } + break; + case 'd': /* ncurses extension */ + debug = TRUE; + break; + case 'f': + tab_list = "1,7,11,15,19,23"; + /* FORTRAN */ + break; + case 'n': /* ncurses extension */ + no_op = TRUE; + break; + case 'p': + tab_list = "1,5,9,13,17,21,25,29,33,37,41,45,49,53,57,61"; + /* PL/I */ + break; + case 's': + tab_list = "1,10,55"; + /* SNOBOL */ + break; + case 'u': + tab_list = "1,12,20,44"; + /* UNIVAC 1100 Assembler */ + break; + case 'T': + ++n; + if (*++option != '\0') { + term_name = option; + } else { + term_name = argv[n++]; + } + option += ((int) strlen(option)) - 1; + continue; + default: + if (isdigit(UChar(*option))) { + tab_list = option; + ++n; + } else { + usage(); + } + option += ((int) strlen(option)) - 1; + break; + } + } + break; + case '+': + while ((ch = *++option) != '\0') { + switch (ch) { + case 'm': + mar_list = option; + break; + default: + /* special case of relative stops separated by spaces? */ + if (option == argv[n] + 1) { + tab_list = add_to_tab_list(&append, argv[n]); + } + break; + } + } + break; + default: + if (append != 0) { + if (tab_list != (const char *) append) { + /* one of the predefined options was used */ + free(append); + append = 0; + } + } + tab_list = add_to_tab_list(&append, option); + break; + } + } + + setupterm(term_name, STDOUT_FILENO, (int *) 0); + + max_cols = (columns > 0) ? columns : 80; + + if (!VALID_STRING(clear_all_tabs)) { + fprintf(stderr, + "%s: terminal type '%s' cannot reset tabs\n", + argv[0], term_name); + } else if (!VALID_STRING(set_tab)) { + fprintf(stderr, + "%s: terminal type '%s' cannot set tabs\n", + argv[0], term_name); + } else if (legal_tab_list(argv[0], tab_list)) { + int *list = decode_tabs(tab_list); + + if (!no_op) + tputs(clear_all_tabs, 1, putch); + + if (list != 0) { + if (!no_op) + do_tabs(list); + if (debug) { + fflush(stderr); + printf("tabs %s\n", tab_list); + print_ruler(list); + write_tabs(list); + } + free(list); + } else if (debug) { + fflush(stderr); + printf("tabs %s\n", tab_list); + } + rc = EXIT_SUCCESS; + } + if (append != 0) + free(append); + ExitProgram(rc); +} diff --git a/contrib/ncurses/progs/tic.c b/contrib/ncurses/progs/tic.c index 82bc3ea0d789..8e89095fc676 100644 --- a/contrib/ncurses/progs/tic.c +++ b/contrib/ncurses/progs/tic.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.137 2008/09/13 16:59:24 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.147 2011/02/12 18:39:08 tom Exp $") const char *_nc_progname = "tic"; @@ -342,8 +342,15 @@ stripped(char *src) while (isspace(UChar(*src))) src++; if (*src != '\0') { - char *dst = strcpy((char *) malloc(strlen(src) + 1), src); - size_t len = strlen(dst); + char *dst; + size_t len; + + if ((dst = strdup(src)) == NULL) + failed("strdup"); + + assert(dst != 0); + + len = strlen(dst); while (--len != 0 && isspace(UChar(dst[len]))) dst[len] = '\0'; return dst; @@ -495,11 +502,11 @@ main(int argc, char *argv[]) _nc_progname = _nc_rootname(argv[0]); - if ((infodump = (strcmp(_nc_progname, PROG_CAPTOINFO) == 0)) != FALSE) { + if ((infodump = same_program(_nc_progname, PROG_CAPTOINFO)) != FALSE) { outform = F_TERMINFO; sortmode = S_TERMINFO; } - if ((capdump = (strcmp(_nc_progname, PROG_INFOTOCAP) == 0)) != FALSE) { + if ((capdump = same_program(_nc_progname, PROG_INFOTOCAP)) != FALSE) { outform = F_TERMCAP; sortmode = S_TERMCAP; } @@ -757,6 +764,7 @@ main(int argc, char *argv[]) put_translate(fgetc(tmp_fp)); } + repair_acsc(&qp->tterm); dump_entry(&qp->tterm, suppress_untranslatable, limited, numbers, NULL); for (j = 0; j < (int) qp->nuses; j++) @@ -923,6 +931,156 @@ keypad_index(const char *string) return result; } +/* + * list[] is down, up, left, right + * "left" may be ^H rather than \E[D + * "down" may be ^J rather than \E[B + * But up/right are generally consistently escape sequences for ANSI terminals. + */ +static void +check_ansi_cursor(char *list[4]) +{ + int j, k; + int want; + size_t prefix = 0; + size_t suffix; + bool skip[4]; + bool repeated = FALSE; + + for (j = 0; j < 4; ++j) { + skip[j] = FALSE; + for (k = 0; k < j; ++k) { + if (j != k + && !strcmp(list[j], list[k])) { + char *value = _nc_tic_expand(list[k], TRUE, 0); + _nc_warning("repeated cursor control %s\n", value); + repeated = TRUE; + } + } + } + if (!repeated) { + char *up = list[1]; + + if (UChar(up[0]) == '\033') { + if (up[1] == '[') { + prefix = 2; + } else { + prefix = 1; + } + } else if (UChar(up[0]) == UChar('\233')) { + prefix = 1; + } + if (prefix) { + suffix = prefix; + while (up[suffix] && isdigit(UChar(up[suffix]))) + ++suffix; + } + if (prefix && up[suffix] == 'A') { + skip[1] = TRUE; + if (!strcmp(list[0], "\n")) + skip[0] = TRUE; + if (!strcmp(list[2], "\b")) + skip[2] = TRUE; + + for (j = 0; j < 4; ++j) { + if (skip[j] || strlen(list[j]) == 1) + continue; + if (memcmp(list[j], up, prefix)) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent prefix for %s\n", value); + continue; + } + if (strlen(list[j]) < suffix) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent length for %s, expected %d\n", + value, (int) suffix + 1); + continue; + } + want = "BADC"[j]; + if (list[j][suffix] != want) { + char *value = _nc_tic_expand(list[j], TRUE, 0); + _nc_warning("inconsistent suffix for %s, expected %c, have %c\n", + value, want, list[j][suffix]); + } + } + } + } +} + +#define EXPECTED(name) if (!PRESENT(name)) _nc_warning("expected " #name) + +static void +check_cursor(TERMTYPE *tp) +{ + int count; + char *list[4]; + + /* if we have a parameterized form, then the non-parameterized is easy */ + ANDMISSING(parm_down_cursor, cursor_down); + ANDMISSING(parm_up_cursor, cursor_up); + ANDMISSING(parm_left_cursor, cursor_left); + ANDMISSING(parm_right_cursor, cursor_right); + + /* Given any of a set of cursor movement, the whole set should be present. + * Technically this is not true (we could use cursor_address to fill in + * unsupported controls), but it is likely. + */ + count = 0; + if (PRESENT(parm_down_cursor)) { + list[count++] = parm_down_cursor; + } + if (PRESENT(parm_up_cursor)) { + list[count++] = parm_up_cursor; + } + if (PRESENT(parm_left_cursor)) { + list[count++] = parm_left_cursor; + } + if (PRESENT(parm_right_cursor)) { + list[count++] = parm_right_cursor; + } + if (count == 4) { + check_ansi_cursor(list); + } else if (count != 0) { + EXPECTED(parm_down_cursor); + EXPECTED(parm_up_cursor); + EXPECTED(parm_left_cursor); + EXPECTED(parm_right_cursor); + } + + count = 0; + if (PRESENT(cursor_down)) { + list[count++] = cursor_down; + } + if (PRESENT(cursor_up)) { + list[count++] = cursor_up; + } + if (PRESENT(cursor_left)) { + list[count++] = cursor_left; + } + if (PRESENT(cursor_right)) { + list[count++] = cursor_right; + } + if (count == 4) { + check_ansi_cursor(list); + } else if (count != 0) { + count = 0; + if (PRESENT(cursor_down) && strcmp(cursor_down, "\n")) + ++count; + if (PRESENT(cursor_left) && strcmp(cursor_left, "\b")) + ++count; + if (PRESENT(cursor_up) && strlen(cursor_up) > 1) + ++count; + if (PRESENT(cursor_right) && strlen(cursor_right) > 1) + ++count; + if (count) { + EXPECTED(cursor_down); + EXPECTED(cursor_up); + EXPECTED(cursor_left); + EXPECTED(cursor_right); + } + } +} + #define MAX_KP 5 /* * Do a quick sanity-check for vt100-style keypads to see if the 5-key keypad @@ -1032,6 +1190,32 @@ check_keypad(TERMTYPE *tp) } } +static void +check_printer(TERMTYPE *tp) +{ + PAIRED(enter_doublewide_mode, exit_doublewide_mode); + PAIRED(enter_italics_mode, exit_italics_mode); + PAIRED(enter_leftward_mode, exit_leftward_mode); + PAIRED(enter_micro_mode, exit_micro_mode); + PAIRED(enter_shadow_mode, exit_shadow_mode); + PAIRED(enter_subscript_mode, exit_subscript_mode); + PAIRED(enter_superscript_mode, exit_superscript_mode); + PAIRED(enter_upward_mode, exit_upward_mode); + + ANDMISSING(start_char_set_def, stop_char_set_def); + + /* if we have a parameterized form, then the non-parameterized is easy */ + ANDMISSING(set_bottom_margin_parm, set_bottom_margin); + ANDMISSING(set_left_margin_parm, set_left_margin); + ANDMISSING(set_right_margin_parm, set_right_margin); + ANDMISSING(set_top_margin_parm, set_top_margin); + + ANDMISSING(parm_down_micro, micro_down); + ANDMISSING(parm_left_micro, micro_left); + ANDMISSING(parm_right_micro, micro_right); + ANDMISSING(parm_up_micro, micro_up); +} + /* * Returns the expected number of parameters for the given capability. */ @@ -1268,6 +1452,8 @@ similar_sgr(int num, char *a, char *b) } else if (delaying) { a = skip_delay(a); b = skip_delay(b); + } else if ((*b == '0' || (*b == ';')) && *a == 'm') { + b++; } else { a++; } @@ -1343,7 +1529,7 @@ show_where(unsigned level) if (_nc_tracing >= DEBUG_LEVEL(level)) { char my_name[256]; _nc_get_type(my_name); - fprintf(stderr, "\"%s\", line %d, '%s' ", + _tracef("\"%s\", line %d, '%s'", _nc_get_source(), _nc_curr_line, my_name); } @@ -1411,7 +1597,9 @@ check_termtype(TERMTYPE *tp, bool literal) check_acs(tp); check_colors(tp); + check_cursor(tp); check_keypad(tp); + check_printer(tp); /* * These may be mismatched because the terminal description relies on @@ -1432,6 +1620,11 @@ check_termtype(TERMTYPE *tp, bool literal) ANDMISSING(change_scroll_region, save_cursor); ANDMISSING(change_scroll_region, restore_cursor); + /* + * If we can clear tabs, we should be able to initialize them. + */ + ANDMISSING(clear_all_tabs, set_tab); + if (PRESENT(set_attributes)) { char *zero = 0; diff --git a/contrib/ncurses/progs/toe.c b/contrib/ncurses/progs/toe.c index 8af6f371b77b..6f45992f7124 100644 --- a/contrib/ncurses/progs/toe.c +++ b/contrib/ncurses/progs/toe.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include #endif -MODULE_ID("$Id: toe.c,v 1.51 2008/08/16 21:53:25 tom Exp $") +MODULE_ID("$Id: toe.c,v 1.52 2010/05/01 22:04:08 tom Exp $") #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, "..")) @@ -61,6 +61,13 @@ ExitProgram(int code) } #endif +static void +failed(const char *msg) +{ + perror(msg); + ExitProgram(EXIT_FAILURE); +} + #if USE_HASHED_DB static bool make_db_name(char *dst, const char *src, unsigned limit) @@ -184,10 +191,10 @@ typelist(int eargc, char *eargv[], DIRENT *entry; cwd_buf = typeRealloc(char, cwd_len, cwd_buf); - if (cwd_buf == 0) { - perror("realloc cwd_buf"); - continue; - } + if (cwd_buf == 0) + failed("realloc cwd_buf"); + + assert(cwd_buf != 0); strncpy(name_1, subdir->d_name, len)[len] = '\0'; if (isDotname(name_1)) @@ -480,6 +487,10 @@ main(int argc, char *argv[]) } if (!pass) { eargv = typeCalloc(char *, count + 1); + if (eargv == 0) + failed("realloc eargv"); + + assert(eargv != 0); } else { code = typelist((int) count, eargv, header, deschook); while (count-- > 0) diff --git a/contrib/ncurses/progs/tput.c b/contrib/ncurses/progs/tput.c index 022d4940c2a1..2e67cfecbef4 100644 --- a/contrib/ncurses/progs/tput.c +++ b/contrib/ncurses/progs/tput.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -47,7 +47,7 @@ #endif #include -MODULE_ID("$Id: tput.c,v 1.42 2008/07/13 11:05:12 tom Exp $") +MODULE_ID("$Id: tput.c,v 1.46 2010/01/09 16:53:24 tom Exp $") #define PUTS(s) fputs(s, stdout) #define PUTCHAR(c) putchar(c) @@ -86,8 +86,8 @@ usage(void) static void check_aliases(const char *name) { - is_init = (strcmp(name, PROG_INIT) == 0); - is_reset = (strcmp(name, PROG_RESET) == 0); + is_init = same_program(name, PROG_INIT); + is_reset = same_program(name, PROG_RESET); } /* @@ -153,6 +153,9 @@ tput(int argc, char *argv[]) int i, j, c; int status; FILE *f; +#if !PURE_TERMINFO + bool termcap = FALSE; +#endif if ((name = argv[0]) == 0) name = ""; @@ -265,35 +268,40 @@ tput(int argc, char *argv[]) return 0; } #if !PURE_TERMINFO - { - const struct name_table_entry *np; - - if ((np = _nc_find_entry(name, _nc_get_hash_table(1))) != 0) - switch (np->nte_type) { - case BOOLEAN: - if (bool_from_termcap[np->nte_index]) - name = boolnames[np->nte_index]; - break; - - case NUMBER: - if (num_from_termcap[np->nte_index]) - name = numnames[np->nte_index]; - break; - - case STRING: - if (str_from_termcap[np->nte_index]) - name = strnames[np->nte_index]; - break; - } - } + retry: #endif - if ((status = tigetflag(name)) != -1) { return exit_code(BOOLEAN, status); } else if ((status = tigetnum(name)) != CANCELLED_NUMERIC) { (void) printf("%d\n", status); return exit_code(NUMBER, 0); } else if ((s = tigetstr(name)) == CANCELLED_STRING) { +#if !PURE_TERMINFO + if (!termcap) { + const struct name_table_entry *np; + + termcap = TRUE; + if ((np = _nc_find_entry(name, _nc_get_hash_table(termcap))) != 0) { + switch (np->nte_type) { + case BOOLEAN: + if (bool_from_termcap[np->nte_index]) + name = boolnames[np->nte_index]; + break; + + case NUMBER: + if (num_from_termcap[np->nte_index]) + name = numnames[np->nte_index]; + break; + + case STRING: + if (str_from_termcap[np->nte_index]) + name = strnames[np->nte_index]; + break; + } + goto retry; + } + } +#endif quit(4, "unknown terminfo capability '%s'", name); } else if (s != ABSENT_STRING) { if (argc > 1) { diff --git a/contrib/ncurses/progs/transform.c b/contrib/ncurses/progs/transform.c new file mode 100644 index 000000000000..75f4573357c3 --- /dev/null +++ b/contrib/ncurses/progs/transform.c @@ -0,0 +1,79 @@ +/**************************************************************************** + * Copyright (c) 2009,2010 Free Software Foundation, Inc. * + * * + * Permission is hereby granted, free of charge, to any person obtaining a * + * copy of this software and associated documentation files (the * + * "Software"), to deal in the Software without restriction, including * + * without limitation the rights to use, copy, modify, merge, publish, * + * distribute, distribute with modifications, sublicense, and/or sell * + * copies of the Software, and to permit persons to whom the Software is * + * furnished to do so, subject to the following conditions: * + * * + * The above copyright notice and this permission notice shall be included * + * in all copies or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * + * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + * * + * Except as contained in this notice, the name(s) of the above copyright * + * holders shall not be used in advertising or otherwise to promote the * + * sale, use or other dealings in this Software without prior written * + * authorization. * + ****************************************************************************/ + +/**************************************************************************** + * Author: Thomas E. Dickey * + ****************************************************************************/ +#include +#include + +#include + +MODULE_ID("$Id: transform.c,v 1.2 2010/09/04 21:16:17 tom Exp $") + +#ifdef SUFFIX_IGNORED +static void +trim_suffix(const char *a, unsigned *len) +{ + const char ignore[] = SUFFIX_IGNORED; + + if (sizeof(ignore) != 0) { + bool trim = FALSE; + unsigned need = (sizeof(ignore) - 1); + + if (*len > need) { + unsigned first = *len - need; + unsigned n; + trim = TRUE; + for (n = first; n < *len; ++n) { + if (tolower(UChar(a[n])) != tolower(UChar(ignore[n - first]))) { + trim = FALSE; + break; + } + } + if (trim) { + *len -= need; + } + } + } +} +#else +#define trim_suffix(a, len) /* nothing */ +#endif + +bool +same_program(const char *a, const char *b) +{ + unsigned len_a = strlen(a); + unsigned len_b = strlen(b); + + trim_suffix(a, &len_a); + trim_suffix(b, &len_b); + + return (len_a == len_b) && (strncmp(a, b, len_a) == 0); +} diff --git a/contrib/ncurses/progs/tset.c b/contrib/ncurses/progs/tset.c index 6a4d2d61c3de..084e41d6db24 100644 --- a/contrib/ncurses/progs/tset.c +++ b/contrib/ncurses/progs/tset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -32,6 +32,22 @@ * and: Thomas E. Dickey 1996-on * ****************************************************************************/ +/* + * Notes: + * The initial adaptation from 4.4BSD Lite sources in September 1995 used 686 + * lines from that version, and made changes/additions for 150 lines. There + * was no reformatting, so with/without ignoring whitespace, the amount of + * change is the same. + * + * Comparing with current (2009) source, excluding this comment: + * a) 209 lines match identically to the 4.4BSD Lite sources, with 771 lines + * changed/added. + * a) Ignoring whitespace, the current version still uses 516 lines from the + * 4.4BSD Lite sources, with 402 lines changed/added. + * + * Raymond's original comment on this follows... + */ + /* * tset.c - terminal initialization utility * @@ -52,11 +68,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -107,7 +119,7 @@ char *ttyname(int fd); #include #include -MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") +MODULE_ID("$Id: tset.c,v 1.82 2010/05/01 21:42:46 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -129,7 +141,9 @@ MODULE_ID("$Id: tset.c,v 1.76 2008/10/11 19:26:19 tom Exp $") # endif #endif +#ifndef environ extern char **environ; +#endif #undef CTRL #define CTRL(x) ((x) & 0x1f) @@ -385,9 +399,13 @@ add_mapping(const char *port, char *arg) char *base = 0; copy = strdup(arg); - mapp = (MAP *) malloc(sizeof(MAP)); + mapp = typeMalloc(MAP, 1); if (copy == 0 || mapp == 0) failed("malloc"); + + assert(copy != 0); + assert(mapp != 0); + mapp->next = 0; if (maplist == 0) cur = maplist = mapp; @@ -1247,12 +1265,12 @@ main(int argc, char **argv) ospeed = (NCURSES_OSPEED) mode.sg_ospeed; #endif - if (!strcmp(_nc_progname, PROG_RESET)) { + if (same_program(_nc_progname, PROG_RESET)) { isreset = TRUE; reset_mode(); } - ttype = get_termcap_entry(*argv); + (void) get_termcap_entry(*argv); if (!noset) { tcolumns = columns; diff --git a/contrib/ncurses/tar-copy.sh b/contrib/ncurses/tar-copy.sh deleted file mode 100755 index 3df1bc11169e..000000000000 --- a/contrib/ncurses/tar-copy.sh +++ /dev/null @@ -1,77 +0,0 @@ -#!/bin/sh -# $Id: tar-copy.sh,v 1.5 2003/10/25 14:40:07 tom Exp $ -############################################################################## -# Copyright (c) 1998,2003 Free Software Foundation, Inc. # -# # -# Permission is hereby granted, free of charge, to any person obtaining a # -# copy of this software and associated documentation files (the "Software"), # -# to deal in the Software without restriction, including without limitation # -# the rights to use, copy, modify, merge, publish, distribute, distribute # -# with modifications, sublicense, and/or sell copies of the Software, and to # -# permit persons to whom the Software is furnished to do so, subject to the # -# following conditions: # -# # -# The above copyright notice and this permission notice shall be included in # -# all copies or substantial portions of the Software. # -# # -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # -# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # -# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # -# DEALINGS IN THE SOFTWARE. # -# # -# Except as contained in this notice, the name(s) of the above copyright # -# holders shall not be used in advertising or otherwise to promote the sale, # -# use or other dealings in this Software without prior written # -# authorization. # -############################################################################## -# -# Author: Thomas E. Dickey -# -# Copy a collection of files using 'tar', so that their dates and links are -# preserved -# -# Parameters: -# $1 = files to copy -# $2 = source directory -# $3 = destination directory -# -#DOIT=echo -DOIT=eval - -if test $# != 3 ; then - echo "Usage: $0 files source target" - exit 1 -elif test ! -d "$2" ; then - echo "Source directory not found: $2" - exit 1 -elif test ! -d "$3" ; then - echo "Target directory not found: $3" - exit 1 -fi - -WD=`pwd` - -TMP=$WD/copy$$ - -cd $2 -TEST=`ls -d $1 2>/dev/null` -if test -z "$TEST" -then - echo "... no match for \"$1\" in $2" -else - echo "... installing files matching \"$1\" in $2" - trap "rm -f $TMP" 0 1 2 5 15 - if ( tar cf $TMP $1 ) - then - cd $3 - LIST=`tar tf $TMP 2>&1` - $DOIT rm -rf $LIST 2>/dev/null - $DOIT tar xvf $TMP - else - echo "Cannot create tar of $1 files" - exit 1 - fi -fi diff --git a/lib/ncurses/form/Makefile b/lib/ncurses/form/Makefile index aa1224220737..4abac432481b 100644 --- a/lib/ncurses/form/Makefile +++ b/lib/ncurses/form/Makefile @@ -84,6 +84,7 @@ MAN= \ form_post.3 \ form_requestname.3 \ form_userptr.3 \ + form_variables.3 \ form_win.3 CLEANFILES+= ${MAN:M*.3} diff --git a/lib/ncurses/ncurses/Makefile b/lib/ncurses/ncurses/Makefile index 869fb2e79f44..3b52b6ac67a9 100644 --- a/lib/ncurses/ncurses/Makefile +++ b/lib/ncurses/ncurses/Makefile @@ -389,9 +389,9 @@ build-tools: make_hash make_keys make_keys: make_keys.c names.c ncurses_def.h ${HEADERS} ${CC} -o $@ ${CFLAGS} ${NCURSES_DIR}/ncurses/tinfo/make_keys.c -make_hash: comp_hash.c hashsize.h ncurses_def.h ${HEADERS} +make_hash: make_hash.c hashsize.h ncurses_def.h ${HEADERS} ${CC} -o $@ ${CFLAGS} -DMAIN_PROGRAM \ - ${NCURSES_DIR}/ncurses/tinfo/comp_hash.c + ${NCURSES_DIR}/ncurses/tinfo/make_hash.c # ./configure generated MKterm.h.awk: MKterm.h.awk.in @@ -415,6 +415,10 @@ termcap.h: termcap.h.in -e "/@NCURSES_CONST@/s%%${NCURSES_CONST}%" \ -e "/@NCURSES_OSPEED@/s%%${NCURSES_OSPEED}%" +ncurses_dll.h: ncurses_dll.h.in + sed <${NCURSES_DIR}/include/ncurses_dll.h.in >$@ \ + -e "s%@NCURSES_WRAP_PREFIX@%_nc_%g" + curses.head: curses.h.in sed <${NCURSES_DIR}/include/curses.h.in >$@ \ -e "/@BROKEN_LINKER@/s%%${BROKEN_LINKER}%" \ @@ -439,6 +443,9 @@ curses.head: curses.h.in -e "/@NCURSES_WINT_T@/s%%${NCURSES_WINT_T}%" \ -e "/@NEED_WCHAR_H@/s%%${NEED_WCHAR_H}%" \ -e "/@USE_CXX_BOOL@/s%%${USE_CXX_BOOL}%" \ + -e "s%@NCURSES_SP_FUNCS@%0%g" \ + -e "s%@NCURSES_INTEROP_FUNCS@%0%g" \ + -e "s%@NCURSES_CCHARW_MAX@%5%g" \ -e "s%@cf_cv_1UL@%${ONEUL}%g" \ -e "s%@cf_cv_builtin_bool@%${BUILTIN_BOOL}%g" \ -e "s%@cf_cv_enable_lp64@%${ENABLE_LP64}%g" \ @@ -453,6 +460,7 @@ curses.head: curses.h.in unctrl.h: unctrl.h.in sed <${NCURSES_DIR}/include/$@.in >$@ \ + -e "s%@NCURSES_SP_FUNCS@%0%g" \ -e "/@NCURSES_MAJOR@/s%%${NCURSES_MAJOR}%" \ -e "/@NCURSES_MINOR@/s%%${NCURSES_MINOR}%" @@ -506,6 +514,7 @@ MAN= \ curs_scr_dump.3 \ curs_scroll.3 \ curs_slk.3 \ + curs_sp_funcs.3 \ curs_termattrs.3 \ curs_termcap.3 \ curs_terminfo.3 \ @@ -513,6 +522,7 @@ MAN= \ curs_touch.3 \ curs_trace.3 \ curs_util.3 \ + curs_variables.3 \ curs_window.3 \ default_colors.3 \ define_key.3 \ @@ -522,6 +532,7 @@ MAN= \ legacy_coding.3 \ ncurses.3 \ resizeterm.3 \ + term_variables.3 \ wresize.3 MAN+= \ @@ -821,6 +832,123 @@ MLINKS= ncurses.3 curses.3 \ curs_slk.3 slk_restore.3 \ curs_slk.3 slk_set.3 \ curs_slk.3 slk_touch.3 \ + curs_sp_funcs.3 sp_funcs.3 \ + curs_sp_funcs.3 assume_default_colors_sp.3 \ + curs_sp_funcs.3 baudrate_sp.3 \ + curs_sp_funcs.3 beep_sp.3 \ + curs_sp_funcs.3 can_change_color_sp.3 \ + curs_sp_funcs.3 cbreak_sp.3 \ + curs_sp_funcs.3 ceiling_panel.3 \ + curs_sp_funcs.3 color_content_sp.3 \ + curs_sp_funcs.3 curs_set_sp.3 \ + curs_sp_funcs.3 def_prog_mode_sp.3 \ + curs_sp_funcs.3 def_shell_mode_sp.3 \ + curs_sp_funcs.3 define_key_sp.3 \ + curs_sp_funcs.3 del_curterm_sp.3 \ + curs_sp_funcs.3 delay_output_sp.3 \ + curs_sp_funcs.3 doupdate_sp.3 \ + curs_sp_funcs.3 echo_sp.3 \ + curs_sp_funcs.3 endwin_sp.3 \ + curs_sp_funcs.3 erasechar_sp.3 \ + curs_sp_funcs.3 filter_sp.3 \ + curs_sp_funcs.3 flash_sp.3 \ + curs_sp_funcs.3 flushinp_sp.3 \ + curs_sp_funcs.3 get_escdelay_sp.3 \ + curs_sp_funcs.3 getmouse_sp.3 \ + curs_sp_funcs.3 getwin_sp.3 \ + curs_sp_funcs.3 ground_panel.3 \ + curs_sp_funcs.3 halfdelay_sp.3 \ + curs_sp_funcs.3 has_colors_sp.3 \ + curs_sp_funcs.3 has_ic_sp.3 \ + curs_sp_funcs.3 has_il_sp.3 \ + curs_sp_funcs.3 has_key_sp.3 \ + curs_sp_funcs.3 has_mouse_sp.3 \ + curs_sp_funcs.3 init_color_sp.3 \ + curs_sp_funcs.3 init_pair_sp.3 \ + curs_sp_funcs.3 intrflush_sp.3 \ + curs_sp_funcs.3 is_term_resized_sp.3 \ + curs_sp_funcs.3 isendwin_sp.3 \ + curs_sp_funcs.3 key_defined_sp.3 \ + curs_sp_funcs.3 keybound_sp.3 \ + curs_sp_funcs.3 keyname_sp.3 \ + curs_sp_funcs.3 keyok_sp.3 \ + curs_sp_funcs.3 killchar_sp.3 \ + curs_sp_funcs.3 mcprint_sp.3 \ + curs_sp_funcs.3 mouseinterval_sp.3 \ + curs_sp_funcs.3 mousemask_sp.3 \ + curs_sp_funcs.3 mvcur_sp.3 \ + curs_sp_funcs.3 napms_sp.3 \ + curs_sp_funcs.3 new_form_sp.3 \ + curs_sp_funcs.3 new_menu_sp.3 \ + curs_sp_funcs.3 new_prescr.3 \ + curs_sp_funcs.3 newpad_sp.3 \ + curs_sp_funcs.3 newterm_sp.3 \ + curs_sp_funcs.3 newwin_sp.3 \ + curs_sp_funcs.3 nl_sp.3 \ + curs_sp_funcs.3 nocbreak_sp.3 \ + curs_sp_funcs.3 noecho_sp.3 \ + curs_sp_funcs.3 nofilter_sp.3 \ + curs_sp_funcs.3 nonl_sp.3 \ + curs_sp_funcs.3 noqiflush_sp.3 \ + curs_sp_funcs.3 noraw_sp.3 \ + curs_sp_funcs.3 pair_content_sp.3 \ + curs_sp_funcs.3 putp_sp.3 \ + curs_sp_funcs.3 qiflush_sp.3 \ + curs_sp_funcs.3 raw_sp.3 \ + curs_sp_funcs.3 reset_prog_mode_sp.3 \ + curs_sp_funcs.3 reset_shell_mode_sp.3 \ + curs_sp_funcs.3 resetty_sp.3 \ + curs_sp_funcs.3 resize_term_sp.3 \ + curs_sp_funcs.3 resizeterm_sp.3 \ + curs_sp_funcs.3 restartterm_sp.3 \ + curs_sp_funcs.3 ripoffline_sp.3 \ + curs_sp_funcs.3 savetty_sp.3 \ + curs_sp_funcs.3 scr_init_sp.3 \ + curs_sp_funcs.3 scr_restore_sp.3 \ + curs_sp_funcs.3 scr_set_sp.3 \ + curs_sp_funcs.3 set_curterm_sp.3 \ + curs_sp_funcs.3 set_escdelay_sp.3 \ + curs_sp_funcs.3 set_tabsize_sp.3 \ + curs_sp_funcs.3 slk_attr_set_sp.3 \ + curs_sp_funcs.3 slk_attr_sp.3 \ + curs_sp_funcs.3 slk_attroff_sp.3 \ + curs_sp_funcs.3 slk_attron_sp.3 \ + curs_sp_funcs.3 slk_attrset_sp.3 \ + curs_sp_funcs.3 slk_clear_sp.3 \ + curs_sp_funcs.3 slk_color_sp.3 \ + curs_sp_funcs.3 slk_init_sp.3 \ + curs_sp_funcs.3 slk_label_sp.3 \ + curs_sp_funcs.3 slk_noutrefresh_sp.3 \ + curs_sp_funcs.3 slk_refresh_sp.3 \ + curs_sp_funcs.3 slk_restore_sp.3 \ + curs_sp_funcs.3 slk_set_sp.3 \ + curs_sp_funcs.3 slk_touch_sp.3 \ + curs_sp_funcs.3 start_color_sp.3 \ + curs_sp_funcs.3 term_attrs_sp.3 \ + curs_sp_funcs.3 termattrs_sp.3 \ + curs_sp_funcs.3 termname_sp.3 \ + curs_sp_funcs.3 tgetent_sp.3 \ + curs_sp_funcs.3 tgetflag_sp.3 \ + curs_sp_funcs.3 tgetnum_sp.3 \ + curs_sp_funcs.3 tgetstr_sp.3 \ + curs_sp_funcs.3 tigetflag_sp.3 \ + curs_sp_funcs.3 tigetnum_sp.3 \ + curs_sp_funcs.3 tigetstr_sp.3 \ + curs_sp_funcs.3 tputs_sp.3 \ + curs_sp_funcs.3 typeahead_sp.3 \ + curs_sp_funcs.3 unctrl_sp.3 \ + curs_sp_funcs.3 unget_wch_sp.3 \ + curs_sp_funcs.3 ungetch_sp.3 \ + curs_sp_funcs.3 ungetmouse_sp.3 \ + curs_sp_funcs.3 update_panels_sp.3 \ + curs_sp_funcs.3 use_default_colors_sp.3 \ + curs_sp_funcs.3 use_env_sp.3 \ + curs_sp_funcs.3 use_legacy_coding_sp.3 \ + curs_sp_funcs.3 vid_attr_sp.3 \ + curs_sp_funcs.3 vid_puts_sp.3 \ + curs_sp_funcs.3 vidattr_sp.3 \ + curs_sp_funcs.3 vidputs_sp.3 \ + curs_sp_funcs.3 wunctrl_sp.3 \ curs_termattrs.3 baudrate.3 \ curs_termattrs.3 erasechar.3 \ curs_termattrs.3 erasewchar.3 \ diff --git a/lib/ncurses/ncurses/ncurses_cfg.h b/lib/ncurses/ncurses/ncurses_cfg.h index 42570c96e4f0..c6533b2bba53 100644 --- a/lib/ncurses/ncurses/ncurses_cfg.h +++ b/lib/ncurses/ncurses/ncurses_cfg.h @@ -49,135 +49,158 @@ #ifndef NC_CONFIG_H #define NC_CONFIG_H -#ifdef __cplusplus +#define SYSTEM_NAME "FreeBSD" +#define CC_HAS_PROTOS 1 +#if 0 #include #endif -#define BSD_TPUTS 1 -#define CC_HAS_PROTOS 1 -#define CPP_HAS_STATIC_CAST 1 -#define ETIP_NEEDS_MATH_H 1 -#define GCC_NORETURN __attribute__((noreturn)) -#define GCC_PRINTF 1 -#define GCC_SCANF 1 -#define GCC_UNUSED __attribute__((unused)) +#define HAVE_LONG_FILE_NAMES 1 +#define MIXEDCASE_FILENAMES 1 +#define USE_SYSMOUSE 1 #define HAVE_BIG_CORE 1 -#define HAVE_BSD_CGETENT 1 -#define HAVE_CURSES_VERSION 1 -#define HAVE_DIRENT_H 1 -#define HAVE_ERRNO 1 -#define HAVE_FCNTL_H 1 -#define HAVE_FORM_H 1 +#define USE_TERMCAP 1 +#define TERMPATH "/etc/termcap:/usr/share/misc/termcap" +#define USE_GETCAP 1 +#define HAVE_REMOVE 1 +#define HAVE_UNLINK 1 +#define HAVE_LINK 1 +#define HAVE_SYMLINK 1 +#define USE_LINKS 1 +#define BSD_TPUTS 1 +#define HAVE_LANGINFO_CODESET 1 #define HAVE_FSEEKO 1 +#define HAVE_CURSES_VERSION 1 +#define HAVE_HAS_KEY 1 +#define HAVE_RESIZETERM 1 +#define HAVE_RESIZE_TERM 1 +#define HAVE_TERM_ENTRY_H 1 +#define HAVE_USE_DEFAULT_COLORS 1 +#define HAVE_WRESIZE 1 +#define NCURSES_EXT_FUNCS 1 +#define NCURSES_NO_PADDING 1 +#define STDC_HEADERS 1 +#define HAVE_SYS_TYPES_H 1 +#define HAVE_SYS_STAT_H 1 +#define HAVE_STDLIB_H 1 +#define HAVE_STRING_H 1 +#define HAVE_MEMORY_H 1 +#define HAVE_STRINGS_H 1 +#define HAVE_INTTYPES_H 1 +#define HAVE_STDINT_H 1 +#define HAVE_UNISTD_H 1 +#define SIZEOF_SIGNED_CHAR 1 +#define USE_SIGWINCH 1 +#define USE_ASSUMED_COLOR 1 +#define USE_HASHMAP 1 +#define USE_COLORFGBG 1 +#define NCURSES_WRAP_PREFIX "_nc_" +#define GCC_SCANF 1 +#define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) +#define GCC_PRINTF 1 +#define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) +#define GCC_UNUSED __attribute__((unused)) +#define GCC_NORETURN __attribute__((noreturn)) +#define NDEBUG 1 +#define HAVE_NC_ALLOC_H 1 +#define HAVE_GETTIMEOFDAY 1 +#define STDC_HEADERS 1 +#define HAVE_DIRENT_H 1 +#define TIME_WITH_SYS_TIME 1 +#define HAVE_REGEX_H_FUNCS 1 +#define HAVE_FCNTL_H 1 +#define HAVE_GETOPT_H 1 +#define HAVE_LIMITS_H 1 +#define HAVE_LOCALE_H 1 +#define HAVE_MATH_H 1 +#define HAVE_POLL_H 1 +#define HAVE_SYS_IOCTL_H 1 +#define HAVE_SYS_PARAM_H 1 +#define HAVE_SYS_POLL_H 1 +#define HAVE_SYS_SELECT_H 1 +#define HAVE_SYS_TIME_H 1 +#define HAVE_SYS_TIMES_H 1 +#define HAVE_TTYENT_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_WCTYPE_H 1 +#define HAVE_SYS_TIME_SELECT 1 +#define SIG_ATOMIC_T volatile sig_atomic_t +#define TYPEOF_CHTYPE int +#define HAVE_ERRNO 1 #define HAVE_GETCWD 1 #define HAVE_GETEGID 1 #define HAVE_GETEUID 1 -#define HAVE_GETOPT_H 1 -#define HAVE_GETTIMEOFDAY 1 #define HAVE_GETTTYNAM 1 -#define HAVE_HAS_KEY 1 -#define HAVE_INTTYPES_H 1 -#define HAVE_IOSTREAM 1 -#define HAVE_ISASCII 1 #define HAVE_ISSETUGID 1 -#define HAVE_LANGINFO_CODESET 1 -#define HAVE_LIBFORM 1 -#define HAVE_LIBMENU 1 -#define HAVE_LIBPANEL 1 -#define HAVE_LIMITS_H 1 -#define HAVE_LINK 1 -#define HAVE_LOCALE_H 1 -#define HAVE_LONG_FILE_NAMES 1 -#define HAVE_MEMORY_H 1 -#define HAVE_MENU_H 1 -#define HAVE_MKSTEMP 1 -#define HAVE_NANOSLEEP 1 -#define HAVE_NC_ALLOC_H 1 -#define HAVE_PANEL_H 1 #define HAVE_POLL 1 -#define HAVE_POLL_H 1 -#define HAVE_REGEX_H_FUNCS 1 #define HAVE_REMOVE 1 -#define HAVE_REMOVE 1 -#define HAVE_RESIZETERM 1 -#define HAVE_RESIZE_TERM 1 #define HAVE_SELECT 1 #define HAVE_SETBUF 1 #define HAVE_SETBUFFER 1 #define HAVE_SETVBUF 1 #define HAVE_SIGACTION 1 #define HAVE_SIGVEC 1 -#define HAVE_SIZECHANGE 1 -#define HAVE_SLK_COLOR 1 -#define HAVE_STDINT_H 1 -#define HAVE_STDLIB_H 1 #define HAVE_STRDUP 1 -#define HAVE_STRINGS_H 1 -#define HAVE_STRING_H 1 #define HAVE_STRSTR 1 -#define HAVE_SYMLINK 1 -#define HAVE_SYS_IOCTL_H 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_POLL_H 1 -#define HAVE_SYS_SELECT_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIMES_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TIME_SELECT 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_TCGETATTR 1 #define HAVE_TCGETPGRP 1 -#define HAVE_TERMIOS_H 1 #define HAVE_TIMES 1 -#define HAVE_TTYENT_H 1 -#define HAVE_TYPEINFO 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_UNLINK 1 -#define HAVE_USE_DEFAULT_COLORS 1 #define HAVE_VSNPRINTF 1 +#define HAVE_BSD_CGETENT 1 +#define HAVE_ISASCII 1 +#define HAVE_NANOSLEEP 1 +#define HAVE_TERMIOS_H 1 +#define HAVE_UNISTD_H 1 +#define HAVE_TCGETATTR 1 #define HAVE_VSSCANF 1 -#define HAVE_WCTYPE_H 1 -#define HAVE_WRESIZE 1 -#define IOSTREAM_NAMESPACE 1 -#define MIXEDCASE_FILENAMES 1 -#define NCURSES_EXT_FUNCS 1 -#define NCURSES_NO_PADDING 1 -#define NCURSES_PATHSEP ':' -#define NCURSES_VERSION_STRING "5.7.20081102" -#define NDEBUG 1 +#define HAVE_MKSTEMP 1 #define RETSIGTYPE void -#define SIG_ATOMIC_T volatile sig_atomic_t -#define SIZEOF_SIGNED_CHAR 1 -#define STDC_HEADERS 1 -#define SYSTEM_NAME "FreeBSD" -#define TERMPATH "/etc/termcap:/usr/share/misc/termcap" -#define TIME_WITH_SYS_TIME 1 -#define TYPEOF_CHTYPE int -#define USE_ASSUMED_COLOR 1 -#define USE_COLORFGBG 1 -#define USE_GETCAP 1 -#define USE_HASHMAP 1 -#define USE_LINKS 1 -#define USE_SIGWINCH 1 -#define USE_SYSMOUSE 1 -#define USE_TERMCAP 1 +#define HAVE_SIZECHANGE 1 +#define HAVE_WORKING_POLL 1 +#define HAVE_VA_COPY 1 +#define HAVE___VA_COPY 1 +#define HAVE_UNISTD_H 1 +#define HAVE_FORK 1 +#define HAVE_VFORK 1 +#define HAVE_WORKING_VFORK 1 +#define HAVE_WORKING_FORK 1 +#define USE_OPENPTY_HEADER +#define USE_XTERM_PTY 1 +#define HAVE_IOSTREAM 1 +#define HAVE_TYPEINFO 1 +#define IOSTREAM_NAMESPACE 1 +#define ETIP_NEEDS_MATH_H 1 +#define HAVE_SLK_COLOR 1 +#define HAVE_PANEL_H 1 +#define HAVE_LIBPANEL 1 +#define HAVE_MENU_H 1 +#define HAVE_LIBMENU 1 +#define HAVE_FORM_H 1 +#define HAVE_LIBFORM 1 +#define NCURSES_PATHSEP ':' +#define NCURSES_VERSION_STRING "5.9.20110404" + +/* + * Begin FreeBSD-specific changes + */ +/* Support ENABLE_WIDEC */ #ifdef ENABLE_WIDEC #define USE_WIDEC_SUPPORT 1 +#define HAVE_PUTWC 1 #define HAVE_BTOWC 1 +#define HAVE_WCTOB 1 +#define HAVE_MBTOWC 1 +#define HAVE_WCTOMB 1 #define HAVE_MBLEN 1 #define HAVE_MBRLEN 1 #define HAVE_MBRTOWC 1 -#define HAVE_MBSRTOWCS 1 -#define HAVE_MBSTOWCS 1 -#define HAVE_MBTOWC 1 -#define HAVE_PUTWC 1 #define HAVE_WCSRTOMBS 1 +#define HAVE_MBSRTOWCS 1 #define HAVE_WCSTOMBS 1 -#define HAVE_WCTOB 1 -#define HAVE_WCTOMB 1 +#define HAVE_MBSTOWCS 1 #define NEED_WCHAR_H 1 #endif +/* + * End FreeBSD-specific changes + */ #include