libpayload: Add PDCurses and ncurses' libform/libmenu

PDCurses provides an alternative implementation of the curses library
standard in addition to tinycurses.
Where tinycurses is really tiny, PDCurses is more complete and provides
virtually unlimited windows and the full API.
The PDCurses code is brought in "vanilla", with all local changes
residing in curses/pdcurses-backend/

In addition to a curses library, this change also provides libpanel (as
part of the PDCurses code), and libform and libmenu which were derived
from ncurses-5.9.
As they rely on ncurses internals (and PDCurses is not ncurses), more
changes were required for these libraries to work.

The build system is extended to install the right set of header files
depending on the selected curses implementation.

Change-Id: I9e5b920f94b6510da01da2f656196a993170d1c5
Signed-off-by: Patrick Georgi <patrick.georgi@secunet.com>
Reviewed-on: http://review.coreboot.org/106
Tested-by: build bot (Jenkins)
Reviewed-by: Marc Jones <marcj303@gmail.com>
diff --git a/payloads/libpayload/Config.in b/payloads/libpayload/Config.in
index fe53400..028dd33 100644
--- a/payloads/libpayload/Config.in
+++ b/payloads/libpayload/Config.in
@@ -90,10 +90,34 @@
 	bool "Enable C library support"
 	default y
 
-config TINYCURSES
-	bool "Enable tinycurses support"
+config CURSES
+	bool "Build a curses library"
 	default y
 
+choice
+	prompt "Curses implementation"
+	default PDCURSES
+	depends on CURSES
+
+config TINYCURSES
+	bool "Tinycurses"
+	help
+	  Tinycurses was the first curses implementation for libpayload.
+	  It features low memory consumption, static allocation of larger
+	  data structures (so few or no memory allocation calls) and a
+	  reduced feature set.
+
+config PDCURSES
+	bool "PDCurses"
+	default y
+	help
+	  libpayload's PDCurses port provides a full features curses
+	  implementation, including libpanel, libmenu and libform (which
+	  are taken from ncurses).
+	  It requires more system resources, in particularily heap memory.
+
+endchoice
+
 config LAR
 	bool "LAR support"
 	default n
diff --git a/payloads/libpayload/Makefile.inc b/payloads/libpayload/Makefile.inc
index 03862ca..5a7d142 100644
--- a/payloads/libpayload/Makefile.inc
+++ b/payloads/libpayload/Makefile.inc
@@ -39,7 +39,8 @@
 
 classes-$(CONFIG_PCI) += libpci
 classes-$(CONFIG_LIBC) += libc
-classes-$(CONFIG_TINYCURSES) += libcurses
+classes-$(CONFIG_CURSES) += libcurses
+classes-$(CONFIG_PDCURSES) += libmenu libform libpanel
 libraries := $(classes-y)
 classes-y += head.o
 
@@ -50,7 +51,7 @@
 
 subdirs-y := arch/$(ARCHDIR-y)
 subdirs-y += crypto libc drivers libpci
-subdirs-$(CONFIG_TINYCURSES) += curses
+subdirs-$(CONFIG_CURSES) += curses
 
 INCLUDES := -Iinclude -Iinclude/$(ARCHDIR-y) -I$(obj)
 CFLAGS = $(INCLUDES) -O2 -pipe -g
@@ -64,6 +65,15 @@
 library-targets = $(addsuffix .a,$(addprefix $(obj)/,$(libraries))) $(obj)/libpayload.a
 lib: $$(library-targets) $(obj)/head.o
 
+extract_nth=$(word $(1), $(subst |, ,$(2)))
+
+#######################################################################
+# Add handler for special include files 
+$(call add-special-class,includes)
+includes-handler= \
+		$(if $(wildcard $(1)$(call extract_nth,1,$(2))), \
+			$(eval includes += $(1)$(2)))
+
 $(obj)/libpayload.a: $(foreach class,$(libraries),$$($(class)-objs))
 	printf "    AR         $(subst $(shell pwd)/,,$(@))\n"
 	$(AR) rc $@ $^
@@ -92,6 +102,9 @@
 		install -m 644 $$file $(DESTDIR)/libpayload/$$file; \
 	done
 	install -m 644 $(obj)/libpayload-config.h $(DESTDIR)/libpayload/include
+	$(foreach item,$(includes), \
+		install -m 755 -d $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); \
+		install -m 644 $(call extract_nth,1,$(item)) $(DESTDIR)/libpayload/include/$(call extract_nth,2,$(item)); )
 	printf "    INSTALL    $(DESTDIR)/libpayload/bin\n"
 	install -m 755 -d $(DESTDIR)/libpayload/bin
 	install -m 755 bin/lpgcc $(DESTDIR)/libpayload/bin
diff --git a/payloads/libpayload/configs/defconfig b/payloads/libpayload/configs/defconfig
index 77b71b7..6d514d6 100644
--- a/payloads/libpayload/configs/defconfig
+++ b/payloads/libpayload/configs/defconfig
@@ -1,7 +1,7 @@
 #
 # Automatically generated make config: don't edit
 # libpayload version: 0.2.0
-# Sat Sep 25 14:01:26 2010
+# Tue Jul 12 15:54:09 2011
 #
 
 #
@@ -16,13 +16,14 @@
 #
 CONFIG_TARGET_I386=y
 # CONFIG_TARGET_POWERPC is not set
+# CONFIG_MEMMAP_RAM_ONLY is not set
 # CONFIG_MULTIBOOT is not set
 
 #
 # Standard Libraries
 #
 CONFIG_LIBC=y
-CONFIG_TINYCURSES=y
+CONFIG_PDCURSES=y
 # CONFIG_CBFS is not set
 
 #
diff --git a/payloads/libpayload/curses/Makefile.inc b/payloads/libpayload/curses/Makefile.inc
index 44e3ab7..5d14431 100644
--- a/payloads/libpayload/curses/Makefile.inc
+++ b/payloads/libpayload/curses/Makefile.inc
@@ -27,8 +27,142 @@
 ## SUCH DAMAGE.
 ##
 
-subdirs-y := libform libpanel libmenu
+ifeq ($(CONFIG_TINYCURSES),y)
+INCLUDES += -Icurses
+endif
 
 libcurses-$(CONFIG_TINYCURSES) += keyboard.c
 libcurses-$(CONFIG_TINYCURSES) += tinycurses.c
 libcurses-$(CONFIG_TINYCURSES) += colors.c
+
+includes-$(CONFIG_TINYCURSES) += curses.h
+
+ifeq ($(CONFIG_PDCURSES),y)
+INCLUDES += -D_LP64=0 -Icurses/PDCurses-3.4 -Icurses/pdcurses-backend -Icurses/menu -Icurses/form
+endif
+
+libcurses-$(CONFIG_PDCURSES) += pdcurses-backend/pdcdisp.c
+libcurses-$(CONFIG_PDCURSES) += pdcurses-backend/pdcgetsc.c
+libcurses-$(CONFIG_PDCURSES) += pdcurses-backend/pdckbd.c
+libcurses-$(CONFIG_PDCURSES) += pdcurses-backend/pdcscrn.c
+libcurses-$(CONFIG_PDCURSES) += pdcurses-backend/pdcsetsc.c
+libcurses-$(CONFIG_PDCURSES) += pdcurses-backend/pdcutil.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/addch.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/move.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/overlay.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/refresh.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/terminfo.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/window.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/util.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/inopts.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/addstr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/keyname.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/instr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/clear.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/addchstr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/kernel.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/pad.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/insstr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/border.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/getyx.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/getstr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/getch.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/termattr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/outopts.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/color.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/deleteln.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/initscr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/slk.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/delch.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/touch.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/mouse.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/scanw.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/scroll.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/printw.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/bkgd.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/inch.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/attr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/insch.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/inchstr.c
+libcurses-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/beep.c
+
+includes-$(CONFIG_PDCURSES) += pdcurses-backend/nc_alloc.h
+includes-$(CONFIG_PDCURSES) += pdcurses-backend/ncurses_cfg.h
+includes-$(CONFIG_PDCURSES) += PDCurses-3.4/curses.h
+includes-$(CONFIG_PDCURSES) += PDCurses-3.4/term.h
+includes-$(CONFIG_PDCURSES) += PDCurses-3.4/panel.h
+includes-$(CONFIG_PDCURSES) += menu/eti.h
+includes-$(CONFIG_PDCURSES) += menu/menu.h
+includes-$(CONFIG_PDCURSES) += menu/mf_common.h
+includes-$(CONFIG_PDCURSES) += form/form.h
+
+libpanel-$(CONFIG_PDCURSES) += PDCurses-3.4/pdcurses/panel.c
+
+libmenu-$(CONFIG_PDCURSES) += menu/m_req_name.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_nam.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_pad.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_cursor.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_new.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_attribs.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_opt.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_format.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_post.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_userptr.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_cur.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_driver.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_sub.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_win.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_global.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_vis.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_new.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_scale.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_spacing.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_opts.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_pattern.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_val.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_hook.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_use.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_items.c
+libmenu-$(CONFIG_PDCURSES) += menu/m_item_top.c
+libform-$(CONFIG_PDCURSES) += form/frm_page.c
+libform-$(CONFIG_PDCURSES) += form/frm_opts.c
+libform-$(CONFIG_PDCURSES) += form/frm_def.c
+libform-$(CONFIG_PDCURSES) += form/frm_req_name.c
+libform-$(CONFIG_PDCURSES) += form/fty_alpha.c
+libform-$(CONFIG_PDCURSES) += form/frm_driver.c
+libform-$(CONFIG_PDCURSES) += form/fld_user.c
+libform-$(CONFIG_PDCURSES) += form/frm_win.c
+libform-$(CONFIG_PDCURSES) += form/fld_newftyp.c
+#libform-$(CONFIG_PDCURSES) += form/fty_regex.c
+libform-$(CONFIG_PDCURSES) += form/fld_stat.c
+libform-$(CONFIG_PDCURSES) += form/fld_pad.c
+libform-$(CONFIG_PDCURSES) += form/fld_current.c
+libform-$(CONFIG_PDCURSES) += form/frm_post.c
+#libform-$(CONFIG_PDCURSES) += form/f_trace.c
+libform-$(CONFIG_PDCURSES) += form/fty_generic.c
+libform-$(CONFIG_PDCURSES) += form/fld_page.c
+libform-$(CONFIG_PDCURSES) += form/frm_hook.c
+libform-$(CONFIG_PDCURSES) += form/frm_scale.c
+libform-$(CONFIG_PDCURSES) += form/fty_int.c
+libform-$(CONFIG_PDCURSES) += form/fty_alnum.c
+libform-$(CONFIG_PDCURSES) += form/frm_cursor.c
+#libform-$(CONFIG_PDCURSES) += form/fty_ipv4.c
+libform-$(CONFIG_PDCURSES) += form/fld_link.c
+libform-$(CONFIG_PDCURSES) += form/fld_arg.c
+libform-$(CONFIG_PDCURSES) += form/fld_move.c
+libform-$(CONFIG_PDCURSES) += form/fld_def.c
+libform-$(CONFIG_PDCURSES) += form/fld_type.c
+libform-$(CONFIG_PDCURSES) += form/fld_max.c
+libform-$(CONFIG_PDCURSES) += form/fld_ftlink.c
+libform-$(CONFIG_PDCURSES) += form/fld_ftchoice.c
+libform-$(CONFIG_PDCURSES) += form/fld_info.c
+libform-$(CONFIG_PDCURSES) += form/frm_user.c
+#libform-$(CONFIG_PDCURSES) += form/fty_num.c
+libform-$(CONFIG_PDCURSES) += form/frm_sub.c
+libform-$(CONFIG_PDCURSES) += form/fty_enum.c
+libform-$(CONFIG_PDCURSES) += form/frm_data.c
+libform-$(CONFIG_PDCURSES) += form/fld_opts.c
+libform-$(CONFIG_PDCURSES) += form/fld_attr.c
+libform-$(CONFIG_PDCURSES) += form/fld_dup.c
+libform-$(CONFIG_PDCURSES) += form/fld_just.c
+
diff --git a/payloads/libpayload/curses/PDCurses-3.4/HISTORY b/payloads/libpayload/curses/PDCurses-3.4/HISTORY
new file mode 100644
index 0000000..7cf5b71
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/HISTORY
@@ -0,0 +1,1925 @@
+PDCurses 3.4 - 2008/09/08
+=========================
+
+Nothing much new this time, but I've been sitting on some bug fixes for 
+almost a year, so it's overdue. Apart from bugs, the main changes are in 
+the documentation.
+
+New features:
+
+- setsyx() is now a function rather than a macro.
+
+Bug fixes and such:
+
+- In x11, the xc_atrtab table size was under-calculated by half, 
+  resulting in crashes at (oddly) certain line counts. (It should've 
+  crashed a lot more.) Reported by Mark Hessling.
+
+- Test for moved cursor was omitting the window origin offset. Reported 
+  by Carey Evans.
+
+- Is DOS and OS/2, the value for max items in key_table was still wrong.
+  Reported by C.E.
+
+- Changed isendwin() so it won't crash after delscreen().
+
+- Ensure zero-termination in PDC_mbstowcs() and PDC_wcstombs(). 
+
+- Disable QuickEdit Mode when enabling mouse input for the Win32 
+  console; reported by "Zalapkrakna".
+
+- Fix for building under Innotek C (I hope). Report by Elbert Pol, fix
+  courtesy of Paul Smedley.
+
+- Unified exports list with no duplicates -- pdcurses.def is now built
+  from components at compile time.
+
+- Don't install curspriv.h, and don't include it with binary
+  distributions.
+
+- Building DLLs with LCC is no longer supported, due to the primitive
+  nature of its make.exe.
+
+- Export the terminfo stub functions from the DLLs, too.
+
+- Added support for Apple's ".dylib" in configure. Suggested by Marc 
+  Vaillant (who says it's needed with OS 10.5.)
+
+- In sdl1/Makefile.mng, ensure that CC is set.
+
+- In the gcc makefiles, "$?" didn't really have the desired effect --
+  _all_ the dependencies showed up on the command line, including
+  curses.h, and pdcurses.a twice.  And apparently, this can mess up some
+  old version (?) of MinGW. So, revert to spelling out "tuidemo.o
+  tui.o". Reported by "Howard L."
+
+- Extensive documentation revision and reorganizing. More to do here. 
+  For example, I moved the build instructions from INSTALL (which never 
+  really described installation) to the platform-specific READMEs. 
+
+- New indentation standard: four spaces, no tabs.
+
+------------------------------------------------------------------------
+
+PDCurses 3.3 - 2007/07/11
+=========================
+
+This release adds an SDL backend, refines the demos, and is faster in 
+some cases.
+
+New features:
+
+- SDL port. See INSTALL, doc/sdl.txt and sdl1/* for details.
+
+- Double-buffering -- minimize screen writes by checking, in doupdate()
+  and wnoutrefresh(), whether the changes to curscr are really changes.
+  In most cases, this makes no difference (writes were already limited
+  to areas marked as changed), but it can greatly reduce the overhead
+  from touchwin(). It also helps if you have small, separated updates on
+  the same line.
+
+- The PDC_RGB colors can now be used, or not, with any platform (as long
+  as the same options are used when compiling both the library and
+  apps). This may help if you have apps that are hardwired to assume
+  certain definitions.
+
+- Restored the use_default_colors() stuff from the ncurses versions of
+  the rain and worm demos, to make them "transparent" (this is useful
+  now, with the SDL port); added transparency to newdemo.
+
+- Added setlocale() to tuidemo, to make it easier to browse files with
+  non-ASCII characters.
+
+- Sped up firework demo by replacing unneeded clear() and init_pair()
+  calls.
+
+- Allow exit from ptest demo by typing 'q'.
+
+- New functions for implementors: PDC_pair_content() and PDC_init_pair()
+  (the old pdc_atrtab stuff was arguably the last remnant of code in the
+  pdcurses directory that was based on platform details).
+
+Bug fixes and such:
+
+- Implicit wrefresh() needs to be called from wgetch() when the window's 
+  cursor position is changed, even if there are no other changes.
+
+- Set SP->audible on a per-platform basis, as was documented in
+  IMPLEMNT, but not actually being done.
+
+- Minor tweaks for efficiency and readability, notably with wscrl().
+
+- tuidemo didn't work correctly on monochrome screens when A_COLOR was
+  defined -- the color pair numbers appeared as the corresponding
+  character; also, the input box was (I now realize) broken with ncurses
+  since our 2.7, and broke more subtly with PDCurses' new implicit
+  refresh handling; also, the path to the default file for the Browse
+  function was a bit off.
+
+- Assume in the demos that curs_set() is always available -- there's no
+  good test for this, and the existing tests were bogus.
+
+- Made the command-line parameter for ptest work. (If given an argument,
+  it delays that number of milliseconds between changes, instead of
+  waiting for a key, and automatically loops five times.)
+
+- Building the Win32 DLL with MinGW or Cygwin wouldn't work from outside
+  the platform directory.
+
+- Building the X11 port with Cygwin required manually editing the 
+  Makefile after configuring; no longer. Reported by Warren W. Gay.
+
+- Minor tightening of configure and makefiles.
+
+- Bogus references to "ACS_BLCORNER" in the border man page. Reported by
+  "Walrii".
+
+- slk_wlabel() was not documented.
+
+- Spelling cleanup.
+
+- Changed RCSIDs to not end with a semicolon -- avoids warnings when
+  compiling with the -pedantic option.
+
+- Merged latin-1.txt into x11.txt.
+
+- Updated config.guess and config.sub to more recent versions.
+
+------------------------------------------------------------------------
+
+PDCurses 3.2 - 2007/06/06
+=========================
+
+This release mainly covers changes to the build process, along with a 
+few structural changes.
+
+New features:
+
+- The panel library has been folded into the main library. What this
+  means is that you no longer need to specify "-lpanel" or equivalent
+  when linking programs that use panel functionality with PDCurses;
+  however, panel.lib/.a is still provided (as a copy of pdcurses.lib/.a)
+  so that you can, optionally, build your projects with no changes. It
+  also means that panel functionality is available with the DLL or
+  shared library. Note that panel.h remains separate from curses.h.
+
+- Setting the PDCURSES_SRCDIR environment variable is no longer required
+  before building, unless you want to build in a location other than the
+  platform directory. (See INSTALL.)
+
+- MinGW and Cygwin makefiles support building DLLs, via the "DLL=Y"
+  option. Partly due to Timofei Shatrov.
+
+- Support for the Digital Mars compiler.
+
+- Watcom makefiles now use the "loaddll" feature.
+
+Bug fixes and such:
+
+- Eliminated the platform defines (DOS, WIN32, OS2, XCURSES) from
+  curses.h, except for X11-specific SCREEN elements and functions.
+  Dynamically-linked X11 apps built against an old version will have
+  their red and blue swapped until rebuilt. (You can define PDC_RGB to
+  build the library with the old color scheme, but it would also have to
+  be defined when building any new app.) Any app that depends on
+  PDCurses to determine the platform it's building on will have to make
+  other arrangements.
+
+- Documentation cleanup -- added more details; removed some content that
+  didn't apply to PDCurses; moved the doc-building tool to the doc
+  directory; changed *.man to *.txt.
+
+- The EMX makefile now accepts "DLL=Y", builds pdcurses.dll instead of
+  curses.dll, builds either the static library or the DLL (not both at
+  once), and links all the demos with the DLL when building it.
+
+- In Win32, read the registry only when needed: when init_color() or 
+  color_content() is called, instead of at startup.
+
+- A few additional consts in declarations.
+
+- The Win32 compilers that build DLLs now use common .def files.
+
+- panel.h functions sorted by name, as with other .h files; curses.h is
+  no longer included by repeated inclusions of panel.h or term.h.
+
+- Simplified Borland makefiles.
+
+- Makefile.aix.in depended on a file, xcurses.exp, that was never there.
+  This problem was fixed as part of the change to common .def files; 
+  however, I still haven't been able to test building on AIX.
+
+------------------------------------------------------------------------
+
+PDCurses 3.1 - 2007/05/03
+=========================
+
+Primarily clipboard-related fixes, and special UTF-8 support.
+
+New features:
+
+- "Force UTF-8" mode, a compile-time option to force the use of UTF-8
+  for multibyte strings, instead of the system locale. (Mainly for
+  Windows, where UTF-8 doesn't work well in the console.) See INSTALL.
+
+- Multibyte string support in PDC_*clipboard() functions, and in Win32's
+  PDC_set_title().
+
+- Added the global string "ttytype", per other curses implementations,
+  for compatibility with old BSD curses.
+
+- Real functions for the "quasi-standard aliases" -- crmode(),
+  nocrmode(), draino(), resetterm(), fixterm() and saveterm().
+  (Corresponding macros removed.)
+
+Bug fixes and such:
+
+- In Win32, under NT-family OSes, the scrollback buffer would be
+  restored by endwin(), but would not be turned off again when resuming
+  curses after an endwin(). The result was an odd, partly-scrolled-up
+  display. Now, the buffer is toggled by PDC_reset_prog_mode() and
+  PDC_reset_shell_mode(), so it's properly turned off when returning
+  from an endwin().
+
+- In 3.0, selection in X11 didn't work. (Well, the selecting worked, but 
+  the pasting elsewhere didn't.) This was due to the attempted fix 
+  "don't return selection start as a press event," so that's been 
+  reverted for now.
+
+- PDC_setclipboard() was locking up in X11. Reported by Mark Hessling.
+
+- Missing underscore in the declaration of XC_say() prevented
+  compilation with PDCDEBUG defined.  Reported by M.H.
+
+- Off-by-one error in copywin() -- the maximum coordinates for the
+  destination window should be inclusive. Reported by Tiago Dionizio.
+
+- Start in echo mode, per X/Open. Reported by T.D.
+
+- Strip leading and trailing spaces from slk labels, per a literal
+  reading of X/Open. Suggested by Alexey Miheev (about ncurses, but it
+  also applies here).
+
+- The #endif for __PDCURSES__ needs to come _after_ the closing of the
+  extern "C". This has been broken since June 2005. Fortunately (?), it
+  only shows up if the file is included multiple times, and then only in
+  C++. Reported on the DOSBox forums.
+
+- Use CF_OEMTEXT instead of CF_TEXT in the narrow versions of the 
+  clipboard functions in Win32, to match the console.
+
+- Changed the format of the string returned from longname().
+
+- In the clipboard test in the testcurs demo, use a single mvprintw() to
+  display the return from PDC_getclipboard(), instead of a loop of
+  addch(), which was incompatible with multibyte strings.
+
+- Moved has_key() into the keyname module, and documented it.
+
+- Moved RIPPEDOFFLINE to curspriv.h.
+
+- Typos in IMPLEMNT.
+
+------------------------------------------------------------------------
+
+PDCurses 3.0 - 2007/04/01
+=========================
+
+The focuses for this release are X/Open conformance, i18n, better color 
+support, cleaner code, and more consistency across platforms.
+
+This is only a brief summary of the changes. For more details, consult 
+the CVS log.
+
+New features:
+
+- An almost complete implementation of X/Open curses, including the
+  wide-character and attr_t functions (but excluding terminfo). The
+  wide-character functions work only in Win32 and X11, for now, and
+  require building the library with the appropriate options (see
+  INSTALL). Note that this is a simplistic implementation, with exactly
+  one wchar_t per cchar_t; the only characters it handles properly are
+  those that are one column wide.
+
+- Support for X Input Methods in the X11 port (see INSTALL). When built
+  this way, the internal compose key support is disabled in favor of
+  XIM's, which is a lot more complete, although you lose the box cursor.
+
+- Multibyte character support in the non-wide string handling functions, 
+  per X/Open. This only works when the library is built with wide- 
+  character support enabled.
+
+- Mouse support for DOS and OS/2. The DOS version includes untested 
+  support for scroll wheels, via the "CuteMouse" driver.
+
+- An ncurses-compatible mouse interface, which can work in parallel with 
+  the traditional PDCurses mouse interface. See the man page (or 
+  mouse.c) for details.
+
+- DOS and OS/2 can now return modifiers as keys, as in Win32 and X11.
+
+- COLORS, which had been fixed at 8, is now either 8 or 16, depending on
+  the terminal -- usually 16. When it's 8, blinking mode is enabled
+  (controlled as before by the A_BLINK attribute); when it's 16, bright
+  background colors are used instead. On platforms where it can be
+  changed, the mode is toggled by the new function PDC_set_blink().
+  PDCurses tries to set PDC_set_blink(FALSE) at startup. (In Win32, it's
+  always set to FALSE; in DOS, with other than an EGA or VGA card, it 
+  can't be.) Also, COLORS is now set to 0 until start_color() is called.
+
+- Corresponding to the change in COLORS, COLOR_PAIRS is now 256.
+
+- Working init_color() and color_content(). The OS/2 version of
+  init_color() works only in a full-screen session; the Win32 version
+  works only in windowed mode, and only in NT-family OSes; the DOS
+  version works only with VGA adapters (real or simulated). The Win32
+  version is based mostly on James Brown's setconsoleinfo.c
+  (www.catch22.net).
+
+- use_default_colors(), assume_default_colors(), and curses_version(),
+  after ncurses.
+
+- Added global int TABSIZE, after ncurses and Solaris curses; removed
+  window-specific _tabsize.
+
+- Logical extension to the wide-character slk_ funcs: slk_wlabel(), for 
+  retrieving the label as a wide-character string.
+
+- A non-macro implementation of ncurses' wresize().
+
+- Working putwin(), getwin(), scr_dump() and scr_restore().
+
+- A working acs_map[]. Characters from the ACS are now stored in window
+  structures as a regular character plus the A_ALTCHARSET attribute, and
+  rendered to the ACS only when displayed. (This allows, for example,
+  the correct display on one platform of windows saved from another.)
+
+- In X11, allow selection and paste of UTF8_STRING.
+
+- The testcurs demo now includes a color chart and init_color() test, a
+  wide character input test, a display of wide ACS characters with
+  sample Unicode text, a specific test of flash(), more info in the
+  resize test, and attempts to change the width as well as the height.
+
+- Command-line option for MSVC to build DLLs (see INSTALL). Also, the
+  naming distinction for DLLs ("curses" vs. "pdcurses") is abandoned,
+  and either the static lib or DLL is built, not both at once (except
+  for X11).
+
+- For backwards compatibility, a special module just for deprecated
+  functions -- currently PDC_check_bios_key(), PDC_get_bios_key(),
+  PDC_get_ctrl_break() and PDC_set_ctrl_break(). These shouldn't be used
+  in applications, but currently are... in fact, all the "private"
+  functions (in curspriv.h) are subject to change and should be avoided. 
+
+- A new document, IMPLEMNT, describing PDCurses' internal functions for
+  those wishing to port it to new platforms.
+
+- Mark Hessling has released the X11 port to the public domain. 
+  (However, x11/ScrollBox* retain their separate copyright and MIT-like 
+  license.)
+
+Bug fixes and such:
+
+- Most of the macros have been removed (along with the NOMACROS ifdef).
+  The only remaining ones are those which have to be macros to work, and
+  those that are required by X/Open to be macros. There were numerous
+  problems with the macros, and no apparent reason to keep them, except
+  tradition -- although it was PCcurses 1.x that first omitted them.
+
+- Clean separation of platform-specific code from the rest. Outside of
+  the platform directories, there remain only a few ifdefs in curses.h
+  and curspriv.h.
+
+- General reorganization and simplification.
+
+- Documentation revisions.
+
+- When expanding control characters in addch() or insch(), retain the 
+  attributes from the chtype.
+
+- Preserve the A_ALTCHARSET attribute in addch() and insch().
+
+- Per X/Open, beep() should always return OK.
+
+- On platforms with a controlling terminal (i.e., not X11), curs_set(1)
+  now sets the cursor to the shape it had at the time of initscr(),
+  rather than always making it small. (Exception for DOS: If the video
+  mode has been changed by PDC_resize_screen(), curs_set(1) reverts to
+  line 6/7.) The shape is taken from SP->orig_cursor (the meaning of
+  which is platform-specific).
+
+- Stop updating the cursor position when the cursor is invisible (this 
+  gives a huge performance boost in Win 9x); update the cursor position 
+  from curs_set() if changing from invisible to visible.
+
+- Some tweaking of the behavior of def_prog_mode(), def_shell_mode(), 
+  savetty(), reset_prog_mode(), reset_shell_mode() and resetty()... 
+  still not quite right.
+
+- flash() was not implemented for Win32 or X. A portable implementation
+  is now used for all platforms. Note that it's much slower than the
+  old (DOS and OS/2) version, but this is only apparent on an extremely
+  slow machine, such as an XT.
+
+- In getstr(), backspacing on high-bit characters caused a double 
+  backspace.
+
+- hline() and vline() used an incorrect (off by one) interpretation of 
+  _maxx and _maxy. If values of n greater than the max were specified, 
+  these functions could access unallocated memory.
+
+- innstr() is supposed to return the number of characters read, not just 
+  OK or ERR. Reported by Mike Aubury.
+
+- A proper implementation of insch() -- the PDC_chadd()-based version 
+  wasn't handling the control characters correctly.
+
+- Return ASCII and control key names from keyname() (problem revealed by
+  ncurses' movewindow test); also, per X/Open, return "UNKNOWN KEY" when 
+  appropriate, rather than "NO KEY NAME".
+
+- Turn off the cursor from leaveok(TRUE), even in X11; leaveok(FALSE)
+  now calls curs_set(1), regardless of the previous state of the cursor.
+
+- In the slk area, BUTTON_CLICKED events now translate to function keys,
+  along with the previously recognized BUTTON_PRESSED events. Of course,
+  it should really be checking the events specified by map_button(),
+  which still doesn't work.
+
+- napms(0) now returns immediately.
+
+- A unified napms() implementation for DOS -- no longer throttles the
+  CPU when built with any compiler.
+
+- Allow backspace editing of the nocbreak() buffer.
+
+- pair_content(0, ...) is valid.
+
+- There was no check to ensure that the pnoutrefresh() window fit within 
+  the screen. It now returns an ERR if it doesn't.
+
+- In X11, resize_term() must be called with parameters (0, 0), and only 
+  when SP->resized is set, else it returns ERR.
+
+- Copy _bkgd in resize_window(). Patch found on Frederic L. W. Meunier's 
+  web site.
+
+- slk_clear() now removes the buttons completely, as in ncurses.
+
+- Use the current foreground color for the line attributes (underline,
+  left, right), unless PDC_set_line_color() is explicitly called. After 
+  setting the line color, you can reset it to this mode via 
+  "PDC_set_line_color(-1)".
+
+- Removed non-macro implementations of COLOR_PAIR() and PAIR_NUMBER().
+
+- Dispensed with PDC_chadd() and PDC_chins() -- waddch() and winsch() 
+  are now (again) the core functions.
+
+- Dropped or made static many obsolete, unused, and/or broken functions,
+  including PDC_chg_attrs(), PDC_cursor_on() and _off(),
+  PDC_fix_cursor(), PDC_get_attribute(), PDC_get_cur_col() and _row(),
+  PDC_set_80x25(), PDC_set_cursor_mode(), PDC_set_rows(),
+  PDC_wunderline(), PDC_wleftline(), PDC_wrightline(),
+  XCursesModifierPress() and XCurses_refresh_scrollbar().
+
+- Obsolete/unused defines: _BCHAR, _GOCHAR, _STOPCHAR, _PRINTCHAR 
+  _ENDLINE, _FULLWIN and _SCROLLWIN.
+
+- Obsolete/unused elements of the WINDOW struct: _pmax*, _lastp*, 
+  _lasts*.
+
+- Obsolete/unused elements of the SCREEN struct: orgcbr, visible_cursor,
+  sizeable, shell, blank, cursor, orig_emulation, font, orig_font,
+  tahead, adapter, scrnmode, kbdinfo, direct_video, video_page,
+  video_seg, video_ofs, bogus_adapter. (Some of these persist outside
+  the SCREEN struct, in the platform directories.) Added mouse_wait and 
+  key_code.
+
+- Removed all the EMALLOC stuff. Straight malloc calls were used 
+  elsewhere; it was undocumented outside of comments in curspriv.h; and 
+  there are better ways to use a substitute malloc().
+
+- Single mouse clicks are now reportable on all platforms (not just
+  double-clicks). And in general, mouse event reporting is more
+  consistent across platforms.
+
+- The mouse cursor no longer appears in full-screen mode in Win32 unless
+  a nonzero mouse event mask is used.
+
+- ALT-keypad input now works in Win32.
+
+- In Win32, SetConsoleMode(ENABLE_WINDOW_INPUT) is not useful, and 
+  appears to be the source of a four-year-old bug report (hanging in 
+  THE) by Phil Smith.
+
+- Removed the PDC_THREAD_BUILD stuff, which has never worked. For the
+  record: PDCurses is not thread-safe. Neither is ncurses; and the
+  X/Open curses spec explicitly makes it a non-requirement.
+
+- With the internal compose key system in the X11 port, modifier keys
+  were breaking out of the compose state, making it impossible to type
+  accented capitals, etc. Also, Multi_key is now the default compose
+  key, instead of leaving it undefined by default; and a few more combos
+  are supported.
+
+- In X11, the first reported mouse event after startup always read as a
+  double-click at position 0, 0. (This bug was introduced in 2.8.)
+
+- In X11, don't return selection start as a press event. (Shift-click on
+  button 1 is still returned.)
+
+- In X11, properly handle pasting of high-bit chars. (It was doing an
+  unwanted sign extension.)
+
+- In X11, BUTTON_MOVED was never returned, although PDC_MOUSE_MOVED was
+  set.
+
+- The fix in 2.8 for the scroll wheel in X11 wasn't very good -- it did
+  report the events as scroll wheel events, but it doubled them. Here's
+  a proper fix.
+
+- Changed mouse handling in X11: Simpler translation table, with
+  XCursesPasteSelection() called from XCursesButton() instead of the
+  translation table; require shift with button 1 or 2 for select or
+  paste when mouse events are being reported (as with ncurses), allowing
+  passthrough of simple button 2 events. This fixes the previously
+  unreliable button 2 behavior.
+
+- Modifier keys are now returned on key up in X11, as in Win32. And in
+  general, modifier key reporting is more consistent across platforms.
+
+- Modifiers are not returned as keys when a mouse click has occurred
+  since the key press.
+
+- In BIOS mode (in DOS), count successive identical output bytes, and
+  make only one BIOS call for all of them. This dramatically improves 
+  performance.
+
+- The cursor position was not always updated correctly in BIOS mode.
+
+- In testcurs, the way the ACS test was written, it would really only
+  work with a) PDCurses (with any compiler), or b) gcc (with any
+  curses). Here's a more portable implementation.
+
+- Better reporting of mouse events in testcurs.
+
+- Blank out buffer and num before the scanw() test in testcurs, in case 
+  the user just hits enter or etc.; clear the screen after resizing.
+
+- Allow tuidemo to use the last line.
+
+- Separate left/right modifier keys are now reported properly in Win32.
+  (Everything was being reported as _R.)
+
+- Attempts to redirect input in Win32 now cause program exit and an 
+  error message, instead of hanging.
+
+- Dropped support for the Microway NDP compiler.
+
+- Some modules renamed, rearranged.
+
+- Fixes for errors and warnings when building with Visual C++ 2005.
+
+- In MSVC, the panel library didn't work with the DLL.
+
+- Complete export lists for DLLs.
+
+- Simplified makefiles; moved common elements to .mif files; better 
+  optimization; strip demos when possible.
+
+- Changed makefile targets of "pdcurses.a/lib" and "panel.a/lib" to 
+  $(LIBCURSES) and $(LIBPANEL). Suggestion of Doug Kaufman.
+
+- Changed "install" target in the makefile to a double-colon rule, to 
+  get around a conflict with INSTALL on non-case-sensitive filesystems, 
+  such as Mac OS X's HFS+. Reported by Douglas Godfrey et al.
+
+- Make PDCurses.man dependent on manext. Suggestion of Tiziano Mueller.
+
+- Set up configure.ac so autoheader works; removed some obsolescent 
+  macros. Partly the suggestion of T.M.
+
+- The X11 port now builds in the x11 directory (including the demos), as
+  with other ports.
+
+- The X11 port should now build on more 64-bit systems. Partly due to 
+  M.H.
+
+- The default window title and icons for the X11 port are now "PDCurses"
+  instead of "XCurses".
+
+- Internal functions and variables made static where possible.
+
+- Adopted a somewhat more consistent naming style: Internal functions
+  with external linkage, and only those, have the prefix "PDC_";
+  external variables that aren't part of the API use "pdc_"; static
+  functions use "_"; and "XC_" and "xc_" prefixes are used for functions
+  and variables, respectively, that are shared between both processes in
+  the X11 port. Also eliminated camel casing, where possible.
+
+- Changed the encoding for non-ASCII characters in comments and
+  documentation from Latin-1 to UTF-8.
+
+------------------------------------------------------------------------
+
+PDCurses 2.8 - 2006/04/01
+=========================
+
+As with the previous version, you should assume that apps linked against 
+older dynamic versions of the library won't work with this one until 
+recompiled.
+
+New features:
+
+- Simpler, faster.
+
+- Declarations for all supported, standard functions, per the X/Open
+  Curses 4.2 spec, with the notable exception of getch() and ungetch().
+  You can disable the use of the macro versions by defining NOMACROS
+  before including curses.h (see xmas.c for an example). NOMACROS yields
+  smaller but theoretically slower executables.
+
+- New functions: vwprintw(), vwscanw(), vw_printw() and vw_scanw(). This 
+  completes the list of X/Open 4.2 functions, except for those concerned 
+  with attr_t and wide characters. Some (especially the terminfo/termcap 
+  functions) aren't yet fully fleshed out, though.
+
+- Non-macro implementations for COLOR_PAIR(), PAIR_NUMBER(), getbkgd(), 
+  mvgetnstr(), mvwgetnstr(), mvhline(), mvvline(), mvwhline(), and 
+  mvwvline(). (The macros are still available, too.)
+
+- newterm() works now, in a limited way -- the parameters are ignored, 
+  and only the first invocation will work (i.e., only one SCREEN can be 
+  used).
+
+- start_color() works now -- which is to say, if you _don't_ call it, 
+  you'll only get monochrome output. Also, without calling it, the 
+  terminal's default colors will be used, where supported (currently 
+  only in Win32). This is equivalent to the PDC_ORIGINAL_COLORS behavior 
+  introduced in 2.7, except that _only_ the default colors will be used. 
+  (PDC_ORIGINAL_COLORS is still available, if you want to combine the 
+  use of specific colors and the default colors.)
+
+- New logic for termname() and longname(): termname() always returns
+  "pdcurses"; longname() returns "PDCurses for [platform] [adapter]
+  [COLOR/MONO]-YxX" (adapter is only defined for DOS and OS/2). This is
+  the first time these functions return _anything_ in Win32.
+
+- New installation method for XCurses: the header files are placed in a 
+  subdirectory "xcurses" within the include directory, rather than being 
+  renamed. (But the renamed xcurses.h and xpanel.h are also installed, 
+  for backwards compatibility.) curspriv.h and term.h are now available,
+  and existing curses-based code need no longer be edited to use 
+  XCurses' curses.h. And with no more need for explicit XCursesExit() 
+  calls (see below), your code need not be changed at all to move from 
+  another curses implementation to XCurses. It can be as simple as "gcc 
+  -I/usr/local/include/xcurses -lXCurses -oprogname progname.c".
+
+- Combined readme.* into this HISTORY file, and incorporated the old 1.x
+  (PCcurses) history.
+
+- New functionality for the testcurs demo: ACS character display; menu 
+  support for PgUp, PgDn, Home and End; centered menu; and it can now 
+  be resized in X.
+
+- Added modified versions of the rain and worm demos from ncurses.
+
+Bug fixes and such:
+
+- Big cleanup of dead and redundant code, including unneeded defines, 
+  ifdefs, and structure elements.
+
+- flushinp() was not implemented for Win32.
+
+- resetty() was not restoring LINES and COLS.
+
+- nonl() made '\n' print a line feed without carriage return. This was 
+  incorrect.
+
+- Removed bogus implementation of intrflush().
+
+- The line-breakout optimization system, disabled by default in 2.7, is
+  removed in 2.8. It simply didn't work, and never has. (The typeahead() 
+  function remains, for compatibility, but does nothing.)
+
+- The declarations for the printw() and scanw() function families were
+  erroneously ifdef'd.
+
+- Safer printw() calls on platforms that support vsnprintf().
+
+- Use the native vsscanf() in DJGPP, MinGW and Cygwin.
+
+- ACS_BLOCK now works in X.
+
+- Explicit calls to XCursesExit() are no longer needed.
+
+- XCURSES is now defined automatically if not DOS, OS2 or WIN32.
+
+- The default icon for XCurses wasn't working (had to remove the focus 
+  hint code to fix this). Also, the default title is now "XCurses" 
+  instead of "main".
+
+- Incorrect dimensions (undercounting by two in each direction) were
+  shown while resizing in X.
+
+- Scroll wheel events were not always correctly reported in X.
+
+- 32 bits are enough for the "long" chtype, but 64 bits were used on a 
+  64-bit system, wasting memory. Now conditioned on _LP64. This could be 
+  faster, too.
+
+- The short, 16-bit chtype now works with XCurses.
+
+- Corrected return value for is_linetouched(), is_wintouched(),
+  can_change_color() and isendwin() (bool instead of int).
+
+- timeout(), wtimeout(), idcok() and immedok() return void.
+
+- pair_content() takes a short.
+
+- Replaced incorrect usages of attr_t with chtype. attr_t is still 
+  typedef'd, for backwards compatibility. (It's supposed to be used for 
+  the WA_*-style functions, which PDCurses doesn't yet support.)
+
+- Added const where required by the spec, and in other appropriate
+  places.
+
+- Removed PDC_usleep(). napms() is now the core delay routine.
+
+- Fixed poll() support in napms().
+
+- Various changes to the internal PDC_* functions -- don't depend on 
+  these, and don't use them unless you absolutely have to.
+
+- Some routines accessed window structures in their variable 
+  declarations, _before_ checking for a NULL window pointer.
+
+- Dropped support for the undocumented PDC_FULL_DISPLAY, wtitle(), and
+  PDC_print().
+
+- Cleaned up remaining warnings.
+
+- Reduced unnecessary #include directives -- speeds up compilation.
+
+- Fix for demos build in Borland/DOS -- the makefile in 2.7 didn't 
+  specify the memory model. Reported by Erwin Waterlander.
+
+- Simplified the makefiles; e.g., some now build each demo in a single 
+  step, and Watcom no longer uses demos.lnk. Also, the demo exes are now 
+  stripped when possible; maximum compression used for archives built 
+  by the makefiles; xcurses-config removed as part of "make distclean"; 
+  and I tweaked optimization for some platforms.
+
+- Reverted to /usr/local/ as default installation directory for XCurses.
+
+- Upgraded to autoconf 2.59... instantly doubling the size of the
+  configure script. Ah well. Otherwise, simplified the build system.
+
+- Dropped support for pre-ANSI compilers. (It hasn't worked since at
+  least version 2.4, anyway.)
+
+- Revised and, I hope, clarified the boilerplate and other comments.
+
+- Simplified logging and RCS ids; added RCS ids where missing.
+
+- Consistent formatting for all code, approximately equivalent to
+  "indent -kr -i8 -bl -bli0", with adjustments for 80 columns.
+
+------------------------------------------------------------------------
+
+PDCurses 2.7 - 2005/12/30
+=========================
+
+INTRODUCTION:
+
+ Hello all. As of a few weeks ago, I'm the new maintainer for PDCurses.
+ Here's a brief summary of changes in this release. (More details are
+ available in the CVS log and trackers on SourceForge.)
+
+NEW FEATURES:
+
+- Functions: delscreen(), getattrs(), has_key(), slk_color(),
+  wcolor_set(), wtimeout().
+
+- Macros: color_set(), mvhline(), mvvline(), mvwgetnstr(), mvwhline(),
+  mvwvline(), timeout(), wresize().
+
+- Stub implementations of terminfo functions (including a term.h).
+
+- More stubs for compatibility: filter(), getwin(), putwin(),
+  noqiflush(), qiflush(), scr_dump(), scr_init(), scr_restore(),
+  scr_set(), use_env(), vidattr(), vidputs().
+
+- The terminal's default colors are used as curses' default colors when
+  the environment variable "PDC_ORIGINAL_COLORS" is set to any value
+  (Win32 only at the moment).
+
+- Simplified build system.
+
+- Replaced PDC_STATIC_BUILD with its opposite, PDC_DLL_BUILD (see .mak
+  files for more info).
+
+- Minimal implementation of color_content() -- no longer a stub.
+
+- Added the remaining ACS defines (ACS_S3, ACS_BBSS, etc.) for
+  DOS/OS2/Win; "enhanced" versions of existing ACS characters used.
+
+- Support for scroll wheels.
+
+- Support for Pacific C.
+
+BUGS FIXED:
+
+- Builds correctly (including demos) on all tested platforms (see
+  below); nearly all compiler warnings have been cleaned up; the ptest
+  demo is built on all platforms; "clean" targets are improved.
+
+- The ability to build ncurses_tests has been restored (see demos dir).
+
+- Line-breakout optimization now defaults to off (equivalent to
+  "typeahead(-1)"), so output is not interrupted by keystrokes (it's
+  supposed to resume on the next refresh(), which wasn't working).
+
+- Implicit wrefresh() in wgetch() was not being invoked in nodelay mode.
+
+- subpad() was erroneously offsetting from the origin coordinates of the
+  parent pad (which are always -1,-1).
+
+- In wborder(), whline(), and wvline(), the current (wattrset) attribute
+  was being used, but not the current background (wbkgd).
+
+- Allow Russian 'r' character ASCII 0xe0 to be returned.
+
+- termattrs() now also returns A_UNDERLINE, A_REVERSE.
+
+- In Win32, with large scrollback buffers set, there was an unwanted
+  "scrollup" effect on startup.
+
+- Revamped keyboard handling for Win32.
+
+- New screen resize method for Win32.
+
+- napms(), delay_output(), etc. now work with Cygwin.
+
+- curs_set(0) wasn't working in Win32 in full-screen (ALT-ENTER) mode --
+  the cursor stayed on.
+
+- The A_REVERSE attribute was broken in XCurses.
+
+- On 64-bit systems, XCurses was ignoring every other keystroke.
+
+- Added focus hints for XCurses.
+
+- Demos (except for tuidemo) once again have their proper titles in
+  XCurses (using Xinitscr() instead of the obsolete XCursesProgramName).
+
+- The 16-bit chtype is a working option again (by removing #define
+  CHTYPE_LONG from curses.h), except in XCurses. It's not recommended;
+  but if your needs are limited, it still works.
+
+- Reset screen size in resetty() under DOS, as in Win32 and OS/2.
+
+- Changes for cursor size under DOS.
+
+- Automatic setting of BIOS mode for CGA under DOS now works.
+
+- The cursor is now always updated in PDC_gotoxy(); this fixes the
+  problem of missing characters in BIOS mode.
+
+- Macros nocbreak(), cbreak(), nocrmode(), crmode(), nodelay(),
+  nl() and nonl() now return OK.
+
+- ERR and OK are now defined as -1 and 0, respectively, for
+  compatibility with other curses implementations -- note that this
+  change is not binary compatible; you'll have to rebuild programs that
+  use shared/dynamic libraries.
+
+- Added "const" to prototypes where appropriate.
+
+- Miscellaneous code cleanup.
+
+ACKNOWLEDGEMENTS:
+
+ Walter Briscoe
+ Jean-Pierre Demailly
+ Ruslan Fedyarov
+ Warren Gay
+ Florian Grosse-Coosmann
+ Vladimir Kokovic
+ Matt Maloy
+ K.H. Man
+ Michael Ryazanov
+ Ron Thibodeau
+ Alexandr Zamaraev
+
+ and of course, MARK HESSLING, for his over 13 years of service as the
+ maintainer of PDCurses. Plus, thanks to all who've reported bugs or
+ requested features. Apologies to anyone I've forgotten.
+
+ I've tested this version on Turbo C++ 3.0 and Borland C++ 3.1 for DOS;
+ DJGPP 2.X; Open Watcom 1.3 for DOS (16 and 32-bit), Windows and OS/2;
+ EMX 0.9d and the "newgcc" version of EMX; Borland C++ 5.5 for Windows;
+ recent versions of MinGW, Cygwin, LCC-Win32 and Microsoft Visual C++;
+ and gcc under several flavors of Linux, Mac OS X, *BSD and Solaris.
+
+-- William McBrine
+
+------------------------------------------------------------------------
+
+PDCurses 2.6 - 2003/01/08
+=========================
+
+INTRODUCTION:
+
+ This release of PDCurses includes the following changes:
+
+BUGS FIXED:
+
+- Allow accented characters on Win32 platform when run on non-English
+  keyboards.
+
+- Allow "special" characters like Ctrl-S, Ctrl-Q under OS/2 to be returned.
+
+- Some bugs with halfdelay() fixed by William McBrine.
+
+- pechochar() should now work correctly.
+
+- redrawwin() macro in curses.h was incorrect - fixed by Alberto Ornaghi
+
+- Don't include "special" characters like KEY_SHIFT_L to be returned in
+  getnstr() family. Bug 542913
+
+- Entering TAB in wgetnstr() no longer exceeds requested buffer size.
+  Bug 489233
+
+- Fixed bug 550066, scrollok() and pads.
+  Also beep() called when buffer exceeded. Bug 562041.
+
+- Reverse video of X11 selection reinstated. Pablo Garcia Abio??
+
+- Right Alt modifier now works like left Alt modifier under Win32
+
+- Add support for all libXaw replacement libraries with Scrollbar bug. 
+  Note that for this to work, you still have to change the libXaw 
+  replacement libraries to fix the bug :-(
+
+- Don't trap signals in XCurses if calling application has ignored them. 
+  Change by Frank Heckenbach.
+
+- Bug reports from Warren W. Gay:
+  - Fix termattrs() to return A_REVERSE and A_BLINK on all platforms.
+  - Fix definition of getsyx() and setsyx() to be consistent with 
+    ncurses. Bug 624424.
+  - Fix definition of echo() and noecho(). Bug 625001.
+  - Fix definition of keypad() and leaveok(). Bug 632653.
+  - Missing panel_hidden() prototype. Bug 649320.
+
+- Fixed bug with calling def_prog_mode(), resize_term(), 
+  reset_prog_mode(); the resize details were being lost.
+
+NEW FEATURES:
+
+- Clipboard support now available on DOS platform, but handled 
+  internally to the currently running process.
+
+- New X11 resource: textCursor, allows the text cursor to be specified 
+  as a vertical bar, or the standard horizontal bar. Thanks to Frank 
+  Heckenbach for the suggestion.
+
+NEW COMPILER SUPPORT:
+
+- lcc-win32 now works correctly
+
+------------------------------------------------------------------------
+
+PDCurses 2.5 - 2001/11/26
+=========================
+
+INTRODUCTION:
+
+ This release of PDCurses includes the following changes:
+
+- Set BASE address for Win32 DLL
+
+- Add KEY_SUP and KEY_SDOWN.
+
+- Add PDC_set_line_color()
+
+- Add blink support as bold background
+
+- Add bold colors
+
+- Add getbkgd() macro
+
+- Add new PDC functions for adding underline, overline, leftline and 
+  rightline
+
+- Add support for shifted keypad keys.
+
+- Allow more keypad keys to work under Win32
+
+- Change Win32 and OS/2 DLL name to curses.dll
+
+- Change example resources to allow overriding from the command line
+
+- Changes for building cleanly on OS/2
+
+- Changes to handle building XCurses under AIX
+
+- Check if prefresh() and pnoutrefresh() parameters are valid.
+
+- Ensure build/install works from any directory
+
+- Handle platforms where X11 headers do not typedef XPointer.
+
+- Mention that Flexos is likely out-of-date.
+
+- Pass delaytenths to XCurses_rawgetch()
+
+- Remove boldFont
+
+- Updates for cursor blinking and italic.
+
+BUGS FIXED:
+
+- Fix bug with getting Win32 clipboard contents. Added new 
+  PDC_freeclipboard() function.
+
+- Fix bug with halfdelay()
+
+- Fix bug with mouse interrupting programs that are not trapping mouse 
+  events under Win32.
+
+- Fix return value from curs_set()
+
+- Reverse the left and right pointing bars in ALT_CHARSET
+
+NEW COMPILER SUPPORT:
+
+- Add QNX-RTP port
+
+------------------------------------------------------------------------
+
+PDCurses 2.4 - 2000/01/17
+=========================
+
+INTRODUCTION:
+
+ This release of PDCurses includes the following changes:
+
+- full support of X11 selection handling
+
+- removed the need for the cursos2.h file
+
+- enabled the "shifted" key on the numeric keypad
+
+- added native clipboard support for X11, Win32 and OS/2
+
+- added extra functions for obtaining internal PDCurses status
+
+- added clipboard and key modifier tests in testcurs.c
+
+- fixes for panel library
+
+- key modifiers pressed by themselves are now returned as keys:
+  KEY_SHIFT_L KEY_SHIFT_R KEY_CONTROL_L KEY_CONTROL_R KEY_ALT_L KEY_ALT_R
+  This works on Win32 and X11 ports only
+
+- Added X11 shared library support
+
+- Added extra slk formats supported by ncurses
+
+- Fixed bug with resizing the terminal when slk were on.
+
+- Changed behavior of slk_attrset(), slk_attron() slk_attroff()
+  functions to work more like ncurses.
+
+BUGS FIXED:
+
+- some minor bug and portability fixes were included in this release
+
+NEW FUNCTIONS:
+
+- PDC_getclipboard() and PDC_setclipboard() for accessing the native
+  clipboard (X11, Win32 and OS/2)
+
+- PDC_set_title() for setting the title of the window (X11 and Win32 
+  only)
+
+- PDC_get_input_fd() for getting the file handle of the PDCurses input
+
+- PDC_get_key_modifiers() for getting the keyboard modifier settings at 
+  the time of the last (w)getch()
+
+- Xinitscr() (only for X11 port) which allows standard X11 switches to 
+  be passed to the application
+
+NEW COMPILER SUPPORT:
+
+- MingW32 GNU compiler under Win95/NT
+
+- Cygnus Win32 GNU compiler under Win95/NT
+
+- Borland C++ for OS/2 1.0+
+
+- lcc-win32 compiler under Win95/NT
+
+ACKNOWLEDGEMENTS: (for this release)
+
+ Georg Fuchs for various changes.
+ Juan David Palomar for pointing out getnstr() was not implemented.
+ William McBrine for fix to allow black/black as valid color pair.
+ Peter Preus for pointing out the missing bccos2.mak file.
+ Laura Michaels for a couple of bug fixes and changes required to 
+ support Mingw32 compiler.
+ Frank Heckenbach for PDC_get_input_fd() and some portability fixes and
+ the fixes for panel library.
+ Matthias Burian for the lcc-win32 compiler support.
+
+------------------------------------------------------------------------
+
+PDCurses 2.3 - 1998/07/09
+=========================
+
+INTRODUCTION:
+
+ This release of PDCurses includes the following changes:
+
+- added more System V R4 functions
+
+- added Win32 port
+
+- the X11 port is now fully functional
+
+- the MS Visual C++ Win32 port now includes a DLL
+
+- both the X11 and Win32 ports support the mouse
+
+- the slk..() functions are now functional
+
+- support for scrollbars under X11 are experimental at this stage
+
+- long chtype extended to non-Unix ports
+
+ The name of the statically built library is pdcurses.lib (or 
+ pdcurses.a). The name of the DLL import library (where applicable) is 
+ curses.lib.
+
+BUGS FIXED:
+
+- some minor bugs were corrected in this release
+
+NEW FUNCTIONS:
+
+- slk..() functions
+
+NEW COMPILER SUPPORT:
+
+- MS Visual C++ under Win95/NT
+
+- Watcom C++ under OS/2, Win32 and DOS
+
+- two EMX ports have been provided:
+  - OS/2 only using OS/2 APIs
+  - OS/2 and DOS using EMX video support routines
+
+EXTRA OPTIONS:
+
+ PDCurses recognizes two environment variables which determines the
+ initialization and finalization behavior.  These environment variables
+ do not apply to the X11 port.
+
+ PDC_PRESERVE_SCREEN
+ If this environment variable is set, PDCurses will not clear the screen
+ to the default white on black on startup.  This allows you to overlay
+ a window over the top of the existing screen background.
+
+ PDC_RESTORE_SCREEN
+ If this environment variable is set, PDCurses will take a copy of the
+ contents of the screen at the time that PDCurses is started; initscr(),
+ and when endwin() is called, the screen will be restored.
+
+
+ACKNOWLEDGEMENTS: (for this release)
+
+ Chris Szurgot for original Win32 port.
+ Gurusamy Sarathy for some updates to the Win32 port.
+ Kim Huron for the slk..() functions.
+ Florian Grosse Coosmann for some bug fixes.
+ Esa Peuha for reducing compiler warnings.
+ Augustin Martin Domingo for patches to X11 port to enable accented 
+ characters.
+
+------------------------------------------------------------------------
+
+PDCurses 2.2 - 1995/02/12
+=========================
+
+INTRODUCTION:
+
+ This release of PDCurses has includes a number of major changes:
+
+- The portable library functions are now grouped together into single 
+  files with the same arrangement as System V R4 curses.
+
+- A panels library has been included. This panels library was written by 
+  Warren Tucker.
+
+- Quite a few more functions have been supplied by Wade Schauer and 
+  incorporated into release 2.2. Wade also supplied the support for the 
+  Microway NDP C/C++ 32 bit DOS compiler.
+
+- The curses datatype has been changed from an unsigned int to a long. 
+  This allows more attributes to be stored as well as increasing the 
+  number of color-pairs from 32 to 64.
+
+- Xwindows port (experimental at the moment).
+
+BUGS FIXED:
+
+- mvwin() checked the wrong coordinates
+
+- removed DESQview shadow memory buffer checking bug in curses.h in 
+  #define for wstandout()
+
+- lots of others I can't remember
+
+NEW FUNCTIONS:
+
+- Too many to mention. See intro.man for a complete list of the 
+  functions PDCurses now supports.
+
+COMPILER SUPPORT:
+
+- DJGPP 1.12 is now supported. The run-time error that caused programs 
+  to crash has been removed.
+
+- emx 0.9a is supported. A program compiled for OS/2 should also work 
+  under DOS if you use the VID=EMX switch when compiling. See the 
+  makefile for details.
+
+- The Microway NDP C/C++ DOS compiler is now supported. Thanks to Wade 
+  Schauer for this port.
+
+- The Watcom C++ 10.0 DOS compiler is now supported. Thanks to Pieter 
+  Kunst for this port.
+
+- The library now has many functions grouped together to reduce the size 
+  of the library and to improve the speed of compilation.
+
+- The "names" of a couple of the compilers in the makefile has changed; 
+  CSET2 is now ICC and GO32 is now GCC.
+
+EXTRA OPTIONS:
+
+ One difference between the behavior of PDCurses and Unix curses is the 
+ attributes that are displayed when a character is cleared. Under Unix 
+ curses, no attributes are displayed, so the result is always black. 
+ Under PDCurses, these functions clear with the current attributes in 
+ effect at the time. With the introduction of the bkgd functions, by 
+ default, PDCurses clears using the value set by (w)bkgd(). To have 
+ PDCurses behave the same way as it did before release 2.2, compile with 
+ -DPDCURSES_WCLR
+
+ACKNOWLEDGEMENTS: (for this release)
+
+ Pieter Kunst, David Nugent, Warren Tucker, Darin Haugen, Stefan Strack, 
+ Wade Schauer and others who either alerted me to bugs or supplied 
+ fixes.
+
+------------------------------------------------------------------------
+
+PDCurses 2.1 - 1993/06/20
+=========================
+
+INTRODUCTION:
+
+ The current code contains bug fixes for the DOS and OS/2 releases and 
+ also includes an alpha release for Unix. The Unix release uses another 
+ public domain package (mytinfo) to handle the low-level screen writes. 
+ mytinfo was posted to comp.sources.unix (or misc) in December 1992 or 
+ January 1993. Unless you are a glutton for punishment I would recommend 
+ you avoid the Unix port at this stage.
+
+ The other major addition to PDCurses is the support for DJGPP (the DOS 
+ port of GNU C++). Thanks to David Nugent <davidn@csource.oz.au>.
+
+ Other additions are copywin() function, function debugging support and 
+ getting the small and medium memory models to work. The testcurs.c demo 
+ program has also been changed significantly and a new demo program, 
+ tuidemo, has been added.
+
+ Some people have suggested including information on where to get dmake 
+ from. oak.oakland.edu in /pub/msdos/c
+
+OTHER NOTES:
+	
+ Under DOS, by default, screen writes to a CGA monitor are done via the 
+ video BIOS rather than by direct video memory writes. This is due to 
+ the CGA "snow" problem. If you have a CGA monitor and do not suffer 
+ from snow, you can compile private\_queryad.c with CGA_DIRECT defined. 
+ This will then use cause PDCurses to write directly to the CGA video 
+ memory.
+
+ Function debugging: Firstly to get function debugging, you have to 
+ compile the library with OPT=N in the makefile. This also turns on 
+ compiler debugging. You can control when you want PDCurses to write to 
+ the debug file (called trace in the current directory) by using the 
+ functions traceon() and traceoff() in your program.
+
+ Microsoft C 6.00 Users note:
+ ----------------------------
+
+ With the addition of several new functions, using dmake to compile 
+ PDCurses now causes the compiler to run "out of heap space in pass 2". 
+ Using the 6.00AX version (DOS-Extended) to compile PDCurses fixes this 
+ problem; hence the -EM switch.
+
+ Functional changes
+ ------------------
+
+ Added OS/2 DLL support.
+
+ A few curses functions have been fixed to exhibit their correct 
+ behavior and make them more functionally portable with System V 
+ curses. The functions that have changed are overlay(), overwrite() and 
+ typeahead.
+
+ overlay() and overwrite()
+
+ Both of theses functions in PDCurses 2.0 allowed for one window to be 
+ effectively placed on top of another, and the characters in the first 
+ window were overlaid or overwritten starting at 0,0 in both windows. 
+ This behavior of these functions was not correct. These functions only 
+ operate on windows that physically overlap with respect to the 
+ displayed screen. To achieve the same functionality as before, use the 
+ new function copywin(). See the manual page for further details.
+
+ typeahead()
+
+ This function in PDCurses 2.0 effectively checked to see if there were 
+ any characters remaining in the keyboard buffer. This is not the 
+ behavior exhibited by System V curses. This function is intended 
+ purely to set a flag so that curses can check while updating the 
+ physical screen if any keyboard input is pending. To achieve the same 
+ effect with typeahead() under PDCurses 2.1 the following code should be 
+ used.
+
+ In place of...
+
+	while(!typeahead(stdin))
+	 {
+		/* do something until any key is pressed... */
+	 }
+
+ use...
+
+	/* getch() to return ERR if no key pending */
+	nodelay(stdscr,TRUE);
+	while(getch() == (ERR))
+	 {
+		/* do something until any key is pressed... */
+	 }
+
+
+ACKNOWLEDGEMENTS: (in no particular order)
+
+ Jason Shumate, Pieter Kunst, David Nugent, Andreas Otte, Pasi 
+ Hamalainen, James McLennan, Duane Paulson, Ib Hojme
+	
+ Apologies to anyone I may have left out.
+
+------------------------------------------------------------------------
+
+PDCurses 2.0 - 1992/11/23
+=========================
+
+INTRODUCTION:
+
+ Well, here it finally is; PDCurses v2.0.
+
+ PDCurses v2.0 is an almost total rewrite of PCcurses 1.4 done by John 
+ 'Frotz' Fa'atuai, the previous maintainer. It adds support for OS/2 as 
+ well as DOS.
+
+ This version has been tested with Microsoft C v6.0, QuickC v2.0 and 
+ Borland C++ 2.0 under DOS and Microsoft C v6.0 and TopSpeed c v3.02 
+ under OS/2 2.0. Also the library has been compiled successfully with 
+ emx 0.8e, C Set/2 and Watcom 9. Most testing was done with the large 
+ memory model, where applicable. The large memory model is probably the 
+ best model to use.
+
+ The amount of testing has not been as extensive as I would have liked, 
+ but demands on releasing a product have outweighed the product's 
+ quality. Nothing new with that !! Hopefully with wider circulation, 
+ more bugs will be fixed more quickly.
+
+ I have included just 1 makefile which is suitable for dmake 3.8 for 
+ both DOS and OS/2. The makefile does not rely on customization of the 
+ dmake.ini file.
+
+ If you discover bugs, and especially if you have fixes, please let me 
+ know ASAP.
+
+ The source to the library is distributed as a zip file made with zip 
+ 1.9. You will need Info-ZIP unzip 5.0 to unzip. Follow the directions 
+ below to compile the library.
+
+DIRECTIONS:
+
+ 1. Create a new directory in which to unzip pdcurs20.zip. This will 
+    create a curses directory and a number of subdirectories containing 
+    source code for the library and utilities and the documentation.
+
+ 2. Make changes to the makefile where necessary:
+    Change the MODEL or model macro to the appropriate value (if it
+    applies to your compiler). Use model for Borland compilers.
+
+    Change any paths in the defined macros to be suitable for your
+    compiler.
+
+ 3. Invoke DMAKE [-e environment_options] [target]
+
+    where environment_options are:
+
+	OS (host operating system)
+	COMP (compiler)
+	OPT (optimized version or debug version) - optional. default Y
+	TOS (target operating system) - optional. default OS
+
+    see the makefile for valid combinations
+
+    targets: all, demos, lcursesd.lib, manual...
+	
+    NB. dmake is case sensitive with targets, so those environments that 
+    use an upper case model value (eg MSC) MUST specify the library 
+    target as for eg. Lcursesd.lib
+
+    The makefile is by default set up for Borland C++. The use of -e 
+    environment_options override these defaults. If you prefer, you can 
+    just change the defaults in the makefile and invoke it without the 
+    -e switch.
+
+OTHER NOTES:
+
+ The documentation for the library is built into each source file, a 
+ couple of specific doc files and the header files. A program is 
+ supplied (manext) to build the manual. This program gets compiled when 
+ you build the documentation.
+	
+ To generate the library response file correctly, I had to write a quick 
+ and dirty program (buildlrf) to achieve this. Originally the makefiles 
+ just had statements like: "echo -+$(OBJ)\$* & >> $(LRF)" which appended 
+ a suitable line to the response file. Unfortunately under some 
+ combinations of makefiles and command processors (eg. nmake and 4DOS) 
+ the & would get treated as stderr and the echo command would fail.
+	
+ The original source for PDCurses that I received from the previous 
+ maintainer contained support for the FLEXOS operating system. Not 
+ having access to it, I could not test the changes I made so its support 
+ has fallen by the wayside. If you really need to have PDCurses running 
+ under FLEXOS, contact me and I will see what can be arranged.
+	
+ Under DOS, by default, screen writes to a CGA monitor are done via the 
+ video BIOS rather than by direct video memory writes. This is due to 
+ the CGA "snow" problem. If you have a CGA monitor and do not suffer 
+ from snow, you can compile private\_queryad.c with CGA_DIRECT defined. 
+ This will then use cause PDCurses to write directly to the CGA video 
+ memory.
+
+ Added System V color support.
+
+COMPILER-SPECIFIC NOTES:
+
+ Microsoft C
+ -----------
+
+ It is possible with MSC 6.0 to build the OS/2 libraries and demo 
+ programs from within DOS. This is the only case where it is possible to 
+ specify the value of TOS on the command line to be OS2 and the value of 
+ OS be DOS.
+
+ C Set/2
+ -------
+
+ I have only tested the library using the migration libraries. I doubt 
+ that the demo programs will work without them.
+
+ emx
+ ---
+
+ Testing has been done with 0.8e of emx together with the 16_to_32 
+ libraries. The emx\lib directory should include the vio32.lib and 
+ kbd32.lib libraries from the 16_to_32 package.
+
+BUGS and UNFINISHED BUSINESS:
+
+- PDC_set_ctrl_break() function does not work under OS/2.
+
+- win_print() and PDC_print() do not work under OS/2.
+
+- The file todo.man in the doc directory also lists those functions of 
+  System V 3.2 curses not yet implemented. Any volunteers?
+
+ACKNOWLEDGEMENTS:
+
+ John 'Frotz' Fa'atuai, the previous maintainer for providing an
+ excellent base for further development.
+ John Burnell <johnb@kea.am.dsir.govt.nz>, for the OS/2 port.
+ John Steele, Jason (finally NOT a John) Shumate....
+ for various fixes and suggestions.
+ Eberhardt Mattes (author of emx) for allowing code based on his
+ C library to be included with PDCurses.
+ Several others for their support, moral and actual.
+
+-- Mark Hessling
+
+------------------------------------------------------------------------
+
+PDCurses 2.0Beta - 1991/12/21
+=============================
+
+Changed back from short to int. (int is the correct size for the default 
+platform. Short might be too short on some platforms. This is more 
+portable. I, also, made this mistake.)
+
+Many functions are now macros.  If you want the real thing, #undef the 
+macro. (X/Open requirement.)
+
+Merged many sources into current release.
+
+Added many X/Open routines (not quite all yet).
+
+Added internal documentation to all routines.
+
+Added a HISTORY file to the environment.
+
+Added a CONTRIB file to the environment.
+
+------------------------------------------------------------------------
+
+PDCurses 1.5Beta - 1990/07/14
+=============================
+
+Added many levels of compiler support. Added mixed prototypes for all 
+"internal" routines. Removed all assembly language.  Added EGA/VGA 
+support.  Converted all #ifdef to #if in all modules except CURSES.H and 
+CURSPRIV.H. Always include ASSERT.H.  Added support for an external 
+malloc(), calloc() and free(). Added support for FAST_VIDEO 
+(direct-memory writes). Added various memory model support (for 
+FAST_VIDEO). Added much of the December 1988 X/Open Curses 
+specification.
+
+-- John 'Frotz' Fa'atuai
+
+------------------------------------------------------------------------
+
+PCcurses 1.4 - 1990/01/14
+=========================
+
+  In PCcurses v.1.4, both portability improvements and bugfixes have 
+been made. The files have been changed to allow lint-free compilation 
+with Microsoft C v.5.1, and with Turbo C v.2.0. The source should still 
+compile without problems on older compilers, although this has not been 
+verified.
+
+  The makefiles have been changed to suit both the public release and 
+the author, who maintains a special kind of libraries for himself. In 
+the case of Microsoft C, changes were done in the makefile to lower the 
+warning level to 2 (was 3). This was to avoid ANSI warnings which are 
+abundant because PCcurses does not attempt to follow strict ANSI C 
+standard.
+
+  BUG FIXES FROM V.1.3 TO V.1.4:
+
+  !!!IMPORTANT CHANGE!!!
+
+  The definitions for OK and ERR in curses.h were exchanged. This was 
+done to be more consistent with UNIX versions. Also, it permits 
+functions like newwin() and subwin() to return 0 (=NULL) when they fail 
+due to memory shortage. This incompatibility with UNIX curses was 
+pointed out by Fred C. Smith. If you have tested success/failure by 
+comparisons to anything other than ERR and OK, your applications will 
+need to be be changed on that point. Sorry... but presumably most of you 
+used the symbolic constants?
+
+  (END OF IMPORTANT CHANGE)
+
+  Fred also pointed out a bug in the file update.c. The bug caused the 
+first character printed after 'unauthorized' screen changes (like during 
+a shell escape, for example) to be placed at the wrong screen position. 
+This happened even if the normal precautions (clear / touch / refresh) 
+were taken. The problem has now been fixed.
+
+  PCcurses is currently also being used on a 68000 system with 
+hard-coded ESCape sequences for ANSI terminals. However, ints used by 
+the 68000 C compiler are 32 bits. Therefore ints have been turned into 
+shorts wherever possible in the code (otherwise all window structures 
+occupy twice as much space as required on the 68000). This does not 
+affect PC versions since normally both ints and shorts are 16 bits for 
+PC C compilers.
+
+  At some places in the source code there are references made to the 
+68000 version. There are also a makefile, a curses68.c file, and a 
+curses68.cmd file. These are for making, low-level I/O, and linking 
+commands when building the 68000 version. These files are probably 
+useful to no-one but the author, since it is very specific for its 
+special hardware environment. Still in an effort to keep all 
+curses-related sources in one place they are included. Note however that 
+PCcurses will not officially support a non-PC environment.
+
+  The file cursesio.c, which was included in the package at revision 
+level 1.2, and which was to be an alternative to the cursesio.asm file, 
+has been verified to behave incorrectly in the function _curseskeytst(). 
+The problem was that the value of 'cflag' does not contain the proper 
+data for the test that is attempted. Furthermore, neither Turbo C or 
+Microsoft C allows any way to return the data that is needed, and 
+consequently you should not use cursesio.c. The best solution is to 
+simply use the ASM version. In v.1.2 and v.1.3, the user could edit the 
+makefile to select which version he wanted to use. The makefiles in 
+v.1.4 have removed this possibility forcing the use of the ASM file, and 
+cursesio.c has been dropped from the distribution.
+
+  A bug in the wgetstr() function caused PCcurses to echo characters 
+when reading a keyboard string, even if the echo had been turned off. 
+Thanks to Per Foreby at Lund University, Sweden, for this. Per also 
+reported bugs concerning the handling of characters with bit 8 set. 
+Their ASCII code were considered as lower than 32, so they were erased 
+etc. like control characters, i.e. erasing two character positions. The 
+control character test was changed to cope with this.
+
+  The overlay() and overwrite() functions were changed so that the 
+overlaying window is positioned at its 'own' coordinates inside the 
+underlying window (it used to be at the underlying window's [0,0] 
+position). There is some controversy about this - the documentation for 
+different curses versions say different things. I think the choice made 
+is the most reasonable.
+
+  The border() and wborder() functions were changed to actually draw a 
+border, since this seems to be the correct behavior of these functions. 
+They used to just set the border characters to be used by box(). These 
+functions are not present in standard BSD UNIX curses.
+
+  The subwin() function previously did not allow the subwindow to be as 
+big as the original window in which it was created. This has now been 
+fixed. There was also the problem that the default size (set by 
+specifying numlines or numcols (or both) as 0 made the resulting actual 
+size 1 line/column too small.
+
+  There were a few spelling errors in function names, both in the 
+function declarations and in curses.h. This was reported by Carlos 
+Amaral at INESC in Portugal. Thanks! There was also an unnecessary (but 
+harmless) parameter in a function call at one place.
+
+------------------------------------------------------------------------
+
+PCcurses 1.3 - 1988/10/05
+=========================
+
+  The file 'border.c' is now included. It allows you to explicitly 
+specify what characters should be used as box borders when the box() 
+functions are called. If the new border characters are non-0, they 
+override the border characters specified in the box() call. In my 
+understanding, this functionality is required for AT&T UNIX sV.3 
+compatibility. Thanks for this goes to Tony L. Hansen
+(hansen@pegasus.UUCP) for posting an article about it on Usenet 
+(newsgroup comp.unix.questions; his posting was not related at all to 
+PCcurses).
+
+  The only other difference between v.1.2 and v.1.3 is that the latter 
+has been changed to avoid warning diagnostics if the source files are 
+compiled with warning switches on (for Microsoft this means '-W3', for 
+Turbo C it means '-w -w-pro'). Of these, the Turbo C warning check is 
+clearly to be used rather than Microsoft, even if neither of them comes 
+even close to a real UNIX 'lint'. Some of the warnings in fact indicated 
+real bugs, mostly functions that did not return correct return values or 
+types.
+
+  The makefiles for both MSC and TRC have been modified to produce 
+warning messages as part of normal compilation.
+
+------------------------------------------------------------------------
+
+PCcurses 1.2 - 1988/10/02
+=========================
+
+  The changes from v.1.1 to v.1.2 are minor. The biggest change is that 
+there was a bug related to limiting the cursor movement if the 
+application tried to move it outside the screen (something that should 
+not be done anyway). Such erroneous application behavior is now handled 
+appropriately.
+
+  All modules have been changed to have a revision string in them, which 
+makes it easier to determine what version is linked into a program (or 
+what library version you have).
+
+  There is now a 'cursesio.c' file. That file does the same as 
+'cursesio.asm' (i.e. it provides the interface to the lower-level system 
+I/O routines). It is written in C and thus it is (possibly) more 
+portable than the assembler version (but still not so portable since it 
+uses 8086 INT XX calls directly). When one creates new curses libraries, 
+one chooses whether to use the assembler or the C version of cursesio. 
+The choice is made by commenting out the appropriate dependencies for 
+cursesio.obj, near the end of the makefiles.
+
+  There is now a 'setmode.c' file. That file contains functions that 
+save and restore terminal modes. They do it into other variables than do 
+savetty() and resetty(), so one should probably use either 
+savetty()/resetty() or the new functions only - and not mix the both 
+ways unless one really knows what one does.
+
+  Diff lists vs v.1.0 are no longer included in the distribution. The 
+make utility still is. PCcurses v.1.2 still compiles with Microsoft C 
+v.4.0, and with Borland Turbo C v.1.0. There is as far as I know no 
+reason to believe that it does not compile under Microsoft C v.3.0 and 
+5.x, or Turbo C v.1.5, but this has not been tested.
+
+  There are two makefiles included, one for Microsoft C, one for Turbo 
+C. They are both copies of my personal makefiles, and as such they 
+reflect the directory structure on my own computer. This will have to be 
+changed before you run make. Check $(INCDIR) and $(LIBDIR) in 
+particular, and make the choice of ASM or C cursesio version as 
+mentioned above (the distribution version uses the C version of 
+cursesio).
+
+  The manual file (curses.man) has been changed at appropriate places.
+
+  I would like to thank the following persons for their help:
+
+  	Brandon S. Allbery (alberry@ncoast.UUCP)
+		for running comp.binaries.ibm.pc (at that time)
+		and comp.source.misc.
+
+	Steve Balogh (Steve@cit5.cit.oz.AU)
+  		for writing a set of manual pages and posting
+		them to the net.
+
+	Torbjorn Lindh
+		for finding bugs and suggesting raw
+		character output routines.
+
+	Nathan Glasser (nathan@eddie.mit.edu)
+  		for finding and reporting bugs.
+
+	Ingvar Olafsson (...enea!hafro!ingvar)
+  		for finding and reporting bugs.
+
+	Eric Rosco (...enea!ipmoea!ericr)
+  		for finding and reporting bugs.
+
+	Steve Creps (creps@silver.bacs.indiana.edu)
+  		for doing a lot of work - among others
+		posting bug fixes to the net, and writing
+		the new cursesio.c module.
+
+	N. Dean Pentcheff (dean@violet.berkeley.edu)
+  		for finding bugs and rewriting cursesio.asm
+		for Turbo 'C' 1.5.
+
+  Finally, Jeff Dean (parcvax,hplabs}!cdp!jeff)
+  		     (jeff@ads.arpa)
+	has had a shareware version of curses deliverable since
+	about half a year before I released PCcurses 1.0 on Use-
+	Net. He is very concerned about confusion between the two
+	packages, and therefore any references on the network
+	should make clear whether they reference Dean's PCcurses
+	or Larsson's PCcurses.
+
+------------------------------------------------------------------------
+
+PCcurses 1.1 - 1988/03/06
+=========================
+
+  The changes from v.1.0 to v.1.1 are minor. There are a few bug fixes, 
+and new (non-portable) functions for verbatim IBM character font display 
+have been added (in charadd.c and charins.c). The manual file 
+(curses.man) has been changed at appropriate places.
+
+  In the file v10tov11.dif there are listings of the differences between
+version 1.0 and 1.1. The diff listings are in UNIX diff(1) format.
+
+  Version 1.1 compiles with Turbo C v.1.0, as well as Microsoft C v.3.0 
+and v.4.0. On the release disk there is a make.exe utility which is very 
+similar to UNIX make (If the package was mailed to you, the make utility 
+will be in uuencoded format - in make.uu - and must be uudecoded first). 
+It is much more powerful than Microsoft's different MAKEs; the latter 
+ones will NOT generate libraries properly if used with the PCcurses 
+makefiles.
+
+  There are three makefiles:
+
+	makefile		generic MSC 3.0 makefile
+	makefile.ms		MSC 4.0 makefile
+	makefile.tc		Turbo C 1.0 makefile
+
+  To make a library with for example Turbo C, make directories to hold 
+.H and .LIB files (these directories are the 'standard places'), edit 
+makefile.tc for this, and type
+
+	make -f makefile.tc all
+
+and libraries for all memory models will be created in the .LIB 
+directory, while the include files will end up in the .H directory. Also 
+read what is said about installation below!
+
+------------------------------------------------------------------------
+
+PCcurses 1.0 - 1987/08/24
+=========================
+
+  This is the release notes for the PCcurses v.1.0 cursor/window control 
+package. PCcurses offers the functionality of UNIX curses, plus some 
+extras. Normally it should be possible to port curses-based programs 
+from UNIX curses to PCcurses on the IBM PC without changes. PCcurses is 
+a port/ rewrite of Pavel Curtis' public domain 'ncurses' package. All 
+the code has been re-written - it is not just an edit of ncurses (or 
+UNIX curses). I mention this to clarify any copyright violation claims. 
+The data structures and ideas are very similar to ncurses. As for UNIX 
+curses, I have not even seen any sources for it.
+
+  For an introduction to the use of 'curses' and its derivatives, you 
+should read 'Screen Updating and Cursor Movement Optimization: A Library 
+Package' by Kenneth C. R. C. Arnold, which describes the original 
+Berkeley UNIX version of curses. It is available as part of the UNIX 
+manuals. The other source of information is 'The Ncurses Reference 
+Manual' by Pavel Curtis. The latter is part of Curtis' ncurses package.
+
+  The only other documentation provided is a 'man' page which describes 
+all the included functions in a very terse way. In the sources, each 
+function is preceded by a rather thorough description of what the 
+function does. I didn't have time to write a nice manual/tutorial - 
+sorry.
+
+  PCcurses is released as a number of source files, a man page, and a 
+make file. A uuencoded copy of a 'make' utility, and a manpage for the 
+'make' is also provided to make it easier to put together PCcurses 
+libraries. Even if you are not interested in PCcurses, it may be 
+worthwhile to grab the make.
+
+  The makefile assumes the presence of the Microsoft C compiler (3.0 or 
+4.0), Microsoft MASM and LIB, plus some MS-DOS utilities. The reason for 
+supplying MAKE.EXE is that the Microsoft 'MAKE:s' are much inferior to a 
+real UNIX make. The supplied make is a port of a public domain make, 
+published on Usenet. It is almost completely compatible with UNIX make. 
+When generating the curses libraries, the makefile will direct make to 
+do some directory creating and file copying, and then re-invoke itself 
+with new targets. The workings of the makefile are not absolutely 
+crystal clear at first sight... just start it and see what it does.
+
+  For portability, the curses libraries depend on one assembler file for 
+access to the BIOS routines. There is no support for the EGA, but both 
+CGA, MGA, and the HGA can be used. The libraries are originally for 
+Microsoft C, but all C modules should be portable right away. In the 
+assembler file, segment names probably need to be changed, and possibly 
+the parameter passing scheme. I think Turbo C will work right away - as 
+far as I understand, all its conventions are compatible with Microsoft 
+C.
+
+  There are some parts left out between ncurses and PCcurses. One is the 
+support for multiple terminals - not very interesting on a PC anyway. 
+Because we KNOW what terminal we have, there is no need for a termcap or 
+terminfo library. PCcurses also has some things that neither curses nor 
+ncurses have. Compared to the original UNIX curses, PCcurses has lots of 
+extras.
+
+  The BIOS routines are used directly, which gives fast screen updates.
+PCcurses does not do direct writes to screen RAM - in my opinion it is
+a bit ugly to rely that much on hardware compatibility. Anyone could fix
+that, of course...
+
+  One of the more serious problems with PCcurses is the way in which 
+normal, cbreak, and raw input modes are done. All those details are in 
+the 'charget' module - I do raw I/O via the BIOS, and perform any 
+buffering myself. If an application program uses PCcurses, it should do 
+ALL its I/O via PCcurses calls, otherwise the mix of normal and 
+PCcurses I/O may mess up the display. I think my code is reasonable... 
+comments are welcome, provided you express them nicely...
+
+  To install, copy all files to a work directory, edit 'makefile' to 
+define the standard include and library file directory names of your 
+choice (these directories must exist already, and their path names must 
+be relative to the root directory, not to the current one). You must 
+also run uudecode on make.uu, to generate MAKE.EXE. You can do that on 
+your PC, if you have uudecode there, otherwise you can do it under UNIX 
+and do a binary transfer to the PC. When you have MAKE.EXE in your work 
+directory (or in your /bin directory), type make.
+
+  Make will now create 4 sub-directories (one for each memory model), 
+copy some assembler include files into them, copy two include files to 
+your include directory, CHDIR to each sub-directory and re-invoke itself 
+with other make targets to compile and assemble all the source files 
+into the appropriate directories. Then the library manager is run to 
+create the library files in your desired library directory. Presto!
+
+  If you only want to generate a library for one memory model, type 
+'make small', 'make large', etc. The name of the memory model must be in 
+lower case, like in the makefile.
+
+  I think the package is fairly well debugged - but then again, that's 
+what I always think. It was completed in May-87, and no problems found 
+yet. Now it's your turn... Comments, suggestions and bug reports and 
+fixes (no flames please) to
+
+-- Bjorn Larsson
diff --git a/payloads/libpayload/curses/PDCurses-3.4/IMPLEMNT b/payloads/libpayload/curses/PDCurses-3.4/IMPLEMNT
new file mode 100644
index 0000000..0445f8b
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/IMPLEMNT
@@ -0,0 +1,325 @@
+PDCurses Implementor's Guide
+============================
+
+Version 1.3 - 200?/??/?? - notes about official ports
+Version 1.2 - 2007/07/11 - added PDC_init_pair(), PDC_pair_content(), 
+			   version history; removed pdc_atrtab
+Version 1.1 - 2007/06/06 - minor cosmetic change
+Version 1.0 - 2007/04/01 - initial revision
+
+This document is for those wishing to port PDCurses to a new platform, 
+or just wanting to better understand how it works. Nothing here should 
+be needed for application programming; for that, refer to PDCurses.txt, 
+as built in doc/, or distributed as a file separate from this source 
+package. This document assumes that you've read the user-level 
+documentation and are very familiar with application-level curses 
+programming.
+
+If you want to submit your port for possible inclusion into the main 
+PDCurses distribution, please follow these guidelines:
+
+ - Don't modify anything in the pdcurses directory or in other port 
+   directories. Don't modify curses.h or curspriv.h unless absolutely 
+   necessary. (And prefer modifying curspriv.h over curses.h.)
+
+ - Use the same indentation style, naming and scope conventions as the 
+   existing code.
+
+ - Release all your code to the public domain -- no copyright. Code 
+   under GPL, BSD, etc. will not be accepted.
+
+
+DATA STRUCTURES
+---------------
+
+A port of PDCurses must provide acs_map[], a 128-element array of 
+chtypes, with values laid out based on the Alternate Character Set of 
+the VT100 (see curses.h). PDC_transform_line() must use this table; when 
+it encounters a chtype with the A_ALTCHARSET flag set, and an A_CHARTEXT 
+value in the range 0-127, it must render it using the A_CHARTEXT portion 
+of the corresponding value from this table, instead of the original 
+value. Also, values may be read from this table by apps, and passed 
+through functions such as waddch(), which does no special processing on 
+control characters (0-31 and 127) when the A_ALTCHARSET flag is set. 
+Thus, any control characters used in acs_map[] should also have the 
+A_ALTCHARSET flag set. Implementations should provide suitable values 
+for all the ACS_ macros defined in curses.h; other values in the table 
+should be filled with their own indices (e.g., acs_map['E'] == 'E'). The 
+table can be either hardwired, or filled by PDC_scr_open(). Existing 
+ports define it in pdcdisp.c, but this is not required.
+
+
+FUNCTIONS
+---------
+
+A port of PDCurses must implement the following functions, with extern 
+scope. These functions are traditionally divided into several modules, 
+as indicated below; this division is not required (only the functions 
+are), but may make it easier to follow for someone familiar with the 
+existing ports.
+
+Any other functions you create as part of your implementation should 
+have static scope, if possible. If they can't be static, they should be 
+named with the "PDC_" prefix. This minimizes the risk of collision with 
+an application's choices.
+
+Current PDCurses style also uses a single leading underscore with the 
+name of any static function; and modified BSD/Allman-style indentation, 
+approximately equivalent to "indent -kr -i8 -bl -bli0", with adjustments 
+to keep every line under 80 columns. This isn't essential, but a 
+consistent style helps readability.
+
+
+pdcdisp.c:
+----------
+
+void	PDC_gotoyx(int y, int x);
+
+Move the physical cursor (as opposed to the logical cursor affected by 
+wmove()) to the given location. This is called mainly from doupdate(). 
+In general, this function need not compare the old location with the new 
+one, and should just move the cursor unconditionally.
+
+void	PDC_transform_line(int lineno, int x, int len, const chtype *srcp);
+
+The core output routine. It takes len chtype entities from srcp (a 
+pointer into curscr) and renders them to the physical screen at line 
+lineno, column x. It must also translate characters 0-127 via acs_map[], 
+if they're flagged with A_ALTCHARSET in the attribute portion of the 
+chtype.
+
+
+pdcgetsc.c:
+-----------
+
+int	PDC_get_columns(void);
+
+Returns the size of the screen in columns. It's used in resize_term() to 
+set the new value of COLS. (Some existing implementations also call it 
+internally from PDC_scr_open(), but this is not required.)
+
+int	PDC_get_cursor_mode(void);
+
+Returns the size/shape of the cursor. The format of the result is 
+unspecified, except that it must be returned as an int. This function is 
+called from initscr(), and the result is stored in SP->orig_cursor, 
+which is used by PDC_curs_set() to determine the size/shape of the 
+cursor in normal visibility mode (curs_set(1)).
+
+int	PDC_get_rows(void);
+
+Returns the size of the screen in rows. It's used in resize_term() to 
+set the new value of LINES. (Some existing implementations also call it 
+internally from PDC_scr_open(), but this is not required.)
+
+
+pdckbd.c:
+---------
+
+bool	PDC_check_key(void);
+
+Keyboard/mouse event check, called from wgetch(). Returns TRUE if
+there's an event ready to process. This function must be non-blocking.
+
+void	PDC_flushinp(void);
+
+This is the core of flushinp(). It discards any pending key or mouse
+events, removing them from any internal queue and from the OS queue, if
+applicable.
+
+int	PDC_get_key(void);
+
+Get the next available key, or mouse event (indicated by a return of
+KEY_MOUSE), and remove it from the OS' input queue, if applicable. This
+function is called from wgetch(). This function may be blocking, and
+traditionally is; but it need not be. If a valid key or mouse event
+cannot be returned, for any reason, this function returns -1. Valid keys
+are those that fall within the appropriate character set, or are in the
+list of special keys found in curses.h (KEY_MIN through KEY_MAX). When
+returning a special key code, this routine must also set SP->key_code to
+TRUE; otherwise it must set it to FALSE. If SP->return_key_modifiers is
+TRUE, this function may return modifier keys (shift, control, alt),
+pressed alone, as special key codes; if SP->return_key_modifiers is
+FALSE, it must not. If modifier keys are returned, it should only happen
+if no other keys were pressed in the meantime; i.e., the return should
+happen on key up. But if this is not possible, it may return the
+modifier keys on key down (if and only if SP->return_key_modifiers is
+TRUE).
+
+int	PDC_modifiers_set(void);
+
+Called from PDC_return_key_modifiers(). If your platform needs to do 
+anything in response to a change in SP->return_key_modifiers, do it 
+here. Returns OK or ERR, which is passed on by the caller.
+
+int	PDC_mouse_set(void);
+
+Called by mouse_set(), mouse_on(), and mouse_off() -- all the functions 
+that modify SP->_trap_mbe. If your platform needs to do anything in 
+response to a change in SP->_trap_mbe (for example, turning the mouse 
+cursor on or off), do it here. Returns OK or ERR, which is passed on by 
+the caller.
+
+void	PDC_set_keyboard_binary(bool on);
+
+Set keyboard input to "binary" mode. If you need to do something to keep 
+the OS from processing ^C, etc. on your platform, do it here. TRUE turns 
+the mode on; FALSE reverts it. This function is called from raw() and 
+noraw().
+
+
+pdcscrn.c:
+----------
+
+bool	PDC_can_change_color(void);
+
+Returns TRUE if init_color() and color_content() give meaningful 
+results, FALSE otherwise. Called from can_change_color().
+
+int	PDC_color_content(short color, short *red, short *green, short *blue);
+
+The core of color_content(). This does all the work of that function, 
+except checking for values out of range and null pointers.
+
+int	PDC_init_color(short color, short red, short green, short blue);
+
+The core of init_color(). This does all the work of that function, 
+except checking for values out of range.
+
+void	PDC_init_pair(short pair, short fg, short bg);
+
+The core of init_pair(). This does all the work of that function, except 
+checking for values out of range. The values passed to this function 
+should be returned by a call to PDC_pair_content() with the same pair 
+number. PDC_transform_line() should use the specified colors when 
+rendering a chtype with the given pair number.
+
+int	PDC_pair_content(short pair, short *fg, short *bg);
+
+The core of pair_content(). This does all the work of that function, 
+except checking for values out of range and null pointers.
+
+void	PDC_reset_prog_mode(void);
+
+The non-portable functionality of reset_prog_mode() is handled here -- 
+whatever's not done in _restore_mode(). In current ports: In OS/2, this 
+sets the keyboard to binary mode; in Win32, it enables or disables the 
+mouse pointer to match the saved mode; in others it does nothing.
+
+void	PDC_reset_shell_mode(void);
+
+The same thing, for reset_shell_mode(). In OS/2 and Win32, it restores 
+the default console mode; in others it does nothing.
+
+int	PDC_resize_screen(int nlines, int ncols);
+
+This does the main work of resize_term(). It may respond to non-zero 
+parameters, by setting the screen to the specified size; to zero 
+parameters, by setting the screen to a size chosen by the user at 
+runtime, in an unspecified way (e.g., by dragging the edges of the 
+window); or both. It may also do nothing, if there's no appropriate 
+action for the platform.
+
+void	PDC_restore_screen_mode(int i);
+
+Called from _restore_mode() in kernel.c, this function does the actual 
+mode changing, if applicable. Currently used only in DOS and OS/2.
+
+void	PDC_save_screen_mode(int i);
+
+Called from _save_mode() in kernel.c, this function saves the actual 
+screen mode, if applicable. Currently used only in DOS and OS/2.
+
+void	PDC_scr_close(void);
+
+The platform-specific part of endwin(). It may restore the image of the 
+original screen saved by PDC_scr_open(), if the PDC_RESTORE_SCREEN 
+environment variable is set; either way, if using an existing terminal, 
+this function should restore it to the mode it had at startup, and move 
+the cursor to the lower left corner. (The X11 port does nothing.)
+
+void	PDC_scr_free(void);
+
+Frees the memory for SP allocated by PDC_scr_open(). Called by 
+delscreen().
+
+int	PDC_scr_open(int argc, char **argv);
+
+The platform-specific part of initscr(). It's actually called from 
+Xinitscr(); the arguments, if present, correspond to those used with 
+main(), and may be used to set the title of the terminal window, or for 
+other, platform-specific purposes. (The arguments are currently used 
+only in X11.) PDC_scr_open() must allocate memory for SP, and must 
+initialize acs_map[] (unless it's preset) and several members of SP, 
+including lines, cols, mouse_wait, orig_attr (and if orig_attr is TRUE, 
+orig_fore and orig_back), mono, _restore and _preserve. (Although SP is 
+used the same way in all ports, it's allocated here in order to allow 
+the X11 port to map it to a block of shared memory.) If using an 
+existing terminal, and the environment variable PDC_RESTORE_SCREEN is 
+set, this function may also store the existing screen image for later 
+restoration by PDC_scr_close().
+
+
+pdcsetsc.c:
+-----------
+
+int	PDC_curs_set(int visibility);
+
+Called from curs_set(). Changes the appearance of the cursor -- 0 turns 
+it off, 1 is normal (the terminal's default, if applicable, as 
+determined by SP->orig_cursor), and 2 is high visibility. The exact 
+appearance of these modes is not specified.
+
+
+pdcutil.c:
+----------
+
+void	PDC_beep(void);
+
+Emits a short audible beep. If this is not possible on your platform, 
+you must set SP->audible to FALSE during initialization (i.e., from 
+PDC_scr_open() -- not here); otherwise, set it to TRUE. This function is 
+called from beep().
+
+void	PDC_napms(int ms);
+
+This is the core delay routine, called by napms(). It pauses for about 
+(the X/Open spec says "at least") ms milliseconds, then returns. High 
+degrees of accuracy and precision are not expected (though desirable, if 
+you can achieve them). More important is that this function gives back 
+the process' time slice to the OS, so that PDCurses idles at low CPU 
+usage.
+
+const char *PDC_sysname(void);
+
+Returns a short string describing the platform, such as "DOS" or "X11". 
+This is used by longname(). It must be no more than 100 characters; it 
+should be much, much shorter (existing platforms use no more than 5).
+
+--------------------------------------------------------------------------
+
+The following functions are implemented in the platform directories, but 
+are accessed directly by apps. Refer to the user documentation for their 
+descriptions:
+
+
+pdcclip.c:
+----------
+
+int     PDC_clearclipboard(void);
+int     PDC_freeclipboard(char *contents);
+int     PDC_getclipboard(char **contents, long *length);
+int     PDC_setclipboard(const char *contents, long length);
+
+
+pdckbd.c:
+---------
+
+unsigned long PDC_get_input_fd(void);
+
+
+pdcsetsc.c:
+-----------
+
+int     PDC_set_blink(bool blinkon);
+void    PDC_set_title(const char *title);
diff --git a/payloads/libpayload/curses/PDCurses-3.4/Makefile.in b/payloads/libpayload/curses/PDCurses-3.4/Makefile.in
new file mode 100644
index 0000000..dc40abf
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/Makefile.in
@@ -0,0 +1,108 @@
+# Makefile for PDCurses library for X11
+
+SHELL = @SHELL@
+
+@SET_MAKE@
+
+srcdir		=@srcdir@
+prefix		=@prefix@
+exec_prefix	=$(DESTDIR)@exec_prefix@
+libdir		=$(exec_prefix)/lib
+bindir		=$(exec_prefix)/bin
+includedir	=$(exec_prefix)/include
+pdcursesdir	=./x11
+
+INSTALL		=$(srcdir)/install-sh
+RANLIB		=@RANLIB@
+SHLPRE = @SHLPRE@
+SHLPST = @SHLPST@
+SHLFILE = XCurses
+
+include $(srcdir)/version.mif
+
+PDC_DIR=PDCurses-$(VERDOT)
+
+ZIPFILE = pdcurs$(VER).zip
+TARBALL = $(PDC_DIR).tar.gz
+
+all \
+clean \
+distclean \
+mostlyclean \
+realclean ::
+	cd x11; $(MAKE) $(MFLAGS) $@
+	cd doc; $(MAKE) $(MFLAGS) $@
+
+install ::
+	$(INSTALL) -d -m 755 $(libdir)
+	$(INSTALL) -d -m 755 $(bindir)
+	$(INSTALL) -d -m 755 $(includedir)
+	$(INSTALL) -d -m 755 $(includedir)/xcurses
+	$(INSTALL) -c -m 644 $(srcdir)/curses.h $(includedir)/xcurses.h
+	$(INSTALL) -c -m 644 $(srcdir)/curses.h $(includedir)/xcurses/curses.h
+	sed -e 's/#include <curses.h>/#include <xcurses.h>/' \
+		< $(srcdir)/panel.h > ./xpanel.h
+	$(INSTALL) -m 644 ./xpanel.h $(includedir)/xpanel.h
+	$(INSTALL) -c -m 644 $(srcdir)/panel.h $(includedir)/xcurses/panel.h
+	$(INSTALL) -c -m 644 $(srcdir)/term.h $(includedir)/xcurses/term.h
+	$(INSTALL) -c -m 644 $(pdcursesdir)/libXCurses.a $(libdir)/libXCurses.a
+	-$(RANLIB) $(libdir)/libXCurses.a
+	-$(INSTALL) -c -m 755 $(pdcursesdir)/$(SHLPRE)$(SHLFILE)$(SHLPST) \
+		$(libdir)/$(SHLPRE)$(SHLFILE)$(SHLPST)
+	ln -f -s $(libdir)/$(SHLPRE)$(SHLFILE)$(SHLPST) \
+		$(libdir)/$(SHLPRE)Xpanel$(SHLPST)
+	ln -f -s $(libdir)/libXCurses.a $(libdir)/libXpanel.a
+	-$(RANLIB) $(libdir)/libXpanel.a
+	$(INSTALL) -c -m 755 x11/xcurses-config $(bindir)/xcurses-config
+
+clean ::
+	rm -f config.log config.cache config.status
+
+distclean ::
+	rm -f config.log config.cache config.status
+	rm -f config.h Makefile x11/xcurses-config
+
+manual:
+	cd doc; $(MAKE) $(MFLAGS) $@
+
+$(ZIPFILE):
+	zip -9y $(ZIPFILE) README HISTORY IMPLEMNT *.spec *.mif *.def \
+	Makefile.in config.h.in configure configure.ac config.guess \
+	config.sub x11/xcurses-config.in install-sh aclocal.m4 curses.h \
+	curspriv.h panel.h term.h pdcurses/README \
+	pdcurses/*.c demos/README demos/*.c demos/*.h dos/README dos/*.c \
+	dos/*.h dos/*.mak dos/*.lrf os2/README os2/*.c os2/*.h os2/*.mak \
+	os2/*.lrf sdl1/README sdl1/*.c sdl1/*.h sdl1/Make* \
+	win32/README win32/*.c win32/*.h win32/*.mak \
+	win32/*.ico win32/*.rc x11/README x11/*.c x11/*.h x11/Makefile.* \
+	x11/*.xbm doc/*.txt doc/manext.c doc/Makefile
+
+zip: $(ZIPFILE)
+
+../$(TARBALL):
+	(cd ..; tar cvf - $(PDC_DIR)/README $(PDC_DIR)/HISTORY \
+	$(PDC_DIR)/IMPLEMNT $(PDC_DIR)/*.spec $(PDC_DIR)/*.mif \
+	$(PDC_DIR)/*.def $(PDC_DIR)/Makefile.in $(PDC_DIR)/aclocal.m4 \
+	$(PDC_DIR)/config.h.in $(PDC_DIR)/configure \
+	$(PDC_DIR)/config.guess $(PDC_DIR)/x11/xcurses-config.in \
+	$(PDC_DIR)/config.sub $(PDC_DIR)/configure.ac \
+	$(PDC_DIR)/install-sh $(PDC_DIR)/curses.h $(PDC_DIR)/curspriv.h \
+	$(PDC_DIR)/panel.h $(PDC_DIR)/term.h \
+	$(PDC_DIR)/pdcurses/README $(PDC_DIR)/pdcurses/*.c \
+	$(PDC_DIR)/demos/README $(PDC_DIR)/demos/*.c $(PDC_DIR)/demos/*.h \
+	$(PDC_DIR)/doc/*.txt $(PDC_DIR)/dos/README $(PDC_DIR)/dos/*.c \
+	$(PDC_DIR)/dos/*.h $(PDC_DIR)/dos/*.mak $(PDC_DIR)/dos/*.lrf \
+	$(PDC_DIR)/os2/README $(PDC_DIR)/os2/*.c $(PDC_DIR)/os2/*.h \
+	$(PDC_DIR)/os2/*.mak $(PDC_DIR)/os2/*.lrf \
+	$(PDC_DIR)/sdl1/README $(PDC_DIR)/sdl1/*.c $(PDC_DIR)/sdl1/*.h \
+	$(PDC_DIR)/sdl1/Make* $(PDC_DIR)/win32/README $(PDC_DIR)/win32/*.c \
+	$(PDC_DIR)/win32/*.h $(PDC_DIR)/win32/*.mak \
+	$(PDC_DIR)/win32/*.ico $(PDC_DIR)/win32/*.rc $(PDC_DIR)/x11/README \
+	$(PDC_DIR)/x11/*.c $(PDC_DIR)/x11/*.xbm $(PDC_DIR)/x11/*.h \
+	$(PDC_DIR)/x11/Makefile.* $(PDC_DIR)/doc/manext.c \
+	$(PDC_DIR)/doc/Makefile | gzip -9 > $(TARBALL))
+
+dist: ../$(TARBALL)
+
+rpm: ../$(TARBALL)
+	rpmbuild -ba $(srcdir)/PDCurses.spec
diff --git a/payloads/libpayload/curses/PDCurses-3.4/PDCurses.spec b/payloads/libpayload/curses/PDCurses-3.4/PDCurses.spec
new file mode 100644
index 0000000..814e313
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/PDCurses.spec
@@ -0,0 +1,52 @@
+# $Id: PDCurses.spec,v 1.18 2008/07/21 12:25:20 wmcbrine Exp $
+
+%define ver 34
+%define verdot 3.4
+%define base /usr
+
+Summary: Public Domain Curses for X11
+Name: PDCurses
+Version: %verdot
+Release: 1
+Copyright: Public Domain
+Group: Development/Libraries
+Source: %{name}-%{version}.tar.gz
+URL: http://pdcurses.sourceforge.net
+BuildRoot: %{_tmppath}/%{name}-%{version}-root
+Prefix: %base
+
+%description
+PDCurses for X11 is an implementation of the curses library that lets 
+you build text-mode curses programs as native X11 applications. For more 
+information, visit http://pdcurses.sourceforge.net/
+
+%prep
+%setup -q
+
+%build
+./configure --prefix=%{base}
+make 
+
+%install
+make DESTDIR=$RPM_BUILD_ROOT install
+
+%clean
+rm -rf $RPM_BUILD_ROOT
+rm -rf $RPM_BUILD_DIR/%{name}-%{version}
+
+%post -p /sbin/ldconfig
+
+%postun -p /sbin/ldconfig
+
+%files
+%defattr(-,root,root)
+%doc README HISTORY
+%{base}/bin/xcurses-config
+%{base}/lib/libXCurses.a
+%{base}/lib/libXpanel.a
+%{base}/lib/libXCurses.so
+%{base}/include/xcurses.h
+%{base}/include/xpanel.h
+%{base}/include/xcurses/curses.h
+%{base}/include/xcurses/panel.h
+%{base}/include/xcurses/term.h
diff --git a/payloads/libpayload/curses/PDCurses-3.4/README b/payloads/libpayload/curses/PDCurses-3.4/README
new file mode 100644
index 0000000..dc476a9
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/README
@@ -0,0 +1,48 @@
+Welcome to PDCurses!
+====================
+
+Public Domain Curses, aka PDCurses, is an implementation of X/Open 
+curses for multiple platforms. The latest version can be found at:
+
+   http://pdcurses.sourceforge.net/
+
+For changes, see the HISTORY file.
+
+
+Legal Stuff
+-----------
+
+The core package is in the public domain, but small portions of PDCurses 
+are subject to copyright under various licenses.  Each directory 
+contains a README file, with a section titled "Distribution Status" 
+which describes the status of the files in that directory.
+
+If you use PDCurses in an application, an acknowledgement would be 
+appreciated, but is not mandatory. If you make corrections or 
+enhancements to PDCurses, please forward them to the current maintainer 
+for the benefit of other users.
+
+This software is provided AS IS with NO WARRANTY whatsoever.
+
+
+Ports
+-----
+
+PDCurses has been ported to DOS, OS/2, Win32, X11 and SDL. A directory 
+containing the port-specific source files exists for each of these 
+platforms. Build instructions are in the README file for each platform.
+
+
+Distribution Status
+-------------------
+
+All files in this directory except configure, config.guess and 
+config.sub are released to the Public Domain. config.guess and 
+config.sub are under the GPL; configure is under a free license 
+described within it.
+
+
+Maintainer
+----------
+
+William McBrine <wmcbrine@users.sf.net>
diff --git a/payloads/libpayload/curses/PDCurses-3.4/aclocal.m4 b/payloads/libpayload/curses/PDCurses-3.4/aclocal.m4
new file mode 100644
index 0000000..ad7c3f3
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/aclocal.m4
@@ -0,0 +1,613 @@
+dnl ---------------------------------------------------------------------------
+dnl This file offers the following macros...
+dnl ---------------------------------------------------------------------------
+dnl MH_IPC
+dnl MH_CHECK_X_INC
+dnl MH_CHECK_X_LIB
+dnl MH_CHECK_X_HEADERS
+dnl MH_CHECK_X_KEYDEFS
+dnl MH_CHECK_X_TYPEDEF
+dnl MH_CHECK_LIB
+dnl MH_SHARED_LIBRARY
+dnl MH_HOWTO_DYN_LINK
+dnl MH_CHECK_CC_O
+dnl MH_SHLPST
+dnl MH_CHECK_MAX_SIGNALS
+
+dnl ---------------------------------------------------------------------------
+dnl Determine if the system has System V IPC. ie sys/ipc.h and sys/shm.h
+dnl headers.
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_IPC],
+[
+AC_CHECK_HEADER(sys/ipc.h)
+if test $ac_cv_header_sys_ipc_h = no; then
+	AC_MSG_ERROR(Cannot find required header file sys/ipc.h; PDCurses cannot be configured)
+fi
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Set up the correct X header file location
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_X_INC],
+[
+mh_x11_dir=""
+mh_x11_xaw_dir=""
+
+mh_inc_dirs="$ac_x_header_dirs"
+
+dnl Provide for user supplying directory
+
+if test "x$x_includes" != xNONE ; then
+	mh_inc_dirs="$x_includes $mh_inc_dirs"
+fi
+
+dnl Try to determine the directory containing X headers
+dnl We will append X11 to all the paths above as an extra check
+
+for ac_dir in $mh_inc_dirs ; do
+  if test -r $ac_dir/Intrinsic.h; then
+    mh_x11_dir=$ac_dir
+    break
+  fi
+  if test -r $ac_dir/X11/Intrinsic.h; then
+    mh_x11_dir="$ac_dir/X11"
+    break
+  fi
+done
+
+dnl Try to determine the directory containing Xaw headers
+dnl We will append X11 to all the paths above as an extra check
+
+if test "$with_xaw3d" = yes; then
+	mh_xaw_dir="Xaw3d"
+else
+	if test "$with_nextaw" = yes; then
+		mh_xaw_dir="neXtaw"
+	else
+		mh_xaw_dir="Xaw"
+	fi
+fi
+for ac_dir in $mh_inc_dirs ; do
+  if test -r $ac_dir/$mh_xaw_dir/Box.h; then
+    mh_x11_xaw_dir=$ac_dir
+    break
+  fi
+  if test -r $ac_dir/X11/$mh_xaw_dir/Box.h; then
+    mh_x11_xaw_dir="$ac_dir/X11"
+    break
+  fi
+done
+
+if test "x$mh_x11_dir" != "x" ; then
+	mh_x11_dir_no_x11=`echo $mh_x11_dir | sed 's/\/X11$//'`
+
+	if test "$mh_x11_dir_no_x11" != "$mh_x11_dir" ; then
+		MH_XINC_DIR="-I$mh_x11_dir -I$mh_x11_dir_no_x11"
+	else
+		MH_XINC_DIR="-I$mh_x11_dir"
+	fi
+else
+	AC_MSG_ERROR(Cannot find required header file Intrinsic.h; PDCurses cannot be configured)
+fi
+
+if test "x$mh_x11_xaw_dir" != "x"; then
+	if test "$mh_x11_xaw_dir" != "$mh_x11_dir" ; then
+		MH_XINC_DIR="-I$mh_x11_xaw_dir $MH_XINC_DIR"
+	fi
+else
+	AC_MSG_ERROR(Cannot find required Xaw header file Box.h; PDCurses cannot be configured)
+fi
+
+AC_SUBST(MH_XINC_DIR)
+
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Set up the correct X library file location
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_X_LIB],
+[
+dnl Some systems require extra libraries...
+
+mh_solaris_flag=no
+mh_hpux9_flag=no
+AC_REQUIRE([AC_CANONICAL_SYSTEM])
+case "$target" in
+	*solaris*)
+		mh_solaris_flag=yes
+		;;
+	*pc-sco*)
+		extra_x_libs="Xext"
+		;;
+	sparc*sunos*)
+		extra_x_libs="Xext"
+		if test "$ac_cv_prog_CC" = "gcc" ; then
+			extra_ld_flags="-Wl,-Bstatic"
+			extra_ld_flags2="-Wl,-Bdynamic"
+		else
+			extra_ld_flags="-Bstatic"
+			extra_ld_flags2="-Bdynamic"
+		fi
+		;;
+	*hpux9*)
+		mh_hpux9_flag=yes
+		;;
+esac
+
+if test "$with_xaw3d" = yes; then
+	MH_X11_LIBS="Xaw3d Xmu Xt X11"
+else
+	if test "$with_nextaw" = yes; then
+		MH_X11_LIBS="neXtaw Xmu Xt X11"
+	else
+		MH_X11_LIBS="Xaw Xmu Xt X11"
+	fi
+fi
+MH_X11R6_LIBS="SM ICE Xext"
+mh_x11r6=no
+
+mh_lib_dirs="$x_libraries `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`"
+
+dnl try to find libSM.[a,sl,so,dylib]. If we find it we are using X11R6
+for ac_dir in $mh_lib_dirs ; do
+	for mh_xsm in libSM.a libSM.so libSM.sl libSM.dylib; do
+	  if test -r $ac_dir/$mh_xsm; then
+	    mh_x11r6=yes
+	    break 2
+	  fi
+	done
+done
+
+if test "$mh_x11r6" = yes ; then
+	mh_libs="$MH_X11_LIBS $MH_X11R6_LIBS"
+else
+	mh_libs="$MH_X11_LIBS $extra_x_libs"
+fi
+
+
+dnl Ensure that all required X libraries are found
+
+mh_prev_dir=""
+mh_where_found=""
+mh_where_found_dirs=""
+mh_solaris_path=""
+for mh_lib in $mh_libs; do
+  mh_lib_found=no
+  for ac_dir in $mh_lib_dirs ; do
+    for mh_ext in a so sl dll.a dylib; do
+      if test -r $ac_dir/lib$mh_lib.$mh_ext; then
+        if test "x$mh_prev_dir" != "x$ac_dir" ; then
+          if test "x$mh_prev_dir" = "x" ; then
+             mh_where_found="$mh_where_found found in $ac_dir"
+          else
+             mh_where_found="$mh_where_found and in $ac_dir"
+          fi
+          mh_prev_dir=$ac_dir
+          mh_where_found_dirs="$mh_where_found_dirs $ac_dir"
+          MH_XLIBS="$MH_XLIBS -L$ac_dir"
+          mh_solaris_path="${mh_solaris_path}:$ac_dir"
+        fi
+        MH_XLIBS="$MH_XLIBS -l$mh_lib"
+        mh_lib_found=yes
+        break 2
+      fi
+    done
+  done
+  if test "$mh_lib_found" = no; then
+    AC_MSG_ERROR(Cannot find required X library; lib$mh_lib. PDCurses cannot be configured)
+  fi
+done
+
+mh_solaris_path=`echo $mh_solaris_path | sed 's/^://'`
+if test "$mh_solaris_flag" = yes ; then
+	MH_XLIBS="-R$mh_solaris_path $extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2"
+else
+	MH_XLIBS="$extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2"
+fi
+if test "$mh_hpux9_flag" = yes ; then
+  grep -q XtSetLanguageProc $mh_x11_dir/Intrinsic.h
+  if test $? -eq 0 ; then
+    mh_found_xtshellstrings=no
+    for mh_acdir in $mh_where_found_dirs ; do
+      for mh_xaw in `ls $mh_acdir/libXaw.*` ; do
+        nm $mh_xaw | grep XtShellStrings | grep -qv extern
+        if test $? -eq 0 ; then
+          mh_found_xtshellstrings=yes
+        fi
+      done
+    done
+    if test "$mh_found_xtshellstrings" = no ; then
+      AC_MSG_WARN(The X11 development environment has not been installed correctly.)
+      AC_MSG_WARN(The header file; Intrinsic.h, is for X11R5 while the Athena Widget)
+      AC_MSG_WARN(Set library; libXaw is for X11R4.  This is a common problem with)
+      AC_MSG_WARN(HP-UX 9.x.)
+      AC_MSG_ERROR(X11 installation incomplete; cannot continue)
+    fi
+  fi
+fi
+
+AC_SUBST(MH_XLIBS)
+
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Determine if the supplied X headers exist.
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_X_HEADERS],
+[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $MH_XINC_DIR"
+for mh_header in $1; do
+	AC_CHECK_HEADERS($mh_header)
+done
+CPPFLAGS="$save_CPPFLAGS"
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Determine if various key definitions exist in keysym.h
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_X_KEYDEFS],
+[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $MH_XINC_DIR"
+for mh_keydef in $1; do
+	AC_MSG_CHECKING(for $mh_keydef in keysym.h)
+	mh_upper_name="HAVE_`echo $mh_keydef | tr '[a-z]' '[A-Z]'`"
+	AC_TRY_COMPILE([#include <keysym.h>],
+[int i = $mh_keydef;],
+  mh_have_key=yes; AC_DEFINE_UNQUOTED($mh_upper_name,1), mh_have_key=no )
+	AC_MSG_RESULT($mh_have_key)
+done
+CPPFLAGS="$save_CPPFLAGS"
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Determine if supplied types have been typedefed
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_X_TYPEDEF],
+[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR"
+for td in $1 ; do
+AC_MSG_CHECKING(if $td is typedefed:)
+AC_TRY_COMPILE(
+[#include "X11/Xlib.h"],
+[$td fred],
+	[mh_td=yes],
+	[mh_td=no]
+)
+if test "$mh_td" = yes ; then
+	TD_upper=`echo $td | tr a-z A-Z`
+	AC_DEFINE_UNQUOTED(${TD_upper}_TYPEDEFED, 1)
+fi
+AC_MSG_RESULT($mh_td)
+done
+CPPFLAGS="$save_CPPFLAGS"
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Check for presence of various libraries
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_LIB],
+[
+MH_EXTRA_LIBS=''
+for mh_lib in $1; do
+	if test "$on_qnx" = yes; then
+		AC_MSG_CHECKING(for library -l${mh_lib})
+		if test -r /usr/lib/${mh_lib}3r.lib; then
+			AC_MSG_RESULT(found)
+			MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}"
+		else
+		AC_MSG_RESULT(not found)
+		fi
+	else
+		AC_CHECK_LIB($mh_lib,main,mh_lib_found=yes,mh_lib_found=no)
+		if test "$mh_lib_found" = yes; then
+			MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}"
+		fi
+	fi
+done
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Work out how to create a dynamically loaded module
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_HOWTO_DYN_LINK],
+[
+mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&AC_FD_CC'
+cat > conftest.$ac_ext <<EOF
+dnl [#]line __oline__ "[$]0"
+[#]line __oline__ "configure"
+int foo()
+{
+return(0);
+}
+EOF
+if AC_TRY_EVAL(mh_compile) && test -s conftest.o; then
+	mh_dyn_link='ld -shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC'
+#	mh_dyn_link='${CC} -Wl,-shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC'
+	if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then
+		LD_RXLIB1="ld -shared"
+#		LD_RXLIB1="${CC} -Wl,-shared"
+		SHLPRE="lib"
+		SHLPST=".so"
+	else
+		mh_dyn_link='ld -G -o conftest.rxlib conftest.o 1>&AC_FD_CC'
+#		mh_dyn_link='${CC} -Wl,-G -o conftest.rxlib conftest.o 1>&AC_FD_CC'
+		if AC_TRY_EVAL(mh_dyn_link) && test -s conftest.rxlib; then
+			LD_RXLIB1="ld -G"
+#			LD_RXLIB1="${CC} -Wl,-G"
+			SHLPRE="lib"
+			SHLPST=".so"
+		else
+			LD_RXLIB1=""
+			SHLPRE=""
+			SHLPST=""
+		fi
+	fi
+fi
+rm -f conftest*
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Determine how to build shared libraries etc..
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_SHARED_LIBRARY],
+[
+AC_REQUIRE([MH_SHLPST])
+dnl
+dnl If compiler is gcc, then flags should be the same for all platforms
+dnl (just guessing on this)
+dnl
+AIX_DYN="no"
+BEOS_DYN="no"
+SHLFILE="$1"
+SHLFILES="$*"
+RXPACKEXPORTS=""
+SHLPRE="lib"
+LD_RXLIB1=""
+
+AC_REQUIRE([AC_CANONICAL_SYSTEM])
+case "$target" in
+	*hp-hpux*)
+		SYS_DEFS="-D_HPUX_SOURCE"
+		LD_RXLIB1="ld -b -q -n"
+		;;
+	*ibm-aix*)
+		SYS_DEFS="-D_ALL_SOURCE -DAIX"
+		AIX_DYN="yes"
+		DYN_COMP="-DDYNAMIC"
+		LD_RXLIB1="ld -bnoentry -bM:SRE"
+		RXPACKEXPORTS="-bE:$SHLFILE.exp"
+		RXPACKEXP="$SHLFILE.exp"
+		;;
+	*dec-osf*)
+		if test "$ac_cv_prog_CC" = "gcc"; then
+			SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE"
+		else
+			SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE -Olimit 800"
+		fi
+		LD_RXLIB1="ld -shared"
+		;;
+	*sequent-dynix*|*esix*|*dgux*)
+		LD_RXLIB1="ld -G"
+		;;
+	*solaris*)
+		if test "$ac_cv_prog_CC" = "gcc"; then
+			LD_RXLIB1="gcc -shared"
+		else
+			LD_RXLIB1="ld -G"
+		fi
+		;;
+	sparc*sunos*)
+		SYS_DEFS="-DSUNOS -DSUNOS_STRTOD_BUG"
+		LD_RXLIB1="ld"
+		;;
+	*linux*|*atheos*|*nto-qnx*)
+		LD_RXLIB1="${CC} -shared"
+		;;
+	*freebsd*)
+		LD_RXLIB1="ld -Bdynamic -Bshareable"
+		;;
+	*pc-sco*)
+		LD_RXLIB1="ld -dy -G"
+		;;
+	*beos*)
+		LD_RXLIB1="${CC} -Wl,-shared -nostart -Xlinker -soname=\$(@)"
+		BEOS_DYN="yes"
+		;;
+	*qnx*)
+		SHLPRE=""
+		DYN_COMP="-Q"   # force no check for dynamic loading
+		SHLFILE=""
+		;;
+	*cygwin)
+		SHLPRE=""
+		DYN_COMP="-DDYNAMIC"
+		LD_RXLIB1="dllwrap --def \$(srcdir)/../win32/pdcurses.def --target i386-cygwin32 --dllname \$(@)"
+# cygwininstall target MUST install the shared library itself because
+# it puts it into $(bindir) not $(libdir) as all other platforms
+		;;
+	*darwin*)
+		DYN_COMP="-fno-common"
+		LD_RXLIB1="${CC} -flat_namespace -undefined suppress -dynamiclib -install_name=\$(@)"
+		;;
+	*)
+		;;
+esac
+
+dnl determine what switches our compiler uses for building objects
+dnl suitable for inclusion in shared libraries
+dnl Only call this if DYN_COMP is not set. If we have set DYN_COMP
+dnl above, then we know how to compile AND link for dynamic libraries
+
+if test "$DYN_COMP" = ""; then
+AC_MSG_CHECKING(compiler flags for a dynamic object)
+
+cat > conftest.$ac_ext <<EOF
+dnl [#]line __oline__ "[$]0"
+[#]line __oline__ "configure"
+int a=0
+EOF
+
+	DYN_COMP=""
+	mh_cv_stop=no
+	save_cflags="$CFLAGS"
+	mh_cv_flags="-fPIC -KPIC +Z"
+	for a in $mh_cv_flags; do
+		CFLAGS="-c $a"
+
+		mh_compile='${CC-cc} -c $CFLAGS conftest.$ac_ext > conftest.tmp 2>&1'
+		if AC_TRY_EVAL(mh_compile); then
+			DYN_COMP=""
+		else
+			slash="\\"
+			mh_dyncomp="`egrep -c $slash$a conftest.tmp`"
+			if test "$mh_dyncomp" = "0"; then
+				DYN_COMP="$a -DDYNAMIC"
+				AC_MSG_RESULT($a)
+				break
+			else
+				DYN_COMP=""
+			fi
+		fi
+	done
+	if test "$DYN_COMP" = ""; then
+		AC_MSG_RESULT(none of $mh_cv_flags supported)
+	fi
+	if test "$LD_RXLIB1" = ""; then
+		MH_HOWTO_DYN_LINK()
+	fi
+	CFLAGS=$save_cflags
+	rm -f conftest.*
+fi
+
+
+SHL_TARGETS=""
+
+if test "$AIX_DYN" = "yes"; then
+	aix_exports="config.exports.aix"
+	echo "" > $aix_exports
+fi
+
+if test "$ac_cv_header_dl_h" = "yes" -o "$ac_cv_header_dlfcn_h" = "yes" -o "$AIX_DYN" = "yes" -o "$BEOS_DYN" = "yes" -o "$DLFCNINCDIR" != "" -o "$DLFCNLIBDIR" != ""; then
+	EXPS="1,2,3,4,5,6,7,8,9"
+	for a in $SHLFILES
+	do
+		SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}"
+		this=`echo $EXPS | cut -d, -f1`
+		EXPS=`echo $EXPS | cut -d, -f2-`
+		if test "$AIX_DYN" = "yes"; then
+			echo "RXPACKEXP$this=$a.exp" >> $aix_exports
+			echo "RXPACKEXPORTS$this=-bE:$a.exp" >> $aix_exports
+		fi
+	done
+fi
+
+AC_SUBST(DYN_COMP)
+AC_SUBST(LIBS)
+AC_SUBST(LD_RXLIB1)
+AC_SUBST(SHLPRE)
+AC_SUBST(SHLPST)
+AC_SUBST(SHL_TARGETS)
+AC_SUBST(O2SAVE)
+AC_SUBST(CC2O)
+AC_SUBST(SAVE2O)
+AC_SUBST(RXPACKEXPORTS)
+])dnl
+
+dnl ---------------------------------------------------------------------------
+dnl Check if C compiler supports -c -o file.ooo
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_CC_O],
+[
+AC_MSG_CHECKING(whether $CC understand -c and -o together)
+set dummy $CC; ac_cc="`echo [$]2 |
+changequote(, )dnl
+		       sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
+changequote([, ])dnl
+AC_CACHE_VAL(ac_cv_prog_cc_${ac_cc}_c_o,
+[echo 'foo(){}' > conftest.c
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC'
+if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try);
+then
+  ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&AC_FD_CC'
+  if AC_TRY_EVAL(ac_try) && test -f conftest.ooo && AC_TRY_EVAL(ac_try);
+  then
+    eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  fi
+fi
+rm -f conftest*
+])dnl
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+	O2SAVE=""
+	SAVE2O=""
+	CC2O="-o $"'@'
+	AC_MSG_RESULT(yes)
+else
+	O2SAVE="-mv \`basename "$'@'" .sho\`.o \`basename "$'@'" .sho\`.o.save;"
+	SAVE2O="-mv \`basename "$'@'" .sho\`.o "$'@'"; mv \`basename "$'@'" .sho\`.o.save \`basename "$'@'" .sho\`.o"
+	CC2O=""
+	AC_MSG_RESULT(no)
+fi
+])
+
+dnl ---------------------------------------------------------------------------
+dnl Determines the file extension for shared libraries
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_SHLPST],
+[
+AC_MSG_CHECKING(shared library extension)
+SHLPST=".so"
+AC_REQUIRE([AC_CANONICAL_SYSTEM])
+case "$target" in
+        *hp-hpux*)
+                SHLPST=".sl"
+                ;;
+        *ibm-aix*)
+                SHLPST=".a"
+                ;;
+        *qnx*)
+                SHLPST=""
+                ;;
+        *cygwin*)
+                SHLPST=".dll"
+                ;;
+        *darwin*)
+                SHLPST=".dylib"
+                ;;
+esac
+AC_SUBST(SHLPST)
+AC_MSG_RESULT($SHLPST)
+])
+
+dnl ---------------------------------------------------------------------------
+dnl Determine the system limit for number of signals
+dnl ---------------------------------------------------------------------------
+AC_DEFUN([MH_CHECK_MAX_SIGNALS],
+[
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $SYS_DEFS"
+AC_MSG_CHECKING(for maximum signal specifier:)
+AC_CACHE_VAL(mh_cv_max_signals,
+mh_found="no"
+for mh_sigs in $1; do
+	AC_TRY_COMPILE([#include <signal.h>],
+[return $mh_sigs;],
+  mh_found="yes"; mh_cv_max_signals="$mh_sigs" )
+	if test "$mh_found" = "yes"; then
+		break;
+	fi
+done)
+CPPFLAGS="$save_CPPFLAGS"
+if test "$mh_found" = "no"; then
+	AC_MSG_ERROR(Cannot find a system limit for number of signals. PDCurses cannot be configured on this machine.)
+else
+	AC_DEFINE_UNQUOTED(PDC_MAX_SIGNALS,$mh_cv_max_signals)
+	AC_MSG_RESULT($mh_cv_max_signals)
+fi
+])dnl
diff --git a/payloads/libpayload/curses/PDCurses-3.4/config.guess b/payloads/libpayload/curses/PDCurses-3.4/config.guess
new file mode 100755
index 0000000..396482d
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/config.guess
@@ -0,0 +1,1500 @@
+#! /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 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-07-02'
+
+# 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Originally written by Per Bothner <per@bothner.com>.
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted 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.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION]
+
+Output the configuration name of the system \`$me' is run on.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+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
+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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help" >&2
+       exit 1 ;;
+    * )
+       break ;;
+  esac
+done
+
+if test $# != 0; then
+  echo "$me: too many arguments$help" >&2
+  exit 1
+fi
+
+trap 'exit 1' 1 2 15
+
+# 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
+# temporary files to be created and, as you can see below, it is a
+# headache to deal with in a portable fashion.
+
+# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
+# use `HOST_CC' if defined, but it is deprecated.
+
+# Portable tmp directory creation inspired by the Autoconf team.
+
+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 ;
+: ${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) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
+dummy=$tmp/dummy ;
+tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
+case $CC_FOR_BUILD,$HOST_CC,$CC in
+ ,,)    echo "int x;" > $dummy.c ;
+	for c in cc gcc c89 c99 ; do
+	  if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
+	     CC_FOR_BUILD="$c"; break ;
+	  fi ;
+	done ;
+	if test x"$CC_FOR_BUILD" = x ; then
+	  CC_FOR_BUILD=no_compiler_found ;
+	fi
+	;;
+ ,,*)   CC_FOR_BUILD=$CC ;;
+ ,*,*)  CC_FOR_BUILD=$HOST_CC ;;
+esac ; set_cc_for_build= ;'
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 1994-08-24)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+	PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null`  || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+    *:NetBSD:*:*)
+	# NetBSD (nbsd) targets should (where applicable) match one or
+	# more of the tupples: *-*-netbsdelf*, *-*-netbsdaout*,
+	# *-*-netbsdecoff* and *-*-netbsd*.  For targets that recently
+	# switched to ELF, *-*-netbsd* would select the old
+	# object file format.  This provides both forward
+	# compatibility and a consistent mechanism for selecting the
+	# object file format.
+	#
+	# Note: NetBSD doesn't particularly care about the vendor
+	# portion of the name.  We always set it to "unknown".
+	sysctl="sysctl -n hw.machine_arch"
+	UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
+	    /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
+	case "${UNAME_MACHINE_ARCH}" in
+	    armeb) machine=armeb-unknown ;;
+	    arm*) machine=arm-unknown ;;
+	    sh3el) machine=shl-unknown ;;
+	    sh3eb) machine=sh-unknown ;;
+	    *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+	esac
+	# The Operating System including object format, if it has switched
+	# to ELF recently, or will in the future.
+	case "${UNAME_MACHINE_ARCH}" 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
+		then
+		    # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout).
+		    # Return netbsd for either.  FIX?
+		    os=netbsd
+		else
+		    os=netbsdelf
+		fi
+		;;
+	    *)
+	        os=netbsd
+		;;
+	esac
+	# The OS release
+	# Debian GNU/NetBSD machines have a different userland, and
+	# thus, need a distinct triplet. However, they do not need
+	# kernel version information, so it can be replaced with a
+	# suitable tag, in the style of linux-gnu.
+	case "${UNAME_VERSION}" in
+	    Debian*)
+		release='-gnu'
+		;;
+	    *)
+		release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+		;;
+	esac
+	# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
+	# contains redundant information, the shorter form:
+	# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
+	echo "${machine}-${os}${release}"
+	exit ;;
+    *:OpenBSD:*:*)
+	UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
+	echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
+	exit ;;
+    *:ekkoBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
+	exit ;;
+    *:SolidBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
+	exit ;;
+    macppc:MirBSD:*:*)
+	echo powerpc-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    *:MirBSD:*:*)
+	echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
+	exit ;;
+    alpha:OSF1:*:*)
+	case $UNAME_RELEASE in
+	*4.0)
+		UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
+		;;
+	*5.*)
+	        UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'`
+		;;
+	esac
+	# According to Compaq, /usr/sbin/psrinfo has been available on
+	# OSF/1 and Tru64 systems produced since 1995.  I hope that
+	# covers most systems running today.  This code pipes the CPU
+	# types through head -n 1, so we only detect the type of CPU 0.
+	ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^  The alpha \(.*\) processor.*$/\1/p' | head -n 1`
+	case "$ALPHA_CPU_TYPE" in
+	    "EV4 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV4.5 (21064)")
+		UNAME_MACHINE="alpha" ;;
+	    "LCA4 (21066/21068)")
+		UNAME_MACHINE="alpha" ;;
+	    "EV5 (21164)")
+		UNAME_MACHINE="alphaev5" ;;
+	    "EV5.6 (21164A)")
+		UNAME_MACHINE="alphaev56" ;;
+	    "EV5.6 (21164PC)")
+		UNAME_MACHINE="alphapca56" ;;
+	    "EV5.7 (21164PC)")
+		UNAME_MACHINE="alphapca57" ;;
+	    "EV6 (21264)")
+		UNAME_MACHINE="alphaev6" ;;
+	    "EV6.7 (21264A)")
+		UNAME_MACHINE="alphaev67" ;;
+	    "EV6.8CB (21264C)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8AL (21264B)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.8CX (21264D)")
+		UNAME_MACHINE="alphaev68" ;;
+	    "EV6.9A (21264/EV69A)")
+		UNAME_MACHINE="alphaev69" ;;
+	    "EV7 (21364)")
+		UNAME_MACHINE="alphaev7" ;;
+	    "EV7.9 (21364A)")
+		UNAME_MACHINE="alphaev79" ;;
+	esac
+	# A Pn.n version is a patched version.
+	# A Vn.n version is a released version.
+	# A Tn.n version is a released field test version.
+	# A Xn.n version is an unreleased experimental baselevel.
+	# 1.2 uses "1.2" for uname -r.
+	echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
+	exit ;;
+    Alpha\ *:Windows_NT*:*)
+	# How do we know it's Interix rather than the generic POSIX subsystem?
+	# Should we change UNAME_MACHINE based on the output of uname instead
+	# of the specific Alpha model?
+	echo alpha-pc-interix
+	exit ;;
+    21064:Windows_NT:50:3)
+	echo alpha-dec-winnt3.5
+	exit ;;
+    Amiga*:UNIX_System_V:4.0:*)
+	echo m68k-unknown-sysv4
+	exit ;;
+    *:[Aa]miga[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-amigaos
+	exit ;;
+    *:[Mm]orph[Oo][Ss]:*:*)
+	echo ${UNAME_MACHINE}-unknown-morphos
+	exit ;;
+    *:OS/390:*:*)
+	echo i370-ibm-openedition
+	exit ;;
+    *:z/VM:*:*)
+	echo s390-ibm-zvmoe
+	exit ;;
+    *:OS400:*:*)
+        echo powerpc-ibm-os400
+	exit ;;
+    arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+	echo arm-acorn-riscix${UNAME_RELEASE}
+	exit ;;
+    arm:riscos:*:*|arm:RISCOS:*:*)
+	echo arm-unknown-riscos
+	exit ;;
+    SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
+	echo hppa1.1-hitachi-hiuxmpp
+	exit ;;
+    Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
+	# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
+	if test "`(/bin/universe) 2>/dev/null`" = att ; then
+		echo pyramid-pyramid-sysv3
+	else
+		echo pyramid-pyramid-bsd
+	fi
+	exit ;;
+    NILE*:*:*:dcosx)
+	echo pyramid-pyramid-svr4
+	exit ;;
+    DRS?6000:unix:4.0:6*)
+	echo sparc-icl-nx6
+	exit ;;
+    DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
+	case `/usr/bin/uname -p` in
+	    sparc) echo sparc-icl-nx7; exit ;;
+	esac ;;
+    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:SunOS:5.*:*)
+	echo i386-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:6*:*)
+	# According to config.sub, this is the proper way to canonicalize
+	# SunOS6.  Hard to guess exactly what SunOS6 will be like, but
+	# it's likely to be more like Solaris than SunOS4.
+	echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    sun4*:SunOS:*:*)
+	case "`/usr/bin/arch -k`" in
+	    Series*|S4*)
+		UNAME_RELEASE=`uname -v`
+		;;
+	esac
+	# Japanese Language versions have a version number like `4.1.3-JL'.
+	echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+	exit ;;
+    sun3*:SunOS:*:*)
+	echo m68k-sun-sunos${UNAME_RELEASE}
+	exit ;;
+    sun*:*:4.2BSD:*)
+	UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
+	test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
+	case "`/bin/arch`" in
+	    sun3)
+		echo m68k-sun-sunos${UNAME_RELEASE}
+		;;
+	    sun4)
+		echo sparc-sun-sunos${UNAME_RELEASE}
+		;;
+	esac
+	exit ;;
+    aushp:SunOS:*:*)
+	echo sparc-auspex-sunos${UNAME_RELEASE}
+	exit ;;
+    # The situation for MiNT is a little confusing.  The machine name
+    # can be virtually everything (everything which is not
+    # "atarist" or "atariste" at least should have a processor
+    # > m68000).  The system name ranges from "MiNT" over "FreeMiNT"
+    # to the lowercase version "mint" (or "freemint").  Finally
+    # the system name "TOS" denotes a system which is actually not
+    # 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}
+	exit ;;
+    atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
+	echo m68k-atari-mint${UNAME_RELEASE}
+        exit ;;
+    *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
+        echo m68k-atari-mint${UNAME_RELEASE}
+	exit ;;
+    milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
+        echo m68k-milan-mint${UNAME_RELEASE}
+        exit ;;
+    hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
+        echo m68k-hades-mint${UNAME_RELEASE}
+        exit ;;
+    *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
+        echo m68k-unknown-mint${UNAME_RELEASE}
+        exit ;;
+    m68k:machten:*:*)
+	echo m68k-apple-machten${UNAME_RELEASE}
+	exit ;;
+    powerpc:machten:*:*)
+	echo powerpc-apple-machten${UNAME_RELEASE}
+	exit ;;
+    RISC*:Mach:*:*)
+	echo mips-dec-mach_bsd4.3
+	exit ;;
+    RISC*:ULTRIX:*:*)
+	echo mips-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    VAX*:ULTRIX*:*:*)
+	echo vax-dec-ultrix${UNAME_RELEASE}
+	exit ;;
+    2020:CLIX:*:* | 2430:CLIX:*:*)
+	echo clipper-intergraph-clix${UNAME_RELEASE}
+	exit ;;
+    mips:*:*:UMIPS | mips:*:*:RISCos)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+#ifdef __cplusplus
+#include <stdio.h>  /* for printf() prototype */
+	int main (int argc, char *argv[]) {
+#else
+	int main (argc, argv) int argc; char *argv[]; {
+#endif
+	#if defined (host_mips) && defined (MIPSEB)
+	#if defined (SYSTYPE_SYSV)
+	  printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_SVR4)
+	  printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+	#endif
+	#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
+	  printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+	#endif
+	#endif
+	  exit (-1);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c &&
+	  dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+	  SYSTEM_NAME=`$dummy $dummyarg` &&
+	    { echo "$SYSTEM_NAME"; exit; }
+	echo mips-mips-riscos${UNAME_RELEASE}
+	exit ;;
+    Motorola:PowerMAX_OS:*:*)
+	echo powerpc-motorola-powermax
+	exit ;;
+    Motorola:*:4.3:PL8-*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
+	echo powerpc-harris-powermax
+	exit ;;
+    Night_Hawk:Power_UNIX:*:*)
+	echo powerpc-harris-powerunix
+	exit ;;
+    m88k:CX/UX:7*:*)
+	echo m88k-harris-cxux7
+	exit ;;
+    m88k:*:4*:R4*)
+	echo m88k-motorola-sysv4
+	exit ;;
+    m88k:*:3*:R3*)
+	echo m88k-motorola-sysv3
+	exit ;;
+    AViiON:dgux:*:*)
+        # 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 ] || \
+	       [ ${TARGET_BINARY_INTERFACE}x = x ]
+	    then
+		echo m88k-dg-dgux${UNAME_RELEASE}
+	    else
+		echo m88k-dg-dguxbcs${UNAME_RELEASE}
+	    fi
+	else
+	    echo i586-dg-dgux${UNAME_RELEASE}
+	fi
+ 	exit ;;
+    M88*:DolphinOS:*:*)	# DolphinOS (SVR3)
+	echo m88k-dolphin-sysv3
+	exit ;;
+    M88*:*:R3*:*)
+	# Delta 88k system running SVR3
+	echo m88k-motorola-sysv3
+	exit ;;
+    XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+	echo m88k-tektronix-sysv3
+	exit ;;
+    Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+	echo m68k-tektronix-bsd
+	exit ;;
+    *:IRIX*:*:*)
+	echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+	exit ;;
+    ????????:AIX?:[12].1:2)   # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+	echo romp-ibm-aix     # uname -m gives an 8 hex-code CPU id
+	exit ;;               # Note that: echo "'`uname -s`'" gives 'AIX '
+    i*86:AIX:*:*)
+	echo i386-ibm-aix
+	exit ;;
+    ia64:AIX:*:*)
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:2:3)
+	if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+		eval $set_cc_for_build
+		sed 's/^		//' << EOF >$dummy.c
+		#include <sys/systemcfg.h>
+
+		main()
+			{
+			if (!__power_pc())
+				exit(1);
+			puts("powerpc-ibm-aix3.2.5");
+			exit(0);
+			}
+EOF
+		if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+		then
+			echo "$SYSTEM_NAME"
+		else
+			echo rs6000-ibm-aix3.2.5
+		fi
+	elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+		echo rs6000-ibm-aix3.2.4
+	else
+		echo rs6000-ibm-aix3.2
+	fi
+	exit ;;
+    *:AIX:*:[45])
+	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
+	else
+		IBM_ARCH=powerpc
+	fi
+	if [ -x /usr/bin/oslevel ] ; then
+		IBM_REV=`/usr/bin/oslevel`
+	else
+		IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+	fi
+	echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+	exit ;;
+    *:AIX:*:*)
+	echo rs6000-ibm-aix
+	exit ;;
+    ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+	echo romp-ibm-bsd4.4
+	exit ;;
+    ibmrt:*BSD:*|romp-ibm:BSD:*)            # covers RT/PC BSD and
+	echo romp-ibm-bsd${UNAME_RELEASE}   # 4.3 with uname added to
+	exit ;;                             # report: romp-ibm BSD 4.3
+    *:BOSX:*:*)
+	echo rs6000-bull-bosx
+	exit ;;
+    DPX/2?00:B.O.S.:*:*)
+	echo m68k-bull-sysv3
+	exit ;;
+    9000/[34]??:4.3bsd:1.*:*)
+	echo m68k-hp-bsd
+	exit ;;
+    hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+	echo m68k-hp-bsd4.4
+	exit ;;
+    9000/[34678]??:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	case "${UNAME_MACHINE}" in
+	    9000/31? )            HP_ARCH=m68000 ;;
+	    9000/[34]?? )         HP_ARCH=m68k ;;
+	    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
+                      523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
+                      528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+                      532)                      # CPU_PA_RISC2_0
+                        case "${sc_kernel_bits}" in
+                          32) HP_ARCH="hppa2.0n" ;;
+                          64) HP_ARCH="hppa2.0w" ;;
+			  '') HP_ARCH="hppa2.0" ;;   # HP-UX 10.20
+                        esac ;;
+                    esac
+		fi
+		if [ "${HP_ARCH}" = "" ]; then
+		    eval $set_cc_for_build
+		    sed 's/^              //' << EOF >$dummy.c
+
+              #define _HPUX_SOURCE
+              #include <stdlib.h>
+              #include <unistd.h>
+
+              int main ()
+              {
+              #if defined(_SC_KERNEL_BITS)
+                  long bits = sysconf(_SC_KERNEL_BITS);
+              #endif
+                  long cpu  = sysconf (_SC_CPU_VERSION);
+
+                  switch (cpu)
+              	{
+              	case CPU_PA_RISC1_0: puts ("hppa1.0"); break;
+              	case CPU_PA_RISC1_1: puts ("hppa1.1"); break;
+              	case CPU_PA_RISC2_0:
+              #if defined(_SC_KERNEL_BITS)
+              	    switch (bits)
+              		{
+              		case 64: puts ("hppa2.0w"); break;
+              		case 32: puts ("hppa2.0n"); break;
+              		default: puts ("hppa2.0"); break;
+              		} break;
+              #else  /* !defined(_SC_KERNEL_BITS) */
+              	    puts ("hppa2.0"); break;
+              #endif
+              	default: puts ("hppa1.0"); break;
+              	}
+                  exit (0);
+              }
+EOF
+		    (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+		    test -z "$HP_ARCH" && HP_ARCH=hppa
+		fi ;;
+	esac
+	if [ ${HP_ARCH} = "hppa2.0w" ]
+	then
+	    eval $set_cc_for_build
+
+	    # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
+	    # 32-bit code.  hppa64-hp-hpux* has the same kernel and a compiler
+	    # generating 64-bit code.  GNU and HP use different nomenclature:
+	    #
+	    # $ CC_FOR_BUILD=cc ./config.guess
+	    # => hppa2.0w-hp-hpux11.23
+	    # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
+	    # => hppa64-hp-hpux11.23
+
+	    if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+		grep __LP64__ >/dev/null
+	    then
+		HP_ARCH="hppa2.0w"
+	    else
+		HP_ARCH="hppa64"
+	    fi
+	fi
+	echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+	exit ;;
+    ia64:HP-UX:*:*)
+	HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+	echo ia64-hp-hpux${HPUX_REV}
+	exit ;;
+    3050*:HI-UX:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#include <unistd.h>
+	int
+	main ()
+	{
+	  long cpu = sysconf (_SC_CPU_VERSION);
+	  /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+	     true for CPU_PA_RISC1_0.  CPU_IS_PA_RISC returns correct
+	     results, however.  */
+	  if (CPU_IS_PA_RISC (cpu))
+	    {
+	      switch (cpu)
+		{
+		  case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+		  case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+		  default: puts ("hppa-hitachi-hiuxwe2"); break;
+		}
+	    }
+	  else if (CPU_IS_HP_MC68K (cpu))
+	    puts ("m68k-hitachi-hiuxwe2");
+	  else puts ("unknown-hitachi-hiuxwe2");
+	  exit (0);
+	}
+EOF
+	$CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+		{ echo "$SYSTEM_NAME"; exit; }
+	echo unknown-hitachi-hiuxwe2
+	exit ;;
+    9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
+	echo hppa1.1-hp-bsd
+	exit ;;
+    9000/8??:4.3bsd:*:*)
+	echo hppa1.0-hp-bsd
+	exit ;;
+    *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
+	echo hppa1.0-hp-mpeix
+	exit ;;
+    hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
+	echo hppa1.1-hp-osf
+	exit ;;
+    hp8??:OSF1:*:*)
+	echo hppa1.0-hp-osf
+	exit ;;
+    i*86:OSF1:*:*)
+	if [ -x /usr/sbin/sysversion ] ; then
+	    echo ${UNAME_MACHINE}-unknown-osf1mk
+	else
+	    echo ${UNAME_MACHINE}-unknown-osf1
+	fi
+	exit ;;
+    parisc*:Lites*:*:*)
+	echo hppa1.1-hp-lites
+	exit ;;
+    C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+	echo c1-convex-bsd
+        exit ;;
+    C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+        exit ;;
+    C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+	echo c34-convex-bsd
+        exit ;;
+    C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+	echo c38-convex-bsd
+        exit ;;
+    C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+	echo c4-convex-bsd
+        exit ;;
+    CRAY*Y-MP:*:*:*)
+	echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*[A-Z]90:*:*:*)
+	echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+	| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
+	      -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
+	      -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*TS:*:*:*)
+	echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*T3E:*:*:*)
+	echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    CRAY*SV1:*:*:*)
+	echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	exit ;;
+    *:UNICOS/mp:*:*)
+	echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
+	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 ;;
+    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}"
+	exit ;;
+    i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
+	echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
+	exit ;;
+    sparc*:BSD/OS:*:*)
+	echo sparc-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:BSD/OS:*:*)
+	echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+	exit ;;
+    *:FreeBSD:*:*)
+	case ${UNAME_MACHINE} in
+	    pc98)
+		echo i386-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    amd64)
+		echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	    *)
+		echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+	esac
+	exit ;;
+    i*:CYGWIN*:*)
+	echo ${UNAME_MACHINE}-pc-cygwin
+	exit ;;
+    i*:MINGW*:*)
+	echo ${UNAME_MACHINE}-pc-mingw32
+	exit ;;
+    i*:windows32*:*)
+    	# uname -m includes "-pc" on this system.
+    	echo ${UNAME_MACHINE}-mingw32
+	exit ;;
+    i*:PW*:*)
+	echo ${UNAME_MACHINE}-pc-pw32
+	exit ;;
+    x86:Interix*:[3456]*)
+	echo i586-pc-interix${UNAME_RELEASE}
+	exit ;;
+    EM64T:Interix*:[3456]*)
+	echo x86_64-unknown-interix${UNAME_RELEASE}
+	exit ;;
+    [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
+	echo i${UNAME_MACHINE}-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
+	# UNAME_MACHINE based on the output of uname instead of i386?
+	echo i586-pc-interix
+	exit ;;
+    i*:UWIN*:*)
+	echo ${UNAME_MACHINE}-pc-uwin
+	exit ;;
+    amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
+	echo x86_64-unknown-cygwin
+	exit ;;
+    p*:CYGWIN*:*)
+	echo powerpcle-unknown-cygwin
+	exit ;;
+    prep*:SunOS:5.*:*)
+	echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+	exit ;;
+    *:GNU:*:*)
+	# the GNU system
+	echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+	exit ;;
+    *:GNU/*:*:*)
+	# other systems with GNU libc and userland
+	echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
+	exit ;;
+    i*86:Minix:*:*)
+	echo ${UNAME_MACHINE}-pc-minix
+	exit ;;
+    arm*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    avr32*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    cris:Linux:*:*)
+	echo cris-axis-linux-gnu
+	exit ;;
+    crisv32:Linux:*:*)
+	echo crisv32-axis-linux-gnu
+	exit ;;
+    frv:Linux:*:*)
+    	echo frv-unknown-linux-gnu
+	exit ;;
+    ia64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m32r*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    m68*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    mips:Linux:*:*)
+	eval $set_cc_for_build
+	sed 's/^	//' << EOF >$dummy.c
+	#undef CPU
+	#undef mips
+	#undef mipsel
+	#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
+	CPU=mipsel
+	#else
+	#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
+	CPU=mips
+	#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
+	    }'`"
+	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}
+	exit ;;
+    parisc:Linux:*:* | hppa:Linux:*:*)
+	# Look for CPU level
+	case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
+	  PA7*) echo hppa1.1-unknown-linux-gnu ;;
+	  PA8*) echo hppa2.0-unknown-linux-gnu ;;
+	  *)    echo hppa-unknown-linux-gnu ;;
+	esac
+	exit ;;
+    parisc64:Linux:*:* | hppa64:Linux:*:*)
+	echo hppa64-unknown-linux-gnu
+	exit ;;
+    s390:Linux:*:* | s390x:Linux:*:*)
+	echo ${UNAME_MACHINE}-ibm-linux
+	exit ;;
+    sh64*:Linux:*:*)
+    	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sh*:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    sparc:Linux:*:* | sparc64:Linux:*:*)
+	echo ${UNAME_MACHINE}-unknown-linux-gnu
+	exit ;;
+    vax:Linux:*:*)
+	echo ${UNAME_MACHINE}-dec-linux-gnu
+	exit ;;
+    x86_64:Linux:*:*)
+	echo x86_64-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 ;;
+	  coff-i386)
+		echo "${UNAME_MACHINE}-pc-linux-gnucoff"
+		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 <features.h>
+	#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
+	# sysname and nodename.
+	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,
+	# I just have to hope.  -- rms.
+        # Use sysv4.2uw... so that sysv4* matches it.
+	echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
+	exit ;;
+    i*86:OS/2:*:*)
+	# If we were able to find `uname', then EMX Unix compatibility
+	# is probably installed.
+	echo ${UNAME_MACHINE}-pc-os2-emx
+	exit ;;
+    i*86:XTS-300:*:STOP)
+	echo ${UNAME_MACHINE}-unknown-stop
+	exit ;;
+    i*86:atheos:*:*)
+	echo ${UNAME_MACHINE}-unknown-atheos
+	exit ;;
+    i*86:syllable:*:*)
+	echo ${UNAME_MACHINE}-pc-syllable
+	exit ;;
+    i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.0*:*)
+	echo i386-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    i*86:*DOS:*:*)
+	echo ${UNAME_MACHINE}-pc-msdosdjgpp
+	exit ;;
+    i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
+	UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+	if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+		echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+	else
+		echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+	fi
+	exit ;;
+    i*86:*:5:[678]*)
+    	# UnixWare 7.x, OpenUNIX and OpenServer 6.
+	case `/bin/uname -X | grep "^Machine"` in
+	    *486*)	     UNAME_MACHINE=i486 ;;
+	    *Pentium)	     UNAME_MACHINE=i586 ;;
+	    *Pent*|*Celeron) UNAME_MACHINE=i686 ;;
+	esac
+	echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+	exit ;;
+    i*86:*:3.2:*)
+	if test -f /usr/options/cb.name; then
+		UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+		echo ${UNAME_MACHINE}-pc-isc$UNAME_REL
+	elif /bin/uname -X 2>/dev/null >/dev/null ; then
+		UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
+		(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
+		(/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \
+			&& UNAME_MACHINE=i586
+		(/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
+			&& UNAME_MACHINE=i686
+		echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+	else
+		echo ${UNAME_MACHINE}-pc-sysv32
+	fi
+	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 ;;
+    Intel:Mach:3*:*)
+	echo i386-pc-mach3
+	exit ;;
+    paragon:*:*:*)
+	echo i860-intel-osf1
+	exit ;;
+    i860:*:4.*:*) # i860-SVR4
+	if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+	  echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+	else # Add other i860-SVR4 vendors below as they are discovered.
+	  echo i860-unknown-sysv${UNAME_RELEASE}  # Unknown i860-SVR4
+	fi
+	exit ;;
+    mini*:CTIX:SYS*5:*)
+	# "miniframe"
+	echo m68010-convergent-sysv
+	exit ;;
+    mc68k:UNIX:SYSTEM5:3.51m)
+	echo m68k-convergent-sysv
+	exit ;;
+    M680?0:D-NIX:5.3:*)
+	echo m68k-diab-dnix
+	exit ;;
+    M68*:*:R3V[5678]*:*)
+	test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
+    3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
+	OS_REL=''
+	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; } ;;
+    3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+        /bin/uname -p 2>/dev/null | grep 86 >/dev/null \
+          && { echo i486-ncr-sysv4; exit; } ;;
+    m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
+	echo m68k-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    mc68030:UNIX_System_V:4.*:*)
+	echo m68k-atari-sysv4
+	exit ;;
+    TSUNAMI:LynxOS:2.*:*)
+	echo sparc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    rs6000:LynxOS:2.*:*)
+	echo rs6000-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.0*:*)
+	echo powerpc-unknown-lynxos${UNAME_RELEASE}
+	exit ;;
+    SM[BE]S:UNIX_SV:*:*)
+	echo mips-dde-sysv${UNAME_RELEASE}
+	exit ;;
+    RM*:ReliantUNIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    RM*:SINIX-*:*:*)
+	echo mips-sni-sysv4
+	exit ;;
+    *:SINIX-*:*:*)
+	if uname -p 2>/dev/null >/dev/null ; then
+		UNAME_MACHINE=`(uname -p) 2>/dev/null`
+		echo ${UNAME_MACHINE}-sni-sysv4
+	else
+		echo ns32k-sni-sysv
+	fi
+	exit ;;
+    PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+                      # says <Richard.M.Bartel@ccMail.Census.GOV>
+        echo i586-unisys-sysv4
+        exit ;;
+    *:UNIX_System_V:4*:FTX*)
+	# From Gerald Hewes <hewes@openmarket.com>.
+	# How about differentiating between stratus architectures? -djm
+	echo hppa1.1-stratus-sysv4
+	exit ;;
+    *:*:*:FTX*)
+	# From seanf@swdc.stratus.com.
+	echo i860-stratus-sysv4
+	exit ;;
+    i*86:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo ${UNAME_MACHINE}-stratus-vos
+	exit ;;
+    *:VOS:*:*)
+	# From Paul.Green@stratus.com.
+	echo hppa1.1-stratus-vos
+	exit ;;
+    mc68*:A/UX:*:*)
+	echo m68k-apple-aux${UNAME_RELEASE}
+	exit ;;
+    news*:NEWS-OS:6*:*)
+	echo mips-sony-newsos6
+	exit ;;
+    R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
+	if [ -d /usr/nec ]; then
+	        echo mips-nec-sysv${UNAME_RELEASE}
+	else
+	        echo mips-unknown-sysv${UNAME_RELEASE}
+	fi
+        exit ;;
+    BeBox:BeOS:*:*)	# BeOS running on hardware made by Be, PPC only.
+	echo powerpc-be-beos
+	exit ;;
+    BeMac:BeOS:*:*)	# BeOS running on Mac or Mac clone, PPC only.
+	echo powerpc-apple-beos
+	exit ;;
+    BePC:BeOS:*:*)	# BeOS running on Intel PC compatible.
+	echo i586-pc-beos
+	exit ;;
+    SX-4:SUPER-UX:*:*)
+	echo sx4-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-5:SUPER-UX:*:*)
+	echo sx5-nec-superux${UNAME_RELEASE}
+	exit ;;
+    SX-6:SUPER-UX:*:*)
+	echo sx6-nec-superux${UNAME_RELEASE}
+	exit ;;
+    Power*:Rhapsody:*:*)
+	echo powerpc-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Rhapsody:*:*)
+	echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
+	exit ;;
+    *:Darwin:*:*)
+	UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+	case $UNAME_PROCESSOR in
+	    unknown) UNAME_PROCESSOR=powerpc ;;
+	esac
+	echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
+	exit ;;
+    *:procnto*:*:* | *:QNX:[0123456789]*:*)
+	UNAME_PROCESSOR=`uname -p`
+	if test "$UNAME_PROCESSOR" = "x86"; then
+		UNAME_PROCESSOR=i386
+		UNAME_MACHINE=pc
+	fi
+	echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
+	exit ;;
+    *:QNX:*:4*)
+	echo i386-pc-qnx
+	exit ;;
+    NSE-?:NONSTOP_KERNEL:*:*)
+	echo nse-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    NSR-?:NONSTOP_KERNEL:*:*)
+	echo nsr-tandem-nsk${UNAME_RELEASE}
+	exit ;;
+    *:NonStop-UX:*:*)
+	echo mips-compaq-nonstopux
+	exit ;;
+    BS2000:POSIX*:*:*)
+	echo bs2000-siemens-sysv
+	exit ;;
+    DS/*:UNIX_System_V:*:*)
+	echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
+	exit ;;
+    *:Plan9:*:*)
+	# "uname -m" is not consistent, so use $cputype instead. 386
+	# is converted to i386 for consistency with other x86
+	# operating systems.
+	if test "$cputype" = "386"; then
+	    UNAME_MACHINE=i386
+	else
+	    UNAME_MACHINE="$cputype"
+	fi
+	echo ${UNAME_MACHINE}-unknown-plan9
+	exit ;;
+    *:TOPS-10:*:*)
+	echo pdp10-unknown-tops10
+	exit ;;
+    *:TENEX:*:*)
+	echo pdp10-unknown-tenex
+	exit ;;
+    KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
+	echo pdp10-dec-tops20
+	exit ;;
+    XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
+	echo pdp10-xkl-tops20
+	exit ;;
+    *:TOPS-20:*:*)
+	echo pdp10-unknown-tops20
+	exit ;;
+    *:ITS:*:*)
+	echo pdp10-unknown-its
+	exit ;;
+    SEI:*:*:SEIUX)
+        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`
+	case "${UNAME_MACHINE}" in
+	    A*) echo alpha-dec-vms ; exit ;;
+	    I*) echo ia64-dec-vms ; exit ;;
+	    V*) echo vax-dec-vms ; exit ;;
+	esac ;;
+    *:XENIX:*:SysV)
+	echo i386-pc-xenix
+	exit ;;
+    i*86:skyos:*:*)
+	echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
+	exit ;;
+    i*86:rdos:*:*)
+	echo ${UNAME_MACHINE}-pc-rdos
+	exit ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+eval $set_cc_for_build
+cat >$dummy.c <<EOF
+#ifdef _SEQUENT_
+# include <sys/types.h>
+# include <sys/utsname.h>
+#endif
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+  /* BFD wants "bsd" instead of "newsos".  Perhaps BFD should be changed,
+     I don't know....  */
+  printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+  printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+          "4"
+#else
+	  ""
+#endif
+         ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+  printf ("arm-acorn-riscix\n"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+  printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+  int version;
+  version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+  if (version < 4)
+    printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version);
+  else
+    printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version);
+  exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+  printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+  printf ("ns32k-encore-mach\n"); exit (0);
+#else
+  printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+  printf ("i386-pc-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+  printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+  printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+    struct utsname un;
+
+    uname(&un);
+
+    if (strncmp(un.version, "V2", 2) == 0) {
+	printf ("i386-sequent-ptx2\n"); exit (0);
+    }
+    if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+	printf ("i386-sequent-ptx1\n"); exit (0);
+    }
+    printf ("i386-sequent-ptx\n"); exit (0);
+
+#endif
+
+#if defined (vax)
+# if !defined (ultrix)
+#  include <sys/param.h>
+#  if defined (BSD)
+#   if BSD == 43
+      printf ("vax-dec-bsd4.3\n"); exit (0);
+#   else
+#    if BSD == 199006
+      printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#    else
+      printf ("vax-dec-bsd\n"); exit (0);
+#    endif
+#   endif
+#  else
+    printf ("vax-dec-bsd\n"); exit (0);
+#  endif
+# else
+    printf ("vax-dec-ultrix\n"); exit (0);
+# endif
+#endif
+
+#if defined (alliant) && defined (i860)
+  printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+  exit (1);
+}
+EOF
+
+$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+	{ echo "$SYSTEM_NAME"; exit; }
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+    case `getsysinfo -f cpu_type` in
+    c1*)
+	echo c1-convex-bsd
+	exit ;;
+    c2*)
+	if getsysinfo -f scalar_acc
+	then echo c32-convex-bsd
+	else echo c2-convex-bsd
+	fi
+	exit ;;
+    c34*)
+	echo c34-convex-bsd
+	exit ;;
+    c38*)
+	echo c38-convex-bsd
+	exit ;;
+    c4*)
+	echo c4-convex-bsd
+	exit ;;
+    esac
+fi
+
+cat >&2 <<EOF
+$0: unable to guess system type
+
+This script, last modified $timestamp, has failed to recognize
+the operating system you are using. It is advised that you
+download the most up to date version of the config scripts from
+
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.guess
+and
+  http://savannah.gnu.org/cgi-bin/viewcvs/*checkout*/config/config/config.sub
+
+If the version you run ($0) is already up to date, please
+send the following data and any information you think might be
+pertinent to <config-patches@gnu.org> in order to provide the needed
+information to handle your system.
+
+config.guess timestamp = $timestamp
+
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null`
+
+hostinfo               = `(hostinfo) 2>/dev/null`
+/bin/universe          = `(/bin/universe) 2>/dev/null`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null`
+/bin/arch              = `(/bin/arch) 2>/dev/null`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
+
+UNAME_MACHINE = ${UNAME_MACHINE}
+UNAME_RELEASE = ${UNAME_RELEASE}
+UNAME_SYSTEM  = ${UNAME_SYSTEM}
+UNAME_VERSION = ${UNAME_VERSION}
+EOF
+
+exit 1
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/payloads/libpayload/curses/PDCurses-3.4/config.h.in b/payloads/libpayload/curses/PDCurses-3.4/config.h.in
new file mode 100644
index 0000000..28e9e48e
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/config.h.in
@@ -0,0 +1,133 @@
+/* config.h.in.  Generated from configure.ac by autoheader.  */
+
+/* Define if you have the <DECkeySym.h> header file */
+#undef HAVE_DECKEYSYM_H
+
+/* Define to 1 if you have the <dlfcn.h> header file. */
+#undef HAVE_DLFCN_H
+
+/* Define to 1 if you have the <dl.h> header file. */
+#undef HAVE_DL_H
+
+/* Define to 1 if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef HAVE_INTTYPES_H
+
+/* Define to 1 if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define to 1 if you have the `poll' function. */
+#undef HAVE_POLL
+
+/* Define to 1 if you have the <stdint.h> header file. */
+#undef HAVE_STDINT_H
+
+/* Define to 1 if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define to 1 if you have the <strings.h> header file. */
+#undef HAVE_STRINGS_H
+
+/* Define to 1 if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <Sunkeysym.h> header file */
+#undef HAVE_SUNKEYSYM_H
+
+/* Define to 1 if you have the <sys/select.h> header file. */
+#undef HAVE_SYS_SELECT_H
+
+/* Define to 1 if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define to 1 if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define to 1 if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define to 1 if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `usleep' function. */
+#undef HAVE_USLEEP
+
+/* Define to 1 if you have the `vsnprintf' function. */
+#undef HAVE_VSNPRINTF
+
+/* Define to 1 if you have the `vsscanf' function. */
+#undef HAVE_VSSCANF
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_BEGIN
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_DELETE
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_DOWN
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_END
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_HOME
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_INSERT
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_LEFT
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_NEXT
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_PRIOR
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_RIGHT
+
+/* Define if you have this defined in <keysym.h> */
+#undef HAVE_XK_KP_UP
+
+/* Define if you have the <xpm.h> header file */
+#undef HAVE_XPM_H
+
+/* Define to the address where bug reports for this package should be sent. */
+#undef PACKAGE_BUGREPORT
+
+/* Define to the full name of this package. */
+#undef PACKAGE_NAME
+
+/* Define to the full name and version of this package. */
+#undef PACKAGE_STRING
+
+/* Define to the one symbol short name of this package. */
+#undef PACKAGE_TARNAME
+
+/* Define to the version of this package. */
+#undef PACKAGE_VERSION
+
+/* Define as the system defined limit for number of signals */
+#undef PDC_MAX_SIGNALS
+
+/* Define as the return type of signal handlers (`int' or `void'). */
+#undef RETSIGTYPE
+
+/* Define to 1 if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define to 1 if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if you want to use neXtaw library */
+#undef USE_NEXTAW
+
+/* Define if you want to use Xaw3d library */
+#undef USE_XAW3D
+
+/* Define XPointer is typedefed in X11/Xlib.h */
+#undef XPOINTER_TYPEDEFED
diff --git a/payloads/libpayload/curses/PDCurses-3.4/config.sub b/payloads/libpayload/curses/PDCurses-3.4/config.sub
new file mode 100755
index 0000000..fab0aa3
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/config.sub
@@ -0,0 +1,1616 @@
+#! /bin/sh
+# Configuration validation subroutine script.
+#   Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
+#   2000, 2001, 2002, 2003, 2004, 2005, 2006 Free Software Foundation,
+#   Inc.
+
+timestamp='2006-09-20'
+
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine.  It does not imply ALL GNU software can.
+#
+# 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
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA
+# 02110-1301, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+
+# Please send patches to <config-patches@gnu.org>.  Submit a context
+# diff and a properly formatted 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.
+
+# 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.
+# Each package is responsible for reporting which valid configurations
+# it does not support.  The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+#	CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# or in some cases, the newer four-part form:
+#	CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+me=`echo "$0" | sed -e 's,.*/,,'`
+
+usage="\
+Usage: $0 [OPTION] CPU-MFR-OPSYS
+       $0 [OPTION] ALIAS
+
+Canonicalize a configuration name.
+
+Operation modes:
+  -h, --help         print this help, then exit
+  -t, --time-stamp   print date of last modification, then exit
+  -v, --version      print version number, then exit
+
+Report bugs and patches to <config-patches@gnu.org>."
+
+version="\
+GNU config.sub ($timestamp)
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005
+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."
+
+help="
+Try \`$me --help' for more information."
+
+# Parse command line
+while test $# -gt 0 ; do
+  case $1 in
+    --time-stamp | --time* | -t )
+       echo "$timestamp" ; exit ;;
+    --version | -v )
+       echo "$version" ; exit ;;
+    --help | --h* | -h )
+       echo "$usage"; exit ;;
+    -- )     # Stop option processing
+       shift; break ;;
+    - )	# Use stdin as input.
+       break ;;
+    -* )
+       echo "$me: invalid option $1$help"
+       exit 1 ;;
+
+    *local*)
+       # First pass through any local machine types.
+       echo $1
+       exit ;;
+
+    * )
+       break ;;
+  esac
+done
+
+case $# in
+ 0) echo "$me: missing argument$help" >&2
+    exit 1;;
+ 1) ;;
+ *) echo "$me: too many arguments$help" >&2
+    exit 1;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
+# 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* | \
+  storm-chaos* | os2-emx* | rtmk-nova*)
+    os=-$maybe_os
+    basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
+    ;;
+  *)
+    basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+    if [ $basic_machine != $1 ]
+    then os=`echo $1 | sed 's/.*-/-/'`
+    else os=; fi
+    ;;
+esac
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work.  We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+	-sun*os*)
+		# Prevent following clause from handling this invalid input.
+		;;
+	-dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+	-att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+	-unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+	-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)
+		os=
+		basic_machine=$1
+		;;
+	-sim | -cisco | -oki | -wec | -winbond)
+		os=
+		basic_machine=$1
+		;;
+	-scout)
+		;;
+	-wrs)
+		os=-vxworks
+		basic_machine=$1
+		;;
+	-chorusos*)
+		os=-chorusos
+		basic_machine=$1
+		;;
+ 	-chorusrdb)
+ 		os=-chorusrdb
+		basic_machine=$1
+ 		;;
+	-hiux*)
+		os=-hiuxwe2
+		;;
+	-sco6)
+		os=-sco5v6
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5)
+		os=-sco3.2v5
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco4)
+		os=-sco3.2v4
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2.[4-9]*)
+		os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco3.2v[4-9]*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco5v6*)
+		# Don't forget version if it is 3.2v4 or newer.
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-sco*)
+		os=-sco3.2v2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-udk*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-isc)
+		os=-isc2.2
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-clix*)
+		basic_machine=clipper-intergraph
+		;;
+	-isc*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'`
+		;;
+	-lynx*)
+		os=-lynxos
+		;;
+	-ptx*)
+		basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+		;;
+	-windowsnt*)
+		os=`echo $os | sed -e 's/windowsnt/winnt/'`
+		;;
+	-psos*)
+		os=-psos
+		;;
+	-mint | -mint[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+	# Recognize the basic CPU types without company name.
+	# Some are omitted here because they have special meanings below.
+	1750a | 580 \
+	| a29k \
+	| alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
+	| alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
+	| am33_2.0 \
+	| arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
+	| bfin \
+	| c4x | clipper \
+	| d10v | d30v | dlx | dsp16xx \
+	| fr30 | frv \
+	| h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+	| i370 | i860 | i960 | ia64 \
+	| ip2k | iq2000 \
+	| m32c | m32r | m32rle | m68000 | m68k | m88k \
+	| maxq | mb | microblaze | mcore \
+	| mips | mipsbe | mipseb | mipsel | mipsle \
+	| mips16 \
+	| mips64 | mips64el \
+	| mips64vr | mips64vrel \
+	| mips64orion | mips64orionel \
+	| mips64vr4100 | mips64vr4100el \
+	| mips64vr4300 | mips64vr4300el \
+	| mips64vr5000 | mips64vr5000el \
+	| mips64vr5900 | mips64vr5900el \
+	| mipsisa32 | mipsisa32el \
+	| mipsisa32r2 | mipsisa32r2el \
+	| mipsisa64 | mipsisa64el \
+	| mipsisa64r2 | mipsisa64r2el \
+	| mipsisa64sb1 | mipsisa64sb1el \
+	| mipsisa64sr71k | mipsisa64sr71kel \
+	| mipstx39 | mipstx39el \
+	| mn10200 | mn10300 \
+	| mt \
+	| msp430 \
+	| nios | nios2 \
+	| ns16k | ns32k \
+	| or32 \
+	| pdp10 | pdp11 | pj | pjl \
+	| powerpc | powerpc64 | powerpc64le | powerpcle | ppcbe \
+	| pyramid \
+	| score \
+	| sh | sh[1234] | sh[24]a | 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 \
+	| v850 | v850e \
+	| we32k \
+	| x86 | xc16x | xscale | xscalee[bl] | xstormy16 | xtensa \
+	| z8k)
+		basic_machine=$basic_machine-unknown
+		;;
+	m6811 | m68hc11 | m6812 | m68hc12)
+		# Motorola 68HC11/12.
+		basic_machine=$basic_machine-unknown
+		os=-none
+		;;
+	m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
+		;;
+	ms1)
+		basic_machine=mt-unknown
+		;;
+
+	# We use `pc' rather than `unknown'
+	# 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
+	  ;;
+	# Object if more than one company name word.
+	*-*-*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+	# Recognize the basic CPU types with company name.
+	580-* \
+	| a29k-* \
+	| alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
+	| alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
+	| alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
+	| arm-*  | armbe-* | armle-* | armeb-* | armv*-* \
+	| avr-* | avr32-* \
+	| bfin-* | bs2000-* \
+	| c[123]* | c30-* | [cjt]90-* | c4x-* | c54x-* | c55x-* | c6x-* \
+	| clipper-* | craynv-* | cydra-* \
+	| d10v-* | d30v-* | dlx-* \
+	| elxsi-* \
+	| f30[01]-* | f700-* | fr30-* | frv-* | fx80-* \
+	| h8300-* | h8500-* \
+	| hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
+	| i*86-* | i860-* | i960-* | ia64-* \
+	| ip2k-* | iq2000-* \
+	| m32c-* | m32r-* | m32rle-* \
+	| m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
+	| m88110-* | m88k-* | maxq-* | mcore-* \
+	| mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
+	| mips16-* \
+	| mips64-* | mips64el-* \
+	| mips64vr-* | mips64vrel-* \
+	| mips64orion-* | mips64orionel-* \
+	| mips64vr4100-* | mips64vr4100el-* \
+	| mips64vr4300-* | mips64vr4300el-* \
+	| mips64vr5000-* | mips64vr5000el-* \
+	| mips64vr5900-* | mips64vr5900el-* \
+	| mipsisa32-* | mipsisa32el-* \
+	| mipsisa32r2-* | mipsisa32r2el-* \
+	| mipsisa64-* | mipsisa64el-* \
+	| mipsisa64r2-* | mipsisa64r2el-* \
+	| mipsisa64sb1-* | mipsisa64sb1el-* \
+	| mipsisa64sr71k-* | mipsisa64sr71kel-* \
+	| mipstx39-* | mipstx39el-* \
+	| mmix-* \
+	| mt-* \
+	| msp430-* \
+	| 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-* \
+	| 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-* \
+	| tron-* \
+	| v850-* | v850e-* | vax-* \
+	| we32k-* \
+	| x86-* | x86_64-* | xc16x-* | xps100-* | xscale-* | xscalee[bl]-* \
+	| xstormy16-* | xtensa-* \
+	| ymp-* \
+	| z8k-*)
+		;;
+	# Recognize the various machine names and aliases which stand
+	# for a CPU type and a company and sometimes even an OS.
+	386bsd)
+		basic_machine=i386-unknown
+		os=-bsd
+		;;
+	3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+		basic_machine=m68000-att
+		;;
+	3b*)
+		basic_machine=we32k-att
+		;;
+	a29khif)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+    	abacus)
+		basic_machine=abacus-unknown
+		;;
+	adobe68k)
+		basic_machine=m68010-adobe
+		os=-scout
+		;;
+	alliant | fx80)
+		basic_machine=fx80-alliant
+		;;
+	altos | altos3068)
+		basic_machine=m68k-altos
+		;;
+	am29k)
+		basic_machine=a29k-none
+		os=-bsd
+		;;
+	amd64)
+		basic_machine=x86_64-pc
+		;;
+	amd64-*)
+		basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	amdahl)
+		basic_machine=580-amdahl
+		os=-sysv
+		;;
+	amiga | amiga-*)
+		basic_machine=m68k-unknown
+		;;
+	amigaos | amigados)
+		basic_machine=m68k-unknown
+		os=-amigaos
+		;;
+	amigaunix | amix)
+		basic_machine=m68k-unknown
+		os=-sysv4
+		;;
+	apollo68)
+		basic_machine=m68k-apollo
+		os=-sysv
+		;;
+	apollo68bsd)
+		basic_machine=m68k-apollo
+		os=-bsd
+		;;
+	aux)
+		basic_machine=m68k-apple
+		os=-aux
+		;;
+	balance)
+		basic_machine=ns32k-sequent
+		os=-dynix
+		;;
+	c90)
+		basic_machine=c90-cray
+		os=-unicos
+		;;
+	convex-c1)
+		basic_machine=c1-convex
+		os=-bsd
+		;;
+	convex-c2)
+		basic_machine=c2-convex
+		os=-bsd
+		;;
+	convex-c32)
+		basic_machine=c32-convex
+		os=-bsd
+		;;
+	convex-c34)
+		basic_machine=c34-convex
+		os=-bsd
+		;;
+	convex-c38)
+		basic_machine=c38-convex
+		os=-bsd
+		;;
+	cray | j90)
+		basic_machine=j90-cray
+		os=-unicos
+		;;
+	craynv)
+		basic_machine=craynv-cray
+		os=-unicosmp
+		;;
+	cr16c)
+		basic_machine=cr16c-unknown
+		os=-elf
+		;;
+	crds | unos)
+		basic_machine=m68k-crds
+		;;
+	crisv32 | crisv32-* | etraxfs*)
+		basic_machine=crisv32-axis
+		;;
+	cris | cris-* | etrax*)
+		basic_machine=cris-axis
+		;;
+	crx)
+		basic_machine=crx-unknown
+		os=-elf
+		;;
+	da30 | da30-*)
+		basic_machine=m68k-da30
+		;;
+	decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+		basic_machine=mips-dec
+		;;
+	decsystem10* | dec10*)
+		basic_machine=pdp10-dec
+		os=-tops10
+		;;
+	decsystem20* | dec20*)
+		basic_machine=pdp10-dec
+		os=-tops20
+		;;
+	delta | 3300 | motorola-3300 | motorola-delta \
+	      | 3300-motorola | delta-motorola)
+		basic_machine=m68k-motorola
+		;;
+	delta88)
+		basic_machine=m88k-motorola
+		os=-sysv3
+		;;
+	djgpp)
+		basic_machine=i586-pc
+		os=-msdosdjgpp
+		;;
+	dpx20 | dpx20-*)
+		basic_machine=rs6000-bull
+		os=-bosx
+		;;
+	dpx2* | dpx2*-bull)
+		basic_machine=m68k-bull
+		os=-sysv3
+		;;
+	ebmon29k)
+		basic_machine=a29k-amd
+		os=-ebmon
+		;;
+	elxsi)
+		basic_machine=elxsi-elxsi
+		os=-bsd
+		;;
+	encore | umax | mmax)
+		basic_machine=ns32k-encore
+		;;
+	es1800 | OSE68k | ose68k | ose | OSE)
+		basic_machine=m68k-ericsson
+		os=-ose
+		;;
+	fx2800)
+		basic_machine=i860-alliant
+		;;
+	genix)
+		basic_machine=ns32k-ns
+		;;
+	gmicro)
+		basic_machine=tron-gmicro
+		os=-sysv
+		;;
+	go32)
+		basic_machine=i386-pc
+		os=-go32
+		;;
+	h3050r* | hiux*)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	h8300hms)
+		basic_machine=h8300-hitachi
+		os=-hms
+		;;
+	h8300xray)
+		basic_machine=h8300-hitachi
+		os=-xray
+		;;
+	h8500hms)
+		basic_machine=h8500-hitachi
+		os=-hms
+		;;
+	harris)
+		basic_machine=m88k-harris
+		os=-sysv3
+		;;
+	hp300-*)
+		basic_machine=m68k-hp
+		;;
+	hp300bsd)
+		basic_machine=m68k-hp
+		os=-bsd
+		;;
+	hp300hpux)
+		basic_machine=m68k-hp
+		os=-hpux
+		;;
+	hp3k9[0-9][0-9] | hp9[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k2[0-9][0-9] | hp9k31[0-9])
+		basic_machine=m68000-hp
+		;;
+	hp9k3[2-9][0-9])
+		basic_machine=m68k-hp
+		;;
+	hp9k6[0-9][0-9] | hp6[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hp9k7[0-79][0-9] | hp7[0-79][0-9])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k78[0-9] | hp78[0-9])
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
+		# FIXME: really hppa2.0-hp
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][13679] | hp8[0-9][13679])
+		basic_machine=hppa1.1-hp
+		;;
+	hp9k8[0-9][0-9] | hp8[0-9][0-9])
+		basic_machine=hppa1.0-hp
+		;;
+	hppa-next)
+		os=-nextstep3
+		;;
+	hppaosf)
+		basic_machine=hppa1.1-hp
+		os=-osf
+		;;
+	hppro)
+		basic_machine=hppa1.1-hp
+		os=-proelf
+		;;
+	i370-ibm* | ibm*)
+		basic_machine=i370-ibm
+		;;
+# I'm not sure what "Sysv32" means.  Should this be sysv3.2?
+	i*86v32)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv32
+		;;
+	i*86v4*)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv4
+		;;
+	i*86v)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-sysv
+		;;
+	i*86sol2)
+		basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
+		os=-solaris2
+		;;
+	i386mach)
+		basic_machine=i386-mach
+		os=-mach
+		;;
+	i386-vsta | vsta)
+		basic_machine=i386-unknown
+		os=-vsta
+		;;
+	iris | iris4d)
+		basic_machine=mips-sgi
+		case $os in
+		    -irix*)
+			;;
+		    *)
+			os=-irix4
+			;;
+		esac
+		;;
+	isi68 | isi)
+		basic_machine=m68k-isi
+		os=-sysv
+		;;
+	m88k-omron*)
+		basic_machine=m88k-omron
+		;;
+	magnum | m3230)
+		basic_machine=mips-mips
+		os=-sysv
+		;;
+	merlin)
+		basic_machine=ns32k-utek
+		os=-sysv
+		;;
+	mingw32)
+		basic_machine=i386-pc
+		os=-mingw32
+		;;
+	miniframe)
+		basic_machine=m68000-convergent
+		;;
+	*mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
+		basic_machine=m68k-atari
+		os=-mint
+		;;
+	mips3*-*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+		;;
+	mips3*)
+		basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+		;;
+	monitor)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	morphos)
+		basic_machine=powerpc-unknown
+		os=-morphos
+		;;
+	msdos)
+		basic_machine=i386-pc
+		os=-msdos
+		;;
+	ms1-*)
+		basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
+		;;
+	mvs)
+		basic_machine=i370-ibm
+		os=-mvs
+		;;
+	ncr3000)
+		basic_machine=i486-ncr
+		os=-sysv4
+		;;
+	netbsd386)
+		basic_machine=i386-unknown
+		os=-netbsd
+		;;
+	netwinder)
+		basic_machine=armv4l-rebel
+		os=-linux
+		;;
+	news | news700 | news800 | news900)
+		basic_machine=m68k-sony
+		os=-newsos
+		;;
+	news1000)
+		basic_machine=m68030-sony
+		os=-newsos
+		;;
+	news-3600 | risc-news)
+		basic_machine=mips-sony
+		os=-newsos
+		;;
+	necv70)
+		basic_machine=v70-nec
+		os=-sysv
+		;;
+	next | m*-next )
+		basic_machine=m68k-next
+		case $os in
+		    -nextstep* )
+			;;
+		    -ns2*)
+		      os=-nextstep2
+			;;
+		    *)
+		      os=-nextstep3
+			;;
+		esac
+		;;
+	nh3000)
+		basic_machine=m68k-harris
+		os=-cxux
+		;;
+	nh[45]000)
+		basic_machine=m88k-harris
+		os=-cxux
+		;;
+	nindy960)
+		basic_machine=i960-intel
+		os=-nindy
+		;;
+	mon960)
+		basic_machine=i960-intel
+		os=-mon960
+		;;
+	nonstopux)
+		basic_machine=mips-compaq
+		os=-nonstopux
+		;;
+	np1)
+		basic_machine=np1-gould
+		;;
+	nsr-tandem)
+		basic_machine=nsr-tandem
+		;;
+	op50n-* | op60c-*)
+		basic_machine=hppa1.1-oki
+		os=-proelf
+		;;
+	openrisc | openrisc-*)
+		basic_machine=or32-unknown
+		;;
+	os400)
+		basic_machine=powerpc-ibm
+		os=-os400
+		;;
+	OSE68000 | ose68000)
+		basic_machine=m68000-ericsson
+		os=-ose
+		;;
+	os68k)
+		basic_machine=m68k-none
+		os=-os68k
+		;;
+	pa-hitachi)
+		basic_machine=hppa1.1-hitachi
+		os=-hiuxwe2
+		;;
+	paragon)
+		basic_machine=i860-intel
+		os=-osf
+		;;
+	pbd)
+		basic_machine=sparc-tti
+		;;
+	pbb)
+		basic_machine=m68k-tti
+		;;
+	pc532 | pc532-*)
+		basic_machine=ns32k-pc532
+		;;
+	pc98)
+		basic_machine=i386-pc
+		;;
+	pc98-*)
+		basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium | p5 | k5 | k6 | nexgen | viac3)
+		basic_machine=i586-pc
+		;;
+	pentiumpro | p6 | 6x86 | athlon | athlon_*)
+		basic_machine=i686-pc
+		;;
+	pentiumii | pentium2 | pentiumiii | pentium3)
+		basic_machine=i686-pc
+		;;
+	pentium4)
+		basic_machine=i786-pc
+		;;
+	pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
+		basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumpro-* | p6-* | 6x86-* | athlon-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
+		basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pentium4-*)
+		basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	pn)
+		basic_machine=pn-gould
+		;;
+	power)	basic_machine=power-ibm
+		;;
+	ppc)	basic_machine=powerpc-unknown
+		;;
+	ppc-*)	basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppcle | powerpclittle | ppc-le | powerpc-little)
+		basic_machine=powerpcle-unknown
+		;;
+	ppcle-* | powerpclittle-*)
+		basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64)	basic_machine=powerpc64-unknown
+		;;
+	ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ppc64le | powerpc64little | ppc64-le | powerpc64-little)
+		basic_machine=powerpc64le-unknown
+		;;
+	ppc64le-* | powerpc64little-*)
+		basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+		;;
+	ps2)
+		basic_machine=i386-ibm
+		;;
+	pw32)
+		basic_machine=i586-unknown
+		os=-pw32
+		;;
+	rdos)
+		basic_machine=i386-pc
+		os=-rdos
+		;;
+	rom68k)
+		basic_machine=m68k-rom68k
+		os=-coff
+		;;
+	rm[46]00)
+		basic_machine=mips-siemens
+		;;
+	rtpc | rtpc-*)
+		basic_machine=romp-ibm
+		;;
+	s390 | s390-*)
+		basic_machine=s390-ibm
+		;;
+	s390x | s390x-*)
+		basic_machine=s390x-ibm
+		;;
+	sa29200)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	sb1)
+		basic_machine=mipsisa64sb1-unknown
+		;;
+	sb1el)
+		basic_machine=mipsisa64sb1el-unknown
+		;;
+	sde)
+		basic_machine=mipsisa32-sde
+		os=-elf
+		;;
+	sei)
+		basic_machine=mips-sei
+		os=-seiux
+		;;
+	sequent)
+		basic_machine=i386-sequent
+		;;
+	sh)
+		basic_machine=sh-hitachi
+		os=-hms
+		;;
+	sh64)
+		basic_machine=sh64-unknown
+		;;
+	sparclite-wrs | simso-wrs)
+		basic_machine=sparclite-wrs
+		os=-vxworks
+		;;
+	sps7)
+		basic_machine=m68k-bull
+		os=-sysv2
+		;;
+	spur)
+		basic_machine=spur-unknown
+		;;
+	st2000)
+		basic_machine=m68k-tandem
+		;;
+	stratus)
+		basic_machine=i860-stratus
+		os=-sysv4
+		;;
+	sun2)
+		basic_machine=m68000-sun
+		;;
+	sun2os3)
+		basic_machine=m68000-sun
+		os=-sunos3
+		;;
+	sun2os4)
+		basic_machine=m68000-sun
+		os=-sunos4
+		;;
+	sun3os3)
+		basic_machine=m68k-sun
+		os=-sunos3
+		;;
+	sun3os4)
+		basic_machine=m68k-sun
+		os=-sunos4
+		;;
+	sun4os3)
+		basic_machine=sparc-sun
+		os=-sunos3
+		;;
+	sun4os4)
+		basic_machine=sparc-sun
+		os=-sunos4
+		;;
+	sun4sol2)
+		basic_machine=sparc-sun
+		os=-solaris2
+		;;
+	sun3 | sun3-*)
+		basic_machine=m68k-sun
+		;;
+	sun4)
+		basic_machine=sparc-sun
+		;;
+	sun386 | sun386i | roadrunner)
+		basic_machine=i386-sun
+		;;
+	sv1)
+		basic_machine=sv1-cray
+		os=-unicos
+		;;
+	symmetry)
+		basic_machine=i386-sequent
+		os=-dynix
+		;;
+	t3e)
+		basic_machine=alphaev5-cray
+		os=-unicos
+		;;
+	t90)
+		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
+		;;
+	tx39)
+		basic_machine=mipstx39-unknown
+		;;
+	tx39el)
+		basic_machine=mipstx39el-unknown
+		;;
+	toad1)
+		basic_machine=pdp10-xkl
+		os=-tops20
+		;;
+	tower | tower-32)
+		basic_machine=m68k-ncr
+		;;
+	tpf)
+		basic_machine=s390x-ibm
+		os=-tpf
+		;;
+	udi29k)
+		basic_machine=a29k-amd
+		os=-udi
+		;;
+	ultra3)
+		basic_machine=a29k-nyu
+		os=-sym1
+		;;
+	v810 | necv810)
+		basic_machine=v810-nec
+		os=-none
+		;;
+	vaxv)
+		basic_machine=vax-dec
+		os=-sysv
+		;;
+	vms)
+		basic_machine=vax-dec
+		os=-vms
+		;;
+	vpp*|vx|vx-*)
+		basic_machine=f301-fujitsu
+		;;
+	vxworks960)
+		basic_machine=i960-wrs
+		os=-vxworks
+		;;
+	vxworks68)
+		basic_machine=m68k-wrs
+		os=-vxworks
+		;;
+	vxworks29k)
+		basic_machine=a29k-wrs
+		os=-vxworks
+		;;
+	w65*)
+		basic_machine=w65-wdc
+		os=-none
+		;;
+	w89k-*)
+		basic_machine=hppa1.1-winbond
+		os=-proelf
+		;;
+	xbox)
+		basic_machine=i686-pc
+		os=-mingw32
+		;;
+	xps | xps100)
+		basic_machine=xps100-honeywell
+		;;
+	ymp)
+		basic_machine=ymp-cray
+		os=-unicos
+		;;
+	z8k-*-coff)
+		basic_machine=z8k-unknown
+		os=-sim
+		;;
+	none)
+		basic_machine=none-none
+		os=-none
+		;;
+
+# Here we handle the default manufacturer of certain CPU types.  It is in
+# some cases the only manufacturer, in others, it is the most popular.
+	w89k)
+		basic_machine=hppa1.1-winbond
+		;;
+	op50n)
+		basic_machine=hppa1.1-oki
+		;;
+	op60c)
+		basic_machine=hppa1.1-oki
+		;;
+	romp)
+		basic_machine=romp-ibm
+		;;
+	mmix)
+		basic_machine=mmix-knuth
+		;;
+	rs6000)
+		basic_machine=rs6000-ibm
+		;;
+	vax)
+		basic_machine=vax-dec
+		;;
+	pdp10)
+		# there are many clones, so DEC is not a safe bet
+		basic_machine=pdp10-unknown
+		;;
+	pdp11)
+		basic_machine=pdp11-dec
+		;;
+	we32k)
+		basic_machine=we32k-att
+		;;
+	sh[1234] | sh[24]a | sh[34]eb | sh[1234]le | sh[23]ele)
+		basic_machine=sh-unknown
+		;;
+	sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v)
+		basic_machine=sparc-sun
+		;;
+	cydra)
+		basic_machine=cydra-cydrome
+		;;
+	orion)
+		basic_machine=orion-highlevel
+		;;
+	orion105)
+		basic_machine=clipper-highlevel
+		;;
+	mac | mpw | mac-mpw)
+		basic_machine=m68k-apple
+		;;
+	pmac | pmac-mpw)
+		basic_machine=powerpc-apple
+		;;
+	*-unknown)
+		# Make sure to match an already-canonicalized machine name.
+		;;
+	*)
+		echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+		exit 1
+		;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+	*-digital*)
+		basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+		;;
+	*-commodore*)
+		basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+		;;
+	*)
+		;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+        # First match some system type aliases
+        # that might get confused with valid system types.
+	# -solaris* is a basic system type, with this one exception.
+	-solaris1 | -solaris1.*)
+		os=`echo $os | sed -e 's|solaris1|sunos4|'`
+		;;
+	-solaris)
+		os=-solaris2
+		;;
+	-svr4*)
+		os=-sysv4
+		;;
+	-unixware*)
+		os=-sysv4.2uw
+		;;
+	-gnu/linux*)
+		os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'`
+		;;
+	# First accept the basic system types.
+	# The portable systems comes first.
+	# 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* \
+	      | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \
+	      | -aos* \
+	      | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \
+	      | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \
+	      | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \
+	      | -openbsd* | -solidbsd* \
+	      | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \
+	      | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \
+	      | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+	      | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
+	      | -chorusos* | -chorusrdb* \
+	      | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
+	      | -mingw32* | -linux-gnu* | -linux-newlib* | -linux-uclibc* \
+	      | -uxpv* | -beos* | -mpeix* | -udk* \
+	      | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \
+	      | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
+	      | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \
+	      | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \
+	      | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \
+	      | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \
+	      | -skyos* | -haiku* | -rdos* | -toppers*)
+	# Remember, each alternative MUST END IN *, to match a version number.
+		;;
+	-qnx*)
+		case $basic_machine in
+		    x86-* | i*86-*)
+			;;
+		    *)
+			os=-nto$os
+			;;
+		esac
+		;;
+	-nto-qnx*)
+		;;
+	-nto*)
+		os=`echo $os | sed -e 's|nto|nto-qnx|'`
+		;;
+	-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
+	      | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \
+	      | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
+		;;
+	-mac*)
+		os=`echo $os | sed -e 's|mac|macos|'`
+		;;
+	-linux-dietlibc)
+		os=-linux-dietlibc
+		;;
+	-linux*)
+		os=`echo $os | sed -e 's|linux|linux-gnu|'`
+		;;
+	-sunos5*)
+		os=`echo $os | sed -e 's|sunos5|solaris2|'`
+		;;
+	-sunos6*)
+		os=`echo $os | sed -e 's|sunos6|solaris3|'`
+		;;
+	-opened*)
+		os=-openedition
+		;;
+        -os400*)
+		os=-os400
+		;;
+	-wince*)
+		os=-wince
+		;;
+	-osfrose*)
+		os=-osfrose
+		;;
+	-osf*)
+		os=-osf
+		;;
+	-utek*)
+		os=-bsd
+		;;
+	-dynix*)
+		os=-bsd
+		;;
+	-acis*)
+		os=-aos
+		;;
+	-atheos*)
+		os=-atheos
+		;;
+	-syllable*)
+		os=-syllable
+		;;
+	-386bsd)
+		os=-bsd
+		;;
+	-ctix* | -uts*)
+		os=-sysv
+		;;
+	-nova*)
+		os=-rtmk-nova
+		;;
+	-ns2 )
+		os=-nextstep2
+		;;
+	-nsk*)
+		os=-nsk
+		;;
+	# Preserve the version number of sinix5.
+	-sinix5.*)
+		os=`echo $os | sed -e 's|sinix|sysv|'`
+		;;
+	-sinix*)
+		os=-sysv4
+		;;
+        -tpf*)
+		os=-tpf
+		;;
+	-triton*)
+		os=-sysv3
+		;;
+	-oss*)
+		os=-sysv3
+		;;
+	-svr4)
+		os=-sysv4
+		;;
+	-svr3)
+		os=-sysv3
+		;;
+	-sysvr4)
+		os=-sysv4
+		;;
+	# This must come after -sysvr4.
+	-sysv*)
+		;;
+	-ose*)
+		os=-ose
+		;;
+	-es1800*)
+		os=-ose
+		;;
+	-xenix)
+		os=-xenix
+		;;
+	-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+		os=-mint
+		;;
+	-aros*)
+		os=-aros
+		;;
+	-kaos*)
+		os=-kaos
+		;;
+	-zvmoe)
+		os=-zvmoe
+		;;
+	-none)
+		;;
+	*)
+		# Get rid of the `-' at the beginning of $os.
+		os=`echo $os | sed 's/[^-]*-//'`
+		echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+		exit 1
+		;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system.  Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+        score-*)
+		os=-elf
+		;;
+        spu-*)
+		os=-elf
+		;;
+	*-acorn)
+		os=-riscix1.2
+		;;
+	arm*-rebel)
+		os=-linux
+		;;
+	arm*-semi)
+		os=-aout
+		;;
+        c4x-* | tic4x-*)
+        	os=-coff
+		;;
+	# This must come before the *-dec entry.
+	pdp10-*)
+		os=-tops20
+		;;
+	pdp11-*)
+		os=-none
+		;;
+	*-dec | vax-*)
+		os=-ultrix4.2
+		;;
+	m68*-apollo)
+		os=-domain
+		;;
+	i386-sun)
+		os=-sunos4.0.2
+		;;
+	m68000-sun)
+		os=-sunos3
+		# This also exists in the configure program, but was not the
+		# default.
+		# os=-sunos4
+		;;
+	m68*-cisco)
+		os=-aout
+		;;
+	mips*-cisco)
+		os=-elf
+		;;
+	mips*-*)
+		os=-elf
+		;;
+	or32-*)
+		os=-coff
+		;;
+	*-tti)	# must be before sparc entry or we get the wrong os.
+		os=-sysv3
+		;;
+	sparc-* | *-sun)
+		os=-sunos4.1.1
+		;;
+	*-be)
+		os=-beos
+		;;
+	*-haiku)
+		os=-haiku
+		;;
+	*-ibm)
+		os=-aix
+		;;
+    	*-knuth)
+		os=-mmixware
+		;;
+	*-wec)
+		os=-proelf
+		;;
+	*-winbond)
+		os=-proelf
+		;;
+	*-oki)
+		os=-proelf
+		;;
+	*-hp)
+		os=-hpux
+		;;
+	*-hitachi)
+		os=-hiux
+		;;
+	i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+		os=-sysv
+		;;
+	*-cbm)
+		os=-amigaos
+		;;
+	*-dg)
+		os=-dgux
+		;;
+	*-dolphin)
+		os=-sysv3
+		;;
+	m68k-ccur)
+		os=-rtu
+		;;
+	m88k-omron*)
+		os=-luna
+		;;
+	*-next )
+		os=-nextstep
+		;;
+	*-sequent)
+		os=-ptx
+		;;
+	*-crds)
+		os=-unos
+		;;
+	*-ns)
+		os=-genix
+		;;
+	i370-*)
+		os=-mvs
+		;;
+	*-next)
+		os=-nextstep3
+		;;
+	*-gould)
+		os=-sysv
+		;;
+	*-highlevel)
+		os=-bsd
+		;;
+	*-encore)
+		os=-bsd
+		;;
+	*-sgi)
+		os=-irix
+		;;
+	*-siemens)
+		os=-sysv4
+		;;
+	*-masscomp)
+		os=-rtu
+		;;
+	f30[01]-fujitsu | f700-fujitsu)
+		os=-uxpv
+		;;
+	*-rom68k)
+		os=-coff
+		;;
+	*-*bug)
+		os=-coff
+		;;
+	*-apple)
+		os=-macos
+		;;
+	*-atari*)
+		os=-mint
+		;;
+	*)
+		os=-none
+		;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer.  We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+	*-unknown)
+		case $os in
+			-riscix*)
+				vendor=acorn
+				;;
+			-sunos*)
+				vendor=sun
+				;;
+			-aix*)
+				vendor=ibm
+				;;
+			-beos*)
+				vendor=be
+				;;
+			-hpux*)
+				vendor=hp
+				;;
+			-mpeix*)
+				vendor=hp
+				;;
+			-hiux*)
+				vendor=hitachi
+				;;
+			-unos*)
+				vendor=crds
+				;;
+			-dgux*)
+				vendor=dg
+				;;
+			-luna*)
+				vendor=omron
+				;;
+			-genix*)
+				vendor=ns
+				;;
+			-mvs* | -opened*)
+				vendor=ibm
+				;;
+			-os400*)
+				vendor=ibm
+				;;
+			-ptx*)
+				vendor=sequent
+				;;
+			-tpf*)
+				vendor=ibm
+				;;
+			-vxsim* | -vxworks* | -windiss*)
+				vendor=wrs
+				;;
+			-aux*)
+				vendor=apple
+				;;
+			-hms*)
+				vendor=hitachi
+				;;
+			-mpw* | -macos*)
+				vendor=apple
+				;;
+			-*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+				vendor=atari
+				;;
+			-vos*)
+				vendor=stratus
+				;;
+		esac
+		basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+		;;
+esac
+
+echo $basic_machine$os
+exit
+
+# Local variables:
+# eval: (add-hook 'write-file-hooks 'time-stamp)
+# time-stamp-start: "timestamp='"
+# time-stamp-format: "%:y-%02m-%02d"
+# time-stamp-end: "'"
+# End:
diff --git a/payloads/libpayload/curses/PDCurses-3.4/configure b/payloads/libpayload/curses/PDCurses-3.4/configure
new file mode 100755
index 0000000..2d094bc
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/configure
@@ -0,0 +1,6738 @@
+#! /bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated by GNU Autoconf 2.61 for PDCurses 3.4.
+#
+# Report bugs to <wmcbrine@users.sf.net>.
+#
+# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+# 2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+# This configure script is free software; the Free Software Foundation
+# gives unlimited permission to copy, distribute and modify it.
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+if test "x$CONFIG_SHELL" = x; then
+  if (eval ":") 2>/dev/null; then
+  as_have_required=yes
+else
+  as_have_required=no
+fi
+
+  if test $as_have_required = yes && 	 (eval ":
+(as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=\$LINENO
+  as_lineno_2=\$LINENO
+  test \"x\$as_lineno_1\" != \"x\$as_lineno_2\" &&
+  test \"x\`expr \$as_lineno_1 + 1\`\" = \"x\$as_lineno_2\") || { (exit 1); exit 1; }
+") 2> /dev/null; then
+  :
+else
+  as_candidate_shells=
+    as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  case $as_dir in
+	 /*)
+	   for as_base in sh bash ksh sh5; do
+	     as_candidate_shells="$as_candidate_shells $as_dir/$as_base"
+	   done;;
+       esac
+done
+IFS=$as_save_IFS
+
+
+      for as_shell in $as_candidate_shells $SHELL; do
+	 # Try only shells that exist, to save several forks.
+	 if { test -f "$as_shell" || test -f "$as_shell.exe"; } &&
+		{ ("$as_shell") 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+_ASEOF
+}; then
+  CONFIG_SHELL=$as_shell
+	       as_have_required=yes
+	       if { "$as_shell" 2> /dev/null <<\_ASEOF
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+:
+(as_func_return () {
+  (exit $1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = "$1" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test $exitcode = 0) || { (exit 1); exit 1; }
+
+(
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2") || { (exit 1); exit 1; }
+
+_ASEOF
+}; then
+  break
+fi
+
+fi
+
+      done
+
+      if test "x$CONFIG_SHELL" != x; then
+  for as_var in BASH_ENV ENV
+        do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+        done
+        export CONFIG_SHELL
+        exec "$CONFIG_SHELL" "$as_myself" ${1+"$@"}
+fi
+
+
+    if test $as_have_required = no; then
+  echo This script requires a shell more modern than all the
+      echo shells that I found on your system.  Please install a
+      echo modern shell, or manually run the script under such a
+      echo shell if you do have one.
+      { (exit 1); exit 1; }
+fi
+
+
+fi
+
+fi
+
+
+
+(eval "as_func_return () {
+  (exit \$1)
+}
+as_func_success () {
+  as_func_return 0
+}
+as_func_failure () {
+  as_func_return 1
+}
+as_func_ret_success () {
+  return 0
+}
+as_func_ret_failure () {
+  return 1
+}
+
+exitcode=0
+if as_func_success; then
+  :
+else
+  exitcode=1
+  echo as_func_success failed.
+fi
+
+if as_func_failure; then
+  exitcode=1
+  echo as_func_failure succeeded.
+fi
+
+if as_func_ret_success; then
+  :
+else
+  exitcode=1
+  echo as_func_ret_success failed.
+fi
+
+if as_func_ret_failure; then
+  exitcode=1
+  echo as_func_ret_failure succeeded.
+fi
+
+if ( set x; as_func_ret_success y && test x = \"\$1\" ); then
+  :
+else
+  exitcode=1
+  echo positional parameters were not saved.
+fi
+
+test \$exitcode = 0") || {
+  echo No shell found that supports shell functions.
+  echo Please tell autoconf@gnu.org about your system,
+  echo including any error possibly output before this
+  echo message
+}
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+
+exec 7<&0 </dev/null 6>&1
+
+# Name of the host.
+# hostname on some systems (SVR3.2, Linux) returns a bogus exit status,
+# so uname gets run too.
+ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q`
+
+#
+# Initializations.
+#
+ac_default_prefix=/usr/local
+ac_clean_files=
+ac_config_libobj_dir=.
+LIBOBJS=
+cross_compiling=no
+subdirs=
+MFLAGS=
+MAKEFLAGS=
+SHELL=${CONFIG_SHELL-/bin/sh}
+
+# Identity of this package.
+PACKAGE_NAME='PDCurses'
+PACKAGE_TARNAME='PDCurses'
+PACKAGE_VERSION='3.4'
+PACKAGE_STRING='PDCurses 3.4'
+PACKAGE_BUGREPORT='wmcbrine@users.sf.net'
+
+ac_unique_file="curspriv.h"
+# Factoring default headers for most tests.
+ac_includes_default="\
+#include <stdio.h>
+#ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+#endif
+#ifdef HAVE_SYS_STAT_H
+# include <sys/stat.h>
+#endif
+#ifdef STDC_HEADERS
+# include <stdlib.h>
+# include <stddef.h>
+#else
+# ifdef HAVE_STDLIB_H
+#  include <stdlib.h>
+# endif
+#endif
+#ifdef HAVE_STRING_H
+# if !defined STDC_HEADERS && defined HAVE_MEMORY_H
+#  include <memory.h>
+# endif
+# include <string.h>
+#endif
+#ifdef HAVE_STRINGS_H
+# include <strings.h>
+#endif
+#ifdef HAVE_INTTYPES_H
+# include <inttypes.h>
+#endif
+#ifdef HAVE_STDINT_H
+# include <stdint.h>
+#endif
+#ifdef HAVE_UNISTD_H
+# include <unistd.h>
+#endif"
+
+ac_subst_vars='SHELL
+PATH_SEPARATOR
+PACKAGE_NAME
+PACKAGE_TARNAME
+PACKAGE_VERSION
+PACKAGE_STRING
+PACKAGE_BUGREPORT
+exec_prefix
+prefix
+program_transform_name
+bindir
+sbindir
+libexecdir
+datarootdir
+datadir
+sysconfdir
+sharedstatedir
+localstatedir
+includedir
+oldincludedir
+docdir
+infodir
+htmldir
+dvidir
+pdfdir
+psdir
+libdir
+localedir
+mandir
+DEFS
+ECHO_C
+ECHO_N
+ECHO_T
+LIBS
+build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+CPPFLAGS
+ac_ct_CC
+EXEEXT
+OBJEXT
+build
+build_cpu
+build_vendor
+build_os
+host
+host_cpu
+host_vendor
+host_os
+target
+target_cpu
+target_vendor
+target_os
+SYS_DEFS
+RANLIB
+INSTALL_PROGRAM
+INSTALL_SCRIPT
+INSTALL_DATA
+SET_MAKE
+CPP
+GREP
+EGREP
+MH_EXTRA_LIBS
+XMKMF
+MH_XINC_DIR
+MH_XLIBS
+PURIFY
+SHLPST
+DYN_COMP
+LD_RXLIB1
+SHLPRE
+SHL_TARGETS
+O2SAVE
+CC2O
+SAVE2O
+RXPACKEXPORTS
+LIBOBJS
+LTLIBOBJS'
+ac_subst_files=''
+      ac_precious_vars='build_alias
+host_alias
+target_alias
+CC
+CFLAGS
+LDFLAGS
+LIBS
+CPPFLAGS
+CPP
+XMKMF'
+
+
+# Initialize some variables set by options.
+ac_init_help=
+ac_init_version=false
+# The variables have the same names as the options, with
+# dashes changed to underlines.
+cache_file=/dev/null
+exec_prefix=NONE
+no_create=
+no_recursion=
+prefix=NONE
+program_prefix=NONE
+program_suffix=NONE
+program_transform_name=s,x,x,
+silent=
+site=
+srcdir=
+verbose=
+x_includes=NONE
+x_libraries=NONE
+
+# Installation directory options.
+# These are left unexpanded so users can "make install exec_prefix=/foo"
+# and all the variables that are supposed to be based on exec_prefix
+# by default will actually change.
+# Use braces instead of parens because sh, perl, etc. also accept them.
+# (The list follows the same order as the GNU Coding Standards.)
+bindir='${exec_prefix}/bin'
+sbindir='${exec_prefix}/sbin'
+libexecdir='${exec_prefix}/libexec'
+datarootdir='${prefix}/share'
+datadir='${datarootdir}'
+sysconfdir='${prefix}/etc'
+sharedstatedir='${prefix}/com'
+localstatedir='${prefix}/var'
+includedir='${prefix}/include'
+oldincludedir='/usr/include'
+docdir='${datarootdir}/doc/${PACKAGE_TARNAME}'
+infodir='${datarootdir}/info'
+htmldir='${docdir}'
+dvidir='${docdir}'
+pdfdir='${docdir}'
+psdir='${docdir}'
+libdir='${exec_prefix}/lib'
+localedir='${datarootdir}/locale'
+mandir='${datarootdir}/man'
+
+ac_prev=
+ac_dashdash=
+for ac_option
+do
+  # If the previous option needs an argument, assign it.
+  if test -n "$ac_prev"; then
+    eval $ac_prev=\$ac_option
+    ac_prev=
+    continue
+  fi
+
+  case $ac_option in
+  *=*)	ac_optarg=`expr "X$ac_option" : '[^=]*=\(.*\)'` ;;
+  *)	ac_optarg=yes ;;
+  esac
+
+  # Accept the important Cygnus configure options, so we can diagnose typos.
+
+  case $ac_dashdash$ac_option in
+  --)
+    ac_dashdash=yes ;;
+
+  -bindir | --bindir | --bindi | --bind | --bin | --bi)
+    ac_prev=bindir ;;
+  -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*)
+    bindir=$ac_optarg ;;
+
+  -build | --build | --buil | --bui | --bu)
+    ac_prev=build_alias ;;
+  -build=* | --build=* | --buil=* | --bui=* | --bu=*)
+    build_alias=$ac_optarg ;;
+
+  -cache-file | --cache-file | --cache-fil | --cache-fi \
+  | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c)
+    ac_prev=cache_file ;;
+  -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \
+  | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*)
+    cache_file=$ac_optarg ;;
+
+  --config-cache | -C)
+    cache_file=config.cache ;;
+
+  -datadir | --datadir | --datadi | --datad)
+    ac_prev=datadir ;;
+  -datadir=* | --datadir=* | --datadi=* | --datad=*)
+    datadir=$ac_optarg ;;
+
+  -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \
+  | --dataroo | --dataro | --datar)
+    ac_prev=datarootdir ;;
+  -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \
+  | --dataroot=* | --dataroo=* | --dataro=* | --datar=*)
+    datarootdir=$ac_optarg ;;
+
+  -disable-* | --disable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=no ;;
+
+  -docdir | --docdir | --docdi | --doc | --do)
+    ac_prev=docdir ;;
+  -docdir=* | --docdir=* | --docdi=* | --doc=* | --do=*)
+    docdir=$ac_optarg ;;
+
+  -dvidir | --dvidir | --dvidi | --dvid | --dvi | --dv)
+    ac_prev=dvidir ;;
+  -dvidir=* | --dvidir=* | --dvidi=* | --dvid=* | --dvi=* | --dv=*)
+    dvidir=$ac_optarg ;;
+
+  -enable-* | --enable-*)
+    ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_feature" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid feature name: $ac_feature" >&2
+   { (exit 1); exit 1; }; }
+    ac_feature=`echo $ac_feature | sed 's/[-.]/_/g'`
+    eval enable_$ac_feature=\$ac_optarg ;;
+
+  -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \
+  | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \
+  | --exec | --exe | --ex)
+    ac_prev=exec_prefix ;;
+  -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \
+  | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \
+  | --exec=* | --exe=* | --ex=*)
+    exec_prefix=$ac_optarg ;;
+
+  -gas | --gas | --ga | --g)
+    # Obsolete; use --with-gas.
+    with_gas=yes ;;
+
+  -help | --help | --hel | --he | -h)
+    ac_init_help=long ;;
+  -help=r* | --help=r* | --hel=r* | --he=r* | -hr*)
+    ac_init_help=recursive ;;
+  -help=s* | --help=s* | --hel=s* | --he=s* | -hs*)
+    ac_init_help=short ;;
+
+  -host | --host | --hos | --ho)
+    ac_prev=host_alias ;;
+  -host=* | --host=* | --hos=* | --ho=*)
+    host_alias=$ac_optarg ;;
+
+  -htmldir | --htmldir | --htmldi | --htmld | --html | --htm | --ht)
+    ac_prev=htmldir ;;
+  -htmldir=* | --htmldir=* | --htmldi=* | --htmld=* | --html=* | --htm=* \
+  | --ht=*)
+    htmldir=$ac_optarg ;;
+
+  -includedir | --includedir | --includedi | --included | --include \
+  | --includ | --inclu | --incl | --inc)
+    ac_prev=includedir ;;
+  -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \
+  | --includ=* | --inclu=* | --incl=* | --inc=*)
+    includedir=$ac_optarg ;;
+
+  -infodir | --infodir | --infodi | --infod | --info | --inf)
+    ac_prev=infodir ;;
+  -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*)
+    infodir=$ac_optarg ;;
+
+  -libdir | --libdir | --libdi | --libd)
+    ac_prev=libdir ;;
+  -libdir=* | --libdir=* | --libdi=* | --libd=*)
+    libdir=$ac_optarg ;;
+
+  -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \
+  | --libexe | --libex | --libe)
+    ac_prev=libexecdir ;;
+  -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \
+  | --libexe=* | --libex=* | --libe=*)
+    libexecdir=$ac_optarg ;;
+
+  -localedir | --localedir | --localedi | --localed | --locale)
+    ac_prev=localedir ;;
+  -localedir=* | --localedir=* | --localedi=* | --localed=* | --locale=*)
+    localedir=$ac_optarg ;;
+
+  -localstatedir | --localstatedir | --localstatedi | --localstated \
+  | --localstate | --localstat | --localsta | --localst | --locals)
+    ac_prev=localstatedir ;;
+  -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \
+  | --localstate=* | --localstat=* | --localsta=* | --localst=* | --locals=*)
+    localstatedir=$ac_optarg ;;
+
+  -mandir | --mandir | --mandi | --mand | --man | --ma | --m)
+    ac_prev=mandir ;;
+  -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*)
+    mandir=$ac_optarg ;;
+
+  -nfp | --nfp | --nf)
+    # Obsolete; use --without-fp.
+    with_fp=no ;;
+
+  -no-create | --no-create | --no-creat | --no-crea | --no-cre \
+  | --no-cr | --no-c | -n)
+    no_create=yes ;;
+
+  -no-recursion | --no-recursion | --no-recursio | --no-recursi \
+  | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r)
+    no_recursion=yes ;;
+
+  -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \
+  | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \
+  | --oldin | --oldi | --old | --ol | --o)
+    ac_prev=oldincludedir ;;
+  -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \
+  | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \
+  | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*)
+    oldincludedir=$ac_optarg ;;
+
+  -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+    ac_prev=prefix ;;
+  -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+    prefix=$ac_optarg ;;
+
+  -program-prefix | --program-prefix | --program-prefi | --program-pref \
+  | --program-pre | --program-pr | --program-p)
+    ac_prev=program_prefix ;;
+  -program-prefix=* | --program-prefix=* | --program-prefi=* \
+  | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*)
+    program_prefix=$ac_optarg ;;
+
+  -program-suffix | --program-suffix | --program-suffi | --program-suff \
+  | --program-suf | --program-su | --program-s)
+    ac_prev=program_suffix ;;
+  -program-suffix=* | --program-suffix=* | --program-suffi=* \
+  | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*)
+    program_suffix=$ac_optarg ;;
+
+  -program-transform-name | --program-transform-name \
+  | --program-transform-nam | --program-transform-na \
+  | --program-transform-n | --program-transform- \
+  | --program-transform | --program-transfor \
+  | --program-transfo | --program-transf \
+  | --program-trans | --program-tran \
+  | --progr-tra | --program-tr | --program-t)
+    ac_prev=program_transform_name ;;
+  -program-transform-name=* | --program-transform-name=* \
+  | --program-transform-nam=* | --program-transform-na=* \
+  | --program-transform-n=* | --program-transform-=* \
+  | --program-transform=* | --program-transfor=* \
+  | --program-transfo=* | --program-transf=* \
+  | --program-trans=* | --program-tran=* \
+  | --progr-tra=* | --program-tr=* | --program-t=*)
+    program_transform_name=$ac_optarg ;;
+
+  -pdfdir | --pdfdir | --pdfdi | --pdfd | --pdf | --pd)
+    ac_prev=pdfdir ;;
+  -pdfdir=* | --pdfdir=* | --pdfdi=* | --pdfd=* | --pdf=* | --pd=*)
+    pdfdir=$ac_optarg ;;
+
+  -psdir | --psdir | --psdi | --psd | --ps)
+    ac_prev=psdir ;;
+  -psdir=* | --psdir=* | --psdi=* | --psd=* | --ps=*)
+    psdir=$ac_optarg ;;
+
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil)
+    silent=yes ;;
+
+  -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb)
+    ac_prev=sbindir ;;
+  -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \
+  | --sbi=* | --sb=*)
+    sbindir=$ac_optarg ;;
+
+  -sharedstatedir | --sharedstatedir | --sharedstatedi \
+  | --sharedstated | --sharedstate | --sharedstat | --sharedsta \
+  | --sharedst | --shareds | --shared | --share | --shar \
+  | --sha | --sh)
+    ac_prev=sharedstatedir ;;
+  -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \
+  | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \
+  | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \
+  | --sha=* | --sh=*)
+    sharedstatedir=$ac_optarg ;;
+
+  -site | --site | --sit)
+    ac_prev=site ;;
+  -site=* | --site=* | --sit=*)
+    site=$ac_optarg ;;
+
+  -srcdir | --srcdir | --srcdi | --srcd | --src | --sr)
+    ac_prev=srcdir ;;
+  -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*)
+    srcdir=$ac_optarg ;;
+
+  -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \
+  | --syscon | --sysco | --sysc | --sys | --sy)
+    ac_prev=sysconfdir ;;
+  -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \
+  | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*)
+    sysconfdir=$ac_optarg ;;
+
+  -target | --target | --targe | --targ | --tar | --ta | --t)
+    ac_prev=target_alias ;;
+  -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*)
+    target_alias=$ac_optarg ;;
+
+  -v | -verbose | --verbose | --verbos | --verbo | --verb)
+    verbose=yes ;;
+
+  -version | --version | --versio | --versi | --vers | -V)
+    ac_init_version=: ;;
+
+  -with-* | --with-*)
+    ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=\$ac_optarg ;;
+
+  -without-* | --without-*)
+    ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_package" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid package name: $ac_package" >&2
+   { (exit 1); exit 1; }; }
+    ac_package=`echo $ac_package | sed 's/[-.]/_/g'`
+    eval with_$ac_package=no ;;
+
+  --x)
+    # Obsolete; use --with-x.
+    with_x=yes ;;
+
+  -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \
+  | --x-incl | --x-inc | --x-in | --x-i)
+    ac_prev=x_includes ;;
+  -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \
+  | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*)
+    x_includes=$ac_optarg ;;
+
+  -x-libraries | --x-libraries | --x-librarie | --x-librari \
+  | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l)
+    ac_prev=x_libraries ;;
+  -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \
+  | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*)
+    x_libraries=$ac_optarg ;;
+
+  -*) { echo "$as_me: error: unrecognized option: $ac_option
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; }
+    ;;
+
+  *=*)
+    ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='`
+    # Reject names that are not valid shell variable names.
+    expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null &&
+      { echo "$as_me: error: invalid variable name: $ac_envvar" >&2
+   { (exit 1); exit 1; }; }
+    eval $ac_envvar=\$ac_optarg
+    export $ac_envvar ;;
+
+  *)
+    # FIXME: should be removed in autoconf 3.0.
+    echo "$as_me: WARNING: you should use --build, --host, --target" >&2
+    expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null &&
+      echo "$as_me: WARNING: invalid host type: $ac_option" >&2
+    : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option}
+    ;;
+
+  esac
+done
+
+if test -n "$ac_prev"; then
+  ac_option=--`echo $ac_prev | sed 's/_/-/g'`
+  { echo "$as_me: error: missing argument to $ac_option" >&2
+   { (exit 1); exit 1; }; }
+fi
+
+# Be sure to have absolute directory names.
+for ac_var in	exec_prefix prefix bindir sbindir libexecdir datarootdir \
+		datadir sysconfdir sharedstatedir localstatedir includedir \
+		oldincludedir docdir infodir htmldir dvidir pdfdir psdir \
+		libdir localedir mandir
+do
+  eval ac_val=\$$ac_var
+  case $ac_val in
+    [\\/$]* | ?:[\\/]* )  continue;;
+    NONE | '' ) case $ac_var in *prefix ) continue;; esac;;
+  esac
+  { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2
+   { (exit 1); exit 1; }; }
+done
+
+# There might be people who depend on the old broken behavior: `$host'
+# used to hold the argument of --host etc.
+# FIXME: To remove some day.
+build=$build_alias
+host=$host_alias
+target=$target_alias
+
+# FIXME: To remove some day.
+if test "x$host_alias" != x; then
+  if test "x$build_alias" = x; then
+    cross_compiling=maybe
+    echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host.
+    If a cross compiler is detected then cross compile mode will be used." >&2
+  elif test "x$build_alias" != "x$host_alias"; then
+    cross_compiling=yes
+  fi
+fi
+
+ac_tool_prefix=
+test -n "$host_alias" && ac_tool_prefix=$host_alias-
+
+test "$silent" = yes && exec 6>/dev/null
+
+
+ac_pwd=`pwd` && test -n "$ac_pwd" &&
+ac_ls_di=`ls -di .` &&
+ac_pwd_ls_di=`cd "$ac_pwd" && ls -di .` ||
+  { echo "$as_me: error: Working directory cannot be determined" >&2
+   { (exit 1); exit 1; }; }
+test "X$ac_ls_di" = "X$ac_pwd_ls_di" ||
+  { echo "$as_me: error: pwd does not report name of working directory" >&2
+   { (exit 1); exit 1; }; }
+
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+  ac_srcdir_defaulted=yes
+  # Try the directory containing this script, then the parent directory.
+  ac_confdir=`$as_dirname -- "$0" ||
+$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$0" : 'X\(//\)[^/]' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$0" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  srcdir=$ac_confdir
+  if test ! -r "$srcdir/$ac_unique_file"; then
+    srcdir=..
+  fi
+else
+  ac_srcdir_defaulted=no
+fi
+if test ! -r "$srcdir/$ac_unique_file"; then
+  test "$ac_srcdir_defaulted" = yes && srcdir="$ac_confdir or .."
+  { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2
+   { (exit 1); exit 1; }; }
+fi
+ac_msg="sources are in $srcdir, but \`cd $srcdir' does not work"
+ac_abs_confdir=`(
+	cd "$srcdir" && test -r "./$ac_unique_file" || { echo "$as_me: error: $ac_msg" >&2
+   { (exit 1); exit 1; }; }
+	pwd)`
+# When building in place, set srcdir=.
+if test "$ac_abs_confdir" = "$ac_pwd"; then
+  srcdir=.
+fi
+# Remove unnecessary trailing slashes from srcdir.
+# Double slashes in file names in object file debugging info
+# mess up M-x gdb in Emacs.
+case $srcdir in
+*/) srcdir=`expr "X$srcdir" : 'X\(.*[^/]\)' \| "X$srcdir" : 'X\(.*\)'`;;
+esac
+for ac_var in $ac_precious_vars; do
+  eval ac_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_env_${ac_var}_value=\$${ac_var}
+  eval ac_cv_env_${ac_var}_set=\${${ac_var}+set}
+  eval ac_cv_env_${ac_var}_value=\$${ac_var}
+done
+
+#
+# Report the --help message.
+#
+if test "$ac_init_help" = "long"; then
+  # Omit some internal or obsolete options to make the list less imposing.
+  # This message is too long to be a string in the A/UX 3.1 sh.
+  cat <<_ACEOF
+\`configure' configures PDCurses 3.4 to adapt to many kinds of systems.
+
+Usage: $0 [OPTION]... [VAR=VALUE]...
+
+To assign environment variables (e.g., CC, CFLAGS...), specify them as
+VAR=VALUE.  See below for descriptions of some of the useful variables.
+
+Defaults for the options are specified in brackets.
+
+Configuration:
+  -h, --help              display this help and exit
+      --help=short        display options specific to this package
+      --help=recursive    display the short help of all the included packages
+  -V, --version           display version information and exit
+  -q, --quiet, --silent   do not print \`checking...' messages
+      --cache-file=FILE   cache test results in FILE [disabled]
+  -C, --config-cache      alias for \`--cache-file=config.cache'
+  -n, --no-create         do not create output files
+      --srcdir=DIR        find the sources in DIR [configure dir or \`..']
+
+Installation directories:
+  --prefix=PREFIX         install architecture-independent files in PREFIX
+			  [$ac_default_prefix]
+  --exec-prefix=EPREFIX   install architecture-dependent files in EPREFIX
+			  [PREFIX]
+
+By default, \`make install' will install all the files in
+\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc.  You can specify
+an installation prefix other than \`$ac_default_prefix' using \`--prefix',
+for instance \`--prefix=\$HOME'.
+
+For better control, use the options below.
+
+Fine tuning of the installation directories:
+  --bindir=DIR           user executables [EPREFIX/bin]
+  --sbindir=DIR          system admin executables [EPREFIX/sbin]
+  --libexecdir=DIR       program executables [EPREFIX/libexec]
+  --sysconfdir=DIR       read-only single-machine data [PREFIX/etc]
+  --sharedstatedir=DIR   modifiable architecture-independent data [PREFIX/com]
+  --localstatedir=DIR    modifiable single-machine data [PREFIX/var]
+  --libdir=DIR           object code libraries [EPREFIX/lib]
+  --includedir=DIR       C header files [PREFIX/include]
+  --oldincludedir=DIR    C header files for non-gcc [/usr/include]
+  --datarootdir=DIR      read-only arch.-independent data root [PREFIX/share]
+  --datadir=DIR          read-only architecture-independent data [DATAROOTDIR]
+  --infodir=DIR          info documentation [DATAROOTDIR/info]
+  --localedir=DIR        locale-dependent data [DATAROOTDIR/locale]
+  --mandir=DIR           man documentation [DATAROOTDIR/man]
+  --docdir=DIR           documentation root [DATAROOTDIR/doc/PDCurses]
+  --htmldir=DIR          html documentation [DOCDIR]
+  --dvidir=DIR           dvi documentation [DOCDIR]
+  --pdfdir=DIR           pdf documentation [DOCDIR]
+  --psdir=DIR            ps documentation [DOCDIR]
+_ACEOF
+
+  cat <<\_ACEOF
+
+X features:
+  --x-includes=DIR    X include files are in DIR
+  --x-libraries=DIR   X library files are in DIR
+
+System types:
+  --build=BUILD     configure for building on BUILD [guessed]
+  --host=HOST       cross-compile to build programs to run on HOST [BUILD]
+  --target=TARGET   configure for building compilers for TARGET [HOST]
+_ACEOF
+fi
+
+if test -n "$ac_init_help"; then
+  case $ac_init_help in
+     short | recursive ) echo "Configuration of PDCurses 3.4:";;
+   esac
+  cat <<\_ACEOF
+
+Optional Features:
+  --disable-FEATURE       do not include FEATURE (same as --enable-FEATURE=no)
+  --enable-FEATURE[=ARG]  include FEATURE [ARG=yes]
+  --enable-debug          turn on debugging
+  --enable-widec          include support for wide characters
+  --enable-xim            include support for XIM
+  --enable-force-utf8     override locale settings; use UTF-8
+  --enable-purify         link with Purify (TM)
+
+Optional Packages:
+  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
+  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
+  --with-x                use the X Window System
+  --with-xaw3d            link with Xaw3d
+  --with-nextaw           link with neXtaw
+
+Some influential environment variables:
+  CC          C compiler command
+  CFLAGS      C compiler flags
+  LDFLAGS     linker flags, e.g. -L<lib dir> if you have libraries in a
+              nonstandard directory <lib dir>
+  LIBS        libraries to pass to the linker, e.g. -l<library>
+  CPPFLAGS    C/C++/Objective C preprocessor flags, e.g. -I<include dir> if
+              you have headers in a nonstandard directory <include dir>
+  CPP         C preprocessor
+  XMKMF       Path to xmkmf, Makefile generator for X Window System
+
+Use these variables to override the choices made by `configure' or to help
+it to find libraries and programs with nonstandard names/locations.
+
+Report bugs to <wmcbrine@users.sf.net>.
+_ACEOF
+ac_status=$?
+fi
+
+if test "$ac_init_help" = "recursive"; then
+  # If there are subdirs, report their specific --help.
+  for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue
+    test -d "$ac_dir" || continue
+    ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+    cd "$ac_dir" || { ac_status=$?; continue; }
+    # Check for guested configure.
+    if test -f "$ac_srcdir/configure.gnu"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure.gnu" --help=recursive
+    elif test -f "$ac_srcdir/configure"; then
+      echo &&
+      $SHELL "$ac_srcdir/configure" --help=recursive
+    else
+      echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2
+    fi || ac_status=$?
+    cd "$ac_pwd" || { ac_status=$?; break; }
+  done
+fi
+
+test -n "$ac_init_help" && exit $ac_status
+if $ac_init_version; then
+  cat <<\_ACEOF
+PDCurses configure 3.4
+generated by GNU Autoconf 2.61
+
+Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
+2002, 2003, 2004, 2005, 2006 Free Software Foundation, Inc.
+This configure script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it.
+_ACEOF
+  exit
+fi
+cat >config.log <<_ACEOF
+This file contains any messages produced by compilers while
+running configure, to aid debugging if configure makes a mistake.
+
+It was created by PDCurses $as_me 3.4, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  $ $0 $@
+
+_ACEOF
+exec 5>>config.log
+{
+cat <<_ASUNAME
+## --------- ##
+## Platform. ##
+## --------- ##
+
+hostname = `(hostname || uname -n) 2>/dev/null | sed 1q`
+uname -m = `(uname -m) 2>/dev/null || echo unknown`
+uname -r = `(uname -r) 2>/dev/null || echo unknown`
+uname -s = `(uname -s) 2>/dev/null || echo unknown`
+uname -v = `(uname -v) 2>/dev/null || echo unknown`
+
+/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown`
+/bin/uname -X     = `(/bin/uname -X) 2>/dev/null     || echo unknown`
+
+/bin/arch              = `(/bin/arch) 2>/dev/null              || echo unknown`
+/usr/bin/arch -k       = `(/usr/bin/arch -k) 2>/dev/null       || echo unknown`
+/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown`
+/usr/bin/hostinfo      = `(/usr/bin/hostinfo) 2>/dev/null      || echo unknown`
+/bin/machine           = `(/bin/machine) 2>/dev/null           || echo unknown`
+/usr/bin/oslevel       = `(/usr/bin/oslevel) 2>/dev/null       || echo unknown`
+/bin/universe          = `(/bin/universe) 2>/dev/null          || echo unknown`
+
+_ASUNAME
+
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  echo "PATH: $as_dir"
+done
+IFS=$as_save_IFS
+
+} >&5
+
+cat >&5 <<_ACEOF
+
+
+## ----------- ##
+## Core tests. ##
+## ----------- ##
+
+_ACEOF
+
+
+# Keep a trace of the command line.
+# Strip out --no-create and --no-recursion so they do not pile up.
+# Strip out --silent because we don't want to record it for future runs.
+# Also quote any args containing shell meta-characters.
+# Make two passes to allow for proper duplicate-argument suppression.
+ac_configure_args=
+ac_configure_args0=
+ac_configure_args1=
+ac_must_keep_next=false
+for ac_pass in 1 2
+do
+  for ac_arg
+  do
+    case $ac_arg in
+    -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;;
+    -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+    | -silent | --silent | --silen | --sile | --sil)
+      continue ;;
+    *\'*)
+      ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;;
+    esac
+    case $ac_pass in
+    1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;;
+    2)
+      ac_configure_args1="$ac_configure_args1 '$ac_arg'"
+      if test $ac_must_keep_next = true; then
+	ac_must_keep_next=false # Got value, back to normal.
+      else
+	case $ac_arg in
+	  *=* | --config-cache | -C | -disable-* | --disable-* \
+	  | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \
+	  | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \
+	  | -with-* | --with-* | -without-* | --without-* | --x)
+	    case "$ac_configure_args0 " in
+	      "$ac_configure_args1"*" '$ac_arg' "* ) continue ;;
+	    esac
+	    ;;
+	  -* ) ac_must_keep_next=true ;;
+	esac
+      fi
+      ac_configure_args="$ac_configure_args '$ac_arg'"
+      ;;
+    esac
+  done
+done
+$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; }
+$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; }
+
+# When interrupted or exit'd, cleanup temporary files, and complete
+# config.log.  We remove comments because anyway the quotes in there
+# would cause problems or look ugly.
+# WARNING: Use '\'' to represent an apostrophe within the trap.
+# WARNING: Do not start the trap code with a newline, due to a FreeBSD 4.0 bug.
+trap 'exit_status=$?
+  # Save into config.log some information that might help in debugging.
+  {
+    echo
+
+    cat <<\_ASBOX
+## ---------------- ##
+## Cache variables. ##
+## ---------------- ##
+_ASBOX
+    echo
+    # The following way of writing the cache mishandles newlines in values,
+(
+  for ac_var in `(set) 2>&1 | sed -n '\''s/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'\''`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+  (set) 2>&1 |
+    case $as_nl`(ac_space='\'' '\''; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      sed -n \
+	"s/'\''/'\''\\\\'\'''\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\''\\2'\''/p"
+      ;; #(
+    *)
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+)
+    echo
+
+    cat <<\_ASBOX
+## ----------------- ##
+## Output variables. ##
+## ----------------- ##
+_ASBOX
+    echo
+    for ac_var in $ac_subst_vars
+    do
+      eval ac_val=\$$ac_var
+      case $ac_val in
+      *\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+      esac
+      echo "$ac_var='\''$ac_val'\''"
+    done | sort
+    echo
+
+    if test -n "$ac_subst_files"; then
+      cat <<\_ASBOX
+## ------------------- ##
+## File substitutions. ##
+## ------------------- ##
+_ASBOX
+      echo
+      for ac_var in $ac_subst_files
+      do
+	eval ac_val=\$$ac_var
+	case $ac_val in
+	*\'\''*) ac_val=`echo "$ac_val" | sed "s/'\''/'\''\\\\\\\\'\'''\''/g"`;;
+	esac
+	echo "$ac_var='\''$ac_val'\''"
+      done | sort
+      echo
+    fi
+
+    if test -s confdefs.h; then
+      cat <<\_ASBOX
+## ----------- ##
+## confdefs.h. ##
+## ----------- ##
+_ASBOX
+      echo
+      cat confdefs.h
+      echo
+    fi
+    test "$ac_signal" != 0 &&
+      echo "$as_me: caught signal $ac_signal"
+    echo "$as_me: exit $exit_status"
+  } >&5
+  rm -f core *.core core.conftest.* &&
+    rm -f -r conftest* confdefs* conf$$* $ac_clean_files &&
+    exit $exit_status
+' 0
+for ac_signal in 1 2 13 15; do
+  trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal
+done
+ac_signal=0
+
+# confdefs.h avoids OS command line length limits that DEFS can exceed.
+rm -f -r conftest* confdefs.h
+
+# Predefined preprocessor variables.
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_NAME "$PACKAGE_NAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_TARNAME "$PACKAGE_TARNAME"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_VERSION "$PACKAGE_VERSION"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_STRING "$PACKAGE_STRING"
+_ACEOF
+
+
+cat >>confdefs.h <<_ACEOF
+#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT"
+_ACEOF
+
+
+# Let the site file select an alternate cache file if it wants to.
+# Prefer explicitly selected file to automatically selected ones.
+if test -n "$CONFIG_SITE"; then
+  set x "$CONFIG_SITE"
+elif test "x$prefix" != xNONE; then
+  set x "$prefix/share/config.site" "$prefix/etc/config.site"
+else
+  set x "$ac_default_prefix/share/config.site" \
+	"$ac_default_prefix/etc/config.site"
+fi
+shift
+for ac_site_file
+do
+  if test -r "$ac_site_file"; then
+    { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5
+echo "$as_me: loading site script $ac_site_file" >&6;}
+    sed 's/^/| /' "$ac_site_file" >&5
+    . "$ac_site_file"
+  fi
+done
+
+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:$LINENO: loading cache $cache_file" >&5
+echo "$as_me: loading cache $cache_file" >&6;}
+    case $cache_file in
+      [\\/]* | ?:[\\/]* ) . "$cache_file";;
+      *)                      . "./$cache_file";;
+    esac
+  fi
+else
+  { echo "$as_me:$LINENO: creating cache $cache_file" >&5
+echo "$as_me: creating cache $cache_file" >&6;}
+  >$cache_file
+fi
+
+# Check that the precious variables saved in the cache have kept the same
+# value.
+ac_cache_corrupted=false
+for ac_var in $ac_precious_vars; do
+  eval ac_old_set=\$ac_cv_env_${ac_var}_set
+  eval ac_new_set=\$ac_env_${ac_var}_set
+  eval ac_old_val=\$ac_cv_env_${ac_var}_value
+  eval ac_new_val=\$ac_env_${ac_var}_value
+  case $ac_old_set,$ac_new_set in
+    set,)
+      { echo "$as_me:$LINENO: 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:$LINENO: 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:$LINENO: 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:$LINENO:   former value:  $ac_old_val" >&5
+echo "$as_me:   former value:  $ac_old_val" >&2;}
+	{ echo "$as_me:$LINENO:   current value: $ac_new_val" >&5
+echo "$as_me:   current value: $ac_new_val" >&2;}
+	ac_cache_corrupted=:
+      fi;;
+  esac
+  # Pass precious variables to config.status.
+  if test "$ac_new_set" = set; then
+    case $ac_new_val in
+    *\'*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;;
+    *) ac_arg=$ac_var=$ac_new_val ;;
+    esac
+    case " $ac_configure_args " in
+      *" '$ac_arg' "*) ;; # Avoid dups.  Use of quotes ensures accuracy.
+      *) ac_configure_args="$ac_configure_args '$ac_arg'" ;;
+    esac
+  fi
+done
+if $ac_cache_corrupted; then
+  { echo "$as_me:$LINENO: 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:$LINENO: 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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+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:$LINENO: 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
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+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:$LINENO: 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
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="gcc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+else
+  CC="$ac_cv_prog_CC"
+fi
+
+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:$LINENO: 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
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="${ac_tool_prefix}cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  fi
+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:$LINENO: 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
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+  ac_prog_rejected=no
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then
+       ac_prog_rejected=yes
+       continue
+     fi
+    ac_cv_prog_CC="cc"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+if test $ac_prog_rejected = yes; then
+  # We found a bogon in the path, so make sure we never use it.
+  set dummy $ac_cv_prog_CC
+  shift
+  if test $# != 0; then
+    # We chose a different compiler from the bogus one.
+    # However, it has the same basename, so the bogon will be chosen
+    # first if we set CC to just the basename; use the full file name.
+    shift
+    ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@"
+  fi
+fi
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+if test -z "$CC"; then
+  if test -n "$ac_tool_prefix"; then
+  for ac_prog in cl.exe
+  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:$LINENO: 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
+else
+  if test -n "$CC"; then
+  ac_cv_prog_CC="$CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_CC="$ac_tool_prefix$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+CC=$ac_cv_prog_CC
+if test -n "$CC"; then
+  { echo "$as_me:$LINENO: result: $CC" >&5
+echo "${ECHO_T}$CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+    test -n "$CC" && break
+  done
+fi
+if test -z "$CC"; then
+  ac_ct_CC=$CC
+  for ac_prog in cl.exe
+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:$LINENO: 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
+else
+  if test -n "$ac_ct_CC"; then
+  ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_CC="$ac_prog"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_CC=$ac_cv_prog_ac_ct_CC
+if test -n "$ac_ct_CC"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_CC" >&5
+echo "${ECHO_T}$ac_ct_CC" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+  test -n "$ac_ct_CC" && break
+done
+
+  if test "x$ac_ct_CC" = x; then
+    CC=""
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    CC=$ac_ct_CC
+  fi
+fi
+
+fi
+
+
+test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&5
+echo "$as_me: error: no acceptable C compiler found in \$PATH
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+
+# Provide some information about the compiler.
+echo "$as_me:$LINENO: checking for C compiler version" >&5
+ac_compiler=`set X $ac_compile; echo $2`
+{ (ac_try="$ac_compiler --version >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler --version >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -v >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -v >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+{ (ac_try="$ac_compiler -V >&5"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compiler -V >&5") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files a.out a.exe b.out"
+# 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:$LINENO: checking for C compiler default output file name" >&5
+echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6; }
+ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'`
+#
+# List of possible output files, starting from the most likely.
+# The algorithm is not robust to junk in `.', hence go to wildcards (a.*)
+# only as a last resort.  b.out is created by i960 compilers.
+ac_files='a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out'
+#
+# The IRIX 6 linker writes into existing files which may not be
+# executable, retaining their permissions.  Remove them first so a
+# subsequent execution test works.
+ac_rmfiles=
+for ac_file in $ac_files
+do
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    * ) ac_rmfiles="$ac_rmfiles $ac_file";;
+  esac
+done
+rm -f $ac_rmfiles
+
+if { (ac_try="$ac_link_default"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link_default") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  # Autoconf-2.13 could set the ac_cv_exeext variable to `no'.
+# So ignore a value of `no', otherwise this would lead to `EXEEXT = no'
+# in a Makefile.  We should not override ac_cv_exeext if it was cached,
+# so that the user can short-circuit this test for compilers unknown to
+# Autoconf.
+for ac_file in $ac_files ''
+do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj )
+	;;
+    [ab].out )
+	# We found the default executable, but exeext='' is most
+	# certainly right.
+	break;;
+    *.* )
+        if test "${ac_cv_exeext+set}" = set && test "$ac_cv_exeext" != no;
+	then :; else
+	   ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	fi
+	# We set ac_cv_exeext here because the later test for it is not
+	# safe: cross compilers may not add the suffix if given an `-o'
+	# argument, so we may need to know it at that point already.
+	# Even if this section looks crufty: it has the advantage of
+	# actually working.
+	break;;
+    * )
+	break;;
+  esac
+done
+test "$ac_cv_exeext" = no && ac_cv_exeext=
+
+else
+  ac_file=''
+fi
+
+{ echo "$as_me:$LINENO: result: $ac_file" >&5
+echo "${ECHO_T}$ac_file" >&6; }
+if test -z "$ac_file"; then
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: C compiler cannot create executables
+See \`config.log' for more details." >&5
+echo "$as_me: error: C compiler cannot create executables
+See \`config.log' for more details." >&2;}
+   { (exit 77); exit 77; }; }
+fi
+
+ac_exeext=$ac_cv_exeext
+
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: 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'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+    cross_compiling=no
+  else
+    if test "$cross_compiling" = maybe; then
+	cross_compiling=yes
+    else
+	{ { echo "$as_me:$LINENO: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot run C compiled programs.
+If you meant to cross compile, use \`--host'.
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+
+rm -f a.out a.exe conftest$ac_cv_exeext b.out
+ac_clean_files=$ac_clean_files_save
+# Check that the compiler produces executables we can run.  If not, either
+# the compiler is broken, or we cross compile.
+{ echo "$as_me:$LINENO: checking whether we are cross compiling" >&5
+echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6; }
+{ echo "$as_me:$LINENO: result: $cross_compiling" >&5
+echo "${ECHO_T}$cross_compiling" >&6; }
+
+{ echo "$as_me:$LINENO: checking for suffix of executables" >&5
+echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6; }
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $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
+# work properly (i.e., refer to `conftest.exe'), while it won't with
+# `rm'.
+for ac_file in conftest.exe conftest conftest.*; do
+  test -f "$ac_file" || continue
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;;
+    *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'`
+	  break;;
+    * ) break;;
+  esac
+done
+else
+  { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of executables: cannot compile and link
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest$ac_cv_exeext
+{ echo "$as_me:$LINENO: 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:$LINENO: checking for suffix of object files" >&5
+echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6; }
+if test "${ac_cv_objext+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.o conftest.obj
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+  for ac_file in conftest.o conftest.obj conftest.*; do
+  test -f "$ac_file" || continue;
+  case $ac_file in
+    *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf ) ;;
+    *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'`
+       break;;
+  esac
+done
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&5
+echo "$as_me: error: cannot compute suffix of object files: cannot compile
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+rm -f conftest.$ac_cv_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_objext" >&5
+echo "${ECHO_T}$ac_cv_objext" >&6; }
+OBJEXT=$ac_cv_objext
+ac_objext=$OBJEXT
+{ echo "$as_me:$LINENO: 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+#ifndef __GNUC__
+       choke me
+#endif
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_compiler_gnu=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_compiler_gnu=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+ac_cv_c_compiler_gnu=$ac_compiler_gnu
+
+fi
+{ echo "$as_me:$LINENO: 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
+{ echo "$as_me:$LINENO: 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
+  ac_save_c_werror_flag=$ac_c_werror_flag
+   ac_c_werror_flag=yes
+   ac_cv_prog_cc_g=no
+   CFLAGS="-g"
+   cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	CFLAGS=""
+      cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_c_werror_flag=$ac_save_c_werror_flag
+	 CFLAGS="-g"
+	 cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_g=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+   ac_c_werror_flag=$ac_save_c_werror_flag
+fi
+{ echo "$as_me:$LINENO: 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
+elif test $ac_cv_prog_cc_g = yes; then
+  if test "$GCC" = yes; then
+    CFLAGS="-g -O2"
+  else
+    CFLAGS="-g"
+  fi
+else
+  if test "$GCC" = yes; then
+    CFLAGS="-O2"
+  else
+    CFLAGS=
+  fi
+fi
+{ echo "$as_me:$LINENO: checking for $CC option to accept ISO C89" >&5
+echo $ECHO_N "checking for $CC option to accept ISO C89... $ECHO_C" >&6; }
+if test "${ac_cv_prog_cc_c89+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_prog_cc_c89=no
+ac_save_CC=$CC
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdarg.h>
+#include <stdio.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+/* Most of the following tests are stolen from RCS 5.7's src/conf.sh.  */
+struct buf { int x; };
+FILE * (*rcsopen) (struct buf *, struct stat *, int);
+static char *e (p, i)
+     char **p;
+     int i;
+{
+  return p[i];
+}
+static char *f (char * (*g) (char **, int), char **p, ...)
+{
+  char *s;
+  va_list v;
+  va_start (v,p);
+  s = g (p, va_arg (v,int));
+  va_end (v);
+  return s;
+}
+
+/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default.  It has
+   function prototypes and stuff, but not '\xHH' hex character constants.
+   These don't provoke an error unfortunately, instead are silently treated
+   as 'x'.  The following induces an error, until -std is added to get
+   proper ANSI mode.  Curiously '\x00'!='x' always comes out true, for an
+   array size at least.  It's necessary to write '\x00'==0 to get something
+   that's true only with -std.  */
+int osf4_cc_array ['\x00' == 0 ? 1 : -1];
+
+/* IBM C 6 for AIX is almost-ANSI by default, but it replaces macro parameters
+   inside strings and character constants.  */
+#define FOO(x) 'x'
+int xlc6_cc_array[FOO(a) == 'x' ? 1 : -1];
+
+int test (int i, double x);
+struct s1 {int (*f) (int a);};
+struct s2 {int (*f) (double a);};
+int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int);
+int argc;
+char **argv;
+int
+main ()
+{
+return f (e, argv, 0) != argv[0]  ||  f (e, argv, 1) != argv[1];
+  ;
+  return 0;
+}
+_ACEOF
+for ac_arg in '' -qlanglvl=extc89 -qlanglvl=ansi -std \
+	-Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__"
+do
+  CC="$ac_save_CC $ac_arg"
+  rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_prog_cc_c89=$ac_arg
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext
+  test "x$ac_cv_prog_cc_c89" != "xno" && break
+done
+rm -f conftest.$ac_ext
+CC=$ac_save_CC
+
+fi
+# AC_CACHE_VAL
+case "x$ac_cv_prog_cc_c89" in
+  x)
+    { echo "$as_me:$LINENO: result: none needed" >&5
+echo "${ECHO_T}none needed" >&6; } ;;
+  xno)
+    { echo "$as_me:$LINENO: result: unsupported" >&5
+echo "${ECHO_T}unsupported" >&6; } ;;
+  *)
+    CC="$CC $ac_cv_prog_cc_c89"
+    { echo "$as_me:$LINENO: result: $ac_cv_prog_cc_c89" >&5
+echo "${ECHO_T}$ac_cv_prog_cc_c89" >&6; } ;;
+esac
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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_config_headers="$ac_config_headers config.h"
+
+ac_aux_dir=
+for ac_dir in "$srcdir" "$srcdir/.." "$srcdir/../.."; do
+  if test -f "$ac_dir/install-sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install-sh -c"
+    break
+  elif test -f "$ac_dir/install.sh"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/install.sh -c"
+    break
+  elif test -f "$ac_dir/shtool"; then
+    ac_aux_dir=$ac_dir
+    ac_install_sh="$ac_aux_dir/shtool install -c"
+    break
+  fi
+done
+if test -z "$ac_aux_dir"; then
+  { { echo "$as_me:$LINENO: 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
+
+# These three variables are undocumented and unsupported,
+# and are intended to be withdrawn in a future Autoconf release.
+# They can cause serious problems if a builder's source tree is in a directory
+# whose full name contains unusual characters.
+ac_config_guess="$SHELL $ac_aux_dir/config.guess"  # Please don't use this var.
+ac_config_sub="$SHELL $ac_aux_dir/config.sub"  # Please don't use this var.
+ac_configure="$SHELL $ac_aux_dir/configure"  # Please don't use this var.
+
+
+# Make sure we can run config.sub.
+$SHELL "$ac_aux_dir/config.sub" sun4 >/dev/null 2>&1 ||
+  { { echo "$as_me:$LINENO: error: cannot run $SHELL $ac_aux_dir/config.sub" >&5
+echo "$as_me: error: cannot run $SHELL $ac_aux_dir/config.sub" >&2;}
+   { (exit 1); exit 1; }; }
+
+{ echo "$as_me:$LINENO: 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
+else
+  ac_build_alias=$build_alias
+test "x$ac_build_alias" = x &&
+  ac_build_alias=`$SHELL "$ac_aux_dir/config.guess"`
+test "x$ac_build_alias" = x &&
+  { { echo "$as_me:$LINENO: 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=`$SHELL "$ac_aux_dir/config.sub" $ac_build_alias` ||
+  { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $ac_build_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_build" >&5
+echo "${ECHO_T}$ac_cv_build" >&6; }
+case $ac_cv_build in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical build" >&5
+echo "$as_me: error: invalid value of canonical build" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+build=$ac_cv_build
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_build
+shift
+build_cpu=$1
+build_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+build_os=$*
+IFS=$ac_save_IFS
+case $build_os in *\ *) build_os=`echo "$build_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: 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
+else
+  if test "x$host_alias" = x; then
+  ac_cv_host=$ac_cv_build
+else
+  ac_cv_host=`$SHELL "$ac_aux_dir/config.sub" $host_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $host_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_host" >&5
+echo "${ECHO_T}$ac_cv_host" >&6; }
+case $ac_cv_host in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical host" >&5
+echo "$as_me: error: invalid value of canonical host" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+host=$ac_cv_host
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_host
+shift
+host_cpu=$1
+host_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+host_os=$*
+IFS=$ac_save_IFS
+case $host_os in *\ *) host_os=`echo "$host_os" | sed 's/ /-/g'`;; esac
+
+
+{ echo "$as_me:$LINENO: 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
+else
+  if test "x$target_alias" = x; then
+  ac_cv_target=$ac_cv_host
+else
+  ac_cv_target=`$SHELL "$ac_aux_dir/config.sub" $target_alias` ||
+    { { echo "$as_me:$LINENO: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&5
+echo "$as_me: error: $SHELL $ac_aux_dir/config.sub $target_alias failed" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_target" >&5
+echo "${ECHO_T}$ac_cv_target" >&6; }
+case $ac_cv_target in
+*-*-*) ;;
+*) { { echo "$as_me:$LINENO: error: invalid value of canonical target" >&5
+echo "$as_me: error: invalid value of canonical target" >&2;}
+   { (exit 1); exit 1; }; };;
+esac
+target=$ac_cv_target
+ac_save_IFS=$IFS; IFS='-'
+set x $ac_cv_target
+shift
+target_cpu=$1
+target_vendor=$2
+shift; shift
+# Remember, the first character of IFS is used to create $*,
+# except with old shells:
+target_os=$*
+IFS=$ac_save_IFS
+case $target_os in *\ *) target_os=`echo "$target_os" | sed 's/ /-/g'`;; esac
+
+
+# The aliases save the names the user supplied, while $host etc.
+# will get canonicalized.
+test -n "$target_alias" &&
+  test "$program_prefix$program_suffix$program_transform_name" = \
+    NONENONEs,x,x, &&
+  program_prefix=${target_alias}-
+
+mymakefile="Makefile"
+on_qnx=no
+case "$target" in
+	*hp-hpux*)
+		SYS_DEFS="-D_HPUX_SOURCE"
+		;;
+	*ibm-aix*)
+		SYS_DEFS="-D_ALL_SOURCE"
+		mymakefile="Makefile.aix"
+		;;
+	*dec-osf*)
+		SYS_DEFS="-D_XOPEN_SOURCE_EXTENDED"
+		;;
+	*pc-sco*)
+		SYS_DEFS="-UM_XENIX -b elf"
+		;;
+	*qnx*)
+		on_qnx=yes
+		SYS_DEFS="-Q"
+		;;
+	*)
+		;;
+esac
+
+
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $SYS_DEFS"
+{ echo "$as_me:$LINENO: checking for maximum signal specifier:" >&5
+echo $ECHO_N "checking for maximum signal specifier:... $ECHO_C" >&6; }
+if test "${mh_cv_max_signals+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  mh_found="no"
+for mh_sigs in NSIG __sys_nsig; do
+
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <signal.h>
+int
+main ()
+{
+return $mh_sigs;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  mh_found="yes"; mh_cv_max_signals="$mh_sigs"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	if test "$mh_found" = "yes"; then
+		break;
+	fi
+done
+fi
+
+CPPFLAGS="$save_CPPFLAGS"
+if test "$mh_found" = "no"; then
+	{ { echo "$as_me:$LINENO: error: Cannot find a system limit for number of signals. PDCurses cannot be configured on this machine." >&5
+echo "$as_me: error: Cannot find a system limit for number of signals. PDCurses cannot be configured on this machine." >&2;}
+   { (exit 1); exit 1; }; }
+else
+	cat >>confdefs.h <<_ACEOF
+#define PDC_MAX_SIGNALS $mh_cv_max_signals
+_ACEOF
+
+	{ echo "$as_me:$LINENO: result: $mh_cv_max_signals" >&5
+echo "${ECHO_T}$mh_cv_max_signals" >&6; }
+fi
+
+
+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:$LINENO: 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
+else
+  if test -n "$RANLIB"; then
+  ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_RANLIB="${ac_tool_prefix}ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+RANLIB=$ac_cv_prog_RANLIB
+if test -n "$RANLIB"; then
+  { echo "$as_me:$LINENO: result: $RANLIB" >&5
+echo "${ECHO_T}$RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+fi
+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:$LINENO: 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
+else
+  if test -n "$ac_ct_RANLIB"; then
+  ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test.
+else
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_exec_ext in '' $ac_executable_extensions; do
+  if { test -f "$as_dir/$ac_word$ac_exec_ext" && $as_test_x "$as_dir/$ac_word$ac_exec_ext"; }; then
+    ac_cv_prog_ac_ct_RANLIB="ranlib"
+    echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+done
+IFS=$as_save_IFS
+
+fi
+fi
+ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB
+if test -n "$ac_ct_RANLIB"; then
+  { echo "$as_me:$LINENO: result: $ac_ct_RANLIB" >&5
+echo "${ECHO_T}$ac_ct_RANLIB" >&6; }
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+  if test "x$ac_ct_RANLIB" = x; then
+    RANLIB=":"
+  else
+    case $cross_compiling:$ac_tool_warned in
+yes:)
+{ echo "$as_me:$LINENO: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&5
+echo "$as_me: WARNING: In the future, Autoconf will not detect cross-tools
+whose name does not start with the host triplet.  If you think this
+configuration is useful to you, please write to autoconf@gnu.org." >&2;}
+ac_tool_warned=yes ;;
+esac
+    RANLIB=$ac_ct_RANLIB
+  fi
+else
+  RANLIB="$ac_cv_prog_RANLIB"
+fi
+
+# Find a good install program.  We prefer a C program (faster),
+# so one script is as good as another.  But avoid the broken or
+# incompatible versions:
+# SysV /etc/install, /usr/sbin/install
+# SunOS /usr/etc/install
+# IRIX /sbin/install
+# AIX /bin/install
+# AmigaOS /C/install, which installs bootblocks on floppy discs
+# AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag
+# AFS /usr/afsws/bin/install, which mishandles nonexistent args
+# SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff"
+# OS/2's system install, which has a completely different semantic
+# ./install, which can be erroneously created by make from ./install.sh.
+{ echo "$as_me:$LINENO: 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
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  # Account for people who put trailing slashes in PATH elements.
+case $as_dir/ in
+  ./ | .// | /cC/* | \
+  /etc/* | /usr/sbin/* | /usr/etc/* | /sbin/* | /usr/afsws/bin/* | \
+  ?:\\/os2\\/install\\/* | ?:\\/OS2\\/INSTALL\\/* | \
+  /usr/ucb/* ) ;;
+  *)
+    # OSF1 and SCO ODT 3.0 have their own names for install.
+    # Don't use installbsd from OSF since it installs stuff as root
+    # by default.
+    for ac_prog in ginstall scoinst install; do
+      for ac_exec_ext in '' $ac_executable_extensions; do
+	if { test -f "$as_dir/$ac_prog$ac_exec_ext" && $as_test_x "$as_dir/$ac_prog$ac_exec_ext"; }; then
+	  if test $ac_prog = install &&
+	    grep dspmsg "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # AIX install.  It has an incompatible calling convention.
+	    :
+	  elif test $ac_prog = install &&
+	    grep pwplus "$as_dir/$ac_prog$ac_exec_ext" >/dev/null 2>&1; then
+	    # program-specific install script used by HP pwplus--don't use.
+	    :
+	  else
+	    ac_cv_path_install="$as_dir/$ac_prog$ac_exec_ext -c"
+	    break 3
+	  fi
+	fi
+      done
+    done
+    ;;
+esac
+done
+IFS=$as_save_IFS
+
+
+fi
+  if test "${ac_cv_path_install+set}" = set; then
+    INSTALL=$ac_cv_path_install
+  else
+    # As a last resort, use the slow shell script.  Don't cache a
+    # value for INSTALL within a source directory, because that will
+    # break other packages using the cache if that directory is
+    # removed, or if the value is a relative name.
+    INSTALL=$ac_install_sh
+  fi
+fi
+{ echo "$as_me:$LINENO: result: $INSTALL" >&5
+echo "${ECHO_T}$INSTALL" >&6; }
+
+# Use test -z because SunOS4 sh mishandles braces in ${var-val}.
+# It thinks the first close brace ends the variable substitution.
+test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}'
+
+test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}'
+
+test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644'
+
+{ echo "$as_me:$LINENO: checking whether ${MAKE-make} sets \$(MAKE)" >&5
+echo $ECHO_N "checking whether ${MAKE-make} sets \$(MAKE)... $ECHO_C" >&6; }
+set x ${MAKE-make}; ac_make=`echo "$2" | sed 's/+/p/g; s/[^a-zA-Z0-9_]/_/g'`
+if { as_var=ac_cv_prog_make_${ac_make}_set; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.make <<\_ACEOF
+SHELL = /bin/sh
+all:
+	@echo '@@@%%%=$(MAKE)=@@@%%%'
+_ACEOF
+# GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+case `${MAKE-make} -f conftest.make 2>/dev/null` in
+  *@@@%%%=?*=@@@%%%*)
+    eval ac_cv_prog_make_${ac_make}_set=yes;;
+  *)
+    eval ac_cv_prog_make_${ac_make}_set=no;;
+esac
+rm -f conftest.make
+fi
+if eval test \$ac_cv_prog_make_${ac_make}_set = yes; then
+  { echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+  SET_MAKE=
+else
+  { echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+  SET_MAKE="MAKE=${MAKE-make}"
+fi
+
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+{ echo "$as_me:$LINENO: 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
+  CPP=
+fi
+if test -z "$CPP"; then
+  if test "${ac_cv_prog_CPP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+      # Double quotes because CPP needs to be expanded
+    for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp"
+    do
+      ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  break
+fi
+
+    done
+    ac_cv_prog_CPP=$CPP
+
+fi
+  CPP=$ac_cv_prog_CPP
+else
+  ac_cv_prog_CPP=$CPP
+fi
+{ echo "$as_me:$LINENO: result: $CPP" >&5
+echo "${ECHO_T}$CPP" >&6; }
+ac_preproc_ok=false
+for ac_c_preproc_warn_flag in '' yes
+do
+  # Use a header file that comes with gcc, so configuring glibc
+  # with a fresh cross-compiler works.
+  # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+  # <limits.h> exists even on freestanding compilers.
+  # 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+		     Syntax error
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  :
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Broken: fails on valid input.
+continue
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+  # OK, works on sane cases.  Now check whether nonexistent headers
+  # can be detected and how.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ac_nonexistent.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # Broken: success on invalid input.
+continue
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  # Passes both tests.
+ac_preproc_ok=:
+break
+fi
+
+rm -f conftest.err conftest.$ac_ext
+
+done
+# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped.
+rm -f conftest.err conftest.$ac_ext
+if $ac_preproc_ok; then
+  :
+else
+  { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&5
+echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check
+See \`config.log' for more details." >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+ac_ext=c
+ac_cpp='$CPP $CPPFLAGS'
+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
+
+
+{ echo "$as_me:$LINENO: checking for grep that handles long lines and -e" >&5
+echo $ECHO_N "checking for grep that handles long lines and -e... $ECHO_C" >&6; }
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # Extract the first word of "grep ggrep" to use in msg output
+if test -z "$GREP"; then
+set dummy grep ggrep; ac_prog_name=$2
+if test "${ac_cv_path_GREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_GREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in grep ggrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_GREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_GREP" && $as_test_x "$ac_path_GREP"; } || continue
+    # Check for GNU ac_path_GREP and select it if it is found.
+  # Check for GNU $ac_path_GREP
+case `"$ac_path_GREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_GREP="$ac_path_GREP" ac_path_GREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'GREP' >> "conftest.nl"
+    "$ac_path_GREP" -e 'GREP$' -e '-(cannot match)-' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_GREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_GREP="$ac_path_GREP"
+      ac_path_GREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_GREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+GREP="$ac_cv_path_GREP"
+if test -z "$GREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_GREP=$GREP
+fi
+
+
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_GREP" >&5
+echo "${ECHO_T}$ac_cv_path_GREP" >&6; }
+ GREP="$ac_cv_path_GREP"
+
+
+{ echo "$as_me:$LINENO: checking for egrep" >&5
+echo $ECHO_N "checking for egrep... $ECHO_C" >&6; }
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  if echo a | $GREP -E '(a|b)' >/dev/null 2>&1
+   then ac_cv_path_EGREP="$GREP -E"
+   else
+     # Extract the first word of "egrep" to use in msg output
+if test -z "$EGREP"; then
+set dummy egrep; ac_prog_name=$2
+if test "${ac_cv_path_EGREP+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_path_EGREP_found=false
+# Loop through the user's path and test for each of PROGNAME-LIST
+as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH$PATH_SEPARATOR/usr/xpg4/bin
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  for ac_prog in egrep; do
+  for ac_exec_ext in '' $ac_executable_extensions; do
+    ac_path_EGREP="$as_dir/$ac_prog$ac_exec_ext"
+    { test -f "$ac_path_EGREP" && $as_test_x "$ac_path_EGREP"; } || continue
+    # Check for GNU ac_path_EGREP and select it if it is found.
+  # Check for GNU $ac_path_EGREP
+case `"$ac_path_EGREP" --version 2>&1` in
+*GNU*)
+  ac_cv_path_EGREP="$ac_path_EGREP" ac_path_EGREP_found=:;;
+*)
+  ac_count=0
+  echo $ECHO_N "0123456789$ECHO_C" >"conftest.in"
+  while :
+  do
+    cat "conftest.in" "conftest.in" >"conftest.tmp"
+    mv "conftest.tmp" "conftest.in"
+    cp "conftest.in" "conftest.nl"
+    echo 'EGREP' >> "conftest.nl"
+    "$ac_path_EGREP" 'EGREP$' < "conftest.nl" >"conftest.out" 2>/dev/null || break
+    diff "conftest.out" "conftest.nl" >/dev/null 2>&1 || break
+    ac_count=`expr $ac_count + 1`
+    if test $ac_count -gt ${ac_path_EGREP_max-0}; then
+      # Best one so far, save it but keep looking for a better one
+      ac_cv_path_EGREP="$ac_path_EGREP"
+      ac_path_EGREP_max=$ac_count
+    fi
+    # 10*(2^10) chars as input seems more than enough
+    test $ac_count -gt 10 && break
+  done
+  rm -f conftest.in conftest.tmp conftest.nl conftest.out;;
+esac
+
+
+    $ac_path_EGREP_found && break 3
+  done
+done
+
+done
+IFS=$as_save_IFS
+
+
+fi
+
+EGREP="$ac_cv_path_EGREP"
+if test -z "$EGREP"; then
+  { { echo "$as_me:$LINENO: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&5
+echo "$as_me: error: no acceptable $ac_prog_name could be found in $PATH$PATH_SEPARATOR/usr/xpg4/bin" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+else
+  ac_cv_path_EGREP=$EGREP
+fi
+
+
+   fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_path_EGREP" >&5
+echo "${ECHO_T}$ac_cv_path_EGREP" >&6; }
+ EGREP="$ac_cv_path_EGREP"
+
+
+{ echo "$as_me:$LINENO: 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+
+int
+main ()
+{
+
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_stdc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_stdc=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <string.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "memchr" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <stdlib.h>
+
+_ACEOF
+if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
+  $EGREP "free" >/dev/null 2>&1; then
+  :
+else
+  ac_cv_header_stdc=no
+fi
+rm -f conftest*
+
+fi
+
+if test $ac_cv_header_stdc = yes; then
+  # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+  if test "$cross_compiling" = yes; then
+  :
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <ctype.h>
+#include <stdlib.h>
+#if ((' ' & 0x0FF) == 0x020)
+# define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#else
+# define ISLOWER(c) \
+		   (('a' <= (c) && (c) <= 'i') \
+		     || ('j' <= (c) && (c) <= 'r') \
+		     || ('s' <= (c) && (c) <= 'z'))
+# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c))
+#endif
+
+#define XOR(e, f) (((e) && !(f)) || (!(e) && (f)))
+int
+main ()
+{
+  int i;
+  for (i = 0; i < 256; i++)
+    if (XOR (islower (i), ISLOWER (i))
+	|| toupper (i) != TOUPPER (i))
+      return 2;
+  return 0;
+}
+_ACEOF
+rm -f conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
+  { (case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_try") 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; }; then
+  :
+else
+  echo "$as_me: program exited with status $ac_status" >&5
+echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+( exit $ac_status )
+ac_cv_header_stdc=no
+fi
+rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
+fi
+
+
+fi
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5
+echo "${ECHO_T}$ac_cv_header_stdc" >&6; }
+if test $ac_cv_header_stdc = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define STDC_HEADERS 1
+_ACEOF
+
+fi
+
+# On IRIX 5.3, sys/types and inttypes.h are conflicting.
+
+
+
+
+
+
+
+
+
+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:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  eval "$as_ac_Header=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Header=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+
+if test "${ac_cv_header_sys_ipc_h+set}" = set; then
+  { echo "$as_me:$LINENO: checking for sys/ipc.h" >&5
+echo $ECHO_N "checking for sys/ipc.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_ipc_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_ipc_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_ipc_h" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking sys/ipc.h usability" >&5
+echo $ECHO_N "checking sys/ipc.h usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <sys/ipc.h>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking sys/ipc.h presence" >&5
+echo $ECHO_N "checking sys/ipc.h presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/ipc.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: sys/ipc.h: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: sys/ipc.h: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h: present but cannot be compiled" >&5
+echo "$as_me: WARNING: sys/ipc.h: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: sys/ipc.h:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: sys/ipc.h: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: sys/ipc.h:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: sys/ipc.h: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: sys/ipc.h: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: sys/ipc.h: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to wmcbrine@users.sf.net ##
+## ------------------------------------ ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for sys/ipc.h" >&5
+echo $ECHO_N "checking for sys/ipc.h... $ECHO_C" >&6; }
+if test "${ac_cv_header_sys_ipc_h+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_cv_header_sys_ipc_h=$ac_header_preproc
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_sys_ipc_h" >&5
+echo "${ECHO_T}$ac_cv_header_sys_ipc_h" >&6; }
+
+fi
+
+
+if test $ac_cv_header_sys_ipc_h = no; then
+	{ { echo "$as_me:$LINENO: error: Cannot find required header file sys/ipc.h; PDCurses cannot be configured" >&5
+echo "$as_me: error: Cannot find required header file sys/ipc.h; PDCurses cannot be configured" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+if test $ac_cv_header_stdc != yes; then
+	{ { echo "$as_me:$LINENO: error: Need ANSI C headers" >&5
+echo "$as_me: error: Need ANSI C headers" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+
+for ac_header in fcntl.h \
+	sys/time.h \
+	sys/select.h \
+	dlfcn.h \
+	dl.h
+
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to wmcbrine@users.sf.net ##
+## ------------------------------------ ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+
+{ echo "$as_me:$LINENO: 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <sys/time.h>
+#include <time.h>
+
+int
+main ()
+{
+if ((struct tm *) 0)
+return 0;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_header_time=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_header_time=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_header_time" >&5
+echo "${ECHO_T}$ac_cv_header_time" >&6; }
+if test $ac_cv_header_time = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define TIME_WITH_SYS_TIME 1
+_ACEOF
+
+fi
+
+
+MH_EXTRA_LIBS=''
+for mh_lib in socket nls; do
+	if test "$on_qnx" = yes; then
+		{ echo "$as_me:$LINENO: checking for library -l${mh_lib}" >&5
+echo $ECHO_N "checking for library -l${mh_lib}... $ECHO_C" >&6; }
+		if test -r /usr/lib/${mh_lib}3r.lib; then
+			{ echo "$as_me:$LINENO: result: found" >&5
+echo "${ECHO_T}found" >&6; }
+			MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}"
+		else
+		{ echo "$as_me:$LINENO: result: not found" >&5
+echo "${ECHO_T}not found" >&6; }
+		fi
+	else
+		as_ac_Lib=`echo "ac_cv_lib_$mh_lib''_main" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for main in -l$mh_lib" >&5
+echo $ECHO_N "checking for main in -l$mh_lib... $ECHO_C" >&6; }
+if { as_var=$as_ac_Lib; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  ac_check_lib_save_LIBS=$LIBS
+LIBS="-l$mh_lib  $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+
+
+int
+main ()
+{
+return main ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_Lib=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_Lib=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+ac_res=`eval echo '${'$as_ac_Lib'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_Lib'}'` = yes; then
+  mh_lib_found=yes
+else
+  mh_lib_found=no
+fi
+
+		if test "$mh_lib_found" = yes; then
+			MH_EXTRA_LIBS="${MH_EXTRA_LIBS} -l${mh_lib}"
+		fi
+	fi
+done
+
+
+
+{ echo "$as_me:$LINENO: checking whether $CC understand -c and -o together" >&5
+echo $ECHO_N "checking whether $CC understand -c and -o together... $ECHO_C" >&6; }
+set dummy $CC; ac_cc="`echo $2 |
+		       sed -e 's/[^a-zA-Z0-9_]/_/g' -e 's/^[0-9]/_/'`"
+if { as_var=ac_cv_prog_cc_${ac_cc}_c_o; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  echo 'foo(){}' > conftest.c
+# We do the test twice because some compilers refuse to overwrite an
+# existing .o file with -o, though they will create one.
+eval ac_cv_prog_cc_${ac_cc}_c_o=no
+ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&5'
+if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -f conftest.ooo && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+then
+  ac_try='${CC-cc} -c conftest.c -o conftest.ooo 1>&5'
+  if { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -f conftest.ooo && { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+  (eval $ac_try) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); };
+  then
+    eval ac_cv_prog_cc_${ac_cc}_c_o=yes
+  fi
+fi
+rm -f conftest*
+
+fi
+if eval "test \"`echo '$ac_cv_prog_cc_'${ac_cc}_c_o`\" = yes"; then
+	O2SAVE=""
+	SAVE2O=""
+	CC2O="-o $"'@'
+	{ echo "$as_me:$LINENO: result: yes" >&5
+echo "${ECHO_T}yes" >&6; }
+else
+	O2SAVE="-mv \`basename "$'@'" .sho\`.o \`basename "$'@'" .sho\`.o.save;"
+	SAVE2O="-mv \`basename "$'@'" .sho\`.o "$'@'"; mv \`basename "$'@'" .sho\`.o.save \`basename "$'@'" .sho\`.o"
+	CC2O=""
+	{ echo "$as_me:$LINENO: result: no" >&5
+echo "${ECHO_T}no" >&6; }
+fi
+
+
+{ echo "$as_me:$LINENO: 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
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <sys/types.h>
+#include <signal.h>
+
+int
+main ()
+{
+return *(signal (0, 0)) (0) == 1;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_cv_type_signal=int
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_cv_type_signal=void
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+fi
+{ echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
+echo "${ECHO_T}$ac_cv_type_signal" >&6; }
+
+cat >>confdefs.h <<_ACEOF
+#define RETSIGTYPE $ac_cv_type_signal
+_ACEOF
+
+
+
+
+
+
+for ac_func in vsscanf usleep poll vsnprintf
+do
+as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
+{ echo "$as_me:$LINENO: checking for $ac_func" >&5
+echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
+if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
+   For example, HP-UX 11i <limits.h> declares gettimeofday.  */
+#define $ac_func innocuous_$ac_func
+
+/* System header to define __stub macros and hopefully few prototypes,
+    which can conflict with char $ac_func (); below.
+    Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
+    <limits.h> exists even on freestanding compilers.  */
+
+#ifdef __STDC__
+# include <limits.h>
+#else
+# include <assert.h>
+#endif
+
+#undef $ac_func
+
+/* Override any GCC internal prototype to avoid an error.
+   Use char because int might match the return type of a GCC
+   builtin and then its argument prototype would still apply.  */
+#ifdef __cplusplus
+extern "C"
+#endif
+char $ac_func ();
+/* 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
+#endif
+
+int
+main ()
+{
+return $ac_func ();
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  eval "$as_ac_var=yes"
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	eval "$as_ac_var=no"
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi
+ac_res=`eval echo '${'$as_ac_var'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+if test `eval echo '${'$as_ac_var'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+done
+
+
+{ echo "$as_me:$LINENO: checking for X" >&5
+echo $ECHO_N "checking for X... $ECHO_C" >&6; }
+
+
+# Check whether --with-x was given.
+if test "${with_x+set}" = set; then
+  withval=$with_x;
+fi
+
+# $have_x is `yes', `no', `disabled', or empty when we do not yet know.
+if test "x$with_x" = xno; then
+  # The user explicitly disabled X.
+  have_x=disabled
+else
+  case $x_includes,$x_libraries in #(
+    *\'*) { { echo "$as_me:$LINENO: error: Cannot use X directory names containing '" >&5
+echo "$as_me: error: Cannot use X directory names containing '" >&2;}
+   { (exit 1); exit 1; }; };; #(
+    *,NONE | NONE,*) if test "${ac_cv_have_x+set}" = set; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  # One or both of the vars are not set, and there is no cached value.
+ac_x_includes=no ac_x_libraries=no
+rm -f -r conftest.dir
+if mkdir conftest.dir; then
+  cd conftest.dir
+  cat >Imakefile <<'_ACEOF'
+incroot:
+	@echo incroot='${INCROOT}'
+usrlibdir:
+	@echo usrlibdir='${USRLIBDIR}'
+libdir:
+	@echo libdir='${LIBDIR}'
+_ACEOF
+  if (export CC; ${XMKMF-xmkmf}) >/dev/null 2>/dev/null && test -f Makefile; then
+    # GNU make sometimes prints "make[1]: Entering...", which would confuse us.
+    for ac_var in incroot usrlibdir libdir; do
+      eval "ac_im_$ac_var=\`\${MAKE-make} $ac_var 2>/dev/null | sed -n 's/^$ac_var=//p'\`"
+    done
+    # Open Windows xmkmf reportedly sets LIBDIR instead of USRLIBDIR.
+    for ac_extension in a so sl; do
+      if test ! -f "$ac_im_usrlibdir/libX11.$ac_extension" &&
+	 test -f "$ac_im_libdir/libX11.$ac_extension"; then
+	ac_im_usrlibdir=$ac_im_libdir; break
+      fi
+    done
+    # Screen out bogus values from the imake configuration.  They are
+    # bogus both because they are the default anyway, and because
+    # using them would break gcc on systems where it needs fixed includes.
+    case $ac_im_incroot in
+	/usr/include) ac_x_includes= ;;
+	*) test -f "$ac_im_incroot/X11/Xos.h" && ac_x_includes=$ac_im_incroot;;
+    esac
+    case $ac_im_usrlibdir in
+	/usr/lib | /lib) ;;
+	*) test -d "$ac_im_usrlibdir" && ac_x_libraries=$ac_im_usrlibdir ;;
+    esac
+  fi
+  cd ..
+  rm -f -r conftest.dir
+fi
+
+# Standard set of common directories for X headers.
+# Check X11 before X11Rn because it is often a symlink to the current release.
+ac_x_header_dirs='
+/usr/X11/include
+/usr/X11R6/include
+/usr/X11R5/include
+/usr/X11R4/include
+
+/usr/include/X11
+/usr/include/X11R6
+/usr/include/X11R5
+/usr/include/X11R4
+
+/usr/local/X11/include
+/usr/local/X11R6/include
+/usr/local/X11R5/include
+/usr/local/X11R4/include
+
+/usr/local/include/X11
+/usr/local/include/X11R6
+/usr/local/include/X11R5
+/usr/local/include/X11R4
+
+/usr/X386/include
+/usr/x386/include
+/usr/XFree86/include/X11
+
+/usr/include
+/usr/local/include
+/usr/unsupported/include
+/usr/athena/include
+/usr/local/x11r5/include
+/usr/lpp/Xamples/include
+
+/usr/openwin/include
+/usr/openwin/share/include'
+
+if test "$ac_x_includes" = no; then
+  # Guess where to find include files, by looking for Xlib.h.
+  # First, try using that file with no special directory specified.
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  # We can compile using X headers with no special include directory.
+ac_x_includes=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  for ac_dir in $ac_x_header_dirs; do
+  if test -r "$ac_dir/X11/Xlib.h"; then
+    ac_x_includes=$ac_dir
+    break
+  fi
+done
+fi
+
+rm -f conftest.err conftest.$ac_ext
+fi # $ac_x_includes = no
+
+if test "$ac_x_libraries" = no; then
+  # Check for the libraries.
+  # See if we find them without any special options.
+  # Don't add to $LIBS permanently.
+  ac_save_LIBS=$LIBS
+  LIBS="-lX11 $LIBS"
+  cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <X11/Xlib.h>
+int
+main ()
+{
+XrmInitialize ()
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (ac_try="$ac_link"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_link") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest$ac_exeext &&
+       $as_test_x conftest$ac_exeext; then
+  LIBS=$ac_save_LIBS
+# We can link X programs with no special library path.
+ac_x_libraries=
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	LIBS=$ac_save_LIBS
+for ac_dir in `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`
+do
+  # Don't even attempt the hair of trying to link an X program!
+  for ac_extension in a so sl; do
+    if test -r "$ac_dir/libX11.$ac_extension"; then
+      ac_x_libraries=$ac_dir
+      break 2
+    fi
+  done
+done
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
+      conftest$ac_exeext conftest.$ac_ext
+fi # $ac_x_libraries = no
+
+case $ac_x_includes,$ac_x_libraries in #(
+  no,* | *,no | *\'*)
+    # Didn't find X, or a directory has "'" in its name.
+    ac_cv_have_x="have_x=no";; #(
+  *)
+    # Record where we found X for the cache.
+    ac_cv_have_x="have_x=yes\
+	ac_x_includes='$ac_x_includes'\
+	ac_x_libraries='$ac_x_libraries'"
+esac
+fi
+;; #(
+    *) have_x=yes;;
+  esac
+  eval "$ac_cv_have_x"
+fi # $with_x != no
+
+if test "$have_x" != yes; then
+  { echo "$as_me:$LINENO: result: $have_x" >&5
+echo "${ECHO_T}$have_x" >&6; }
+  no_x=yes
+else
+  # If each of the values was on the command line, it overrides each guess.
+  test "x$x_includes" = xNONE && x_includes=$ac_x_includes
+  test "x$x_libraries" = xNONE && x_libraries=$ac_x_libraries
+  # Update the cache value to reflect the command line values.
+  ac_cv_have_x="have_x=yes\
+	ac_x_includes='$x_includes'\
+	ac_x_libraries='$x_libraries'"
+  { echo "$as_me:$LINENO: result: libraries $x_libraries, headers $x_includes" >&5
+echo "${ECHO_T}libraries $x_libraries, headers $x_includes" >&6; }
+fi
+
+
+mh_x11_dir=""
+mh_x11_xaw_dir=""
+
+mh_inc_dirs="$ac_x_header_dirs"
+
+
+if test "x$x_includes" != xNONE ; then
+	mh_inc_dirs="$x_includes $mh_inc_dirs"
+fi
+
+
+for ac_dir in $mh_inc_dirs ; do
+  if test -r $ac_dir/Intrinsic.h; then
+    mh_x11_dir=$ac_dir
+    break
+  fi
+  if test -r $ac_dir/X11/Intrinsic.h; then
+    mh_x11_dir="$ac_dir/X11"
+    break
+  fi
+done
+
+
+if test "$with_xaw3d" = yes; then
+	mh_xaw_dir="Xaw3d"
+else
+	if test "$with_nextaw" = yes; then
+		mh_xaw_dir="neXtaw"
+	else
+		mh_xaw_dir="Xaw"
+	fi
+fi
+for ac_dir in $mh_inc_dirs ; do
+  if test -r $ac_dir/$mh_xaw_dir/Box.h; then
+    mh_x11_xaw_dir=$ac_dir
+    break
+  fi
+  if test -r $ac_dir/X11/$mh_xaw_dir/Box.h; then
+    mh_x11_xaw_dir="$ac_dir/X11"
+    break
+  fi
+done
+
+if test "x$mh_x11_dir" != "x" ; then
+	mh_x11_dir_no_x11=`echo $mh_x11_dir | sed 's/\/X11$//'`
+
+	if test "$mh_x11_dir_no_x11" != "$mh_x11_dir" ; then
+		MH_XINC_DIR="-I$mh_x11_dir -I$mh_x11_dir_no_x11"
+	else
+		MH_XINC_DIR="-I$mh_x11_dir"
+	fi
+else
+	{ { echo "$as_me:$LINENO: error: Cannot find required header file Intrinsic.h; PDCurses cannot be configured" >&5
+echo "$as_me: error: Cannot find required header file Intrinsic.h; PDCurses cannot be configured" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+if test "x$mh_x11_xaw_dir" != "x"; then
+	if test "$mh_x11_xaw_dir" != "$mh_x11_dir" ; then
+		MH_XINC_DIR="-I$mh_x11_xaw_dir $MH_XINC_DIR"
+	fi
+else
+	{ { echo "$as_me:$LINENO: error: Cannot find required Xaw header file Box.h; PDCurses cannot be configured" >&5
+echo "$as_me: error: Cannot find required Xaw header file Box.h; PDCurses cannot be configured" >&2;}
+   { (exit 1); exit 1; }; }
+fi
+
+
+
+
+
+
+mh_solaris_flag=no
+mh_hpux9_flag=no
+
+case "$target" in
+	*solaris*)
+		mh_solaris_flag=yes
+		;;
+	*pc-sco*)
+		extra_x_libs="Xext"
+		;;
+	sparc*sunos*)
+		extra_x_libs="Xext"
+		if test "$ac_cv_prog_CC" = "gcc" ; then
+			extra_ld_flags="-Wl,-Bstatic"
+			extra_ld_flags2="-Wl,-Bdynamic"
+		else
+			extra_ld_flags="-Bstatic"
+			extra_ld_flags2="-Bdynamic"
+		fi
+		;;
+	*hpux9*)
+		mh_hpux9_flag=yes
+		;;
+esac
+
+if test "$with_xaw3d" = yes; then
+	MH_X11_LIBS="Xaw3d Xmu Xt X11"
+else
+	if test "$with_nextaw" = yes; then
+		MH_X11_LIBS="neXtaw Xmu Xt X11"
+	else
+		MH_X11_LIBS="Xaw Xmu Xt X11"
+	fi
+fi
+MH_X11R6_LIBS="SM ICE Xext"
+mh_x11r6=no
+
+mh_lib_dirs="$x_libraries `echo "$ac_x_includes $ac_x_header_dirs" | sed s/include/lib/g`"
+
+for ac_dir in $mh_lib_dirs ; do
+	for mh_xsm in libSM.a libSM.so libSM.sl libSM.dylib; do
+	  if test -r $ac_dir/$mh_xsm; then
+	    mh_x11r6=yes
+	    break 2
+	  fi
+	done
+done
+
+if test "$mh_x11r6" = yes ; then
+	mh_libs="$MH_X11_LIBS $MH_X11R6_LIBS"
+else
+	mh_libs="$MH_X11_LIBS $extra_x_libs"
+fi
+
+
+
+mh_prev_dir=""
+mh_where_found=""
+mh_where_found_dirs=""
+mh_solaris_path=""
+for mh_lib in $mh_libs; do
+  mh_lib_found=no
+  for ac_dir in $mh_lib_dirs ; do
+    for mh_ext in a so sl dll.a dylib; do
+      if test -r $ac_dir/lib$mh_lib.$mh_ext; then
+        if test "x$mh_prev_dir" != "x$ac_dir" ; then
+          if test "x$mh_prev_dir" = "x" ; then
+             mh_where_found="$mh_where_found found in $ac_dir"
+          else
+             mh_where_found="$mh_where_found and in $ac_dir"
+          fi
+          mh_prev_dir=$ac_dir
+          mh_where_found_dirs="$mh_where_found_dirs $ac_dir"
+          MH_XLIBS="$MH_XLIBS -L$ac_dir"
+          mh_solaris_path="${mh_solaris_path}:$ac_dir"
+        fi
+        MH_XLIBS="$MH_XLIBS -l$mh_lib"
+        mh_lib_found=yes
+        break 2
+      fi
+    done
+  done
+  if test "$mh_lib_found" = no; then
+    { { echo "$as_me:$LINENO: error: Cannot find required X library; lib$mh_lib. PDCurses cannot be configured" >&5
+echo "$as_me: error: Cannot find required X library; lib$mh_lib. PDCurses cannot be configured" >&2;}
+   { (exit 1); exit 1; }; }
+  fi
+done
+
+mh_solaris_path=`echo $mh_solaris_path | sed 's/^://'`
+if test "$mh_solaris_flag" = yes ; then
+	MH_XLIBS="-R$mh_solaris_path $extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2"
+else
+	MH_XLIBS="$extra_ld_flags $MH_XLIBS $extra_libs $extra_ld_flags2"
+fi
+if test "$mh_hpux9_flag" = yes ; then
+  grep -q XtSetLanguageProc $mh_x11_dir/Intrinsic.h
+  if test $? -eq 0 ; then
+    mh_found_xtshellstrings=no
+    for mh_acdir in $mh_where_found_dirs ; do
+      for mh_xaw in `ls $mh_acdir/libXaw.*` ; do
+        nm $mh_xaw | grep XtShellStrings | grep -qv extern
+        if test $? -eq 0 ; then
+          mh_found_xtshellstrings=yes
+        fi
+      done
+    done
+    if test "$mh_found_xtshellstrings" = no ; then
+      { echo "$as_me:$LINENO: WARNING: The X11 development environment has not been installed correctly." >&5
+echo "$as_me: WARNING: The X11 development environment has not been installed correctly." >&2;}
+      { echo "$as_me:$LINENO: WARNING: The header file; Intrinsic.h" >&5
+echo "$as_me: WARNING: The header file; Intrinsic.h" >&2;}
+      { echo "$as_me:$LINENO: WARNING: Set library; libXaw is for X11R4.  This is a common problem with" >&5
+echo "$as_me: WARNING: Set library; libXaw is for X11R4.  This is a common problem with" >&2;}
+      { echo "$as_me:$LINENO: WARNING: HP-UX 9.x." >&5
+echo "$as_me: WARNING: HP-UX 9.x." >&2;}
+      { { echo "$as_me:$LINENO: error: X11 installation incomplete; cannot continue" >&5
+echo "$as_me: error: X11 installation incomplete; cannot continue" >&2;}
+   { (exit 1); exit 1; }; }
+    fi
+  fi
+fi
+
+
+
+
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $MH_XINC_DIR"
+for mh_header in DECkeysym.h Sunkeysym.h xpm.h; do
+
+for ac_header in $mh_header
+do
+as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  { echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+else
+  # Is the header compilable?
+{ echo "$as_me:$LINENO: checking $ac_header usability" >&5
+echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+$ac_includes_default
+#include <$ac_header>
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  ac_header_compiler=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	ac_header_compiler=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_compiler" >&5
+echo "${ECHO_T}$ac_header_compiler" >&6; }
+
+# Is the header present?
+{ echo "$as_me:$LINENO: checking $ac_header presence" >&5
+echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <$ac_header>
+_ACEOF
+if { (ac_try="$ac_cpp conftest.$ac_ext"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_cpp conftest.$ac_ext") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } >/dev/null && {
+	 test -z "$ac_c_preproc_warn_flag$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       }; then
+  ac_header_preproc=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+  ac_header_preproc=no
+fi
+
+rm -f conftest.err conftest.$ac_ext
+{ echo "$as_me:$LINENO: result: $ac_header_preproc" >&5
+echo "${ECHO_T}$ac_header_preproc" >&6; }
+
+# So?  What about this header?
+case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in
+  yes:no: )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5
+echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;}
+    ac_header_preproc=yes
+    ;;
+  no:yes:* )
+    { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5
+echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     check for missing prerequisite headers?" >&5
+echo "$as_me: WARNING: $ac_header:     check for missing prerequisite headers?" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5
+echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&5
+echo "$as_me: WARNING: $ac_header:     section \"Present But Cannot Be Compiled\"" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5
+echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;}
+    { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5
+echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;}
+    ( cat <<\_ASBOX
+## ------------------------------------ ##
+## Report this to wmcbrine@users.sf.net ##
+## ------------------------------------ ##
+_ASBOX
+     ) | sed "s/^/$as_me: WARNING:     /" >&2
+    ;;
+esac
+{ echo "$as_me:$LINENO: checking for $ac_header" >&5
+echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6; }
+if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
+  echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+  eval "$as_ac_Header=\$ac_header_preproc"
+fi
+ac_res=`eval echo '${'$as_ac_Header'}'`
+	       { echo "$as_me:$LINENO: result: $ac_res" >&5
+echo "${ECHO_T}$ac_res" >&6; }
+
+fi
+if test `eval echo '${'$as_ac_Header'}'` = yes; then
+  cat >>confdefs.h <<_ACEOF
+#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1
+_ACEOF
+
+fi
+
+done
+
+done
+CPPFLAGS="$save_CPPFLAGS"
+
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $MH_XINC_DIR"
+for mh_keydef in XK_KP_Delete XK_KP_Insert XK_KP_End XK_KP_Down XK_KP_Next \
+	XK_KP_Left XK_KP_Right XK_KP_Home XK_KP_Up XK_KP_Prior XK_KP_Begin; do
+	{ echo "$as_me:$LINENO: checking for $mh_keydef in keysym.h" >&5
+echo $ECHO_N "checking for $mh_keydef in keysym.h... $ECHO_C" >&6; }
+	mh_upper_name="HAVE_`echo $mh_keydef | tr 'a-z' 'A-Z'`"
+	cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include <keysym.h>
+int
+main ()
+{
+int i = $mh_keydef;
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  mh_have_key=yes; cat >>confdefs.h <<_ACEOF
+#define $mh_upper_name 1
+_ACEOF
+
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	mh_have_key=no
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+	{ echo "$as_me:$LINENO: result: $mh_have_key" >&5
+echo "${ECHO_T}$mh_have_key" >&6; }
+done
+CPPFLAGS="$save_CPPFLAGS"
+
+
+save_CPPFLAGS="$CPPFLAGS"
+CPPFLAGS="$CPPFLAGS $SYS_DEFS $MH_XINC_DIR"
+for td in XPointer ; do
+{ echo "$as_me:$LINENO: checking if $td is typedefed:" >&5
+echo $ECHO_N "checking if $td is typedefed:... $ECHO_C" >&6; }
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h.  */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h.  */
+#include "X11/Xlib.h"
+int
+main ()
+{
+$td fred
+  ;
+  return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext
+if { (ac_try="$ac_compile"
+case "(($ac_try" in
+  *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
+  *) ac_try_echo=$ac_try;;
+esac
+eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
+  (eval "$ac_compile") 2>conftest.er1
+  ac_status=$?
+  grep -v '^ *+' conftest.er1 >conftest.err
+  rm -f conftest.er1
+  cat conftest.err >&5
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && {
+	 test -z "$ac_c_werror_flag" ||
+	 test ! -s conftest.err
+       } && test -s conftest.$ac_objext; then
+  mh_td=yes
+else
+  echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+	mh_td=no
+
+fi
+
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+if test "$mh_td" = yes ; then
+	TD_upper=`echo $td | tr a-z A-Z`
+	cat >>confdefs.h <<_ACEOF
+#define ${TD_upper}_TYPEDEFED 1
+_ACEOF
+
+fi
+{ echo "$as_me:$LINENO: result: $mh_td" >&5
+echo "${ECHO_T}$mh_td" >&6; }
+done
+CPPFLAGS="$save_CPPFLAGS"
+
+if test $ac_cv_header_xpm_h = yes; then
+	MH_XLIBS="$MH_XLIBS -lXpm"
+fi
+# Check whether --enable-debug was given.
+if test "${enable_debug+set}" = set; then
+  enableval=$enable_debug; with_debug=$enableval
+else
+  with_debug=no
+fi
+
+cflags_g="`echo $CFLAGS | grep -c '\-g'`"
+cflags_O="`echo $CFLAGS | grep -c '\-O'`"
+
+if test "$with_debug" = yes; then
+	if test "$cflags_g" = "0"; then
+		CFLAGS="${CFLAGS} -g"
+	fi
+	if test "$cflags_O" != "0"; then
+		CFLAGS="`echo ${CFLAGS} | sed -e s/-O.//`"
+	fi
+	CFLAGS="${CFLAGS} -DPDCDEBUG"
+else
+	if test "$cflags_O" = "0"; then
+		CFLAGS="${CFLAGS} -O"
+	fi
+	if test "$cflags_g" != "0"; then
+		CFLAGS="`echo ${CFLAGS} | sed -e s/-g//`"
+	fi
+fi
+if test "$ac_cv_prog_CC" = "gcc"; then
+	if test "$with_debug" = yes; then
+		CFLAGS="${CFLAGS} -Wall"
+	else
+		CFLAGS="-O2 -Wall -fomit-frame-pointer"
+	fi
+fi
+if test "$on_qnx" = yes; then
+	if test "$with_debug" = yes; then
+		CFLAGS="-g"
+	else
+		CFLAGS="-Otax"
+	fi
+fi
+
+# Check whether --enable-widec was given.
+if test "${enable_widec+set}" = set; then
+  enableval=$enable_widec; with_widec=$enableval
+else
+  with_widec=no
+fi
+
+if test "$with_widec" = yes; then
+	SYS_DEFS="$SYS_DEFS -DPDC_WIDE"
+fi
+
+# Check whether --enable-xim was given.
+if test "${enable_xim+set}" = set; then
+  enableval=$enable_xim; with_xim=$enableval
+else
+  with_xim=no
+fi
+
+if test "$with_xim" = yes; then
+	SYS_DEFS="$SYS_DEFS -DPDC_XIM"
+fi
+
+# Check whether --enable-force-utf8 was given.
+if test "${enable_force_utf8+set}" = set; then
+  enableval=$enable_force_utf8; force_utf8=$enableval
+else
+  force_utf8=no
+fi
+
+if test "$force_utf8" = yes; then
+	SYS_DEFS="$SYS_DEFS -DPDC_FORCE_UTF8"
+fi
+
+# Check whether --enable-purify was given.
+if test "${enable_purify+set}" = set; then
+  enableval=$enable_purify; with_purify=$enableval
+else
+  with_purify=no
+fi
+
+if test "$with_purify" = yes; then
+	PURIFY="purify"
+else
+	PURIFY=""
+fi
+
+
+
+# Check whether --with-xaw3d was given.
+if test "${with_xaw3d+set}" = set; then
+  withval=$with_xaw3d; with_xaw3d=$withval
+else
+  with_xaw3d=no
+fi
+
+if test "$with_xaw3d" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_XAW3D 1
+_ACEOF
+
+fi
+
+
+# Check whether --with-nextaw was given.
+if test "${with_nextaw+set}" = set; then
+  withval=$with_nextaw; with_nextaw=$withval
+else
+  with_nextaw=no
+fi
+
+if test "$with_nextaw" = yes; then
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_NEXTAW 1
+_ACEOF
+
+fi
+
+
+{ echo "$as_me:$LINENO: checking shared library extension" >&5
+echo $ECHO_N "checking shared library extension... $ECHO_C" >&6; }
+SHLPST=".so"
+
+case "$target" in
+        *hp-hpux*)
+                SHLPST=".sl"
+                ;;
+        *ibm-aix*)
+                SHLPST=".a"
+                ;;
+        *qnx*)
+                SHLPST=""
+                ;;
+        *cygwin*)
+                SHLPST=".dll"
+                ;;
+        *darwin*)
+                SHLPST=".dylib"
+                ;;
+esac
+
+{ echo "$as_me:$LINENO: result: $SHLPST" >&5
+echo "${ECHO_T}$SHLPST" >&6; }
+
+
+
+AIX_DYN="no"
+BEOS_DYN="no"
+SHLFILE="XCurses"
+SHLFILES="XCurses"
+RXPACKEXPORTS=""
+SHLPRE="lib"
+LD_RXLIB1=""
+
+
+case "$target" in
+	*hp-hpux*)
+		SYS_DEFS="-D_HPUX_SOURCE"
+		LD_RXLIB1="ld -b -q -n"
+		;;
+	*ibm-aix*)
+		SYS_DEFS="-D_ALL_SOURCE -DAIX"
+		AIX_DYN="yes"
+		DYN_COMP="-DDYNAMIC"
+		LD_RXLIB1="ld -bnoentry -bM:SRE"
+		RXPACKEXPORTS="-bE:$SHLFILE.exp"
+		RXPACKEXP="$SHLFILE.exp"
+		;;
+	*dec-osf*)
+		if test "$ac_cv_prog_CC" = "gcc"; then
+			SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE"
+		else
+			SYS_DEFS="-D_POSIX_SOURCE -D_XOPEN_SOURCE -Olimit 800"
+		fi
+		LD_RXLIB1="ld -shared"
+		;;
+	*sequent-dynix*|*esix*|*dgux*)
+		LD_RXLIB1="ld -G"
+		;;
+	*solaris*)
+		if test "$ac_cv_prog_CC" = "gcc"; then
+			LD_RXLIB1="gcc -shared"
+		else
+			LD_RXLIB1="ld -G"
+		fi
+		;;
+	sparc*sunos*)
+		SYS_DEFS="-DSUNOS -DSUNOS_STRTOD_BUG"
+		LD_RXLIB1="ld"
+		;;
+	*linux*|*atheos*|*nto-qnx*)
+		LD_RXLIB1="${CC} -shared"
+		;;
+	*freebsd*)
+		LD_RXLIB1="ld -Bdynamic -Bshareable"
+		;;
+	*pc-sco*)
+		LD_RXLIB1="ld -dy -G"
+		;;
+	*beos*)
+		LD_RXLIB1="${CC} -Wl,-shared -nostart -Xlinker -soname=\$(@)"
+		BEOS_DYN="yes"
+		;;
+	*qnx*)
+		SHLPRE=""
+		DYN_COMP="-Q"   # force no check for dynamic loading
+		SHLFILE=""
+		;;
+	*cygwin)
+		SHLPRE=""
+		DYN_COMP="-DDYNAMIC"
+		LD_RXLIB1="dllwrap --def \$(srcdir)/../win32/pdcurses.def --target i386-cygwin32 --dllname \$(@)"
+# cygwininstall target MUST install the shared library itself because
+# it puts it into $(bindir) not $(libdir) as all other platforms
+		;;
+	*darwin*)
+		DYN_COMP="-fno-common"
+		LD_RXLIB1="${CC} -flat_namespace -undefined suppress -dynamiclib -install_name=\$(@)"
+		;;
+	*)
+		;;
+esac
+
+
+if test "$DYN_COMP" = ""; then
+{ echo "$as_me:$LINENO: checking compiler flags for a dynamic object" >&5
+echo $ECHO_N "checking compiler flags for a dynamic object... $ECHO_C" >&6; }
+
+cat > conftest.$ac_ext <<EOF
+#line 5368 "configure"
+int a=0
+EOF
+
+	DYN_COMP=""
+	mh_cv_stop=no
+	save_cflags="$CFLAGS"
+	mh_cv_flags="-fPIC -KPIC +Z"
+	for a in $mh_cv_flags; do
+		CFLAGS="-c $a"
+
+		mh_compile='${CC-cc} -c $CFLAGS conftest.$ac_ext > conftest.tmp 2>&1'
+		if { (eval echo "$as_me:$LINENO: \"$mh_compile\"") >&5
+  (eval $mh_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); }; then
+			DYN_COMP=""
+		else
+			slash="\\"
+			mh_dyncomp="`egrep -c $slash$a conftest.tmp`"
+			if test "$mh_dyncomp" = "0"; then
+				DYN_COMP="$a -DDYNAMIC"
+				{ echo "$as_me:$LINENO: result: $a" >&5
+echo "${ECHO_T}$a" >&6; }
+				break
+			else
+				DYN_COMP=""
+			fi
+		fi
+	done
+	if test "$DYN_COMP" = ""; then
+		{ echo "$as_me:$LINENO: result: none of $mh_cv_flags supported" >&5
+echo "${ECHO_T}none of $mh_cv_flags supported" >&6; }
+	fi
+	if test "$LD_RXLIB1" = ""; then
+
+mh_compile='${CC-cc} -c $DYN_COMP conftest.$ac_ext 1>&5'
+cat > conftest.$ac_ext <<EOF
+#line 5407 "configure"
+int foo()
+{
+return(0);
+}
+EOF
+if { (eval echo "$as_me:$LINENO: \"$mh_compile\"") >&5
+  (eval $mh_compile) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest.o; then
+	mh_dyn_link='ld -shared -o conftest.rxlib conftest.o -lc 1>&5'
+#	mh_dyn_link='${CC} -Wl,-shared -o conftest.rxlib conftest.o -lc 1>&AC_FD_CC'
+	if { (eval echo "$as_me:$LINENO: \"$mh_dyn_link\"") >&5
+  (eval $mh_dyn_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest.rxlib; then
+		LD_RXLIB1="ld -shared"
+#		LD_RXLIB1="${CC} -Wl,-shared"
+		SHLPRE="lib"
+		SHLPST=".so"
+	else
+		mh_dyn_link='ld -G -o conftest.rxlib conftest.o 1>&5'
+#		mh_dyn_link='${CC} -Wl,-G -o conftest.rxlib conftest.o 1>&AC_FD_CC'
+		if { (eval echo "$as_me:$LINENO: \"$mh_dyn_link\"") >&5
+  (eval $mh_dyn_link) 2>&5
+  ac_status=$?
+  echo "$as_me:$LINENO: \$? = $ac_status" >&5
+  (exit $ac_status); } && test -s conftest.rxlib; then
+			LD_RXLIB1="ld -G"
+#			LD_RXLIB1="${CC} -Wl,-G"
+			SHLPRE="lib"
+			SHLPST=".so"
+		else
+			LD_RXLIB1=""
+			SHLPRE=""
+			SHLPST=""
+		fi
+	fi
+fi
+rm -f conftest*
+
+	fi
+	CFLAGS=$save_cflags
+	rm -f conftest.*
+fi
+
+
+SHL_TARGETS=""
+
+if test "$AIX_DYN" = "yes"; then
+	aix_exports="config.exports.aix"
+	echo "" > $aix_exports
+fi
+
+if test "$ac_cv_header_dl_h" = "yes" -o "$ac_cv_header_dlfcn_h" = "yes" -o "$AIX_DYN" = "yes" -o "$BEOS_DYN" = "yes" -o "$DLFCNINCDIR" != "" -o "$DLFCNLIBDIR" != ""; then
+	EXPS="1,2,3,4,5,6,7,8,9"
+	for a in $SHLFILES
+	do
+		SHL_TARGETS="${SHL_TARGETS} ${SHLPRE}${a}${SHLPST}"
+		this=`echo $EXPS | cut -d, -f1`
+		EXPS=`echo $EXPS | cut -d, -f2-`
+		if test "$AIX_DYN" = "yes"; then
+			echo "RXPACKEXP$this=$a.exp" >> $aix_exports
+			echo "RXPACKEXPORTS$this=-bE:$a.exp" >> $aix_exports
+		fi
+	done
+fi
+
+
+
+
+
+
+
+
+
+
+
+
+
+ac_config_files="$ac_config_files Makefile x11/$mymakefile x11/xcurses-config"
+
+cat >confcache <<\_ACEOF
+# This file is a shell script that caches the results of configure
+# tests run on this system so they can be shared between configure
+# scripts and configure runs, see configure's option --config-cache.
+# It is not useful on other systems.  If it contains results you don't
+# want to keep, you may remove or edit it.
+#
+# config.status only pays attention to the cache file if you give it
+# the --recheck option to rerun configure.
+#
+# `ac_cv_env_foo' variables (set or unset) will be overridden when
+# loading this file, other *unset* `ac_cv_foo' will be assigned the
+# following values.
+
+_ACEOF
+
+# The following way of writing the cache mishandles newlines in values,
+# but we know of no workaround that is simple, portable, and efficient.
+# So, we kill variables containing newlines.
+# Ultrix sh set writes to stderr and can't be redirected directly,
+# and sets the high bit in the cache file unless we assign to the vars.
+(
+  for ac_var in `(set) 2>&1 | sed -n 's/^\([a-zA-Z_][a-zA-Z0-9_]*\)=.*/\1/p'`; do
+    eval ac_val=\$$ac_var
+    case $ac_val in #(
+    *${as_nl}*)
+      case $ac_var in #(
+      *_cv_*) { echo "$as_me:$LINENO: WARNING: Cache variable $ac_var contains a newline." >&5
+echo "$as_me: WARNING: Cache variable $ac_var contains a newline." >&2;} ;;
+      esac
+      case $ac_var in #(
+      _ | IFS | as_nl) ;; #(
+      *) $as_unset $ac_var ;;
+      esac ;;
+    esac
+  done
+
+  (set) 2>&1 |
+    case $as_nl`(ac_space=' '; set) 2>&1` in #(
+    *${as_nl}ac_space=\ *)
+      # `set' does not quote correctly, so add quotes (double-quote
+      # substitution turns \\\\ into \\, and sed turns \\ into \).
+      sed -n \
+	"s/'/'\\\\''/g;
+	  s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p"
+      ;; #(
+    *)
+      # `set' quotes correctly as required by POSIX, so do not add quotes.
+      sed -n "/^[_$as_cr_alnum]*_cv_[_$as_cr_alnum]*=/p"
+      ;;
+    esac |
+    sort
+) |
+  sed '
+     /^ac_cv_env_/b end
+     t clear
+     :clear
+     s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/
+     t end
+     s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/
+     :end' >>confcache
+if diff "$cache_file" confcache >/dev/null 2>&1; then :; else
+  if test -w "$cache_file"; then
+    test "x$cache_file" != "x/dev/null" &&
+      { echo "$as_me:$LINENO: updating cache $cache_file" >&5
+echo "$as_me: updating cache $cache_file" >&6;}
+    cat confcache >$cache_file
+  else
+    { echo "$as_me:$LINENO: not updating unwritable cache $cache_file" >&5
+echo "$as_me: not updating unwritable cache $cache_file" >&6;}
+  fi
+fi
+rm -f confcache
+
+test "x$prefix" = xNONE && prefix=$ac_default_prefix
+# Let make expand exec_prefix.
+test "x$exec_prefix" = xNONE && exec_prefix='${prefix}'
+
+DEFS=-DHAVE_CONFIG_H
+
+ac_libobjs=
+ac_ltlibobjs=
+for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue
+  # 1. Remove the extension, and $U if already installed.
+  ac_script='s/\$U\././;s/\.o$//;s/\.obj$//'
+  ac_i=`echo "$ac_i" | sed "$ac_script"`
+  # 2. Prepend LIBOBJDIR.  When used with automake>=1.10 LIBOBJDIR
+  #    will be set to the directory where LIBOBJS objects are built.
+  ac_libobjs="$ac_libobjs \${LIBOBJDIR}$ac_i\$U.$ac_objext"
+  ac_ltlibobjs="$ac_ltlibobjs \${LIBOBJDIR}$ac_i"'$U.lo'
+done
+LIBOBJS=$ac_libobjs
+
+LTLIBOBJS=$ac_ltlibobjs
+
+
+
+: ${CONFIG_STATUS=./config.status}
+ac_clean_files_save=$ac_clean_files
+ac_clean_files="$ac_clean_files $CONFIG_STATUS"
+{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5
+echo "$as_me: creating $CONFIG_STATUS" >&6;}
+cat >$CONFIG_STATUS <<_ACEOF
+#! $SHELL
+# Generated by $as_me.
+# Run this file to recreate the current configuration.
+# Compiler output produced by configure, useful for debugging
+# configure, is in config.log if it exists.
+
+debug=false
+ac_cs_recheck=false
+ac_cs_silent=false
+SHELL=\${CONFIG_SHELL-$SHELL}
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+## --------------------- ##
+## M4sh Initialization.  ##
+## --------------------- ##
+
+# Be more Bourne compatible
+DUALCASE=1; export DUALCASE # for MKS sh
+if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then
+  emulate sh
+  NULLCMD=:
+  # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which
+  # is contrary to our usage.  Disable this feature.
+  alias -g '${1+"$@"}'='"$@"'
+  setopt NO_GLOB_SUBST
+else
+  case `(set -o) 2>/dev/null` in
+  *posix*) set -o posix ;;
+esac
+
+fi
+
+
+
+
+# PATH needs CR
+# Avoid depending upon Character Ranges.
+as_cr_letters='abcdefghijklmnopqrstuvwxyz'
+as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ'
+as_cr_Letters=$as_cr_letters$as_cr_LETTERS
+as_cr_digits='0123456789'
+as_cr_alnum=$as_cr_Letters$as_cr_digits
+
+# The user is always right.
+if test "${PATH_SEPARATOR+set}" != set; then
+  echo "#! /bin/sh" >conf$$.sh
+  echo  "exit 0"   >>conf$$.sh
+  chmod +x conf$$.sh
+  if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then
+    PATH_SEPARATOR=';'
+  else
+    PATH_SEPARATOR=:
+  fi
+  rm -f conf$$.sh
+fi
+
+# Support unset when possible.
+if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then
+  as_unset=unset
+else
+  as_unset=false
+fi
+
+
+# IFS
+# We need space, tab and new line, in precisely that order.  Quoting is
+# there to prevent editors from complaining about space-tab.
+# (If _AS_PATH_WALK were called with IFS unset, it would disable word
+# splitting by setting IFS to empty value.)
+as_nl='
+'
+IFS=" ""	$as_nl"
+
+# Find who we are.  Look in the path if we contain no directory separator.
+case $0 in
+  *[\\/]* ) as_myself=$0 ;;
+  *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+  test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break
+done
+IFS=$as_save_IFS
+
+     ;;
+esac
+# We did not find ourselves, most probably we were run as `sh COMMAND'
+# in which case we are not to be found in the path.
+if test "x$as_myself" = x; then
+  as_myself=$0
+fi
+if test ! -f "$as_myself"; then
+  echo "$as_myself: error: cannot find myself; rerun with an absolute file name" >&2
+  { (exit 1); exit 1; }
+fi
+
+# Work around bugs in pre-3.0 UWIN ksh.
+for as_var in ENV MAIL MAILPATH
+do ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+done
+PS1='$ '
+PS2='> '
+PS4='+ '
+
+# NLS nuisances.
+for as_var in \
+  LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \
+  LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \
+  LC_TELEPHONE LC_TIME
+do
+  if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then
+    eval $as_var=C; export $as_var
+  else
+    ($as_unset $as_var) >/dev/null 2>&1 && $as_unset $as_var
+  fi
+done
+
+# Required to use basename.
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+if (basename -- /) >/dev/null 2>&1 && test "X`basename -- / 2>&1`" = "X/"; then
+  as_basename=basename
+else
+  as_basename=false
+fi
+
+
+# Name of the executable.
+as_me=`$as_basename -- "$0" ||
+$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \
+	 X"$0" : 'X\(//\)$' \| \
+	 X"$0" : 'X\(/\)' \| . 2>/dev/null ||
+echo X/"$0" |
+    sed '/^.*\/\([^/][^/]*\)\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\/\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+
+# CDPATH.
+$as_unset CDPATH
+
+
+
+  as_lineno_1=$LINENO
+  as_lineno_2=$LINENO
+  test "x$as_lineno_1" != "x$as_lineno_2" &&
+  test "x`expr $as_lineno_1 + 1`" = "x$as_lineno_2" || {
+
+  # Create $as_me.lineno as a copy of $as_myself, but with $LINENO
+  # uniformly replaced by the line number.  The first 'sed' inserts a
+  # line-number line after each line using $LINENO; the second 'sed'
+  # does the real work.  The second script uses 'N' to pair each
+  # line-number line with the line containing $LINENO, and appends
+  # trailing '-' during substitution so that $LINENO is not a special
+  # case at line end.
+  # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the
+  # scripts with optimization help from Paolo Bonzini.  Blame Lee
+  # E. McMahon (1931-1989) for sed's syntax.  :-)
+  sed -n '
+    p
+    /[$]LINENO/=
+  ' <$as_myself |
+    sed '
+      s/[$]LINENO.*/&-/
+      t lineno
+      b
+      :lineno
+      N
+      :loop
+      s/[$]LINENO\([^'$as_cr_alnum'_].*\n\)\(.*\)/\2\1\2/
+      t loop
+      s/-\n.*//
+    ' >$as_me.lineno &&
+  chmod +x "$as_me.lineno" ||
+    { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2
+   { (exit 1); exit 1; }; }
+
+  # Don't try to exec as it changes $[0], causing all sort of problems
+  # (the dirname of $[0] is not the place where we might find the
+  # original and so on.  Autoconf is especially sensitive to this).
+  . "./$as_me.lineno"
+  # Exit status is that of the last command.
+  exit
+}
+
+
+if (as_dir=`dirname -- /` && test "X$as_dir" = X/) >/dev/null 2>&1; then
+  as_dirname=dirname
+else
+  as_dirname=false
+fi
+
+ECHO_C= ECHO_N= ECHO_T=
+case `echo -n x` in
+-n*)
+  case `echo 'x\c'` in
+  *c*) ECHO_T='	';;	# ECHO_T is single tab character.
+  *)   ECHO_C='\c';;
+  esac;;
+*)
+  ECHO_N='-n';;
+esac
+
+if expr a : '\(a\)' >/dev/null 2>&1 &&
+   test "X`expr 00001 : '.*\(...\)'`" = X001; then
+  as_expr=expr
+else
+  as_expr=false
+fi
+
+rm -f conf$$ conf$$.exe conf$$.file
+if test -d conf$$.dir; then
+  rm -f conf$$.dir/conf$$.file
+else
+  rm -f conf$$.dir
+  mkdir conf$$.dir
+fi
+echo >conf$$.file
+if ln -s conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s='ln -s'
+  # ... but there are two gotchas:
+  # 1) On MSYS, both `ln -s file dir' and `ln file dir' fail.
+  # 2) DJGPP < 2.04 has no symlinks; `ln -s' creates a wrapper executable.
+  # In both cases, we have to default to `cp -p'.
+  ln -s conf$$.file conf$$.dir 2>/dev/null && test ! -f conf$$.exe ||
+    as_ln_s='cp -p'
+elif ln conf$$.file conf$$ 2>/dev/null; then
+  as_ln_s=ln
+else
+  as_ln_s='cp -p'
+fi
+rm -f conf$$ conf$$.exe conf$$.dir/conf$$.file conf$$.file
+rmdir conf$$.dir 2>/dev/null
+
+if mkdir -p . 2>/dev/null; then
+  as_mkdir_p=:
+else
+  test -d ./-p && rmdir ./-p
+  as_mkdir_p=false
+fi
+
+if test -x / >/dev/null 2>&1; then
+  as_test_x='test -x'
+else
+  if ls -dL / >/dev/null 2>&1; then
+    as_ls_L_option=L
+  else
+    as_ls_L_option=
+  fi
+  as_test_x='
+    eval sh -c '\''
+      if test -d "$1"; then
+        test -d "$1/.";
+      else
+	case $1 in
+        -*)set "./$1";;
+	esac;
+	case `ls -ld'$as_ls_L_option' "$1" 2>/dev/null` in
+	???[sx]*):;;*)false;;esac;fi
+    '\'' sh
+  '
+fi
+as_executable_p=$as_test_x
+
+# Sed expression to map a string onto a valid CPP name.
+as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'"
+
+# Sed expression to map a string onto a valid variable name.
+as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'"
+
+
+exec 6>&1
+
+# Save the log message, to keep $[0] and so on meaningful, and to
+# report actual input values of CONFIG_FILES etc. instead of their
+# values after options handling.
+ac_log="
+This file was extended by PDCurses $as_me 3.4, which was
+generated by GNU Autoconf 2.61.  Invocation command line was
+
+  CONFIG_FILES    = $CONFIG_FILES
+  CONFIG_HEADERS  = $CONFIG_HEADERS
+  CONFIG_LINKS    = $CONFIG_LINKS
+  CONFIG_COMMANDS = $CONFIG_COMMANDS
+  $ $0 $@
+
+on `(hostname || uname -n) 2>/dev/null | sed 1q`
+"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<_ACEOF
+# Files that config.status was made for.
+config_files="$ac_config_files"
+config_headers="$ac_config_headers"
+
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+ac_cs_usage="\
+\`$as_me' instantiates files from templates according to the
+current configuration.
+
+Usage: $0 [OPTIONS] [FILE]...
+
+  -h, --help       print this help, then exit
+  -V, --version    print version number and configuration settings, then exit
+  -q, --quiet      do not print progress messages
+  -d, --debug      don't remove temporary files
+      --recheck    update $as_me by reconfiguring in the same conditions
+  --file=FILE[:TEMPLATE]
+		   instantiate the configuration file FILE
+  --header=FILE[:TEMPLATE]
+		   instantiate the configuration header FILE
+
+Configuration files:
+$config_files
+
+Configuration headers:
+$config_headers
+
+Report bugs to <bug-autoconf@gnu.org>."
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+ac_cs_version="\\
+PDCurses config.status 3.4
+configured by $0, generated by GNU Autoconf 2.61,
+  with options \\"`echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
+
+Copyright (C) 2006 Free Software Foundation, Inc.
+This config.status script is free software; the Free Software Foundation
+gives unlimited permission to copy, distribute and modify it."
+
+ac_pwd='$ac_pwd'
+srcdir='$srcdir'
+INSTALL='$INSTALL'
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If no file are specified by the user, then we need to provide default
+# value.  By we need to know if files were specified by the user.
+ac_need_defaults=:
+while test $# != 0
+do
+  case $1 in
+  --*=*)
+    ac_option=`expr "X$1" : 'X\([^=]*\)='`
+    ac_optarg=`expr "X$1" : 'X[^=]*=\(.*\)'`
+    ac_shift=:
+    ;;
+  *)
+    ac_option=$1
+    ac_optarg=$2
+    ac_shift=shift
+    ;;
+  esac
+
+  case $ac_option in
+  # Handling of the options.
+  -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+    ac_cs_recheck=: ;;
+  --version | --versio | --versi | --vers | --ver | --ve | --v | -V )
+    echo "$ac_cs_version"; exit ;;
+  --debug | --debu | --deb | --de | --d | -d )
+    debug=: ;;
+  --file | --fil | --fi | --f )
+    $ac_shift
+    CONFIG_FILES="$CONFIG_FILES $ac_optarg"
+    ac_need_defaults=false;;
+  --header | --heade | --head | --hea )
+    $ac_shift
+    CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg"
+    ac_need_defaults=false;;
+  --he | --h)
+    # Conflict between --help and --header
+    { echo "$as_me: error: ambiguous option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; };;
+  --help | --hel | -h )
+    echo "$ac_cs_usage"; exit ;;
+  -q | -quiet | --quiet | --quie | --qui | --qu | --q \
+  | -silent | --silent | --silen | --sile | --sil | --si | --s)
+    ac_cs_silent=: ;;
+
+  # This is an error.
+  -*) { echo "$as_me: error: unrecognized option: $1
+Try \`$0 --help' for more information." >&2
+   { (exit 1); exit 1; }; } ;;
+
+  *) ac_config_targets="$ac_config_targets $1"
+     ac_need_defaults=false ;;
+
+  esac
+  shift
+done
+
+ac_configure_extra_args=
+
+if $ac_cs_silent; then
+  exec 6>/dev/null
+  ac_configure_extra_args="$ac_configure_extra_args --silent"
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+if \$ac_cs_recheck; then
+  echo "running CONFIG_SHELL=$SHELL $SHELL $0 "$ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6
+  CONFIG_SHELL=$SHELL
+  export CONFIG_SHELL
+  exec $SHELL "$0"$ac_configure_args \$ac_configure_extra_args --no-create --no-recursion
+fi
+
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+exec 5>>config.log
+{
+  echo
+  sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX
+## Running $as_me. ##
+_ASBOX
+  echo "$ac_log"
+} >&5
+
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+
+# Handling of arguments.
+for ac_config_target in $ac_config_targets
+do
+  case $ac_config_target in
+    "config.h") CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;;
+    "Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
+    "x11/$mymakefile") CONFIG_FILES="$CONFIG_FILES x11/$mymakefile" ;;
+    "x11/xcurses-config") CONFIG_FILES="$CONFIG_FILES x11/xcurses-config" ;;
+
+  *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5
+echo "$as_me: error: invalid argument: $ac_config_target" >&2;}
+   { (exit 1); exit 1; }; };;
+  esac
+done
+
+
+# If the user did not use the arguments to specify the items to instantiate,
+# then the envvar interface is used.  Set only those that are not.
+# We use the long form for the default assignment because of an extremely
+# bizarre bug on SunOS 4.1.3.
+if $ac_need_defaults; then
+  test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
+  test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
+fi
+
+# Have a temporary directory for convenience.  Make it in the build tree
+# simply because there is no reason against having it here, and in addition,
+# creating and moving files from /tmp can sometimes cause problems.
+# Hook for its removal unless debugging.
+# Note that there is a small window in which the directory will not be cleaned:
+# after its creation but before its name has been assigned to `$tmp'.
+$debug ||
+{
+  tmp=
+  trap 'exit_status=$?
+  { test -z "$tmp" || test ! -d "$tmp" || rm -fr "$tmp"; } && exit $exit_status
+' 0
+  trap '{ (exit 1); exit 1; }' 1 2 13 15
+}
+# Create a (secure) tmp directory for tmp files.
+
+{
+  tmp=`(umask 077 && mktemp -d "./confXXXXXX") 2>/dev/null` &&
+  test -n "$tmp" && test -d "$tmp"
+}  ||
+{
+  tmp=./conf$$-$RANDOM
+  (umask 077 && mkdir "$tmp")
+} ||
+{
+   echo "$me: cannot create a temporary directory in ." >&2
+   { (exit 1); exit 1; }
+}
+
+#
+# Set up the sed scripts for CONFIG_FILES section.
+#
+
+# No need to generate the scripts if there are no CONFIG_FILES.
+# This happens for instance when ./config.status config.h
+if test -n "$CONFIG_FILES"; then
+
+_ACEOF
+
+
+
+ac_delim='%!_!# '
+for ac_last_try in false false false false false :; do
+  cat >conf$$subs.sed <<_ACEOF
+SHELL!$SHELL$ac_delim
+PATH_SEPARATOR!$PATH_SEPARATOR$ac_delim
+PACKAGE_NAME!$PACKAGE_NAME$ac_delim
+PACKAGE_TARNAME!$PACKAGE_TARNAME$ac_delim
+PACKAGE_VERSION!$PACKAGE_VERSION$ac_delim
+PACKAGE_STRING!$PACKAGE_STRING$ac_delim
+PACKAGE_BUGREPORT!$PACKAGE_BUGREPORT$ac_delim
+exec_prefix!$exec_prefix$ac_delim
+prefix!$prefix$ac_delim
+program_transform_name!$program_transform_name$ac_delim
+bindir!$bindir$ac_delim
+sbindir!$sbindir$ac_delim
+libexecdir!$libexecdir$ac_delim
+datarootdir!$datarootdir$ac_delim
+datadir!$datadir$ac_delim
+sysconfdir!$sysconfdir$ac_delim
+sharedstatedir!$sharedstatedir$ac_delim
+localstatedir!$localstatedir$ac_delim
+includedir!$includedir$ac_delim
+oldincludedir!$oldincludedir$ac_delim
+docdir!$docdir$ac_delim
+infodir!$infodir$ac_delim
+htmldir!$htmldir$ac_delim
+dvidir!$dvidir$ac_delim
+pdfdir!$pdfdir$ac_delim
+psdir!$psdir$ac_delim
+libdir!$libdir$ac_delim
+localedir!$localedir$ac_delim
+mandir!$mandir$ac_delim
+DEFS!$DEFS$ac_delim
+ECHO_C!$ECHO_C$ac_delim
+ECHO_N!$ECHO_N$ac_delim
+ECHO_T!$ECHO_T$ac_delim
+LIBS!$LIBS$ac_delim
+build_alias!$build_alias$ac_delim
+host_alias!$host_alias$ac_delim
+target_alias!$target_alias$ac_delim
+CC!$CC$ac_delim
+CFLAGS!$CFLAGS$ac_delim
+LDFLAGS!$LDFLAGS$ac_delim
+CPPFLAGS!$CPPFLAGS$ac_delim
+ac_ct_CC!$ac_ct_CC$ac_delim
+EXEEXT!$EXEEXT$ac_delim
+OBJEXT!$OBJEXT$ac_delim
+build!$build$ac_delim
+build_cpu!$build_cpu$ac_delim
+build_vendor!$build_vendor$ac_delim
+build_os!$build_os$ac_delim
+host!$host$ac_delim
+host_cpu!$host_cpu$ac_delim
+host_vendor!$host_vendor$ac_delim
+host_os!$host_os$ac_delim
+target!$target$ac_delim
+target_cpu!$target_cpu$ac_delim
+target_vendor!$target_vendor$ac_delim
+target_os!$target_os$ac_delim
+SYS_DEFS!$SYS_DEFS$ac_delim
+RANLIB!$RANLIB$ac_delim
+INSTALL_PROGRAM!$INSTALL_PROGRAM$ac_delim
+INSTALL_SCRIPT!$INSTALL_SCRIPT$ac_delim
+INSTALL_DATA!$INSTALL_DATA$ac_delim
+SET_MAKE!$SET_MAKE$ac_delim
+CPP!$CPP$ac_delim
+GREP!$GREP$ac_delim
+EGREP!$EGREP$ac_delim
+MH_EXTRA_LIBS!$MH_EXTRA_LIBS$ac_delim
+XMKMF!$XMKMF$ac_delim
+MH_XINC_DIR!$MH_XINC_DIR$ac_delim
+MH_XLIBS!$MH_XLIBS$ac_delim
+PURIFY!$PURIFY$ac_delim
+SHLPST!$SHLPST$ac_delim
+DYN_COMP!$DYN_COMP$ac_delim
+LD_RXLIB1!$LD_RXLIB1$ac_delim
+SHLPRE!$SHLPRE$ac_delim
+SHL_TARGETS!$SHL_TARGETS$ac_delim
+O2SAVE!$O2SAVE$ac_delim
+CC2O!$CC2O$ac_delim
+SAVE2O!$SAVE2O$ac_delim
+RXPACKEXPORTS!$RXPACKEXPORTS$ac_delim
+LIBOBJS!$LIBOBJS$ac_delim
+LTLIBOBJS!$LTLIBOBJS$ac_delim
+_ACEOF
+
+  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 81; then
+    break
+  elif $ac_last_try; then
+    { { echo "$as_me:$LINENO: error: could not make $CONFIG_STATUS" >&5
+echo "$as_me: error: could not make $CONFIG_STATUS" >&2;}
+   { (exit 1); exit 1; }; }
+  else
+    ac_delim="$ac_delim!$ac_delim _$ac_delim!! "
+  fi
+done
+
+ac_eof=`sed -n '/^CEOF[0-9]*$/s/CEOF/0/p' conf$$subs.sed`
+if test -n "$ac_eof"; then
+  ac_eof=`echo "$ac_eof" | sort -nru | sed 1q`
+  ac_eof=`expr $ac_eof + 1`
+fi
+
+cat >>$CONFIG_STATUS <<_ACEOF
+cat >"\$tmp/subs-1.sed" <<\CEOF$ac_eof
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b end
+_ACEOF
+sed '
+s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g
+s/^/s,@/; s/!/@,|#_!!_#|/
+:n
+t n
+s/'"$ac_delim"'$/,g/; t
+s/$/\\/; p
+N; s/^.*\n//; s/[,\\&]/\\&/g; s/@/@|#_!!_#|/g; b n
+' >>$CONFIG_STATUS <conf$$subs.sed
+rm -f conf$$subs.sed
+cat >>$CONFIG_STATUS <<_ACEOF
+:end
+s/|#_!!_#|//g
+CEOF$ac_eof
+_ACEOF
+
+
+# VPATH may cause trouble with some makes, so we remove $(srcdir),
+# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and
+# trailing colons and then remove the whole line if VPATH becomes empty
+# (actually we leave an empty line to preserve line numbers).
+if test "x$srcdir" = x.; then
+  ac_vpsub='/^[	 ]*VPATH[	 ]*=/{
+s/:*\$(srcdir):*/:/
+s/:*\${srcdir}:*/:/
+s/:*@srcdir@:*/:/
+s/^\([^=]*=[	 ]*\):*/\1/
+s/:*$//
+s/^[^=]*=[	 ]*$//
+}'
+fi
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+fi # test -n "$CONFIG_FILES"
+
+
+for ac_tag in  :F $CONFIG_FILES  :H $CONFIG_HEADERS
+do
+  case $ac_tag in
+  :[FHLC]) ac_mode=$ac_tag; continue;;
+  esac
+  case $ac_mode$ac_tag in
+  :[FHL]*:*);;
+  :L* | :C*:*) { { echo "$as_me:$LINENO: error: Invalid tag $ac_tag." >&5
+echo "$as_me: error: Invalid tag $ac_tag." >&2;}
+   { (exit 1); exit 1; }; };;
+  :[FH]-) ac_tag=-:-;;
+  :[FH]*) ac_tag=$ac_tag:$ac_tag.in;;
+  esac
+  ac_save_IFS=$IFS
+  IFS=:
+  set x $ac_tag
+  IFS=$ac_save_IFS
+  shift
+  ac_file=$1
+  shift
+
+  case $ac_mode in
+  :L) ac_source=$1;;
+  :[FH])
+    ac_file_inputs=
+    for ac_f
+    do
+      case $ac_f in
+      -) ac_f="$tmp/stdin";;
+      *) # Look for the file first in the build tree, then in the source tree
+	 # (if the path is not absolute).  The absolute path cannot be DOS-style,
+	 # because $ac_f cannot contain `:'.
+	 test -f "$ac_f" ||
+	   case $ac_f in
+	   [\\/$]*) false;;
+	   *) test -f "$srcdir/$ac_f" && ac_f="$srcdir/$ac_f";;
+	   esac ||
+	   { { echo "$as_me:$LINENO: error: cannot find input file: $ac_f" >&5
+echo "$as_me: error: cannot find input file: $ac_f" >&2;}
+   { (exit 1); exit 1; }; };;
+      esac
+      ac_file_inputs="$ac_file_inputs $ac_f"
+    done
+
+    # Let's still pretend it is `configure' which instantiates (i.e., don't
+    # use $as_me), people would be surprised to read:
+    #    /* config.h.  Generated by config.status.  */
+    configure_input="Generated from "`IFS=:
+	  echo $* | sed 's|^[^:]*/||;s|:[^:]*/|, |g'`" by configure."
+    if test x"$ac_file" != x-; then
+      configure_input="$ac_file.  $configure_input"
+      { echo "$as_me:$LINENO: creating $ac_file" >&5
+echo "$as_me: creating $ac_file" >&6;}
+    fi
+
+    case $ac_tag in
+    *:-:* | *:-) cat >"$tmp/stdin";;
+    esac
+    ;;
+  esac
+
+  ac_dir=`$as_dirname -- "$ac_file" ||
+$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$ac_file" : 'X\(//\)[^/]' \| \
+	 X"$ac_file" : 'X\(//\)$' \| \
+	 X"$ac_file" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$ac_file" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+  { as_dir="$ac_dir"
+  case $as_dir in #(
+  -*) as_dir=./$as_dir;;
+  esac
+  test -d "$as_dir" || { $as_mkdir_p && mkdir -p "$as_dir"; } || {
+    as_dirs=
+    while :; do
+      case $as_dir in #(
+      *\'*) as_qdir=`echo "$as_dir" | sed "s/'/'\\\\\\\\''/g"`;; #(
+      *) as_qdir=$as_dir;;
+      esac
+      as_dirs="'$as_qdir' $as_dirs"
+      as_dir=`$as_dirname -- "$as_dir" ||
+$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
+	 X"$as_dir" : 'X\(//\)[^/]' \| \
+	 X"$as_dir" : 'X\(//\)$' \| \
+	 X"$as_dir" : 'X\(/\)' \| . 2>/dev/null ||
+echo X"$as_dir" |
+    sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)[^/].*/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\/\)$/{
+	    s//\1/
+	    q
+	  }
+	  /^X\(\/\).*/{
+	    s//\1/
+	    q
+	  }
+	  s/.*/./; q'`
+      test -d "$as_dir" && break
+    done
+    test -z "$as_dirs" || eval "mkdir $as_dirs"
+  } || test -d "$as_dir" || { { echo "$as_me:$LINENO: error: cannot create directory $as_dir" >&5
+echo "$as_me: error: cannot create directory $as_dir" >&2;}
+   { (exit 1); exit 1; }; }; }
+  ac_builddir=.
+
+case "$ac_dir" in
+.) ac_dir_suffix= ac_top_builddir_sub=. ac_top_build_prefix= ;;
+*)
+  ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'`
+  # A ".." for each directory in $ac_dir_suffix.
+  ac_top_builddir_sub=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,/..,g;s,/,,'`
+  case $ac_top_builddir_sub in
+  "") ac_top_builddir_sub=. ac_top_build_prefix= ;;
+  *)  ac_top_build_prefix=$ac_top_builddir_sub/ ;;
+  esac ;;
+esac
+ac_abs_top_builddir=$ac_pwd
+ac_abs_builddir=$ac_pwd$ac_dir_suffix
+# for backward compatibility:
+ac_top_builddir=$ac_top_build_prefix
+
+case $srcdir in
+  .)  # We are building in place.
+    ac_srcdir=.
+    ac_top_srcdir=$ac_top_builddir_sub
+    ac_abs_top_srcdir=$ac_pwd ;;
+  [\\/]* | ?:[\\/]* )  # Absolute name.
+    ac_srcdir=$srcdir$ac_dir_suffix;
+    ac_top_srcdir=$srcdir
+    ac_abs_top_srcdir=$srcdir ;;
+  *) # Relative name.
+    ac_srcdir=$ac_top_build_prefix$srcdir$ac_dir_suffix
+    ac_top_srcdir=$ac_top_build_prefix$srcdir
+    ac_abs_top_srcdir=$ac_pwd/$srcdir ;;
+esac
+ac_abs_srcdir=$ac_abs_top_srcdir$ac_dir_suffix
+
+
+  case $ac_mode in
+  :F)
+  #
+  # CONFIG_FILE
+  #
+
+  case $INSTALL in
+  [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;;
+  *) ac_INSTALL=$ac_top_build_prefix$INSTALL ;;
+  esac
+_ACEOF
+
+cat >>$CONFIG_STATUS <<\_ACEOF
+# If the template does not know about datarootdir, expand it.
+# FIXME: This hack should be removed a few years after 2.60.
+ac_datarootdir_hack=; ac_datarootdir_seen=
+
+case `sed -n '/datarootdir/ {
+  p
+  q
+}
+/@datadir@/p
+/@docdir@/p
+/@infodir@/p
+/@localedir@/p
+/@mandir@/p
+' $ac_file_inputs` in
+*datarootdir*) ac_datarootdir_seen=yes;;
+*@datadir@*|*@docdir@*|*@infodir@*|*@localedir@*|*@mandir@*)
+  { echo "$as_me:$LINENO: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&5
+echo "$as_me: WARNING: $ac_file_inputs seems to ignore the --datarootdir setting" >&2;}
+_ACEOF
+cat >>$CONFIG_STATUS <<_ACEOF
+  ac_datarootdir_hack='
+  s&@datadir@&$datadir&g
+  s&@docdir@&$docdir&g
+  s&@infodir@&$infodir&g
+  s&@localedir@&$localedir&g
+  s&@mandir@&$mandir&g
+    s&\\\${datarootdir}&$datarootdir&g' ;;
+esac
+_ACEOF
+
+# Neutralize VPATH when `$srcdir' = `.'.
+# Shell code in configure.ac might set extrasub.
+# FIXME: do we really want to maintain this feature?
+cat >>$CONFIG_STATUS <<_ACEOF
+  sed "$ac_vpsub
+$extrasub
+_ACEOF
+cat >>$CONFIG_STATUS <<\_ACEOF
+:t
+/@[a-zA-Z_][a-zA-Z_0-9]*@/!b
+s&@configure_input@&$configure_input&;t t
+s&@top_builddir@&$ac_top_builddir_sub&;t t
+s&@srcdir@&$ac_srcdir&;t t
+s&@abs_srcdir@&$ac_abs_srcdir&;t t
+s&@top_srcdir@&$ac_top_srcdir&;t t
+s&@abs_top_srcdir@&$ac_abs_top_srcdir&;t t
+s&@builddir@&$ac_builddir&;t t
+s&@abs_builddir@&$ac_abs_builddir&;t t
+s&@abs_top_builddir@&$ac_abs_top_builddir&;t t
+s&@INSTALL@&$ac_INSTALL&;t t
+$ac_datarootdir_hack
+" $ac_file_inputs | sed -f "$tmp/subs-1.sed" >$tmp/out
+
+test -z "$ac_datarootdir_hack$ac_datarootdir_seen" &&
+  { ac_out=`sed -n '/\${datarootdir}/p' "$tmp/out"`; test -n "$ac_out"; } &&
+  { ac_out=`sed -n '/^[	 ]*datarootdir[	 ]*:*=/p' "$tmp/out"`; test -z "$ac_out"; } &&
+  { echo "$as_me:$LINENO: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&5
+echo "$as_me: WARNING: $ac_file contains a reference to the variable \`datarootdir'
+which seems to be undefined.  Please make sure it is defined." >&2;}
+
+  rm -f "$tmp/stdin"
+  case $ac_file in
+  -) cat "$tmp/out"; rm -f "$tmp/out";;
+  *) rm -f "$ac_file"; mv "$tmp/out" $ac_file;;
+  esac
+ ;;
+  :H)
+  #
+  # CONFIG_HEADER
+  #
+_ACEOF
+
+# Transform confdefs.h into a sed script `conftest.defines', that
+# substitutes the proper values into config.h.in to produce config.h.
+rm -f conftest.defines conftest.tail
+# First, append a space to every undef/define line, to ease matching.
+echo 's/$/ /' >conftest.defines
+# Then, protect against being on the right side of a sed subst, or in
+# an unquoted here document, in config.status.  If some macros were
+# called several times there might be several #defines for the same
+# symbol, which is useless.  But do not sort them, since the last
+# AC_DEFINE must be honored.
+ac_word_re=[_$as_cr_Letters][_$as_cr_alnum]*
+# These sed commands are passed to sed as "A NAME B PARAMS C VALUE D", where
+# NAME is the cpp macro being defined, VALUE is the value it is being given.
+# PARAMS is the parameter list in the macro definition--in most cases, it's
+# just an empty string.
+ac_dA='s,^\\([	 #]*\\)[^	 ]*\\([	 ]*'
+ac_dB='\\)[	 (].*,\\1define\\2'
+ac_dC=' '
+ac_dD=' ,'
+
+uniq confdefs.h |
+  sed -n '
+	t rset
+	:rset
+	s/^[	 ]*#[	 ]*define[	 ][	 ]*//
+	t ok
+	d
+	:ok
+	s/[\\&,]/\\&/g
+	s/^\('"$ac_word_re"'\)\(([^()]*)\)[	 ]*\(.*\)/ '"$ac_dA"'\1'"$ac_dB"'\2'"${ac_dC}"'\3'"$ac_dD"'/p
+	s/^\('"$ac_word_re"'\)[	 ]*\(.*\)/'"$ac_dA"'\1'"$ac_dB$ac_dC"'\2'"$ac_dD"'/p
+  ' >>conftest.defines
+
+# Remove the space that was appended to ease matching.
+# Then replace #undef with comments.  This is necessary, for
+# example, in the case of _POSIX_SOURCE, which is predefined and required
+# on some systems where configure will not decide to define it.
+# (The regexp can be short, since the line contains either #define or #undef.)
+echo 's/ $//
+s,^[	 #]*u.*,/* & */,' >>conftest.defines
+
+# Break up conftest.defines:
+ac_max_sed_lines=50
+
+# First sed command is:	 sed -f defines.sed $ac_file_inputs >"$tmp/out1"
+# Second one is:	 sed -f defines.sed "$tmp/out1" >"$tmp/out2"
+# Third one will be:	 sed -f defines.sed "$tmp/out2" >"$tmp/out1"
+# et cetera.
+ac_in='$ac_file_inputs'
+ac_out='"$tmp/out1"'
+ac_nxt='"$tmp/out2"'
+
+while :
+do
+  # Write a here document:
+    cat >>$CONFIG_STATUS <<_ACEOF
+    # First, check the format of the line:
+    cat >"\$tmp/defines.sed" <<\\CEOF
+/^[	 ]*#[	 ]*undef[	 ][	 ]*$ac_word_re[	 ]*\$/b def
+/^[	 ]*#[	 ]*define[	 ][	 ]*$ac_word_re[(	 ]/b def
+b
+:def
+_ACEOF
+  sed ${ac_max_sed_lines}q conftest.defines >>$CONFIG_STATUS
+  echo 'CEOF
+    sed -f "$tmp/defines.sed"' "$ac_in >$ac_out" >>$CONFIG_STATUS
+  ac_in=$ac_out; ac_out=$ac_nxt; ac_nxt=$ac_in
+  sed 1,${ac_max_sed_lines}d conftest.defines >conftest.tail
+  grep . conftest.tail >/dev/null || break
+  rm -f conftest.defines
+  mv conftest.tail conftest.defines
+done
+rm -f conftest.defines conftest.tail
+
+echo "ac_result=$ac_in" >>$CONFIG_STATUS
+cat >>$CONFIG_STATUS <<\_ACEOF
+  if test x"$ac_file" != x-; then
+    echo "/* $configure_input  */" >"$tmp/config.h"
+    cat "$ac_result" >>"$tmp/config.h"
+    if diff $ac_file "$tmp/config.h" >/dev/null 2>&1; then
+      { echo "$as_me:$LINENO: $ac_file is unchanged" >&5
+echo "$as_me: $ac_file is unchanged" >&6;}
+    else
+      rm -f $ac_file
+      mv "$tmp/config.h" $ac_file
+    fi
+  else
+    echo "/* $configure_input  */"
+    cat "$ac_result"
+  fi
+  rm -f "$tmp/out12"
+ ;;
+
+
+  esac
+
+done # for ac_tag
+
+
+{ (exit 0); exit 0; }
+_ACEOF
+chmod +x $CONFIG_STATUS
+ac_clean_files=$ac_clean_files_save
+
+
+# configure is writing to config.log, and then calls config.status.
+# config.status does its own redirection, appending to config.log.
+# Unfortunately, on DOS this fails, as config.log is still kept open
+# by configure, so config.status won't be able to write to it; its
+# output is simply discarded.  So we exec the FD to /dev/null,
+# effectively closing config.log, so it can be properly (re)opened and
+# appended to by config.status.  When coming back to configure, we
+# need to make the FD available again.
+if test "$no_create" != yes; then
+  ac_cs_success=:
+  ac_config_status_args=
+  test "$silent" = yes &&
+    ac_config_status_args="$ac_config_status_args --quiet"
+  exec 5>/dev/null
+  $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false
+  exec 5>>config.log
+  # Use ||, not &&, to avoid exiting from the if with $? = 1, which
+  # would make configure fail if this is the last instruction.
+  $ac_cs_success || { (exit 1); exit 1; }
+fi
+
+
+case "$target" in
+        *ibm-aix*)
+                mv x11/Makefile.aix x11/Makefile
+                { echo "$as_me:$LINENO: result: renaming x11/Makefile.aix to x11/Makefile" >&5
+echo "${ECHO_T}renaming x11/Makefile.aix to x11/Makefile" >&6; }
+                ;;
+        *)
+                ;;
+esac
+
+
+cat >>confdefs.h <<\_ACEOF
+#define PDC_MAX_SIGNALS
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_DECKEYSYM_H
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_SUNKEYSYM_H
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XPM_H
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_DELETE
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_INSERT
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_END
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_DOWN
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_NEXT
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_LEFT
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_RIGHT
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_HOME
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_UP
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_PRIOR
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define HAVE_XK_KP_BEGIN
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_XAW3D
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define USE_NEXTAW
+_ACEOF
+
+
+
+cat >>confdefs.h <<\_ACEOF
+#define XPOINTER_TYPEDEFED
+_ACEOF
+
diff --git a/payloads/libpayload/curses/PDCurses-3.4/configure.ac b/payloads/libpayload/curses/PDCurses-3.4/configure.ac
new file mode 100644
index 0000000..cf87496
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/configure.ac
@@ -0,0 +1,285 @@
+dnl $Id: configure.ac,v 1.35 2008/07/21 12:19:21 wmcbrine Exp $
+dnl Process this file with autoconf to produce a configure script.
+
+AC_INIT([PDCurses], [3.4], [wmcbrine@users.sf.net], [PDCurses])
+AC_CONFIG_SRCDIR([curspriv.h])
+
+AC_SUBST(prefix)
+
+AC_PROG_CC
+
+AC_CONFIG_HEADER(config.h)
+dnl Checks for system first
+AC_CANONICAL_SYSTEM([])
+
+mymakefile="Makefile"
+on_qnx=no
+case "$target" in
+	*hp-hpux*) 
+		SYS_DEFS="-D_HPUX_SOURCE"
+		;;
+	*ibm-aix*)
+		SYS_DEFS="-D_ALL_SOURCE"
+		mymakefile="Makefile.aix"
+		;;
+	*dec-osf*)
+		SYS_DEFS="-D_XOPEN_SOURCE_EXTENDED"
+		;;
+	*pc-sco*)
+		SYS_DEFS="-UM_XENIX -b elf"
+		;;
+	*qnx*)
+		on_qnx=yes
+		SYS_DEFS="-Q"
+		;;
+	*)
+		;;
+esac
+AC_SUBST(SYS_DEFS)
+
+MH_CHECK_MAX_SIGNALS(NSIG __sys_nsig)
+
+dnl Check for other programs.
+AC_PROG_RANLIB
+AC_PROG_INSTALL
+AC_PROG_MAKE_SET
+
+dnl ensure that the system has System V IPC support
+MH_IPC
+
+if test $ac_cv_header_stdc != yes; then
+	AC_MSG_ERROR([Need ANSI C headers])
+fi
+
+dnl Checks for libraries.
+
+AC_CHECK_HEADERS(fcntl.h \
+	sys/time.h \
+	sys/select.h \
+	dlfcn.h \
+	dl.h
+)
+
+dnl Checks for typedefs, structures, and compiler characteristics.
+AC_HEADER_TIME
+MH_CHECK_LIB(socket nls)
+AC_SUBST(MH_EXTRA_LIBS)
+MH_CHECK_CC_O
+
+dnl Checks for library functions.
+AC_TYPE_SIGNAL
+AC_CHECK_FUNCS(vsscanf usleep poll vsnprintf)
+
+dnl Check for X includes and X libraries
+AC_PATH_X
+MH_CHECK_X_INC
+MH_CHECK_X_LIB
+MH_CHECK_X_HEADERS(DECkeysym.h Sunkeysym.h xpm.h)
+MH_CHECK_X_KEYDEFS(XK_KP_Delete XK_KP_Insert XK_KP_End XK_KP_Down XK_KP_Next \
+	XK_KP_Left XK_KP_Right XK_KP_Home XK_KP_Up XK_KP_Prior XK_KP_Begin)
+MH_CHECK_X_TYPEDEF(XPointer)
+dnl
+dnl extra for xpm library
+if test $ac_cv_header_xpm_h = yes; then
+	MH_XLIBS="$MH_XLIBS -lXpm"
+fi
+dnl ---------- allow --enable-debug to compile in debug mode ---------
+AC_ARG_ENABLE(debug,
+	[  --enable-debug          turn on debugging],
+	[with_debug=$enableval],
+	[with_debug=no],
+)
+cflags_g="`echo $CFLAGS | grep -c '\-g'`"
+cflags_O="`echo $CFLAGS | grep -c '\-O'`"
+
+if test "$with_debug" = yes; then
+	if test "$cflags_g" = "0"; then
+		CFLAGS="${CFLAGS} -g"
+	fi
+	if test "$cflags_O" != "0"; then
+		CFLAGS="`echo ${CFLAGS} | sed -e s/-O.//`"
+	fi
+	CFLAGS="${CFLAGS} -DPDCDEBUG"
+else
+	if test "$cflags_O" = "0"; then
+		CFLAGS="${CFLAGS} -O"
+	fi
+	if test "$cflags_g" != "0"; then
+		CFLAGS="`echo ${CFLAGS} | sed -e s/-g//`"
+	fi
+fi
+if test "$ac_cv_prog_CC" = "gcc"; then
+	if test "$with_debug" = yes; then
+		CFLAGS="${CFLAGS} -Wall"
+	else
+		CFLAGS="-O2 -Wall -fomit-frame-pointer"
+	fi
+fi
+if test "$on_qnx" = yes; then
+	if test "$with_debug" = yes; then
+		CFLAGS="-g"
+	else
+		CFLAGS="-Otax"
+	fi
+fi
+
+dnl --------------- check for wide character support -----------------
+dnl allow --enable-widec to include wide character support
+AC_ARG_ENABLE(widec,
+	[  --enable-widec          include support for wide characters],
+	[with_widec=$enableval],
+	[with_widec=no],
+)
+if test "$with_widec" = yes; then
+	SYS_DEFS="$SYS_DEFS -DPDC_WIDE"
+fi
+
+dnl -------------------- check for XIM support -----------------------
+dnl allow --enable-xim to include XIM support
+AC_ARG_ENABLE(xim,
+	[  --enable-xim            include support for XIM],
+	[with_xim=$enableval],
+	[with_xim=no],
+)
+if test "$with_xim" = yes; then
+	SYS_DEFS="$SYS_DEFS -DPDC_XIM"
+fi
+
+dnl ------------------------ force UTF-8? ----------------------------
+dnl allow --enable-force-utf8 to override locale settings
+AC_ARG_ENABLE(force-utf8,
+	[  --enable-force-utf8     override locale settings; use UTF-8],
+	[force_utf8=$enableval],
+	[force_utf8=no],
+)
+if test "$force_utf8" = yes; then
+	SYS_DEFS="$SYS_DEFS -DPDC_FORCE_UTF8"
+fi
+
+dnl ----------------- check for Purify support -----------------------
+dnl allow --enable-purify to enable linking with Purify
+AC_ARG_ENABLE(purify,
+	[  --enable-purify         link with Purify (TM)],
+	[with_purify=$enableval],
+	[with_purify=no],
+)
+if test "$with_purify" = yes; then
+	PURIFY="purify"
+else
+	PURIFY=""
+fi
+AC_SUBST(PURIFY)
+
+dnl --------------------- check for Xaw3d library --------------------
+dnl allow --with-xaw3d to link with PDCurses
+AC_ARG_WITH(xaw3d,
+	[  --with-xaw3d            link with Xaw3d],
+	[with_xaw3d=$withval],
+	[with_xaw3d=no],
+)
+if test "$with_xaw3d" = yes; then
+	AC_DEFINE([USE_XAW3D], [1],
+		[Define if you want to use Xaw3d library]
+	)
+fi
+
+dnl --------------------- check for neXtaw library -------------------
+dnl allow --with-nextaw to link with PDCurses
+AC_ARG_WITH(nextaw,
+	[  --with-nextaw           link with neXtaw],
+	[with_nextaw=$withval],
+	[with_nextaw=no],
+)
+if test "$with_nextaw" = yes; then
+	AC_DEFINE([USE_NEXTAW], [1],
+		[Define if you want to use neXtaw library]
+	)
+fi
+
+dnl -------------- check how to make shared libraries ----------------
+dnl Force the ability of shared library usage
+MH_SHARED_LIBRARY(XCurses)
+
+AC_CONFIG_FILES([Makefile x11/$mymakefile x11/xcurses-config])
+AC_OUTPUT
+
+case "$target" in
+        *ibm-aix*)
+                mv x11/Makefile.aix x11/Makefile
+                AC_MSG_RESULT(renaming x11/Makefile.aix to x11/Makefile)
+                ;;
+        *)
+                ;;
+esac
+
+AC_DEFINE([PDC_MAX_SIGNALS], [],
+	[Define as the system defined limit for number of signals]
+)
+
+AC_DEFINE([HAVE_DECKEYSYM_H], [],
+	[Define if you have the <DECkeySym.h> header file]
+)
+
+AC_DEFINE([HAVE_SUNKEYSYM_H], [],
+	[Define if you have the <Sunkeysym.h> header file]
+)
+
+AC_DEFINE([HAVE_XPM_H], [],
+	[Define if you have the <xpm.h> header file]
+)
+
+AC_DEFINE([HAVE_XK_KP_DELETE], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_INSERT], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_END], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_DOWN], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_NEXT], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_LEFT], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_RIGHT], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_HOME], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_UP], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_PRIOR], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([HAVE_XK_KP_BEGIN], [],
+	[Define if you have this defined in <keysym.h>]
+)
+
+AC_DEFINE([USE_XAW3D], [],
+	[Define if you want to use Xaw3d library]
+)
+
+AC_DEFINE([USE_NEXTAW], [],
+	[Define if you want to use neXtaw library]
+)
+
+AC_DEFINE([XPOINTER_TYPEDEFED], [],
+	[Define XPointer is typedefed in X11/Xlib.h]
+)
diff --git a/payloads/libpayload/curses/PDCurses-3.4/curses.h b/payloads/libpayload/curses/PDCurses-3.4/curses.h
new file mode 100644
index 0000000..6f3ce19
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/curses.h
@@ -0,0 +1,1377 @@
+/* Public Domain Curses */
+
+/* $Id: curses.h,v 1.295 2008/07/15 17:13:25 wmcbrine Exp $ */
+
+/*----------------------------------------------------------------------*
+ *                              PDCurses                                *
+ *----------------------------------------------------------------------*/
+
+#ifndef __PDCURSES__
+#define __PDCURSES__ 1
+
+/*man-start**************************************************************
+
+PDCurses definitions list:  (Only define those needed)
+
+    XCURSES         True if compiling for X11.
+    PDC_RGB         True if you want to use RGB color definitions
+                    (Red = 1, Green = 2, Blue = 4) instead of BGR.
+    PDC_WIDE        True if building wide-character support.
+    PDC_DLL_BUILD   True if building a Win32 DLL.
+    NCURSES_MOUSE_VERSION   Use the ncurses mouse API instead
+                            of PDCurses' traditional mouse API.
+
+PDCurses portable platform definitions list:
+
+    PDC_BUILD       Defines API build version.
+    PDCURSES        Enables access to PDCurses-only routines.
+    XOPEN           Always true.
+    SYSVcurses      True if you are compiling for SYSV portability.
+    BSDcurses       True if you are compiling for BSD portability.
+
+**man-end****************************************************************/
+
+#define PDC_BUILD 3401
+#define PDCURSES        1      /* PDCurses-only routines */
+#define XOPEN           1      /* X/Open Curses routines */
+#define SYSVcurses      1      /* System V Curses routines */
+#define BSDcurses       1      /* BSD Curses routines */
+#define CHTYPE_LONG     1      /* size of chtype; long */
+
+/*----------------------------------------------------------------------*/
+
+#include <stdarg.h>
+#include <stddef.h>
+#include <stdio.h>             /* Required by X/Open usage below */
+
+#ifdef PDC_WIDE
+# include <wchar.h>
+#endif
+
+#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
+extern "C"
+{
+# define bool _bool
+#endif
+
+/*----------------------------------------------------------------------
+ *
+ *  PDCurses Manifest Constants
+ *
+ */
+
+#ifndef FALSE
+# define FALSE 0
+#endif
+#ifndef TRUE
+# define TRUE 1
+#endif
+#ifndef NULL
+# define NULL (void *)0
+#endif
+#ifndef ERR
+# define ERR (-1)
+#endif
+#ifndef OK
+# define OK 0
+#endif
+
+/*----------------------------------------------------------------------
+ *
+ *  PDCurses Type Declarations
+ *
+ */
+
+typedef unsigned char bool;    /* PDCurses Boolean type */
+
+#ifdef CHTYPE_LONG
+# if _LP64
+typedef unsigned int chtype;
+# else
+typedef unsigned long chtype;  /* 16-bit attr + 16-bit char */
+# endif
+#else
+typedef unsigned short chtype; /* 8-bit attr + 8-bit char */
+#endif
+
+#ifdef PDC_WIDE
+typedef chtype cchar_t;
+#endif
+
+typedef chtype attr_t;
+
+/*----------------------------------------------------------------------
+ *
+ *  PDCurses Mouse Interface -- SYSVR4, with extensions
+ *
+ */
+
+typedef struct
+{
+    int x;           /* absolute column, 0 based, measured in characters */
+    int y;           /* absolute row, 0 based, measured in characters */
+    short button[3]; /* state of each button */
+    int changes;     /* flags indicating what has changed with the mouse */
+} MOUSE_STATUS;
+
+#define BUTTON_RELEASED         0x0000
+#define BUTTON_PRESSED          0x0001
+#define BUTTON_CLICKED          0x0002
+#define BUTTON_DOUBLE_CLICKED   0x0003
+#define BUTTON_TRIPLE_CLICKED   0x0004
+#define BUTTON_MOVED            0x0005  /* PDCurses */
+#define WHEEL_SCROLLED          0x0006  /* PDCurses */
+#define BUTTON_ACTION_MASK      0x0007  /* PDCurses */
+
+#define PDC_BUTTON_SHIFT        0x0008  /* PDCurses */
+#define PDC_BUTTON_CONTROL      0x0010  /* PDCurses */
+#define PDC_BUTTON_ALT          0x0020  /* PDCurses */
+#define BUTTON_MODIFIER_MASK    0x0038  /* PDCurses */
+
+#define MOUSE_X_POS             (Mouse_status.x)
+#define MOUSE_Y_POS             (Mouse_status.y)
+
+/*
+ * Bits associated with the .changes field:
+ *   3         2         1         0
+ * 210987654321098765432109876543210
+ *                                 1 <- button 1 has changed
+ *                                10 <- button 2 has changed
+ *                               100 <- button 3 has changed
+ *                              1000 <- mouse has moved
+ *                             10000 <- mouse position report
+ *                            100000 <- mouse wheel up
+ *                           1000000 <- mouse wheel down
+ */
+
+#define PDC_MOUSE_MOVED         0x0008
+#define PDC_MOUSE_POSITION      0x0010
+#define PDC_MOUSE_WHEEL_UP      0x0020
+#define PDC_MOUSE_WHEEL_DOWN    0x0040
+
+#define A_BUTTON_CHANGED        (Mouse_status.changes & 7)
+#define MOUSE_MOVED             (Mouse_status.changes & PDC_MOUSE_MOVED)
+#define MOUSE_POS_REPORT        (Mouse_status.changes & PDC_MOUSE_POSITION)
+#define BUTTON_CHANGED(x)       (Mouse_status.changes & (1 << ((x) - 1)))
+#define BUTTON_STATUS(x)        (Mouse_status.button[(x) - 1])
+#define MOUSE_WHEEL_UP          (Mouse_status.changes & PDC_MOUSE_WHEEL_UP)
+#define MOUSE_WHEEL_DOWN        (Mouse_status.changes & PDC_MOUSE_WHEEL_DOWN)
+
+/* mouse bit-masks */
+
+#define BUTTON1_RELEASED        0x00000001L
+#define BUTTON1_PRESSED         0x00000002L
+#define BUTTON1_CLICKED         0x00000004L
+#define BUTTON1_DOUBLE_CLICKED  0x00000008L
+#define BUTTON1_TRIPLE_CLICKED  0x00000010L
+#define BUTTON1_MOVED           0x00000010L /* PDCurses */
+
+#define BUTTON2_RELEASED        0x00000020L
+#define BUTTON2_PRESSED         0x00000040L
+#define BUTTON2_CLICKED         0x00000080L
+#define BUTTON2_DOUBLE_CLICKED  0x00000100L
+#define BUTTON2_TRIPLE_CLICKED  0x00000200L
+#define BUTTON2_MOVED           0x00000200L /* PDCurses */
+
+#define BUTTON3_RELEASED        0x00000400L
+#define BUTTON3_PRESSED         0x00000800L
+#define BUTTON3_CLICKED         0x00001000L
+#define BUTTON3_DOUBLE_CLICKED  0x00002000L
+#define BUTTON3_TRIPLE_CLICKED  0x00004000L
+#define BUTTON3_MOVED           0x00004000L /* PDCurses */
+
+/* For the ncurses-compatible functions only, BUTTON4_PRESSED and 
+   BUTTON5_PRESSED are returned for mouse scroll wheel up and down; 
+   otherwise PDCurses doesn't support buttons 4 and 5 */
+
+#define BUTTON4_RELEASED        0x00008000L
+#define BUTTON4_PRESSED         0x00010000L
+#define BUTTON4_CLICKED         0x00020000L
+#define BUTTON4_DOUBLE_CLICKED  0x00040000L
+#define BUTTON4_TRIPLE_CLICKED  0x00080000L
+
+#define BUTTON5_RELEASED        0x00100000L
+#define BUTTON5_PRESSED         0x00200000L
+#define BUTTON5_CLICKED         0x00400000L
+#define BUTTON5_DOUBLE_CLICKED  0x00800000L
+#define BUTTON5_TRIPLE_CLICKED  0x01000000L
+
+#define MOUSE_WHEEL_SCROLL      0x02000000L /* PDCurses */
+#define BUTTON_MODIFIER_SHIFT   0x04000000L /* PDCurses */
+#define BUTTON_MODIFIER_CONTROL 0x08000000L /* PDCurses */
+#define BUTTON_MODIFIER_ALT     0x10000000L /* PDCurses */
+
+#define ALL_MOUSE_EVENTS        0x1fffffffL
+#define REPORT_MOUSE_POSITION   0x20000000L
+
+/* ncurses mouse interface */
+
+typedef unsigned long mmask_t;
+
+typedef struct
+{
+        short id;       /* unused, always 0 */
+        int x, y, z;    /* x, y same as MOUSE_STATUS; z unused */
+        mmask_t bstate; /* equivalent to changes + button[], but
+                           in the same format as used for mousemask() */
+} MEVENT;
+
+#ifdef NCURSES_MOUSE_VERSION
+# define BUTTON_SHIFT   BUTTON_MODIFIER_SHIFT
+# define BUTTON_CONTROL BUTTON_MODIFIER_CONTROL
+# define BUTTON_CTRL    BUTTON_MODIFIER_CONTROL
+# define BUTTON_ALT     BUTTON_MODIFIER_ALT
+#else
+# define BUTTON_SHIFT   PDC_BUTTON_SHIFT
+# define BUTTON_CONTROL PDC_BUTTON_CONTROL
+# define BUTTON_ALT     PDC_BUTTON_ALT
+#endif
+
+/*----------------------------------------------------------------------
+ *
+ *  PDCurses Structure Definitions
+ *
+ */
+
+typedef struct _win       /* definition of a window */
+{
+    int   _cury;          /* current pseudo-cursor */
+    int   _curx;
+    int   _maxy;          /* max window coordinates */
+    int   _maxx;
+    int   _begy;          /* origin on screen */
+    int   _begx;
+    int   _flags;         /* window properties */
+    chtype _attrs;        /* standard attributes and colors */
+    chtype _bkgd;         /* background, normally blank */
+    bool  _clear;         /* causes clear at next refresh */
+    bool  _leaveit;       /* leaves cursor where it is */
+    bool  _scroll;        /* allows window scrolling */
+    bool  _nodelay;       /* input character wait flag */
+    bool  _immed;         /* immediate update flag */
+    bool  _sync;          /* synchronise window ancestors */
+    bool  _use_keypad;    /* flags keypad key mode active */
+    chtype **_y;          /* pointer to line pointer array */
+    int   *_firstch;      /* first changed character in line */
+    int   *_lastch;       /* last changed character in line */
+    int   _tmarg;         /* top of scrolling region */
+    int   _bmarg;         /* bottom of scrolling region */
+    int   _delayms;       /* milliseconds of delay for getch() */
+    int   _parx, _pary;   /* coords relative to parent (0,0) */
+    struct _win *_parent; /* subwin's pointer to parent win */
+} WINDOW;
+
+/* Avoid using the SCREEN struct directly -- use the corresponding 
+   functions if possible. This struct may eventually be made private. */
+
+typedef struct
+{
+    bool  alive;          /* if initscr() called, and not endwin() */
+    bool  autocr;         /* if cr -> lf */
+    bool  cbreak;         /* if terminal unbuffered */
+    bool  echo;           /* if terminal echo */
+    bool  raw_inp;        /* raw input mode (v. cooked input) */
+    bool  raw_out;        /* raw output mode (7 v. 8 bits) */
+    bool  audible;        /* FALSE if the bell is visual */
+    bool  mono;           /* TRUE if current screen is mono */
+    bool  resized;        /* TRUE if TERM has been resized */
+    bool  orig_attr;      /* TRUE if we have the original colors */
+    short orig_fore;      /* original screen foreground color */
+    short orig_back;      /* original screen foreground color */
+    int   cursrow;        /* position of physical cursor */
+    int   curscol;        /* position of physical cursor */
+    int   visibility;     /* visibility of cursor */
+    int   orig_cursor;    /* original cursor size */
+    int   lines;          /* new value for LINES */
+    int   cols;           /* new value for COLS */
+    unsigned long _trap_mbe;       /* trap these mouse button events */
+    unsigned long _map_mbe_to_key; /* map mouse buttons to slk */
+    int   mouse_wait;              /* time to wait (in ms) for a
+                                      button release after a press, in 
+                                      order to count it as a click */
+    int   slklines;                /* lines in use by slk_init() */
+    WINDOW *slk_winptr;            /* window for slk */
+    int   linesrippedoff;          /* lines ripped off via ripoffline() */
+    int   linesrippedoffontop;     /* lines ripped off on 
+                                      top via ripoffline() */
+    int   delaytenths;             /* 1/10ths second to wait block
+                                      getch() for */
+    bool  _preserve;               /* TRUE if screen background
+                                      to be preserved */
+    int   _restore;                /* specifies if screen background
+                                      to be restored, and how */
+    bool  save_key_modifiers;      /* TRUE if each key modifiers saved
+                                      with each key press */
+    bool  return_key_modifiers;    /* TRUE if modifier keys are
+                                      returned as "real" keys */
+    bool  key_code;                /* TRUE if last key is a special key;
+                                      used internally by get_wch() */
+#ifdef XCURSES
+    int   XcurscrSize;    /* size of Xcurscr shared memory block */
+    bool  sb_on;
+    int   sb_viewport_y;
+    int   sb_viewport_x;
+    int   sb_total_y;
+    int   sb_total_x;
+    int   sb_cur_y;
+    int   sb_cur_x;
+#endif
+    short line_color;     /* color of line attributes - default -1 */
+} SCREEN;
+
+/*----------------------------------------------------------------------
+ *
+ *  PDCurses External Variables
+ *
+ */
+
+#ifdef PDC_DLL_BUILD
+# ifdef CURSES_LIBRARY
+#  define PDCEX __declspec(dllexport) extern
+# else
+#  define PDCEX __declspec(dllimport)
+# endif
+#else
+# define PDCEX extern
+#endif
+
+PDCEX  int          LINES;        /* terminal height */
+PDCEX  int          COLS;         /* terminal width */
+PDCEX  WINDOW       *stdscr;      /* the default screen window */
+PDCEX  WINDOW       *curscr;      /* the current screen image */
+PDCEX  SCREEN       *SP;          /* curses variables */
+PDCEX  MOUSE_STATUS Mouse_status;
+PDCEX  int          COLORS;
+PDCEX  int          COLOR_PAIRS;
+PDCEX  int          TABSIZE;
+PDCEX  chtype       acs_map[];    /* alternate character set map */
+PDCEX  char         ttytype[];    /* terminal name/description */
+
+/*man-start**************************************************************
+
+PDCurses Text Attributes
+========================
+
+Originally, PDCurses used a short (16 bits) for its chtype. To include 
+color, a number of things had to be sacrificed from the strict Unix and 
+System V support. The main problem was fitting all character attributes 
+and color into an unsigned char (all 8 bits!).
+
+Today, PDCurses by default uses a long (32 bits) for its chtype, as in 
+System V. The short chtype is still available, by undefining CHTYPE_LONG 
+and rebuilding the library.
+
+The following is the structure of a win->_attrs chtype:
+
+short form:
+
+-------------------------------------------------
+|15|14|13|12|11|10| 9| 8| 7| 6| 5| 4| 3| 2| 1| 0|
+-------------------------------------------------
+  color number |  attrs |   character eg 'a'
+
+The available non-color attributes are bold, reverse and blink. Others 
+have no effect. The high order char is an index into an array of 
+physical colors (defined in color.c) -- 32 foreground/background color 
+pairs (5 bits) plus 3 bits for other attributes.
+
+long form:
+
+----------------------------------------------------------------------------
+|31|30|29|28|27|26|25|24|23|22|21|20|19|18|17|16|15|14|13|12|..| 3| 2| 1| 0|
+----------------------------------------------------------------------------
+      color number      |     modifiers         |      character eg 'a'
+
+The available non-color attributes are bold, underline, invisible, 
+right-line, left-line, protect, reverse and blink. 256 color pairs (8 
+bits), 8 bits for other attributes, and 16 bits for character data.
+
+**man-end****************************************************************/
+
+/*** Video attribute macros ***/
+
+#define A_NORMAL      (chtype)0
+
+#ifdef CHTYPE_LONG
+# define A_ALTCHARSET (chtype)0x00010000
+# define A_RIGHTLINE  (chtype)0x00020000
+# define A_LEFTLINE   (chtype)0x00040000
+# define A_INVIS      (chtype)0x00080000
+# define A_UNDERLINE  (chtype)0x00100000
+# define A_REVERSE    (chtype)0x00200000
+# define A_BLINK      (chtype)0x00400000
+# define A_BOLD       (chtype)0x00800000
+
+# define A_ATTRIBUTES (chtype)0xffff0000
+# define A_CHARTEXT   (chtype)0x0000ffff
+# define A_COLOR      (chtype)0xff000000
+
+# define A_ITALIC     A_INVIS
+# define A_PROTECT    (A_UNDERLINE | A_LEFTLINE | A_RIGHTLINE)
+
+# define PDC_ATTR_SHIFT  19
+# define PDC_COLOR_SHIFT 24
+#else
+# define A_BOLD       (chtype)0x0100  /* X/Open */
+# define A_REVERSE    (chtype)0x0200  /* X/Open */
+# define A_BLINK      (chtype)0x0400  /* X/Open */
+
+# define A_ATTRIBUTES (chtype)0xff00  /* X/Open */
+# define A_CHARTEXT   (chtype)0x00ff  /* X/Open */
+# define A_COLOR      (chtype)0xf800  /* System V */
+
+# define A_ALTCHARSET A_NORMAL        /* X/Open */
+# define A_PROTECT    A_NORMAL        /* X/Open */
+# define A_UNDERLINE  A_NORMAL        /* X/Open */
+
+# define A_LEFTLINE   A_NORMAL
+# define A_RIGHTLINE  A_NORMAL
+# define A_ITALIC     A_NORMAL
+# define A_INVIS      A_NORMAL
+
+# define PDC_ATTR_SHIFT   8
+# define PDC_COLOR_SHIFT 11
+#endif
+
+#define A_STANDOUT    (A_REVERSE | A_BOLD) /* X/Open */
+#define A_DIM         A_NORMAL
+
+#define CHR_MSK       A_CHARTEXT           /* Obsolete */
+#define ATR_MSK       A_ATTRIBUTES         /* Obsolete */
+#define ATR_NRM       A_NORMAL             /* Obsolete */
+
+/* For use with attr_t -- X/Open says, "these shall be distinct", so 
+   this is a non-conforming implementation. */
+
+#define WA_ALTCHARSET A_ALTCHARSET
+#define WA_BLINK      A_BLINK
+#define WA_BOLD       A_BOLD
+#define WA_DIM        A_DIM
+#define WA_INVIS      A_INVIS
+#define WA_LEFT       A_LEFTLINE
+#define WA_PROTECT    A_PROTECT
+#define WA_REVERSE    A_REVERSE
+#define WA_RIGHT      A_RIGHTLINE
+#define WA_STANDOUT   A_STANDOUT
+#define WA_UNDERLINE  A_UNDERLINE
+
+#define WA_HORIZONTAL A_NORMAL
+#define WA_LOW        A_NORMAL
+#define WA_TOP        A_NORMAL
+#define WA_VERTICAL   A_NORMAL
+
+/*** Alternate character set macros ***/
+
+/* 'w' = 32-bit chtype; acs_map[] index | A_ALTCHARSET
+   'n' = 16-bit chtype; it gets the fallback set because no bit is 
+         available for A_ALTCHARSET */
+
+#ifdef CHTYPE_LONG
+# define ACS_PICK(w, n) ((chtype)w | A_ALTCHARSET)
+#else
+# define ACS_PICK(w, n) ((chtype)n)
+#endif
+
+/* VT100-compatible symbols -- box chars */
+
+#define ACS_ULCORNER  ACS_PICK('l', '+')
+#define ACS_LLCORNER  ACS_PICK('m', '+')
+#define ACS_URCORNER  ACS_PICK('k', '+')
+#define ACS_LRCORNER  ACS_PICK('j', '+')
+#define ACS_RTEE      ACS_PICK('u', '+')
+#define ACS_LTEE      ACS_PICK('t', '+')
+#define ACS_BTEE      ACS_PICK('v', '+')
+#define ACS_TTEE      ACS_PICK('w', '+')
+#define ACS_HLINE     ACS_PICK('q', '-')
+#define ACS_VLINE     ACS_PICK('x', '|')
+#define ACS_PLUS      ACS_PICK('n', '+')
+
+/* VT100-compatible symbols -- other */
+
+#define ACS_S1        ACS_PICK('o', '-')
+#define ACS_S9        ACS_PICK('s', '_')
+#define ACS_DIAMOND   ACS_PICK('`', '+')
+#define ACS_CKBOARD   ACS_PICK('a', ':')
+#define ACS_DEGREE    ACS_PICK('f', '\'')
+#define ACS_PLMINUS   ACS_PICK('g', '#')
+#define ACS_BULLET    ACS_PICK('~', 'o')
+
+/* Teletype 5410v1 symbols -- these are defined in SysV curses, but
+   are not well-supported by most terminals. Stick to VT100 characters
+   for optimum portability. */
+
+#define ACS_LARROW    ACS_PICK(',', '<')
+#define ACS_RARROW    ACS_PICK('+', '>')
+#define ACS_DARROW    ACS_PICK('.', 'v')
+#define ACS_UARROW    ACS_PICK('-', '^')
+#define ACS_BOARD     ACS_PICK('h', '#')
+#define ACS_LANTERN   ACS_PICK('i', '*')
+#define ACS_BLOCK     ACS_PICK('0', '#')
+
+/* That goes double for these -- undocumented SysV symbols. Don't use
+   them. */
+
+#define ACS_S3        ACS_PICK('p', '-')
+#define ACS_S7        ACS_PICK('r', '-')
+#define ACS_LEQUAL    ACS_PICK('y', '<')
+#define ACS_GEQUAL    ACS_PICK('z', '>')
+#define ACS_PI        ACS_PICK('{', 'n')
+#define ACS_NEQUAL    ACS_PICK('|', '+')
+#define ACS_STERLING  ACS_PICK('}', 'L')
+
+/* Box char aliases */
+
+#define ACS_BSSB      ACS_ULCORNER
+#define ACS_SSBB      ACS_LLCORNER
+#define ACS_BBSS      ACS_URCORNER
+#define ACS_SBBS      ACS_LRCORNER
+#define ACS_SBSS      ACS_RTEE
+#define ACS_SSSB      ACS_LTEE
+#define ACS_SSBS      ACS_BTEE
+#define ACS_BSSS      ACS_TTEE
+#define ACS_BSBS      ACS_HLINE
+#define ACS_SBSB      ACS_VLINE
+#define ACS_SSSS      ACS_PLUS
+
+/* cchar_t aliases */
+
+#ifdef PDC_WIDE
+# define WACS_ULCORNER (&(acs_map['l']))
+# define WACS_LLCORNER (&(acs_map['m']))
+# define WACS_URCORNER (&(acs_map['k']))
+# define WACS_LRCORNER (&(acs_map['j']))
+# define WACS_RTEE     (&(acs_map['u']))
+# define WACS_LTEE     (&(acs_map['t']))
+# define WACS_BTEE     (&(acs_map['v']))
+# define WACS_TTEE     (&(acs_map['w']))
+# define WACS_HLINE    (&(acs_map['q']))
+# define WACS_VLINE    (&(acs_map['x']))
+# define WACS_PLUS     (&(acs_map['n']))
+
+# define WACS_S1       (&(acs_map['o']))
+# define WACS_S9       (&(acs_map['s']))
+# define WACS_DIAMOND  (&(acs_map['`']))
+# define WACS_CKBOARD  (&(acs_map['a']))
+# define WACS_DEGREE   (&(acs_map['f']))
+# define WACS_PLMINUS  (&(acs_map['g']))
+# define WACS_BULLET   (&(acs_map['~']))
+
+# define WACS_LARROW   (&(acs_map[',']))
+# define WACS_RARROW   (&(acs_map['+']))
+# define WACS_DARROW   (&(acs_map['.']))
+# define WACS_UARROW   (&(acs_map['-']))
+# define WACS_BOARD    (&(acs_map['h']))
+# define WACS_LANTERN  (&(acs_map['i']))
+# define WACS_BLOCK    (&(acs_map['0']))
+
+# define WACS_S3       (&(acs_map['p']))
+# define WACS_S7       (&(acs_map['r']))
+# define WACS_LEQUAL   (&(acs_map['y']))
+# define WACS_GEQUAL   (&(acs_map['z']))
+# define WACS_PI       (&(acs_map['{']))
+# define WACS_NEQUAL   (&(acs_map['|']))
+# define WACS_STERLING (&(acs_map['}']))
+
+# define WACS_BSSB     WACS_ULCORNER
+# define WACS_SSBB     WACS_LLCORNER
+# define WACS_BBSS     WACS_URCORNER
+# define WACS_SBBS     WACS_LRCORNER
+# define WACS_SBSS     WACS_RTEE
+# define WACS_SSSB     WACS_LTEE
+# define WACS_SSBS     WACS_BTEE
+# define WACS_BSSS     WACS_TTEE
+# define WACS_BSBS     WACS_HLINE
+# define WACS_SBSB     WACS_VLINE
+# define WACS_SSSS     WACS_PLUS
+#endif
+
+/*** Color macros ***/
+
+#define COLOR_BLACK   0
+
+#ifdef PDC_RGB        /* RGB */
+# define COLOR_RED    1
+# define COLOR_GREEN  2
+# define COLOR_BLUE   4
+#else                 /* BGR */
+# define COLOR_BLUE   1
+# define COLOR_GREEN  2
+# define COLOR_RED    4
+#endif
+
+#define COLOR_CYAN    (COLOR_BLUE | COLOR_GREEN)
+#define COLOR_MAGENTA (COLOR_RED | COLOR_BLUE)
+#define COLOR_YELLOW  (COLOR_RED | COLOR_GREEN)
+
+#define COLOR_WHITE   7
+
+/*----------------------------------------------------------------------
+ *
+ *  Function and Keypad Key Definitions.
+ *  Many are just for compatibility.
+ *
+ */
+
+#define KEY_CODE_YES  0x100  /* If get_wch() gives a key code */
+
+#define KEY_BREAK     0x101  /* Not on PC KBD */
+#define KEY_DOWN      0x102  /* Down arrow key */
+#define KEY_UP        0x103  /* Up arrow key */
+#define KEY_LEFT      0x104  /* Left arrow key */
+#define KEY_RIGHT     0x105  /* Right arrow key */
+#define KEY_HOME      0x106  /* home key */
+#define KEY_BACKSPACE 0x107  /* not on pc */
+#define KEY_F0        0x108  /* function keys; 64 reserved */
+
+#define KEY_DL        0x148  /* delete line */
+#define KEY_IL        0x149  /* insert line */
+#define KEY_DC        0x14a  /* delete character */
+#define KEY_IC        0x14b  /* insert char or enter ins mode */
+#define KEY_EIC       0x14c  /* exit insert char mode */
+#define KEY_CLEAR     0x14d  /* clear screen */
+#define KEY_EOS       0x14e  /* clear to end of screen */
+#define KEY_EOL       0x14f  /* clear to end of line */
+#define KEY_SF        0x150  /* scroll 1 line forward */
+#define KEY_SR        0x151  /* scroll 1 line back (reverse) */
+#define KEY_NPAGE     0x152  /* next page */
+#define KEY_PPAGE     0x153  /* previous page */
+#define KEY_STAB      0x154  /* set tab */
+#define KEY_CTAB      0x155  /* clear tab */
+#define KEY_CATAB     0x156  /* clear all tabs */
+#define KEY_ENTER     0x157  /* enter or send (unreliable) */
+#define KEY_SRESET    0x158  /* soft/reset (partial/unreliable) */
+#define KEY_RESET     0x159  /* reset/hard reset (unreliable) */
+#define KEY_PRINT     0x15a  /* print/copy */
+#define KEY_LL        0x15b  /* home down/bottom (lower left) */
+#define KEY_ABORT     0x15c  /* abort/terminate key (any) */
+#define KEY_SHELP     0x15d  /* short help */
+#define KEY_LHELP     0x15e  /* long help */
+#define KEY_BTAB      0x15f  /* Back tab key */
+#define KEY_BEG       0x160  /* beg(inning) key */
+#define KEY_CANCEL    0x161  /* cancel key */
+#define KEY_CLOSE     0x162  /* close key */
+#define KEY_COMMAND   0x163  /* cmd (command) key */
+#define KEY_COPY      0x164  /* copy key */
+#define KEY_CREATE    0x165  /* create key */
+#define KEY_END       0x166  /* end key */
+#define KEY_EXIT      0x167  /* exit key */
+#define KEY_FIND      0x168  /* find key */
+#define KEY_HELP      0x169  /* help key */
+#define KEY_MARK      0x16a  /* mark key */
+#define KEY_MESSAGE   0x16b  /* message key */
+#define KEY_MOVE      0x16c  /* move key */
+#define KEY_NEXT      0x16d  /* next object key */
+#define KEY_OPEN      0x16e  /* open key */
+#define KEY_OPTIONS   0x16f  /* options key */
+#define KEY_PREVIOUS  0x170  /* previous object key */
+#define KEY_REDO      0x171  /* redo key */
+#define KEY_REFERENCE 0x172  /* ref(erence) key */
+#define KEY_REFRESH   0x173  /* refresh key */
+#define KEY_REPLACE   0x174  /* replace key */
+#define KEY_RESTART   0x175  /* restart key */
+#define KEY_RESUME    0x176  /* resume key */
+#define KEY_SAVE      0x177  /* save key */
+#define KEY_SBEG      0x178  /* shifted beginning key */
+#define KEY_SCANCEL   0x179  /* shifted cancel key */
+#define KEY_SCOMMAND  0x17a  /* shifted command key */
+#define KEY_SCOPY     0x17b  /* shifted copy key */
+#define KEY_SCREATE   0x17c  /* shifted create key */
+#define KEY_SDC       0x17d  /* shifted delete char key */
+#define KEY_SDL       0x17e  /* shifted delete line key */
+#define KEY_SELECT    0x17f  /* select key */
+#define KEY_SEND      0x180  /* shifted end key */
+#define KEY_SEOL      0x181  /* shifted clear line key */
+#define KEY_SEXIT     0x182  /* shifted exit key */
+#define KEY_SFIND     0x183  /* shifted find key */
+#define KEY_SHOME     0x184  /* shifted home key */
+#define KEY_SIC       0x185  /* shifted input key */
+
+#define KEY_SLEFT     0x187  /* shifted left arrow key */
+#define KEY_SMESSAGE  0x188  /* shifted message key */
+#define KEY_SMOVE     0x189  /* shifted move key */
+#define KEY_SNEXT     0x18a  /* shifted next key */
+#define KEY_SOPTIONS  0x18b  /* shifted options key */
+#define KEY_SPREVIOUS 0x18c  /* shifted prev key */
+#define KEY_SPRINT    0x18d  /* shifted print key */
+#define KEY_SREDO     0x18e  /* shifted redo key */
+#define KEY_SREPLACE  0x18f  /* shifted replace key */
+#define KEY_SRIGHT    0x190  /* shifted right arrow */
+#define KEY_SRSUME    0x191  /* shifted resume key */
+#define KEY_SSAVE     0x192  /* shifted save key */
+#define KEY_SSUSPEND  0x193  /* shifted suspend key */
+#define KEY_SUNDO     0x194  /* shifted undo key */
+#define KEY_SUSPEND   0x195  /* suspend key */
+#define KEY_UNDO      0x196  /* undo key */
+
+/* PDCurses-specific key definitions -- PC only */
+
+#define ALT_0         0x197
+#define ALT_1         0x198
+#define ALT_2         0x199
+#define ALT_3         0x19a
+#define ALT_4         0x19b
+#define ALT_5         0x19c
+#define ALT_6         0x19d
+#define ALT_7         0x19e
+#define ALT_8         0x19f
+#define ALT_9         0x1a0
+#define ALT_A         0x1a1
+#define ALT_B         0x1a2
+#define ALT_C         0x1a3
+#define ALT_D         0x1a4
+#define ALT_E         0x1a5
+#define ALT_F         0x1a6
+#define ALT_G         0x1a7
+#define ALT_H         0x1a8
+#define ALT_I         0x1a9
+#define ALT_J         0x1aa
+#define ALT_K         0x1ab
+#define ALT_L         0x1ac
+#define ALT_M         0x1ad
+#define ALT_N         0x1ae
+#define ALT_O         0x1af
+#define ALT_P         0x1b0
+#define ALT_Q         0x1b1
+#define ALT_R         0x1b2
+#define ALT_S         0x1b3
+#define ALT_T         0x1b4
+#define ALT_U         0x1b5
+#define ALT_V         0x1b6
+#define ALT_W         0x1b7
+#define ALT_X         0x1b8
+#define ALT_Y         0x1b9
+#define ALT_Z         0x1ba
+
+#define CTL_LEFT      0x1bb  /* Control-Left-Arrow */
+#define CTL_RIGHT     0x1bc
+#define CTL_PGUP      0x1bd
+#define CTL_PGDN      0x1be
+#define CTL_HOME      0x1bf
+#define CTL_END       0x1c0
+
+#define KEY_A1        0x1c1  /* upper left on Virtual keypad */
+#define KEY_A2        0x1c2  /* upper middle on Virt. keypad */
+#define KEY_A3        0x1c3  /* upper right on Vir. keypad */
+#define KEY_B1        0x1c4  /* middle left on Virt. keypad */
+#define KEY_B2        0x1c5  /* center on Virt. keypad */
+#define KEY_B3        0x1c6  /* middle right on Vir. keypad */
+#define KEY_C1        0x1c7  /* lower left on Virt. keypad */
+#define KEY_C2        0x1c8  /* lower middle on Virt. keypad */
+#define KEY_C3        0x1c9  /* lower right on Vir. keypad */
+
+#define PADSLASH      0x1ca  /* slash on keypad */
+#define PADENTER      0x1cb  /* enter on keypad */
+#define CTL_PADENTER  0x1cc  /* ctl-enter on keypad */
+#define ALT_PADENTER  0x1cd  /* alt-enter on keypad */
+#define PADSTOP       0x1ce  /* stop on keypad */
+#define PADSTAR       0x1cf  /* star on keypad */
+#define PADMINUS      0x1d0  /* minus on keypad */
+#define PADPLUS       0x1d1  /* plus on keypad */
+#define CTL_PADSTOP   0x1d2  /* ctl-stop on keypad */
+#define CTL_PADCENTER 0x1d3  /* ctl-enter on keypad */
+#define CTL_PADPLUS   0x1d4  /* ctl-plus on keypad */
+#define CTL_PADMINUS  0x1d5  /* ctl-minus on keypad */
+#define CTL_PADSLASH  0x1d6  /* ctl-slash on keypad */
+#define CTL_PADSTAR   0x1d7  /* ctl-star on keypad */
+#define ALT_PADPLUS   0x1d8  /* alt-plus on keypad */
+#define ALT_PADMINUS  0x1d9  /* alt-minus on keypad */
+#define ALT_PADSLASH  0x1da  /* alt-slash on keypad */
+#define ALT_PADSTAR   0x1db  /* alt-star on keypad */
+#define ALT_PADSTOP   0x1dc  /* alt-stop on keypad */
+#define CTL_INS       0x1dd  /* ctl-insert */
+#define ALT_DEL       0x1de  /* alt-delete */
+#define ALT_INS       0x1df  /* alt-insert */
+#define CTL_UP        0x1e0  /* ctl-up arrow */
+#define CTL_DOWN      0x1e1  /* ctl-down arrow */
+#define CTL_TAB       0x1e2  /* ctl-tab */
+#define ALT_TAB       0x1e3
+#define ALT_MINUS     0x1e4
+#define ALT_EQUAL     0x1e5
+#define ALT_HOME      0x1e6
+#define ALT_PGUP      0x1e7
+#define ALT_PGDN      0x1e8
+#define ALT_END       0x1e9
+#define ALT_UP        0x1ea  /* alt-up arrow */
+#define ALT_DOWN      0x1eb  /* alt-down arrow */
+#define ALT_RIGHT     0x1ec  /* alt-right arrow */
+#define ALT_LEFT      0x1ed  /* alt-left arrow */
+#define ALT_ENTER     0x1ee  /* alt-enter */
+#define ALT_ESC       0x1ef  /* alt-escape */
+#define ALT_BQUOTE    0x1f0  /* alt-back quote */
+#define ALT_LBRACKET  0x1f1  /* alt-left bracket */
+#define ALT_RBRACKET  0x1f2  /* alt-right bracket */
+#define ALT_SEMICOLON 0x1f3  /* alt-semi-colon */
+#define ALT_FQUOTE    0x1f4  /* alt-forward quote */
+#define ALT_COMMA     0x1f5  /* alt-comma */
+#define ALT_STOP      0x1f6  /* alt-stop */
+#define ALT_FSLASH    0x1f7  /* alt-forward slash */
+#define ALT_BKSP      0x1f8  /* alt-backspace */
+#define CTL_BKSP      0x1f9  /* ctl-backspace */
+#define PAD0          0x1fa  /* keypad 0 */
+
+#define CTL_PAD0      0x1fb  /* ctl-keypad 0 */
+#define CTL_PAD1      0x1fc
+#define CTL_PAD2      0x1fd
+#define CTL_PAD3      0x1fe
+#define CTL_PAD4      0x1ff
+#define CTL_PAD5      0x200
+#define CTL_PAD6      0x201
+#define CTL_PAD7      0x202
+#define CTL_PAD8      0x203
+#define CTL_PAD9      0x204
+
+#define ALT_PAD0      0x205  /* alt-keypad 0 */
+#define ALT_PAD1      0x206
+#define ALT_PAD2      0x207
+#define ALT_PAD3      0x208
+#define ALT_PAD4      0x209
+#define ALT_PAD5      0x20a
+#define ALT_PAD6      0x20b
+#define ALT_PAD7      0x20c
+#define ALT_PAD8      0x20d
+#define ALT_PAD9      0x20e
+
+#define CTL_DEL       0x20f  /* clt-delete */
+#define ALT_BSLASH    0x210  /* alt-back slash */
+#define CTL_ENTER     0x211  /* ctl-enter */
+
+#define SHF_PADENTER  0x212  /* shift-enter on keypad */
+#define SHF_PADSLASH  0x213  /* shift-slash on keypad */
+#define SHF_PADSTAR   0x214  /* shift-star  on keypad */
+#define SHF_PADPLUS   0x215  /* shift-plus  on keypad */
+#define SHF_PADMINUS  0x216  /* shift-minus on keypad */
+#define SHF_UP        0x217  /* shift-up on keypad */
+#define SHF_DOWN      0x218  /* shift-down on keypad */
+#define SHF_IC        0x219  /* shift-insert on keypad */
+#define SHF_DC        0x21a  /* shift-delete on keypad */
+
+#define KEY_MOUSE     0x21b  /* "mouse" key */
+#define KEY_SHIFT_L   0x21c  /* Left-shift */
+#define KEY_SHIFT_R   0x21d  /* Right-shift */
+#define KEY_CONTROL_L 0x21e  /* Left-control */
+#define KEY_CONTROL_R 0x21f  /* Right-control */
+#define KEY_ALT_L     0x220  /* Left-alt */
+#define KEY_ALT_R     0x221  /* Right-alt */
+#define KEY_RESIZE    0x222  /* Window resize */
+#define KEY_SUP       0x223  /* Shifted up arrow */
+#define KEY_SDOWN     0x224  /* Shifted down arrow */
+
+#define KEY_MIN       KEY_BREAK      /* Minimum curses key value */
+#define KEY_MAX       KEY_SDOWN      /* Maximum curses key */
+
+#define KEY_F(n)      (KEY_F0 + (n))
+
+/*----------------------------------------------------------------------
+ *
+ *  PDCurses Function Declarations
+ *
+ */
+
+/* Standard */
+
+int     addch(const chtype);
+int     addchnstr(const chtype *, int);
+int     addchstr(const chtype *);
+int     addnstr(const char *, int);
+int     addstr(const char *);
+int     attroff(chtype);
+int     attron(chtype);
+int     attrset(chtype);
+int     attr_get(attr_t *, short *, void *);
+int     attr_off(attr_t, void *);
+int     attr_on(attr_t, void *);
+int     attr_set(attr_t, short, void *);
+int     baudrate(void);
+int     beep(void);
+int     bkgd(chtype);
+void    bkgdset(chtype);
+int     border(chtype, chtype, chtype, chtype, chtype, chtype, chtype, chtype);
+int     box(WINDOW *, chtype, chtype);
+bool    can_change_color(void);
+int     cbreak(void); 
+int     chgat(int, attr_t, short, const void *);
+int     clearok(WINDOW *, bool);
+int     clear(void);
+int     clrtobot(void);
+int     clrtoeol(void);
+int     color_content(short, short *, short *, short *);
+int     color_set(short, void *);
+int     copywin(const WINDOW *, WINDOW *, int, int, int, int, int, int, int);
+int     curs_set(int);
+int     def_prog_mode(void);
+int     def_shell_mode(void);
+int     delay_output(int);
+int     delch(void);
+int     deleteln(void);
+void    delscreen(SCREEN *); 
+int     delwin(WINDOW *);
+WINDOW *derwin(WINDOW *, int, int, int, int);
+int     doupdate(void);
+WINDOW *dupwin(WINDOW *);
+int     echochar(const chtype);
+int     echo(void);
+int     endwin(void);
+char    erasechar(void);
+int     erase(void);
+void    filter(void);
+int     flash(void);
+int     flushinp(void);
+chtype  getbkgd(WINDOW *);
+int     getnstr(char *, int);
+int     getstr(char *);
+WINDOW *getwin(FILE *);
+int     halfdelay(int);
+bool    has_colors(void);
+bool    has_ic(void);
+bool    has_il(void);
+int     hline(chtype, int);
+void    idcok(WINDOW *, bool);
+int     idlok(WINDOW *, bool);
+void    immedok(WINDOW *, bool);
+int     inchnstr(chtype *, int);
+int     inchstr(chtype *);
+chtype  inch(void);
+int     init_color(short, short, short, short);
+int     init_pair(short, short, short);
+WINDOW *initscr(void);
+int     innstr(char *, int);
+int     insch(chtype);
+int     insdelln(int);
+int     insertln(void);
+int     insnstr(const char *, int);
+int     insstr(const char *);
+int     instr(char *);
+int     intrflush(WINDOW *, bool);
+bool    isendwin(void);
+bool    is_linetouched(WINDOW *, int);
+bool    is_wintouched(WINDOW *);
+char   *keyname(int);
+int     keypad(WINDOW *, bool);
+char    killchar(void);
+int     leaveok(WINDOW *, bool);
+char   *longname(void);
+int     meta(WINDOW *, bool);
+int     move(int, int);
+int     mvaddch(int, int, const chtype);
+int     mvaddchnstr(int, int, const chtype *, int);
+int     mvaddchstr(int, int, const chtype *);
+int     mvaddnstr(int, int, const char *, int);
+int     mvaddstr(int, int, const char *);
+int     mvchgat(int, int, int, attr_t, short, const void *);
+int     mvcur(int, int, int, int);
+int     mvdelch(int, int);
+int     mvderwin(WINDOW *, int, int);
+int     mvgetch(int, int);
+int     mvgetnstr(int, int, char *, int);
+int     mvgetstr(int, int, char *);
+int     mvhline(int, int, chtype, int);
+chtype  mvinch(int, int);
+int     mvinchnstr(int, int, chtype *, int);
+int     mvinchstr(int, int, chtype *);
+int     mvinnstr(int, int, char *, int);
+int     mvinsch(int, int, chtype);
+int     mvinsnstr(int, int, const char *, int);
+int     mvinsstr(int, int, const char *);
+int     mvinstr(int, int, char *);
+int     mvprintw(int, int, const char *, ...);
+int     mvscanw(int, int, const char *, ...);
+int     mvvline(int, int, chtype, int);
+int     mvwaddchnstr(WINDOW *, int, int, const chtype *, int);
+int     mvwaddchstr(WINDOW *, int, int, const chtype *);
+int     mvwaddch(WINDOW *, int, int, const chtype);
+int     mvwaddnstr(WINDOW *, int, int, const char *, int);
+int     mvwaddstr(WINDOW *, int, int, const char *);
+int     mvwchgat(WINDOW *, int, int, int, attr_t, short, const void *);
+int     mvwdelch(WINDOW *, int, int);
+int     mvwgetch(WINDOW *, int, int);
+int     mvwgetnstr(WINDOW *, int, int, char *, int);
+int     mvwgetstr(WINDOW *, int, int, char *);
+int     mvwhline(WINDOW *, int, int, chtype, int);
+int     mvwinchnstr(WINDOW *, int, int, chtype *, int);
+int     mvwinchstr(WINDOW *, int, int, chtype *);
+chtype  mvwinch(WINDOW *, int, int);
+int     mvwinnstr(WINDOW *, int, int, char *, int);
+int     mvwinsch(WINDOW *, int, int, chtype);
+int     mvwinsnstr(WINDOW *, int, int, const char *, int);
+int     mvwinsstr(WINDOW *, int, int, const char *);
+int     mvwinstr(WINDOW *, int, int, char *);
+int     mvwin(WINDOW *, int, int);
+int     mvwprintw(WINDOW *, int, int, const char *, ...);
+int     mvwscanw(WINDOW *, int, int, const char *, ...);
+int     mvwvline(WINDOW *, int, int, chtype, int);
+int     napms(int);
+WINDOW *newpad(int, int);
+SCREEN *newterm(const char *, FILE *, FILE *);
+WINDOW *newwin(int, int, int, int);
+int     nl(void);
+int     nocbreak(void);
+int     nodelay(WINDOW *, bool);
+int     noecho(void);
+int     nonl(void);
+void    noqiflush(void);
+int     noraw(void);
+int     notimeout(WINDOW *, bool);
+int     overlay(const WINDOW *, WINDOW *);
+int     overwrite(const WINDOW *, WINDOW *);
+int     pair_content(short, short *, short *);
+int     pechochar(WINDOW *, chtype);
+int     pnoutrefresh(WINDOW *, int, int, int, int, int, int);
+int     prefresh(WINDOW *, int, int, int, int, int, int);
+int     printw(const char *, ...);
+int     putwin(WINDOW *, FILE *);
+void    qiflush(void);
+int     raw(void);
+int     redrawwin(WINDOW *);
+int     refresh(void);
+int     reset_prog_mode(void);
+int     reset_shell_mode(void);
+int     resetty(void);
+int     ripoffline(int, int (*)(WINDOW *, int));
+int     savetty(void);
+int     scanw(const char *, ...);
+int     scr_dump(const char *);
+int     scr_init(const char *);
+int     scr_restore(const char *);
+int     scr_set(const char *);
+int     scrl(int);
+int     scroll(WINDOW *);
+int     scrollok(WINDOW *, bool);
+SCREEN *set_term(SCREEN *);
+int     setscrreg(int, int);
+int     slk_attroff(const chtype);
+int     slk_attr_off(const attr_t, void *);
+int     slk_attron(const chtype);
+int     slk_attr_on(const attr_t, void *);
+int     slk_attrset(const chtype);
+int     slk_attr_set(const attr_t, short, void *);
+int     slk_clear(void);
+int     slk_color(short);
+int     slk_init(int);
+char   *slk_label(int);
+int     slk_noutrefresh(void);
+int     slk_refresh(void);
+int     slk_restore(void);
+int     slk_set(int, const char *, int);
+int     slk_touch(void);
+int     standend(void);
+int     standout(void);
+int     start_color(void);
+WINDOW *subpad(WINDOW *, int, int, int, int);
+WINDOW *subwin(WINDOW *, int, int, int, int);
+int     syncok(WINDOW *, bool);
+chtype  termattrs(void);
+attr_t  term_attrs(void);
+char   *termname(void);
+void    timeout(int);
+int     touchline(WINDOW *, int, int);
+int     touchwin(WINDOW *);
+int     typeahead(int);
+int     untouchwin(WINDOW *);
+void    use_env(bool);
+int     vidattr(chtype);
+int     vid_attr(attr_t, short, void *);
+int     vidputs(chtype, int (*)(int));
+int     vid_puts(attr_t, short, void *, int (*)(int));
+int     vline(chtype, int);
+int     vw_printw(WINDOW *, const char *, va_list);
+int     vwprintw(WINDOW *, const char *, va_list);
+int     vw_scanw(WINDOW *, const char *, va_list);
+int     vwscanw(WINDOW *, const char *, va_list);
+int     waddchnstr(WINDOW *, const chtype *, int);
+int     waddchstr(WINDOW *, const chtype *);
+int     waddch(WINDOW *, const chtype);
+int     waddnstr(WINDOW *, const char *, int);
+int     waddstr(WINDOW *, const char *);
+int     wattroff(WINDOW *, chtype);
+int     wattron(WINDOW *, chtype);
+int     wattrset(WINDOW *, chtype);
+int     wattr_get(WINDOW *, attr_t *, short *, void *);
+int     wattr_off(WINDOW *, attr_t, void *);
+int     wattr_on(WINDOW *, attr_t, void *);
+int     wattr_set(WINDOW *, attr_t, short, void *);
+void    wbkgdset(WINDOW *, chtype);
+int     wbkgd(WINDOW *, chtype);
+int     wborder(WINDOW *, chtype, chtype, chtype, chtype,
+                chtype, chtype, chtype, chtype);
+int     wchgat(WINDOW *, int, attr_t, short, const void *);
+int     wclear(WINDOW *);
+int     wclrtobot(WINDOW *);
+int     wclrtoeol(WINDOW *);
+int     wcolor_set(WINDOW *, short, void *);
+void    wcursyncup(WINDOW *);
+int     wdelch(WINDOW *);
+int     wdeleteln(WINDOW *);
+int     wechochar(WINDOW *, const chtype);
+int     werase(WINDOW *);
+int     wgetch(WINDOW *);
+int     wgetnstr(WINDOW *, char *, int);
+int     wgetstr(WINDOW *, char *);
+int     whline(WINDOW *, chtype, int);
+int     winchnstr(WINDOW *, chtype *, int);
+int     winchstr(WINDOW *, chtype *);
+chtype  winch(WINDOW *);
+int     winnstr(WINDOW *, char *, int);
+int     winsch(WINDOW *, chtype);
+int     winsdelln(WINDOW *, int);
+int     winsertln(WINDOW *);
+int     winsnstr(WINDOW *, const char *, int);
+int     winsstr(WINDOW *, const char *);
+int     winstr(WINDOW *, char *);
+int     wmove(WINDOW *, int, int);
+int     wnoutrefresh(WINDOW *);
+int     wprintw(WINDOW *, const char *, ...);
+int     wredrawln(WINDOW *, int, int);
+int     wrefresh(WINDOW *);
+int     wscanw(WINDOW *, const char *, ...);
+int     wscrl(WINDOW *, int);
+int     wsetscrreg(WINDOW *, int, int);
+int     wstandend(WINDOW *);
+int     wstandout(WINDOW *);
+void    wsyncdown(WINDOW *);
+void    wsyncup(WINDOW *);
+void    wtimeout(WINDOW *, int);
+int     wtouchln(WINDOW *, int, int, int);
+int     wvline(WINDOW *, chtype, int);
+
+/* Wide-character functions */
+
+#ifdef PDC_WIDE
+int     addnwstr(const wchar_t *, int);
+int     addwstr(const wchar_t *);
+int     add_wch(const cchar_t *);
+int     add_wchnstr(const cchar_t *, int);
+int     add_wchstr(const cchar_t *);
+int     border_set(const cchar_t *, const cchar_t *, const cchar_t *, 
+                   const cchar_t *, const cchar_t *, const cchar_t *, 
+                   const cchar_t *, const cchar_t *);
+int     box_set(WINDOW *, const cchar_t *, const cchar_t *);
+int     echo_wchar(const cchar_t *);
+int     erasewchar(wchar_t *);
+int     getbkgrnd(cchar_t *);
+int     getcchar(const cchar_t *, wchar_t *, attr_t *, short *, void *);
+int     getn_wstr(wint_t *, int);
+int     get_wch(wint_t *);
+int     get_wstr(wint_t *);
+int     hline_set(const cchar_t *, int);
+int     innwstr(wchar_t *, int);
+int     ins_nwstr(const wchar_t *, int);
+int     ins_wch(const cchar_t *);
+int     ins_wstr(const wchar_t *);
+int     inwstr(wchar_t *);
+int     in_wch(cchar_t *);
+int     in_wchnstr(cchar_t *, int);
+int     in_wchstr(cchar_t *);
+char   *key_name(wchar_t);
+int     killwchar(wchar_t *);
+int     mvaddnwstr(int, int, const wchar_t *, int);
+int     mvaddwstr(int, int, const wchar_t *);
+int     mvadd_wch(int, int, const cchar_t *);
+int     mvadd_wchnstr(int, int, const cchar_t *, int);
+int     mvadd_wchstr(int, int, const cchar_t *);
+int     mvgetn_wstr(int, int, wint_t *, int);
+int     mvget_wch(int, int, wint_t *);
+int     mvget_wstr(int, int, wint_t *);
+int     mvhline_set(int, int, const cchar_t *, int);
+int     mvinnwstr(int, int, wchar_t *, int);
+int     mvins_nwstr(int, int, const wchar_t *, int);
+int     mvins_wch(int, int, const cchar_t *);
+int     mvins_wstr(int, int, const wchar_t *);
+int     mvinwstr(int, int, wchar_t *);
+int     mvin_wch(int, int, cchar_t *);
+int     mvin_wchnstr(int, int, cchar_t *, int);
+int     mvin_wchstr(int, int, cchar_t *);
+int     mvvline_set(int, int, const cchar_t *, int);
+int     mvwaddnwstr(WINDOW *, int, int, const wchar_t *, int);
+int     mvwaddwstr(WINDOW *, int, int, const wchar_t *);
+int     mvwadd_wch(WINDOW *, int, int, const cchar_t *);
+int     mvwadd_wchnstr(WINDOW *, int, int, const cchar_t *, int);
+int     mvwadd_wchstr(WINDOW *, int, int, const cchar_t *);
+int     mvwgetn_wstr(WINDOW *, int, int, wint_t *, int);
+int     mvwget_wch(WINDOW *, int, int, wint_t *);
+int     mvwget_wstr(WINDOW *, int, int, wint_t *);
+int     mvwhline_set(WINDOW *, int, int, const cchar_t *, int);
+int     mvwinnwstr(WINDOW *, int, int, wchar_t *, int);
+int     mvwins_nwstr(WINDOW *, int, int, const wchar_t *, int);
+int     mvwins_wch(WINDOW *, int, int, const cchar_t *);
+int     mvwins_wstr(WINDOW *, int, int, const wchar_t *);
+int     mvwin_wch(WINDOW *, int, int, cchar_t *);
+int     mvwin_wchnstr(WINDOW *, int, int, cchar_t *, int);
+int     mvwin_wchstr(WINDOW *, int, int, cchar_t *);
+int     mvwinwstr(WINDOW *, int, int, wchar_t *);
+int     mvwvline_set(WINDOW *, int, int, const cchar_t *, int);
+int     pecho_wchar(WINDOW *, const cchar_t*);
+int     setcchar(cchar_t*, const wchar_t*, const attr_t, short, const void*);
+int     slk_wset(int, const wchar_t *, int);
+int     unget_wch(const wchar_t);
+int     vline_set(const cchar_t *, int);
+int     waddnwstr(WINDOW *, const wchar_t *, int);
+int     waddwstr(WINDOW *, const wchar_t *);
+int     wadd_wch(WINDOW *, const cchar_t *);
+int     wadd_wchnstr(WINDOW *, const cchar_t *, int);
+int     wadd_wchstr(WINDOW *, const cchar_t *);
+int     wbkgrnd(WINDOW *, const cchar_t *);
+void    wbkgrndset(WINDOW *, const cchar_t *);
+int     wborder_set(WINDOW *, const cchar_t *, const cchar_t *,
+                    const cchar_t *, const cchar_t *, const cchar_t *, 
+                    const cchar_t *, const cchar_t *, const cchar_t *);
+int     wecho_wchar(WINDOW *, const cchar_t *);
+int     wgetbkgrnd(WINDOW *, cchar_t *);
+int     wgetn_wstr(WINDOW *, wint_t *, int);
+int     wget_wch(WINDOW *, wint_t *);
+int     wget_wstr(WINDOW *, wint_t *);
+int     whline_set(WINDOW *, const cchar_t *, int);
+int     winnwstr(WINDOW *, wchar_t *, int);
+int     wins_nwstr(WINDOW *, const wchar_t *, int);
+int     wins_wch(WINDOW *, const cchar_t *);
+int     wins_wstr(WINDOW *, const wchar_t *);
+int     winwstr(WINDOW *, wchar_t *);
+int     win_wch(WINDOW *, cchar_t *);
+int     win_wchnstr(WINDOW *, cchar_t *, int);
+int     win_wchstr(WINDOW *, cchar_t *);
+wchar_t *wunctrl(cchar_t *);
+int     wvline_set(WINDOW *, const cchar_t *, int);
+#endif
+
+/* Quasi-standard */
+
+chtype  getattrs(WINDOW *);
+int     getbegx(WINDOW *);
+int     getbegy(WINDOW *);
+int     getmaxx(WINDOW *);
+int     getmaxy(WINDOW *);
+int     getparx(WINDOW *);
+int     getpary(WINDOW *);
+int     getcurx(WINDOW *);
+int     getcury(WINDOW *);
+void    traceoff(void);
+void    traceon(void);
+char   *unctrl(chtype);
+
+int     crmode(void);
+int     nocrmode(void);
+int     draino(int);
+int     resetterm(void);
+int     fixterm(void);
+int     saveterm(void);
+int     setsyx(int, int);
+
+int     mouse_set(unsigned long);
+int     mouse_on(unsigned long);
+int     mouse_off(unsigned long);
+int     request_mouse_pos(void);
+int     map_button(unsigned long);
+void    wmouse_position(WINDOW *, int *, int *);
+unsigned long getmouse(void);
+unsigned long getbmap(void);
+
+/* ncurses */
+
+int     assume_default_colors(int, int);
+const char *curses_version(void);
+bool    has_key(int);
+int     use_default_colors(void);
+int     wresize(WINDOW *, int, int);
+
+int     mouseinterval(int);
+mmask_t mousemask(mmask_t, mmask_t *);
+bool    mouse_trafo(int *, int *, bool);
+int     nc_getmouse(MEVENT *);
+int     ungetmouse(MEVENT *);
+bool    wenclose(const WINDOW *, int, int);
+bool    wmouse_trafo(const WINDOW *, int *, int *, bool);
+
+/* PDCurses */
+
+int     addrawch(chtype);
+int     insrawch(chtype);
+bool    is_termresized(void);
+int     mvaddrawch(int, int, chtype);
+int     mvdeleteln(int, int);
+int     mvinsertln(int, int);
+int     mvinsrawch(int, int, chtype);
+int     mvwaddrawch(WINDOW *, int, int, chtype);
+int     mvwdeleteln(WINDOW *, int, int);
+int     mvwinsertln(WINDOW *, int, int);
+int     mvwinsrawch(WINDOW *, int, int, chtype);
+int     raw_output(bool);
+int     resize_term(int, int);
+WINDOW *resize_window(WINDOW *, int, int);
+int     waddrawch(WINDOW *, chtype);
+int     winsrawch(WINDOW *, chtype);
+char    wordchar(void);
+
+#ifdef PDC_WIDE
+wchar_t *slk_wlabel(int);
+#endif
+
+void    PDC_debug(const char *, ...);
+int     PDC_ungetch(int);
+int     PDC_set_blink(bool);
+int     PDC_set_line_color(short);
+void    PDC_set_title(const char *);
+
+int     PDC_clearclipboard(void);
+int     PDC_freeclipboard(char *);
+int     PDC_getclipboard(char **, long *);
+int     PDC_setclipboard(const char *, long);
+
+unsigned long PDC_get_input_fd(void);
+unsigned long PDC_get_key_modifiers(void);
+int     PDC_return_key_modifiers(bool);
+int     PDC_save_key_modifiers(bool);
+
+#ifdef XCURSES
+WINDOW *Xinitscr(int, char **);
+void    XCursesExit(void);
+int     sb_init(void);
+int     sb_set_horz(int, int, int);
+int     sb_set_vert(int, int, int);
+int     sb_get_horz(int *, int *, int *);
+int     sb_get_vert(int *, int *, int *);
+int     sb_refresh(void);
+#endif
+
+/*** Functions defined as macros ***/
+
+/* getch() and ungetch() conflict with some DOS libraries */
+
+#define getch()            wgetch(stdscr)
+#define ungetch(ch)        PDC_ungetch(ch)
+
+#define COLOR_PAIR(n)      (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR)
+#define PAIR_NUMBER(n)     (((n) & A_COLOR) >> PDC_COLOR_SHIFT)
+
+/* These will _only_ work as macros */
+
+#define getbegyx(w, y, x)  (y = getbegy(w), x = getbegx(w))
+#define getmaxyx(w, y, x)  (y = getmaxy(w), x = getmaxx(w))
+#define getparyx(w, y, x)  (y = getpary(w), x = getparx(w))
+#define getyx(w, y, x)     (y = getcury(w), x = getcurx(w))
+
+#define getsyx(y, x)       { if (curscr->_leaveit) (y)=(x)=-1; \
+                             else getyx(curscr,(y),(x)); }
+
+#ifdef NCURSES_MOUSE_VERSION
+# define getmouse(x) nc_getmouse(x)
+#endif
+
+/* return codes from PDC_getclipboard() and PDC_setclipboard() calls */
+
+#define PDC_CLIP_SUCCESS         0
+#define PDC_CLIP_ACCESS_ERROR    1
+#define PDC_CLIP_EMPTY           2
+#define PDC_CLIP_MEMORY_ERROR    3
+
+/* PDCurses key modifier masks */
+
+#define PDC_KEY_MODIFIER_SHIFT   1
+#define PDC_KEY_MODIFIER_CONTROL 2
+#define PDC_KEY_MODIFIER_ALT     4
+#define PDC_KEY_MODIFIER_NUMLOCK 8
+
+#if defined(__cplusplus) || defined(__cplusplus__) || defined(__CPLUSPLUS)
+# undef bool
+}
+#endif
+
+#endif  /* __PDCURSES__ */
diff --git a/payloads/libpayload/curses/PDCurses-3.4/curspriv.h b/payloads/libpayload/curses/PDCurses-3.4/curspriv.h
new file mode 100644
index 0000000..8b34f01
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/curspriv.h
@@ -0,0 +1,142 @@
+/* Public Domain Curses */
+
+/* $Id: curspriv.h,v 1.158 2008/07/13 16:08:16 wmcbrine Exp $ */
+
+/* Private definitions and declarations for use within PDCurses.
+   These should generally not be referenced by applications. */
+
+#ifndef __CURSES_INTERNALS__
+#define __CURSES_INTERNALS__ 1
+
+#ifdef HAVE_CONFIG_H
+# include <config.h>
+#endif
+
+#define CURSES_LIBRARY
+#include <curses.h>
+
+#if defined(__TURBOC__) || defined(__EMX__) || defined(__DJGPP__) || \
+    defined(__CYGWIN32__) || defined(__MINGW32__) || \
+    defined(__WATCOMC__) || defined(__PACIFIC__)
+# ifndef HAVE_VSSCANF
+#  define HAVE_VSSCANF       /* have vsscanf() */
+# endif
+#endif
+
+#if defined(__CYGWIN32__) || defined(__MINGW32__) || \
+    defined(__LCC__) || defined(__WATCOMC__)
+# ifndef HAVE_VSNPRINTF
+#  define HAVE_VSNPRINTF     /* have vsnprintf() */
+# endif
+#endif
+
+#if defined(_MSC_VER) && defined(_WIN32) && !defined(_CRT_SECURE_NO_DEPRECATE)
+# define _CRT_SECURE_NO_DEPRECATE 1   /* kill nonsense warnings */
+#endif
+
+/*----------------------------------------------------------------------*/
+
+typedef struct           /* structure for ripped off lines */
+{
+    int line;
+    int (*init)(WINDOW *, int);
+} RIPPEDOFFLINE;
+
+/* Window properties */
+
+#define _SUBWIN    0x01  /* window is a subwindow */
+#define _PAD       0x10  /* X/Open Pad. */
+#define _SUBPAD    0x20  /* X/Open subpad. */
+
+/* Miscellaneous */
+
+#define _NO_CHANGE -1    /* flags line edge unchanged */
+
+#define _ECHAR     0x08  /* Erase char       (^H) */
+#define _DWCHAR    0x17  /* Delete Word char (^W) */
+#define _DLCHAR    0x15  /* Delete Line char (^U) */
+
+extern WINDOW *pdc_lastscr;
+extern bool pdc_trace_on;   /* tracing flag */
+extern bool pdc_color_started;
+extern unsigned long pdc_key_modifiers;
+extern MOUSE_STATUS pdc_mouse_status;
+
+/*----------------------------------------------------------------------*/
+
+/* Platform implementation functions */
+
+void    PDC_beep(void);
+bool    PDC_can_change_color(void);
+int     PDC_color_content(short, short *, short *, short *);
+bool    PDC_check_key(void);
+int     PDC_curs_set(int);
+void    PDC_flushinp(void);
+int     PDC_get_columns(void);
+int     PDC_get_cursor_mode(void);
+int     PDC_get_key(void);
+int     PDC_get_rows(void);
+void    PDC_gotoyx(int, int);
+int     PDC_init_color(short, short, short, short);
+void    PDC_init_pair(short, short, short);
+int     PDC_modifiers_set(void);
+int     PDC_mouse_set(void);
+void    PDC_napms(int);
+int     PDC_pair_content(short, short *, short *);
+void    PDC_reset_prog_mode(void);
+void    PDC_reset_shell_mode(void);
+int     PDC_resize_screen(int, int);
+void    PDC_restore_screen_mode(int);
+void    PDC_save_screen_mode(int);
+void    PDC_scr_close(void);
+void    PDC_scr_free(void);
+int     PDC_scr_open(int, char **);
+void    PDC_set_keyboard_binary(bool);
+void    PDC_transform_line(int, int, int, const chtype *);
+const char *PDC_sysname(void);
+
+/* Internal cross-module functions */
+
+void    PDC_init_atrtab(void);
+WINDOW *PDC_makelines(WINDOW *);
+WINDOW *PDC_makenew(int, int, int, int);
+int     PDC_mouse_in_slk(int, int);
+void    PDC_slk_free(void);
+void    PDC_slk_initialize(void);
+void    PDC_sync(WINDOW *);
+
+#ifdef PDC_WIDE
+int     PDC_mbtowc(wchar_t *, const char *, size_t);
+size_t  PDC_mbstowcs(wchar_t *, const char *, size_t);
+size_t  PDC_wcstombs(char *, const wchar_t *, size_t);
+#endif
+
+#ifdef PDCDEBUG
+# define PDC_LOG(x) if (pdc_trace_on) PDC_debug x
+# define RCSID(x) static const char *rcsid = x;
+#else
+# define PDC_LOG(x)
+# define RCSID(x)
+#endif
+
+/* Internal macros for attributes */
+
+#ifdef CHTYPE_LONG
+# define PDC_COLOR_PAIRS 256
+#else
+# define PDC_COLOR_PAIRS  32
+#endif
+
+#ifndef max
+# define max(a,b) (((a) > (b)) ? (a) : (b))
+#endif
+#ifndef min
+# define min(a,b) (((a) < (b)) ? (a) : (b))
+#endif
+
+#define DIVROUND(num, divisor) ((num) + ((divisor) >> 1)) / (divisor)
+
+#define PDC_CLICK_PERIOD 150  /* time to wait for a click, if
+                                 not set by mouseinterval() */
+
+#endif /* __CURSES_INTERNALS__*/
diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/README b/payloads/libpayload/curses/PDCurses-3.4/demos/README
new file mode 100644
index 0000000..8f4b5c6
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/demos/README
@@ -0,0 +1,25 @@
+PDCurses Demos
+==============
+
+This directory contains demonstration programs to show and test the 
+capabilities of curses libraries. Some of them predate PDCurses, 
+PCcurses or even pcurses/ncurses. Although some PDCurses-specific code 
+has been added, all programs remain portable to other implementations 
+(at a minimum, to ncurses).
+
+
+Building
+--------
+
+The demos are built by the platform-specific makefiles, in the platform 
+directories. Alternatively, you can build them manually, individually, 
+and link with any curses library; e.g., "cc -lcurses -orain rain.c". 
+There are no dependencies besides curses and the standard C library, and 
+no configuration is needed.
+
+
+Distribution Status
+-------------------
+
+Public Domain, except for rain.c and worm.c, which are under the ncurses 
+license (MIT-like).
diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c b/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c
new file mode 100644
index 0000000..8d7921f
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/demos/firework.c
@@ -0,0 +1,148 @@
+/* $Id: firework.c,v 1.25 2008/07/13 16:08:17 wmcbrine Exp $ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <curses.h>
+#include <ctype.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <time.h>
+
+#define DELAYSIZE 200
+
+void myrefresh(void);
+void get_color(void);
+void explode(int, int);
+
+short color_table[] =
+{
+    COLOR_RED, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN,
+    COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE
+};
+
+int main(int argc, char **argv)
+{
+    int i, start, end, row, diff, flag, direction, seed;
+
+#ifdef XCURSES
+    Xinitscr(argc, argv);
+#else
+    initscr();
+#endif
+    nodelay(stdscr, TRUE);
+    noecho();
+
+    if (has_colors())
+        start_color();
+
+    for (i = 0; i < 8; i++)
+        init_pair(i, color_table[i], COLOR_BLACK);
+
+    seed = time((time_t *)0);
+    srand(seed);
+    flag = 0;
+       
+    while (getch() == ERR)      /* loop until a key is hit */
+    {
+        do {
+            start = rand() % (COLS - 3);
+            end = rand() % (COLS - 3);
+            start = (start < 2) ? 2 : start;
+            end = (end < 2) ? 2 : end;
+            direction = (start > end) ? -1 : 1;
+            diff = abs(start - end);
+
+        } while (diff < 2 || diff >= LINES - 2);
+
+        attrset(A_NORMAL);
+
+        for (row = 0; row < diff; row++)
+        {
+            mvaddstr(LINES - row, row * direction + start,
+                (direction < 0) ? "\\" : "/");
+
+            if (flag++)
+            {
+                myrefresh();
+                erase();
+                flag = 0;
+            }
+        }
+
+        if (flag++)
+        {
+            myrefresh();
+            flag = 0;
+        }
+
+        explode(LINES - row, diff * direction + start);
+        erase();
+        myrefresh();
+    }
+
+    endwin();
+
+    return 0;
+}
+
+void explode(int row, int col)
+{
+    erase();
+    mvaddstr(row, col, "-");
+    myrefresh();
+
+    --col;
+
+    get_color();
+    mvaddstr(row - 1, col, " - ");
+    mvaddstr(row,     col, "-+-");
+    mvaddstr(row + 1, col, " - ");
+    myrefresh();
+
+    --col;
+
+    get_color();
+    mvaddstr(row - 2, col, " --- ");
+    mvaddstr(row - 1, col, "-+++-");
+    mvaddstr(row,     col, "-+#+-");
+    mvaddstr(row + 1, col, "-+++-");
+    mvaddstr(row + 2, col, " --- ");
+    myrefresh();
+
+    get_color();
+    mvaddstr(row - 2, col, " +++ ");
+    mvaddstr(row - 1, col, "++#++");
+    mvaddstr(row,     col, "+# #+");
+    mvaddstr(row + 1, col, "++#++");
+    mvaddstr(row + 2, col, " +++ ");
+    myrefresh();
+
+    get_color();
+    mvaddstr(row - 2, col, "  #  ");
+    mvaddstr(row - 1, col, "## ##");
+    mvaddstr(row,     col, "#   #");
+    mvaddstr(row + 1, col, "## ##");
+    mvaddstr(row + 2, col, "  #  ");
+    myrefresh();
+
+    get_color();
+    mvaddstr(row - 2, col, " # # ");
+    mvaddstr(row - 1, col, "#   #");
+    mvaddstr(row,     col, "     ");
+    mvaddstr(row + 1, col, "#   #");
+    mvaddstr(row + 2, col, " # # ");
+    myrefresh();
+}
+
+void myrefresh(void)
+{
+    napms(DELAYSIZE);
+    move(LINES - 1, COLS - 1);
+    refresh();
+}
+
+void get_color(void)
+{
+    chtype bold = (rand() % 2) ? A_BOLD : A_NORMAL;
+    attrset(COLOR_PAIR(rand() % 8) | bold);
+}
diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c b/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c
new file mode 100644
index 0000000..3eae98d
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/demos/newdemo.c
@@ -0,0 +1,425 @@
+/*
+ *  newdemo.c   -   A demo program using PDCurses. The program 
+ *          illustrates the use of colors for text output.
+ *
+ *  Hacks by jbuhler@cs.washington.edu on 12/29/96
+ *
+ *  $Id: newdemo.c,v 1.39 2008/07/13 16:08:17 wmcbrine Exp $
+ */
+
+#include <stdio.h>
+#include <signal.h>
+#include <string.h>
+#include <curses.h>
+#include <stdlib.h>
+#include <time.h>
+
+int WaitForUser(void);
+int SubWinTest(WINDOW *);
+int BouncingBalls(WINDOW *);
+void trap(int);
+
+/* An ASCII map of Australia */
+
+char *AusMap[17] =
+{
+    "                       A ",
+    "           AA         AA ",
+    "    N.T. AAAAA       AAAA ",
+    "     AAAAAAAAAAA  AAAAAAAA ",
+    "   AAAAAAAAAAAAAAAAAAAAAAAAA Qld.",
+    " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
+    " AAAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
+    " AAAAAAAAAAAAAAAAAAAAAAAAAAAA ",
+    "   AAAAAAAAAAAAAAAAAAAAAAAAA N.S.W.",
+    "W.A. AAAAAAAAA      AAAAAA Vic.",
+    "       AAA   S.A.     AA",
+    "                       A  Tas.",
+    ""
+};
+
+/* Funny messages for the scroller */
+
+char *messages[] =
+{
+    "Hello from the Land Down Under",
+    "The Land of crocs, and a big Red Rock",
+    "Where the sunflower runs along the highways",
+    "The dusty red roads lead one to loneliness",
+    "Blue sky in the morning and",
+    "Freezing nights and twinkling stars",
+    NULL
+};
+
+int WaitForUser(void)
+{
+    chtype ch;
+
+    nodelay(stdscr, TRUE);
+    halfdelay(50);
+
+    ch = getch();
+
+    nodelay(stdscr, FALSE);
+    nocbreak();     /* Reset the halfdelay() value */
+    cbreak();
+
+    return (ch == '\033') ? ch : 0;
+}
+
+int SubWinTest(WINDOW *win)
+{
+    WINDOW *swin1, *swin2, *swin3;
+    int w, h, sw, sh, bx, by;
+
+    wattrset(win, 0);
+    getmaxyx(win, h, w);
+    getbegyx(win, by, bx);
+
+    sw = w / 3;
+    sh = h / 3;
+
+    if ((swin1 = derwin(win, sh, sw, 3, 5)) == NULL)
+        return 1;
+    if ((swin2 = subwin(win, sh, sw, by + 4, bx + 8)) == NULL)
+        return 1;
+    if ((swin3 = subwin(win, sh, sw, by + 5, bx + 11)) == NULL)
+        return 1;
+
+    init_pair(8, COLOR_RED, COLOR_BLUE);
+    wbkgd(swin1, COLOR_PAIR(8));
+    werase(swin1);
+    mvwaddstr(swin1, 0, 3, "Sub-window 1");
+    wrefresh(swin1);
+
+    init_pair(9, COLOR_CYAN, COLOR_MAGENTA);
+    wbkgd(swin2, COLOR_PAIR(9));
+    werase(swin2);
+    mvwaddstr(swin2, 0, 3, "Sub-window 2");
+    wrefresh(swin2);
+
+    init_pair(10, COLOR_YELLOW, COLOR_GREEN);
+    wbkgd(swin3, COLOR_PAIR(10));
+    werase(swin3);
+    mvwaddstr(swin3, 0, 3, "Sub-window 3");
+    wrefresh(swin3);
+
+    delwin(swin1);
+    delwin(swin2);
+    delwin(swin3);
+    WaitForUser();
+
+    return 0;
+}
+
+int BouncingBalls(WINDOW *win)
+{
+    chtype c1, c2, c3, ball1, ball2, ball3;
+    int w, h, x1, y1, xd1, yd1, x2, y2, xd2, yd2, x3, y3, xd3, yd3, c;
+
+    curs_set(0);
+
+    wbkgd(win, COLOR_PAIR(1));
+    wrefresh(win);
+    wattrset(win, 0);
+
+    init_pair(11, COLOR_RED, COLOR_GREEN);
+    init_pair(12, COLOR_BLUE, COLOR_RED);
+    init_pair(13, COLOR_YELLOW, COLOR_WHITE);
+
+    ball1 = 'O' | COLOR_PAIR(11);
+    ball2 = '*' | COLOR_PAIR(12);
+    ball3 = '@' | COLOR_PAIR(13);
+
+    getmaxyx(win, h, w);
+
+    x1 = 2 + rand() % (w - 4);
+    y1 = 2 + rand() % (h - 4);
+    x2 = 2 + rand() % (w - 4);
+    y2 = 2 + rand() % (h - 4);
+    x3 = 2 + rand() % (w - 4);
+    y3 = 2 + rand() % (h - 4);
+
+    xd1 = 1;
+    yd1 = 1;
+    xd2 = 1;
+    yd2 = -1;
+    xd3 = -1;
+    yd3 = 1;
+
+    nodelay(stdscr, TRUE);
+
+    while ((c = getch()) == ERR)
+    {
+        x1 += xd1;
+        if (x1 <= 1 || x1 >= w - 2)
+            xd1 *= -1;
+
+        y1 += yd1;
+        if (y1 <= 1 || y1 >= h - 2)
+            yd1 *= -1;
+
+        x2 += xd2;
+        if (x2 <= 1 || x2 >= w - 2)
+            xd2 *= -1;
+
+        y2 += yd2;
+        if (y2 <= 1 || y2 >= h - 2)
+            yd2 *= -1;
+
+        x3 += xd3;
+        if (x3 <= 1 || x3 >= w - 2)
+            xd3 *= -1;
+
+        y3 += yd3;
+        if (y3 <= 1 || y3 >= h - 2)
+            yd3 *= -1;
+
+        c1 = mvwinch(win, y1, x1);
+        c2 = mvwinch(win, y2, x2);
+        c3 = mvwinch(win, y3, x3);
+
+        mvwaddch(win, y1, x1, ball1);
+        mvwaddch(win, y2, x2, ball2);
+        mvwaddch(win, y3, x3, ball3);
+
+        wmove(win, 0, 0);
+        wrefresh(win);
+
+        mvwaddch(win, y1, x1, c1);
+        mvwaddch(win, y2, x2, c2);
+        mvwaddch(win, y3, x3, c3);
+
+        napms(150);
+    }
+
+    nodelay(stdscr, FALSE);
+    ungetch(c);
+    return 0;
+}
+
+/* Trap interrupt */
+
+void trap(int sig)
+{
+    if (sig == SIGINT)
+    {
+        endwin();
+
+        exit(0);
+    }
+}
+
+int main(int argc, char **argv)
+{
+    WINDOW *win;
+    chtype save[80], ch;
+    int width, height, w, x, y, i, j, seed;
+
+#ifdef XCURSES
+    Xinitscr(argc, argv);
+#else
+    initscr();
+#endif
+    seed = time((time_t *)0);
+        srand(seed);
+
+    start_color();
+# if defined(NCURSES_VERSION) || (defined(PDC_BUILD) && PDC_BUILD > 3000)
+    use_default_colors();
+# endif
+    cbreak();
+    noecho();
+
+    curs_set(0);
+
+#if !defined(__TURBOC__) && !defined(OS2)
+    signal(SIGINT, trap);
+#endif
+    noecho();
+
+    /* refresh stdscr so that reading from it will not cause it to 
+       overwrite the other windows that are being created */
+
+    refresh();
+
+    /* Create a drawing window */
+
+    width  = 48;
+    height = 15;
+
+    win = newwin(height, width, (LINES - height) / 2, (COLS - width) / 2);
+
+    if (win == NULL)
+    {
+        endwin();
+
+        return 1;
+    }
+
+    for (;;)
+    {
+        init_pair(1, COLOR_WHITE, COLOR_BLUE);
+        wbkgd(win, COLOR_PAIR(1));
+        werase(win);
+
+        init_pair(2, COLOR_RED, COLOR_RED);
+        wattrset(win, COLOR_PAIR(2));
+        box(win, ' ', ' ');
+        wrefresh(win);
+      
+        wattrset(win, 0);
+
+        /* Do random output of a character */
+
+        ch = 'a';
+
+        nodelay(stdscr, TRUE);
+
+        for (i = 0; i < 5000; ++i)
+        {
+            x = rand() % (width - 2) + 1;
+            y = rand() % (height - 2) + 1;
+
+            mvwaddch(win, y, x, ch);
+            wrefresh(win);
+
+            if (getch() != ERR)
+                break;
+
+            if (i == 2000)
+            {
+                ch = 'b';
+                init_pair(3, COLOR_CYAN, COLOR_YELLOW);
+                wattrset(win, COLOR_PAIR(3));
+            }
+        }
+
+        nodelay(stdscr, FALSE);
+
+        SubWinTest(win);
+
+        /* Erase and draw green window */
+
+        init_pair(4, COLOR_YELLOW, COLOR_GREEN);
+        wbkgd(win, COLOR_PAIR(4));
+        wattrset(win, A_BOLD);
+        werase(win);
+        wrefresh(win);
+
+        /* Draw RED bounding box */
+
+        wattrset(win, COLOR_PAIR(2));
+        box(win, ' ', ' ');
+        wrefresh(win);
+
+        /* Display Australia map */
+
+        wattrset(win, A_BOLD);
+        i = 0;
+
+        while (*AusMap[i])
+        {
+            mvwaddstr(win, i + 1, 8, AusMap[i]);
+            wrefresh(win);
+            napms(100);
+            ++i;
+        }
+
+        init_pair(5, COLOR_BLUE, COLOR_WHITE);
+        wattrset(win, COLOR_PAIR(5) | A_BLINK);
+        mvwaddstr(win, height - 2, 3,
+            " PDCurses 3.4 - DOS, OS/2, Win32, X11, SDL");
+        wrefresh(win);
+
+        /* Draw running messages */
+
+        init_pair(6, COLOR_BLACK, COLOR_WHITE);
+        wattrset(win, COLOR_PAIR(6));
+        w = width - 2;
+        nodelay(win, TRUE);
+
+        /* jbuhler's re-hacked scrolling messages */
+
+        for (j = 0; messages[j] != NULL; j++)
+        {
+            char *message = messages[j];
+            int msg_len = strlen(message);
+            int scroll_len = w + 2 * msg_len;
+            char *scrollbuf = malloc(scroll_len);
+            char *visbuf = scrollbuf + msg_len;
+            int stop = 0;
+            int i;
+
+            for (i = w + msg_len; i > 0; i--)
+            {
+                memset(visbuf, ' ', w);
+                strncpy(scrollbuf + i, message, msg_len);
+                mvwaddnstr(win, height / 2, 1, visbuf, w);
+                wrefresh(win);
+
+                if (wgetch(win) != ERR)
+                {
+                    flushinp();
+                    stop = 1;
+                    break;
+                }
+
+                napms(100);
+            }
+
+            free(scrollbuf);
+
+            if (stop)
+                break;
+        }
+
+        j = 0;
+
+        /*  Draw running 'A's across in RED */
+
+        init_pair(7, COLOR_RED, COLOR_GREEN);
+        wattron(win, COLOR_PAIR(7));
+
+        for (i = 2; i < width - 4; ++i)
+        {
+            ch = mvwinch(win, 5, i);
+            save[j++] = ch;
+            ch = ch & 0x7f;
+            mvwaddch(win, 5, i, ch);
+        }
+
+        wrefresh(win);
+
+        /* Put a message up; wait for a key */
+
+        i = height - 2;
+        wattrset(win, COLOR_PAIR(5));
+        mvwaddstr(win, i, 3,
+            "   Type a key to continue or ESC to quit  ");
+        wrefresh(win);
+
+        if (WaitForUser() == '\033')
+            break;
+
+        /* Restore the old line */
+
+        wattrset(win, 0);
+
+        for (i = 2, j = 0; i < width - 4; ++i)
+            mvwaddch(win, 5, i, save[j++]);
+
+        wrefresh(win);
+
+        BouncingBalls(win);
+
+        /* BouncingBalls() leaves a keystroke in the queue */
+
+        if (WaitForUser() == '\033')
+            break;
+    }
+
+    endwin();
+
+    return 0;
+}
diff --git a/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c b/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c
new file mode 100644
index 0000000..1134f6f
--- /dev/null
+++ b/payloads/libpayload/curses/PDCurses-3.4/demos/ptest.c
@@ -0,0 +1,285 @@
+/* $Id: ptest.c,v 1.24 2008/07/13 16:08:17 wmcbrine Exp $ */
+
+#include <curses.h>
+#include <panel.h>
+#include <stdlib.h>
+
+PANEL *p1, *p2, *p3, *p4, *p5;
+WINDOW *w4, *w5;
+
+long nap_msec = 1;
+
+char *mod[] = 
+{
+    "test ", "TEST ", "(**) ", "*()* ", "<--> ", "LAST "
+};
+
+void pflush(void)
+{
+    update_panels();
+    doupdate();
+}
+
+void backfill(void)
+{
+    int y, x;
+
+    erase();
+
+    for (y = 0; y < LINES - 1; y++)
+        for (x = 0; x < COLS; x++)
+            printw("%d", (y + x) % 10);
+}
+
+void wait_a_while(long msec)
+{
+    int c;
+
+    if (msec != 1)
+        timeout(msec);
+
+    c = getch();
+
+    if (c == 'q')
+    {
+        endwin();
+        exit(1);
+    }
+}
+
+void saywhat(const char *text)
+{
+    mvprintw(LINES - 1, 0, "%-20.20s", text);
+}
+
+/* mkpanel - alloc a win and panel and associate them */
+
+PANEL *mkpanel(int rows, int cols, int tly, int tlx)
+{
+    WINDOW *win = newwin(rows, cols, tly, tlx);
+    PANEL *pan = (PANEL *)0;
+
+    if (win)
+    {
+        pan = new_panel(win);
+
+        if (!pan)
+            delwin(win);
+    }
+
+    return pan;
+}
+
+void rmpanel(PANEL *pan)
+{
+    WINDOW *win = pan->win;
+
+    del_panel(pan);
+    delwin(win);
+}
+
+void fill_panel(PANEL *pan)
+{
+    WINDOW *win = pan->win;
+    char num = *((char *)pan->user + 1);
+    int y, x, maxy, maxx;
+
+    box(win, 0, 0);  
+    mvwprintw(win, 1, 1, "-pan%c-", num);
+    getmaxyx(win, maxy, maxx);
+
+    for (y = 2; y < maxy - 1; y++)
+        for (x = 1; x < maxx - 1; x++)
+            mvwaddch(win, y, x, num);
+}
+
+int main(int argc, char **argv)
+{
+    int itmp, y;
+
+    if (argc > 1 && atol(argv[1]))
+        nap_msec = atol(argv[1]);
+
+#ifdef XCURSES