--- newt-0.52.2.orig/debian/patches/222_fix_gauge_crash.patch +++ newt-0.52.2/debian/patches/222_fix_gauge_crash.patch @@ -0,0 +1,26 @@ +diff -ur newt-0.52.2/dialogboxes.c newt-0.52.2/dialogboxes.c +--- newt-0.52.2/dialogboxes.c 2005-09-21 05:32:03.000000000 -0400 ++++ newt-0.52.2/dialogboxes.c 2006-08-03 01:07:27.000000000 -0400 +@@ -140,7 +140,7 @@ + } + + val = strtoul(buf, &end, 10); +- if (!*end) { ++ if (!*end && val >= 0) { + newtScaleSet(scale, val); + newtDrawForm(form); + newtRefresh(); +diff -ur newt-0.52.2/scale.c newt-0.52.2/scale.c +--- newt-0.52.2/scale.c 2006-08-03 01:07:33.000000000 -0400 ++++ newt-0.52.2/scale.c 2006-08-03 01:07:27.000000000 -0400 +@@ -48,6 +48,10 @@ + struct scale * sc = co->data; + int newPercentage; + ++ /* this will promote fullValue to unsigned for the compare */ ++ if (amount > sc->fullValue) ++ amount = sc->fullValue; ++ + sc->charsSet = (amount * co->width) / sc->fullValue; + newPercentage = (amount * 100) / sc->fullValue; + --- newt-0.52.2.orig/debian/patches/130_colors.patch +++ newt-0.52.2/debian/patches/130_colors.patch @@ -0,0 +1,35 @@ +# Patch taken from Fedora newt 0.52.2-7; makes the default colors +# more 8-color-display friendly. +# +diff -ruN newt-0.52.2-old/newt.c newt-0.52.2/newt.c +--- newt-0.52.2-old/newt.c 2006-06-20 16:13:12.000000000 +0000 ++++ newt-0.52.2/newt.c 2006-06-20 16:13:24.000000000 +0000 +@@ -506,21 +506,21 @@ + "red", "lightgray", /* title fg, bg */ + "lightgray", "red", /* button fg, bg */ + "red", "lightgray", /* active button fg, bg */ +- "yellow", "blue", /* checkbox fg, bg */ +- "blue", "brown", /* active checkbox fg, bg */ +- "yellow", "blue", /* entry box fg, bg */ ++ "lightgray", "blue", /* checkbox fg, bg */ ++ "lightgray", "red", /* active checkbox fg, bg */ ++ "lightgray", "blue", /* entry box fg, bg */ + "blue", "lightgray", /* label fg, bg */ + "black", "lightgray", /* listbox fg, bg */ +- "yellow", "blue", /* active listbox fg, bg */ ++ "lightgray", "blue", /* active listbox fg, bg */ + "black", "lightgray", /* textbox fg, bg */ +- "lightgray", "black", /* active textbox fg, bg */ ++ "lightgray", "red", /* active textbox fg, bg */ + "white", "blue", /* help line */ +- "yellow", "blue", /* root text */ ++ "lightgray", "blue", /* root text */ + "blue", /* scale full */ + "red", /* scale empty */ + "blue", "lightgray", /* disabled entry fg, bg */ + "black", "lightgray", /* compact button fg, bg */ +- "yellow", "red", /* active & sel listbox */ ++ "lightgray", "red", /* active & sel listbox */ + "black", "brown" /* selected listbox */ + }; + --- newt-0.52.2.orig/debian/patches/100_dzongkha.patch +++ newt-0.52.2/debian/patches/100_dzongkha.patch @@ -0,0 +1,45 @@ +diff -ruN newt-0.52.2-old/po/dz.po newt-0.52.2/po/dz.po +--- newt-0.52.2-old/po/dz.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/dz.po 2006-06-20 21:13:38.000000000 +0100 +@@ -0,0 +1,34 @@ ++# Dzongkha translation of newt ++# Copyright @ 2006 Free Software Foundation. ++# Kinley Tshering ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: newt\n" ++"Report-Msgid-Bugs-To: mckinstry@debian.org\n" ++"POT-Creation-Date: 2005-11-22 09:35+0100\n" ++"PO-Revision-Date: 2006-04-05 20:34-0500\n" ++"Last-Translator: kinley tshering \n" ++"Language-Team: DZONGKHA \n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=utf-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++ ++#: dialogboxes.c:43 ++#: dialogboxes.c:48 ++#: dialogboxes.c:493 ++msgid "Ok" ++msgstr "བཏུབ།" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "ཆ་མེད་གཏང་།" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "ཨིན།" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "མེན།" ++ +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2006-06-20 21:13:38.000000000 +0100 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 21:13:59.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bn bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de dz el es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh + --- newt-0.52.2.orig/debian/patches/140_screensize.patch +++ newt-0.52.2/debian/patches/140_screensize.patch @@ -0,0 +1,1495 @@ +# Patch from Fedora newt 0.52.2-7 to fix window handling when handling windows +# larger than the screen size. +diff -ruN newt-0.52.2-old/newt.c newt-0.52.2/newt.c +--- newt-0.52.2-old/newt.c 2006-06-20 16:29:35.000000000 +0000 ++++ newt-0.52.2/newt.c 2006-06-20 16:29:45.000000000 +0000 +@@ -1064,14 +1064,14 @@ + + /** + * Open a new window. +- * @param left. unsigned int Size; _not_ including border +- * @param top: unsigned int size, _not_ including border ++ * @param left. int Size; _not_ including border ++ * @param top: int size, _not_ including border + * @param width unsigned int + * @param height unsigned int + * @param title - title string + * @return zero on success (currently no errors reported) + */ +-int newtOpenWindow(unsigned int left, unsigned int top, ++int newtOpenWindow(int left, int top, + unsigned int width, unsigned int height, + const char * title) { + int j, row, col; +@@ -1162,14 +1162,14 @@ + */ + int newtCenteredWindow(unsigned int width,unsigned int height, + const char * title) { +- unsigned int top, left; ++ int top, left; + +- top = (SLtt_Screen_Rows - height) / 2; ++ top = (int)(SLtt_Screen_Rows - height) / 2; + + /* I don't know why, but this seems to look better */ + if ((SLtt_Screen_Rows % 2) && (top % 2)) top--; + +- left = (SLtt_Screen_Cols - width) / 2; ++ left = (int)(SLtt_Screen_Cols - width) / 2; + + newtOpenWindow(left, top, width, height, title); + +diff -ruN newt-0.52.2-old/newt.c.orig newt-0.52.2/newt.c.orig +--- newt-0.52.2-old/newt.c.orig 1970-01-01 00:00:00.000000000 +0000 ++++ newt-0.52.2/newt.c.orig 2006-06-20 16:29:35.000000000 +0000 +@@ -0,0 +1,1438 @@ ++#include "config.h" ++ ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++#include ++ ++#ifdef HAVE_ALLOCA_H ++#include ++#endif ++ ++#include "newt.h" ++#include "newt_pr.h" ++ ++#if defined(HAVE_FRIBIDI_FRIBIDI_H) && defined(HAVE_DLFCN_H) ++#include ++#include ++ ++/* No sense in enabling shaping if we don't have BIDI support. */ ++typedef struct ++{ ++ int is_shaped; ++ wchar_t isolated; ++ wchar_t initial; ++ wchar_t medial; ++ wchar_t final; ++} ++arabic_char_node; ++ ++#define ARABIC_BASE 0x621 ++#define ARABIC_END 0x64A ++ ++static const arabic_char_node arabic_shaping_table[] = { ++/* 0x621 */ { TRUE , 0xFE80, 0x0000, 0x0000, 0x0000}, ++/* 0x622 */ { TRUE , 0xFE81, 0x0000, 0x0000, 0xFE82}, ++/* 0x623 */ { TRUE , 0xFE83, 0x0000, 0x0000, 0xFE84}, ++/* 0x624 */ { TRUE , 0xFE85, 0x0000, 0x0000, 0xFE86}, ++/* 0x625 */ { TRUE , 0xFE87, 0x0000, 0x0000, 0xFE88}, ++/* 0x626 */ { TRUE , 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, ++/* 0x627 */ { TRUE , 0xFE8D, 0x0000, 0x0000, 0xFE8E}, ++/* 0x628 */ { TRUE , 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, ++/* 0x629 */ { TRUE , 0xFE93, 0x0000, 0x0000, 0xFE94}, ++/* 0x62A */ { TRUE , 0xFE95, 0xFE97, 0xFE98, 0xFE96}, ++/* 0x62B */ { TRUE , 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, ++/* 0x62C */ { TRUE , 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, ++/* 0x62D */ { TRUE , 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, ++/* 0x62E */ { TRUE , 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, ++/* 0x62F */ { TRUE , 0xFEA9, 0x0000, 0x0000, 0xFEAA}, ++/* 0x630 */ { TRUE , 0xFEAB, 0x0000, 0x0000, 0xFEAC}, ++/* 0x631 */ { TRUE , 0xFEAD, 0x0000, 0x0000, 0xFEAE}, ++/* 0x632 */ { TRUE , 0xFEAF, 0x0000, 0x0000, 0xFEB0}, ++/* 0x633 */ { TRUE , 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, ++/* 0x634 */ { TRUE , 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, ++/* 0x635 */ { TRUE , 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, ++/* 0x636 */ { TRUE , 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, ++/* 0x637 */ { TRUE , 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, ++/* 0x638 */ { TRUE , 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, ++/* 0x639 */ { TRUE , 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, ++/* 0x63A */ { TRUE , 0xFECD, 0xFECF, 0xFED0, 0xFECE}, ++/* 0x63B */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63C */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63D */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63E */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63F */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x640 */ { TRUE , 0x0640, 0x0640, 0x0640, 0x0640}, ++/* 0x641 */ { TRUE , 0xFED1, 0xFED3, 0xFED4, 0xFED2}, ++/* 0x642 */ { TRUE , 0xFED5, 0xFED7, 0xFED8, 0xFED6}, ++/* 0x643 */ { TRUE , 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, ++/* 0x644 */ { TRUE , 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, ++/* 0x645 */ { TRUE , 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, ++/* 0x646 */ { TRUE , 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, ++/* 0x647 */ { TRUE , 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, ++/* 0x648 */ { TRUE , 0xFEED, 0x0000, 0x0000, 0xFEEE}, ++/* 0x649 */ { TRUE , 0xFEEF, 0x0000, 0x0000, 0xFEF0}, ++/* 0x64A */ { TRUE , 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2} ++}; ++ ++typedef struct { ++ wchar_t c; ++ arabic_char_node ar_node; ++} ++extra_char_node; ++ ++#define EXTRA_BASE 0x67E ++#define EXTRA_END 0x6CC ++static const extra_char_node extra_shaping_table[] = { ++ {0x067E, {TRUE, 0xFB56, 0xFB58, 0xFB59, 0xFB57}}, ++ {0x0686, {TRUE, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}}, ++ {0x0698, {TRUE, 0xFB8A, 0x0000, 0x0000, 0xFB8B}}, ++ {0x06A9, {TRUE, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}}, ++ {0x06AF, {TRUE, 0xFB92, 0xFB94, 0xFB95, 0xFB93}}, ++ {0x06CC, {TRUE, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}}, ++ {0x0000, {FALSE, 0x0000, 0x0000, 0x0000, 0x0000}}, ++}; ++ ++static const arabic_char_node *get_char_node(wchar_t w) ++{ ++ if (w >= ARABIC_BASE && w <= ARABIC_END) ++ return &arabic_shaping_table[w - ARABIC_BASE]; ++ else if (w >= EXTRA_BASE && w <= EXTRA_END) { ++ const extra_char_node *node = extra_shaping_table; ++ ++ while (node->c) { ++ if (node->c == w) ++ return &node->ar_node; ++ node++; ++ } ++ return NULL; ++ } ++ return NULL; ++} ++ ++static int do_shaping(wchar_t *buf, int len) { ++ int i,j; ++ ++ wchar_t *newbuf; ++ ++ if (len < 1) ++ return 0; ++ ++ newbuf = (wchar_t *)malloc(sizeof(wchar_t)*len); ++ ++ for (i = 0, j = 0; i < len; i++, j++) { ++ int have_previous = FALSE, have_next = FALSE; ++ const arabic_char_node *node, *node1; ++ int prev, next; ++ ++ if (buf[i] == L'\0') ++ break; ++ ++ /* If it is non-joiner, ignore it */ ++ if (buf[i] == 0x200C) { ++ j--; ++ continue; ++ } ++ ++ newbuf[j] = buf[i]; ++ ++ /* If it's not in our range, skip it. */ ++ node = get_char_node(buf[i]); ++ if (!node) ++ { ++ continue; ++ } ++ ++ /* The character wasn't included in the unicode shaping table. */ ++ if (!node->is_shaped) ++ { ++ continue; ++ } ++ ++ for (prev = i - 1; prev >= 0; prev--) ++ if (wcwidth(buf[prev]) || buf[prev] == 0x200C) ++ break; ++ ++ if (prev >= 0 && (node1 = get_char_node(buf[prev])) ++ && ( node1->initial || node1->medial)) ++ { ++ have_previous = TRUE; ++ } ++ ++ for (next = i + 1; next < len; next++) ++ if (wcwidth(buf[next]) || buf[next] == 0x200C) ++ break; ++ ++ if (next < len && (node1 = get_char_node(buf[next])) ++ && (node1->medial || node1->final)) ++ { ++ have_next = TRUE; ++ } ++ ++ /* ++ * FIXME: do not make ligature if there are combining ++ * characters between two parts. ++ */ ++ if (buf[i] == 0x644 && have_next && next == i + 1) ++ { ++ switch (buf[next]) ++ { ++ case 0x622: ++ newbuf[j] = 0xFEF5 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x623: ++ newbuf[j] = 0xFEF7 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x625: ++ newbuf[j] = 0xFEF9 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x627: ++ newbuf[j] = 0xFEFB + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ default: ++ break; ++ } ++ } ++ ++ /** Medial **/ ++ if (have_previous && have_next && node->medial) ++ { ++ newbuf[j] = node->medial; ++ } ++ ++ /** Final **/ ++ else if (have_previous && node->final) ++ { ++ newbuf[j] = node->final; ++ } ++ ++ /** Initial **/ ++ else if (have_next && node->initial) ++ { ++ newbuf[j] = node->initial; ++ } ++ ++ /** Isolated **/ ++ else if (node->isolated) ++ { ++ newbuf[j] = node->isolated; ++ } ++ } ++ for (i = 0; i < len && i < j; i++) { ++ buf[i] = newbuf[i]; ++ } ++ while (i < len) { ++ buf[i++] = L'\0'; ++ } ++ ++ free(newbuf); ++ return 0; ++} ++ ++/* Converts bidi wchar text {in} to visual wchar text which is displayable ++ * in text mode. Uses {base_dir} as default base direction. ++ * Returns malloc'ed converted text or NULL in case of error or if {need_out} is ++ * not set. Modifies {base_dir} to reflect actual direction. ++ */ ++static wchar_t* wchar_to_textmod_visual(wchar_t *in,unsigned int len,FriBidiCharType *base_dir, int need_out) ++{ ++ FriBidiChar *out = NULL; ++ static void *handle = NULL; ++ ++ fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex, ++ FriBidiCharType *, FriBidiChar *, ++ FriBidiStrIndex *, FriBidiStrIndex *, ++ FriBidiLevel *); ++ ++ if (!handle) ++ handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); ++ if (!handle) ++ handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); ++ if (!handle) ++ return NULL; ++ ++ func_ptr = dlsym(handle, "fribidi_log2vis"); ++ if (!func_ptr) { ++ dlclose(handle); ++ handle = NULL; ++ return NULL; ++ } ++ ++ if (need_out) { ++ out = (FriBidiChar *)malloc(sizeof(FriBidiChar)*(len+1)); ++ if(!out) ++ { ++ dlclose(handle); ++ handle = NULL; ++ return (wchar_t *) out; ++ } ++ ++ do_shaping(in, len); ++ len = wcsnlen(in, len); ++ } ++ (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); ++ ++ return (wchar_t *) out; ++} ++ ++/* ++ * Converts text given in {str} from logical order to visual order. ++ * Uses {dir} as base direction ('N', 'R', 'L'). ++ * Returns malloc'ed converted string. Modifies {dir} to reflect actual ++ * direction. ++ */ ++static char *_newt_log2vis(const char *str, char *dir) ++{ ++ wchar_t *wcs; ++ char *rstr = NULL; ++ int len = strlen(str); ++ int ret; ++ FriBidiCharType basedir; ++ ++ switch (*dir) ++ { ++ case 'R': basedir = FRIBIDI_TYPE_R; ++ break; ++ case 'L': basedir = FRIBIDI_TYPE_L; ++ break; ++ default: basedir = FRIBIDI_TYPE_ON; ++ break; ++ } ++ ++ if (len) { ++ wchar_t *owcs; ++ int newlen; ++ ++ wcs = malloc(sizeof(*wcs) * (len + 1)); ++ if (!wcs) ++ return NULL; ++ ret = mbstowcs(wcs, str, len + 1); ++ if (ret < 0) { ++ free(wcs); ++ return NULL; ++ } ++ owcs = wchar_to_textmod_visual(wcs, ret, &basedir, 1); ++ if (FRIBIDI_DIR_TO_LEVEL(basedir)) ++ *dir = 'R'; ++ else ++ *dir = 'L'; ++ ++ free(wcs); ++ if (!owcs) ++ return NULL; ++ ++ newlen = wcstombs(NULL, owcs, 0); ++ if (newlen < 0) { ++ free(owcs); ++ return NULL; ++ } ++ rstr = malloc(newlen + 1); ++ if (!rstr) { ++ free(owcs); ++ return NULL; ++ } ++ ret = wcstombs(rstr, owcs, newlen + 1); ++ free(owcs); ++ if (ret < 0) { ++ free(rstr); ++ return NULL; ++ } ++ } ++ return rstr; ++} ++ ++/* Returns base direction of text given in {str}. ++ */ ++char get_text_direction(const char *str) ++{ ++ int len = strlen(str); ++ char dir = 'N'; ++ wchar_t *wcs; ++ int ret; ++ ++ FriBidiCharType basedir = FRIBIDI_TYPE_ON; ++ ++ if (len) { ++ wcs = malloc(sizeof(*wcs) * (len + 1)); ++ if (!wcs) ++ return dir; ++ ret = mbstowcs(wcs, str, len + 1); ++ if (ret < 0) { ++ free(wcs); ++ return dir; ++ } ++ wchar_to_textmod_visual(wcs, ret, &basedir, 1); ++ free(wcs); ++ if (FRIBIDI_DIR_TO_LEVEL(basedir)) ++ dir = 'R'; ++ else ++ dir = 'L'; ++ } ++ return dir; ++} ++ ++/* If width of string {str} is less then {width} adds ++ * final spaces to make it {width} position wide. ++ * Returns malloc'ed padded string or NULL in case of errors ++ * or if string does not need padding. ++ */ ++static char *pad_line(const char *str, int width) ++{ ++ int len = strlen(str); ++ int w = _newt_wstrlen(str, len); ++ ++ if (w < width) { ++ char *newstr = malloc(len + 1 + (width - w)); ++ if (!newstr) ++ return NULL; ++ memcpy(newstr, str, len); ++ memset(newstr + len, ' ', width - w); ++ newstr[len+width-w] = '\0'; ++ return newstr; ++ } ++ return NULL; ++} ++ ++/* ++ * Writes string {str}. Uses {dir} as default direction. ++ * Returns direction of the string in {dir}. ++ */ ++void write_string_int(const char *str, char *dir) ++{ ++ char dummy; ++ char *tmpstr; ++ ++ if (!dir) { ++ dummy = 'N'; ++ dir = &dummy; ++ } ++ ++ tmpstr = _newt_log2vis(str, dir); ++ if (tmpstr) ++ str = tmpstr; ++ SLsmg_write_string(str); ++ if (tmpstr) ++ free(tmpstr); ++} ++ ++/* Writes at most {n} positions of the string {str}. ++ * Adds final (logical) spaces if string width is less than {n}. ++ * Uses {dir} as default direction. ++ * Returns direction of the string in {dir} ++ */ ++void write_nstring_int(const char *str, int n, char *dir) ++{ ++ char dummy; ++ char *tmpstr, *tmpstr1; ++ ++ if (!dir) { ++ dummy = 'N'; ++ dir = &dummy; ++ } ++ ++ tmpstr1 = pad_line(str, n); ++ if (tmpstr1) ++ str = tmpstr1; ++ tmpstr = _newt_log2vis(str, dir); ++ if (tmpstr) { ++ free(tmpstr1); ++ str = tmpstr; ++ } ++ SLsmg_write_nstring(str, n); ++ if (tmpstr) ++ free(tmpstr); ++ else ++ free(tmpstr1); ++} ++#else ++void write_string_int(const char *str, char *dir) ++{ ++ SLsmg_write_string(str); ++} ++ ++void write_nstring_int(const char *str, int w, char *dir) ++{ ++ SLsmg_write_nstring(str, w); ++} ++ ++char get_text_direction(const char *str) ++{ ++ return 'L'; ++} ++#endif ++ ++struct Window { ++ int height, width, top, left; ++ SLsmg_Char_Type * buffer; ++ char * title; ++}; ++ ++struct keymap { ++ char * str; ++ int code; ++ char * tc; ++}; ++ ++static struct Window windowStack[20]; ++static struct Window * currentWindow = NULL; ++ ++static char * helplineStack[20]; ++static char ** currentHelpline = NULL; ++ ++static int cursorRow, cursorCol; ++static int needResize = 0; ++static int cursorOn = 1; ++static int trashScreen = 0; ++ ++static const char * defaultHelpLine = ++" / between elements | selects | next screen" ++; ++ ++const struct newtColors newtDefaultColorPalette = { ++ "white", "blue", /* root fg, bg */ ++ "black", "lightgray", /* border fg, bg */ ++ "black", "lightgray", /* window fg, bg */ ++ "white", "black", /* shadow fg, bg */ ++ "red", "lightgray", /* title fg, bg */ ++ "lightgray", "red", /* button fg, bg */ ++ "red", "lightgray", /* active button fg, bg */ ++ "lightgray", "blue", /* checkbox fg, bg */ ++ "lightgray", "red", /* active checkbox fg, bg */ ++ "lightgray", "blue", /* entry box fg, bg */ ++ "blue", "lightgray", /* label fg, bg */ ++ "black", "lightgray", /* listbox fg, bg */ ++ "lightgray", "blue", /* active listbox fg, bg */ ++ "black", "lightgray", /* textbox fg, bg */ ++ "lightgray", "red", /* active textbox fg, bg */ ++ "white", "blue", /* help line */ ++ "lightgray", "blue", /* root text */ ++ "blue", /* scale full */ ++ "red", /* scale empty */ ++ "blue", "lightgray", /* disabled entry fg, bg */ ++ "black", "lightgray", /* compact button fg, bg */ ++ "lightgray", "red", /* active & sel listbox */ ++ "black", "brown" /* selected listbox */ ++}; ++ ++static const struct keymap keymap[] = { ++ { "\033OA", NEWT_KEY_UP, "ku" }, ++ { "\020", NEWT_KEY_UP, NULL }, /* emacs ^P */ ++ { "\033OB", NEWT_KEY_DOWN, "kd" }, ++ { "\016", NEWT_KEY_DOWN, NULL }, /* emacs ^N */ ++ { "\033OC", NEWT_KEY_RIGHT, "kr" }, ++ { "\006", NEWT_KEY_RIGHT, NULL }, /* emacs ^F */ ++ { "\033OD", NEWT_KEY_LEFT, "kl" }, ++ { "\002", NEWT_KEY_LEFT, NULL }, /* emacs ^B */ ++ { "\033OH", NEWT_KEY_HOME, "kh" }, ++ { "\033[1~", NEWT_KEY_HOME, NULL }, ++ { "\001", NEWT_KEY_HOME, NULL }, /* emacs ^A */ ++ { "\033Ow", NEWT_KEY_END, "kH" }, ++ { "\033[4~", NEWT_KEY_END, "@7" }, ++ { "\005", NEWT_KEY_END, NULL }, /* emacs ^E */ ++ ++ { "\033[3~", NEWT_KEY_DELETE, "kD" }, ++ { "\004", NEWT_KEY_DELETE, NULL }, /* emacs ^D */ ++ { "\033[2~", NEWT_KEY_INSERT, "kI" }, ++ ++ { "\033\t", NEWT_KEY_UNTAB, "kB" }, ++ ++ { "\033[5~", NEWT_KEY_PGUP, "kP" }, ++ { "\033[6~", NEWT_KEY_PGDN, "kN" }, ++ { "\033V", NEWT_KEY_PGUP, NULL }, ++ { "\033v", NEWT_KEY_PGUP, NULL }, ++ { "\026", NEWT_KEY_PGDN, NULL }, ++ ++ { "\033[[A", NEWT_KEY_F1, NULL }, ++ { "\033[[B", NEWT_KEY_F2, NULL }, ++ { "\033[[C", NEWT_KEY_F3, NULL }, ++ { "\033[[D", NEWT_KEY_F4, NULL }, ++ { "\033[[E", NEWT_KEY_F5, NULL }, ++ ++ { "\033OP", NEWT_KEY_F1, NULL }, ++ { "\033OQ", NEWT_KEY_F2, NULL }, ++ { "\033OR", NEWT_KEY_F3, NULL }, ++ { "\033OS", NEWT_KEY_F4, NULL }, ++ ++ { "\033[11~", NEWT_KEY_F1, "k1" }, ++ { "\033[12~", NEWT_KEY_F2, "k2" }, ++ { "\033[13~", NEWT_KEY_F3, "k3" }, ++ { "\033[14~", NEWT_KEY_F4, "k4" }, ++ { "\033[15~", NEWT_KEY_F5, "k5" }, ++ { "\033[17~", NEWT_KEY_F6, "k6" }, ++ { "\033[18~", NEWT_KEY_F7, "k7" }, ++ { "\033[19~", NEWT_KEY_F8, "k8" }, ++ { "\033[20~", NEWT_KEY_F9, "k9" }, ++ { "\033[21~", NEWT_KEY_F10, "k;" }, ++ { "\033[23~", NEWT_KEY_F11, "F1" }, ++ { "\033[24~", NEWT_KEY_F12, "F2" }, ++ { "\033", NEWT_KEY_ESCAPE, "@2" }, ++ { "\033", NEWT_KEY_ESCAPE, "@9" }, ++ ++ { "\177", NEWT_KEY_BKSPC, NULL }, ++ { "\010", NEWT_KEY_BKSPC, NULL }, ++ ++ { 0 }, /* LEAVE this one */ ++}; ++static void initKeymap(); ++ ++static const char ident[] = // ident friendly ++ "$Version: Newt windowing library v" VERSION " $" ++ "$Copyright: (C) 1996-2003 Red Hat, Inc. Written by Erik Troan $" ++ "$License: Lesser GNU Public License. $"; ++ ++static newtSuspendCallback suspendCallback = NULL; ++static void * suspendCallbackData = NULL; ++ ++void newtSetSuspendCallback(newtSuspendCallback cb, void * data) { ++ suspendCallback = cb; ++ suspendCallbackData = data; ++} ++ ++static void handleSigwinch(int signum) { ++ needResize = 1; ++} ++ ++static int getkeyInterruptHook(void) { ++ return -1; ++} ++ ++int _newt_wstrlen(const char *str, int len) { ++ mbstate_t ps; ++ wchar_t tmp; ++ int nchars = 0; ++ ++ if (!str) return 0; ++ if (!len) return 0; ++ if (len < 0) len = strlen(str); ++ memset(&ps,0,sizeof(mbstate_t)); ++ while (len > 0) { ++ int x,y; ++ ++ x = mbrtowc(&tmp,str,len,&ps); ++ if (x >0) { ++ str += x; ++ len -= x; ++ y = wcwidth(tmp); ++ if (y>0) ++ nchars+=y; ++ } else break; ++ } ++ return nchars; ++} ++ ++/** Trim a string to fit ++ * @param title - string. NULL will be inserted if necessary ++ * @param chrs - available space. (character cells) ++ */ ++void trim_string(char *title, int chrs) ++{ ++ char *p = title; ++ int ln = chrs; ++ int x = 0,y = 0; ++ wchar_t tmp; ++ mbstate_t ps; ++ ++ memset(&ps, 0, sizeof(ps)); ++ ++ while (*p) { ++ x = mbrtowc(&tmp, p, ln, &ps); ++ if (x < 0) { // error ++ *p = '\0'; ++ return; ++ } ++ y = wcwidth(tmp); ++ if (y > ln) { ++ *p = '\0'; ++ return; ++ } else { ++ p += x; ++ ln -= y; ++ } ++ } ++} ++ ++static int getkey() { ++ int c; ++ ++ while ((c = SLang_getkey()) == '\xC') { /* if Ctrl-L redraw whole screen */ ++ SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); ++ SLsmg_refresh(); ++ } ++ return c; ++ ++} ++ ++void newtFlushInput(void) { ++ while (SLang_input_pending(0)) { ++ getkey(); ++ } ++} ++ ++/** ++ * @brief Refresh the screen ++ */ ++void newtRefresh(void) { ++ SLsmg_refresh(); ++} ++ ++void newtSuspend(void) { ++ SLtt_set_cursor_visibility (1); ++ SLsmg_suspend_smg(); ++ SLang_reset_tty(); ++ SLtt_set_cursor_visibility (cursorOn); ++} ++ ++/** ++ * @brief Return after suspension. ++ * @return 0 on success. ++ */ ++int newtResume(void) { ++ SLsmg_resume_smg (); ++ SLsmg_refresh(); ++ return SLang_init_tty(0, 0, 0); ++} ++ ++void newtCls(void) { ++ SLsmg_set_color(NEWT_COLORSET_ROOT); ++ SLsmg_gotorc(0, 0); ++ SLsmg_erase_eos(); ++ ++ newtRefresh(); ++} ++ ++/** ++ * @brief Resize the screen ++ * @param redraw - boolean - should we redraw the screen? ++ */ ++void newtResizeScreen(int redraw) { ++ SLtt_get_screen_size(); ++ SLsmg_reinit_smg(); ++ if (redraw) { ++ SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); ++ newtRefresh(); ++ } ++} ++ ++/** ++ * @brief Initialize the newt library ++ * @return int - 0 for success, else < 0 ++ */ ++int newtInit(void) { ++ char * MonoValue, * MonoEnv = "NEWT_MONO"; ++ const char *lang; ++ int ret; ++ ++ if ((lang = getenv("LC_ALL")) == NULL) ++ if ((lang = getenv("LC_CTYPE")) == NULL) ++ if ((lang = getenv("LANG")) == NULL) ++ lang = ""; ++ if (strstr (lang, ".euc") != NULL) ++ trashScreen = 1; ++ ++ (void) strlen(ident); ++ ++ SLtt_get_terminfo(); ++ SLtt_get_screen_size(); ++ SLutf8_enable(-1); /* init. utf8 according to locale */ ++ ++ MonoValue = getenv(MonoEnv); ++ if ( MonoValue == NULL ) { ++ SLtt_Use_Ansi_Colors = 1; ++ } else { ++ SLtt_Use_Ansi_Colors = 0; ++ } ++ ++ if ((ret = SLsmg_init_smg()) < 0) ++ return ret; ++ if ((ret = SLang_init_tty(0, 0, 0)) < 0) ++ return ret; ++ ++ newtSetColors(newtDefaultColorPalette); ++ newtCursorOff(); ++ initKeymap(); ++ ++ /*memset(&sa, 0, sizeof(sa)); ++ sa.sa_handler = handleSigwinch; ++ sigaction(SIGWINCH, &sa, NULL);*/ ++ ++ SLsignal_intr(SIGWINCH, handleSigwinch); ++ SLang_getkey_intr_hook = getkeyInterruptHook; ++ ++ return 0; ++} ++ ++/** ++ * @brief Closedown the newt library, tidying screen. ++ * @returns int , 0. (no errors reported) ++ */ ++int newtFinished(void) { ++ SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); ++ newtCursorOn(); ++ SLsmg_refresh(); ++ SLsmg_reset_smg(); ++ SLang_reset_tty(); ++ ++ return 0; ++} ++ ++/** ++ * @brief Set the colors used. ++ * @param colors - newtColor struct used. ++ */ ++void newtSetColors(struct newtColors colors) { ++ if (!SLtt_Use_Ansi_Colors) { ++ int i; ++ ++ for (i = 2; i < 25; i++) ++ SLtt_set_mono(i, NULL, 0); ++ ++ SLtt_set_mono(NEWT_COLORSET_SELLISTBOX, NULL, SLTT_BOLD_MASK); ++ ++ SLtt_set_mono(NEWT_COLORSET_ACTBUTTON, NULL, SLTT_REV_MASK); ++ SLtt_set_mono(NEWT_COLORSET_ACTCHECKBOX, NULL, SLTT_REV_MASK); ++ SLtt_set_mono(NEWT_COLORSET_ACTLISTBOX, NULL, SLTT_REV_MASK); ++ SLtt_set_mono(NEWT_COLORSET_ACTTEXTBOX, NULL, SLTT_REV_MASK); ++ ++ SLtt_set_mono(NEWT_COLORSET_ACTSELLISTBOX, NULL, SLTT_REV_MASK | SLTT_BOLD_MASK); ++ ++ SLtt_set_mono(NEWT_COLORSET_DISENTRY, NULL, 0); // FIXME ++ SLtt_set_mono(NEWT_COLORSET_FULLSCALE, NULL, SLTT_ULINE_MASK | SLTT_REV_MASK); ++ SLtt_set_mono(NEWT_COLORSET_EMPTYSCALE, NULL, SLTT_ULINE_MASK); ++ return; ++ } ++ SLtt_set_color(NEWT_COLORSET_ROOT, "", colors.rootFg, colors.rootBg); ++ SLtt_set_color(NEWT_COLORSET_BORDER, "", colors.borderFg, colors.borderBg); ++ SLtt_set_color(NEWT_COLORSET_WINDOW, "", colors.windowFg, colors.windowBg); ++ SLtt_set_color(NEWT_COLORSET_SHADOW, "", colors.shadowFg, colors.shadowBg); ++ SLtt_set_color(NEWT_COLORSET_TITLE, "", colors.titleFg, colors.titleBg); ++ SLtt_set_color(NEWT_COLORSET_BUTTON, "", colors.buttonFg, colors.buttonBg); ++ SLtt_set_color(NEWT_COLORSET_ACTBUTTON, "", colors.actButtonFg, ++ colors.actButtonBg); ++ SLtt_set_color(NEWT_COLORSET_CHECKBOX, "", colors.checkboxFg, ++ colors.checkboxBg); ++ SLtt_set_color(NEWT_COLORSET_ACTCHECKBOX, "", colors.actCheckboxFg, ++ colors.actCheckboxBg); ++ SLtt_set_color(NEWT_COLORSET_ENTRY, "", colors.entryFg, colors.entryBg); ++ SLtt_set_color(NEWT_COLORSET_LABEL, "", colors.labelFg, colors.labelBg); ++ SLtt_set_color(NEWT_COLORSET_LISTBOX, "", colors.listboxFg, ++ colors.listboxBg); ++ SLtt_set_color(NEWT_COLORSET_ACTLISTBOX, "", colors.actListboxFg, ++ colors.actListboxBg); ++ SLtt_set_color(NEWT_COLORSET_TEXTBOX, "", colors.textboxFg, ++ colors.textboxBg); ++ SLtt_set_color(NEWT_COLORSET_ACTTEXTBOX, "", colors.actTextboxFg, ++ colors.actTextboxBg); ++ SLtt_set_color(NEWT_COLORSET_HELPLINE, "", colors.helpLineFg, ++ colors.helpLineBg); ++ SLtt_set_color(NEWT_COLORSET_ROOTTEXT, "", colors.rootTextFg, ++ colors.rootTextBg); ++ ++ SLtt_set_color(NEWT_COLORSET_EMPTYSCALE, "", "white", ++ colors.emptyScale); ++ SLtt_set_color(NEWT_COLORSET_FULLSCALE, "", "white", ++ colors.fullScale); ++ SLtt_set_color(NEWT_COLORSET_DISENTRY, "", colors.disabledEntryFg, ++ colors.disabledEntryBg); ++ ++ SLtt_set_color(NEWT_COLORSET_COMPACTBUTTON, "", colors.compactButtonFg, ++ colors.compactButtonBg); ++ ++ SLtt_set_color(NEWT_COLORSET_ACTSELLISTBOX, "", colors.actSelListboxFg, ++ colors.actSelListboxBg); ++ SLtt_set_color(NEWT_COLORSET_SELLISTBOX, "", colors.selListboxFg, ++ colors.selListboxBg); ++} ++ ++/* Keymap handling - rewritten by Henning Makholm , ++ * November 2003. ++ */ ++ ++struct kmap_trie_entry { ++ char c ; /* character got from terminal */ ++ int code; /* newt key, or 0 if c does not make a complete sequence */ ++ struct kmap_trie_entry *contseq; /* sub-trie for character following c */ ++ struct kmap_trie_entry *next; /* try this if char received != c */ ++}; ++/* Here are some static entries that will help in handling esc O foo and ++ esc [ foo as variants of each other: */ ++static struct kmap_trie_entry ++ kmap_trie_escO = { 'O', 0, 0, 0 }, ++ kmap_trie_escBrack = { '[', 0, 0, &kmap_trie_escO }, ++ kmap_trie_root = { '\033', 0, &kmap_trie_escBrack, 0 }; ++static int keyreader_buf_len = 10 ; ++static unsigned char default_keyreader_buf[10]; ++static unsigned char *keyreader_buf = default_keyreader_buf; ++ ++#if 0 /* for testing of the keymap manipulation code */ ++static void dumpkeys_recursive(struct kmap_trie_entry *curr, int i, FILE *f) { ++ int j, ps ; ++ char seen[256]={0}; ++ if( curr && i >= keyreader_buf_len ) { ++ fprintf(f,"ARGH! Too long sequence!\n") ; ++ return ; ++ } ++ for(;curr;curr=curr->next) { ++ keyreader_buf[i] = curr->c ; ++ ps = seen[(unsigned char)curr->c]++ ; ++ if( ps || curr->code || (!curr->code && !curr->contseq) ) { ++ for(j=0;j<=i;j++) { ++ if( keyreader_buf[j] > 32 && keyreader_buf[j]<127 && ++ keyreader_buf[j] != '^' && keyreader_buf[j] != '\\' ) ++ fprintf(f,"%c",keyreader_buf[j]); ++ else if( keyreader_buf[j] > 0 && keyreader_buf[j]<=32 ) ++ fprintf(f,"^%c",keyreader_buf[j] + 0x40); ++ else ++ fprintf(f,"\\%03o", ++ (unsigned)(unsigned char)keyreader_buf[j]); ++ } ++ if( curr->code ) ++ fprintf(f,": 0x%X\n",curr->code); ++ else ++ fprintf(f,": (just keymap)\n"); ++ } ++ dumpkeys_recursive(curr->contseq,i+1,f); ++ } ++} ++static void dump_keymap(void) { ++ FILE *f = fopen("newt.keydump","wt"); ++ if (f) { ++ dumpkeys_recursive(&kmap_trie_root,0,f); ++ fclose(f); ++ } ++} ++#endif ++ ++/* newtBindKey may overwrite a binding that is there already */ ++static void newtBindKey(char *keyseq, int meaning) { ++ struct kmap_trie_entry *root = &kmap_trie_root ; ++ struct kmap_trie_entry **curptr = &root ; ++ ++ /* Try to make sure the common matching buffer is long enough. */ ++ if( strlen(keyseq) > keyreader_buf_len ) { ++ int i = strlen(keyseq)+10; ++ unsigned char *newbuf = malloc(i); ++ if (newbuf) { ++ if (keyreader_buf != default_keyreader_buf) ++ free(keyreader_buf); ++ keyreader_buf = newbuf; ++ keyreader_buf_len = i; ++ } ++ } ++ ++ if (*keyseq == 0) return; /* binding the empty sequence is meaningless */ ++ ++ while(1) { ++ while ((*curptr) && (*curptr)->c != *keyseq) ++ curptr = &(*curptr)->next; ++ if ((*curptr)==0) { ++ struct kmap_trie_entry* fresh ++ = calloc(strlen(keyseq),sizeof(struct kmap_trie_entry)); ++ if (fresh == 0) return; /* despair! */ ++ *curptr = fresh; ++ while (keyseq[1]) { ++ fresh->contseq = fresh+1; ++ (fresh++)->c = *(keyseq++); ++ } ++ fresh->c = *keyseq; ++ fresh->code = meaning; ++ return; ++ } ++ if (keyseq[1]==0) { ++ (*curptr)->code = meaning; ++ return; ++ } else { ++ curptr = &(*curptr)->contseq; ++ keyseq++; ++ } ++ } ++} ++ ++/* This function recursively inserts all entries in the "to" trie into ++ corresponding positions in the "from" trie, except positions that ++ are already defined in the "from" trie. */ ++static void kmap_trie_fallback(struct kmap_trie_entry *to, ++ struct kmap_trie_entry **from) { ++ if (*from == NULL) ++ *from = to ; ++ if (*from == to) ++ return ; ++ for (;to!=NULL;to=to->next) { ++ struct kmap_trie_entry **fromcopy = from ; ++ while ((*fromcopy) && (*fromcopy)->c != to->c) ++ fromcopy = &(*fromcopy)->next ; ++ if (*fromcopy) { ++ if ((*fromcopy)->code == 0) ++ (*fromcopy)->code = to->code; ++ kmap_trie_fallback(to->contseq, &(*fromcopy)->contseq); ++ } else { ++ *fromcopy = malloc(sizeof(struct kmap_trie_entry)); ++ if (*fromcopy) { ++ **fromcopy = *to ; ++ (*fromcopy)->next = 0 ; ++ } ++ } ++ } ++} ++ ++int newtGetKey(void) { ++ int key; ++ unsigned char *chptr = keyreader_buf, *lastmatch; ++ int lastcode; ++ struct kmap_trie_entry *curr = &kmap_trie_root; ++ ++ do { ++ key = getkey(); ++ if (key == SLANG_GETKEY_ERROR) { ++ /* Either garbage was read, or stdin disappeared ++ * (the parent terminal was proably closed) ++ * if the latter, die. ++ */ ++ if (feof(stdin)) ++ exit(1); ++ if (needResize) { ++ needResize = 0; ++ return NEWT_KEY_RESIZE; ++ } ++ ++ /* ignore other signals */ ++ continue; ++ } ++ ++ if (key == NEWT_KEY_SUSPEND && suspendCallback) ++ suspendCallback(suspendCallbackData); ++ } while (key == NEWT_KEY_SUSPEND); ++ ++ /* Read more characters, matching against the trie as we go */ ++ lastcode = *chptr = key; ++ lastmatch = chptr ; ++ while(1) { ++ while (curr->c != key) { ++ curr = curr->next ; ++ if (curr==NULL) goto break2levels; ++ } ++ if (curr->code) { ++ lastcode = curr->code; ++ lastmatch = chptr; ++ } ++ curr = curr->contseq; ++ if (curr==NULL) break; ++ ++ if (SLang_input_pending(5) <= 0) ++ break; ++ ++ if (chptr==keyreader_buf+keyreader_buf_len-1) break; ++ *++chptr = key = getkey(); ++ } ++ break2levels: ++ ++ /* The last time the trie matched was at position lastmatch. Back ++ * up if we have read too many characters. */ ++ while (chptr > lastmatch) ++ SLang_ungetkey(*chptr--); ++ ++ return lastcode; ++} ++ ++/** ++ * @brief Wait for a keystroke ++ */ ++void newtWaitForKey(void) { ++ newtRefresh(); ++ ++ getkey(); ++ newtClearKeyBuffer(); ++} ++ ++/** ++ * @brief Clear the keybuffer ++ */ ++void newtClearKeyBuffer(void) { ++ while (SLang_input_pending(1)) { ++ getkey(); ++ } ++} ++ ++/** ++ * Open a new window. ++ * @param left. unsigned int Size; _not_ including border ++ * @param top: unsigned int size, _not_ including border ++ * @param width unsigned int ++ * @param height unsigned int ++ * @param title - title string ++ * @return zero on success (currently no errors reported) ++ */ ++int newtOpenWindow(unsigned int left, unsigned int top, ++ unsigned int width, unsigned int height, ++ const char * title) { ++ int j, row, col; ++ int n; ++ int i; ++ ++ newtFlushInput(); ++ ++ if (!currentWindow) { ++ currentWindow = windowStack; ++ } else { ++ currentWindow++; ++ } ++ ++ currentWindow->left = left; ++ currentWindow->top = top; ++ currentWindow->width = width; ++ currentWindow->height = height; ++ currentWindow->title = title ? strdup(title) : NULL; ++ ++ currentWindow->buffer = malloc(sizeof(SLsmg_Char_Type) * (width + 3) * (height + 3)); ++ ++ row = top - 1; ++ col = left - 1; ++ /* clip to the current screen bounds - msw */ ++ if (row < 0) ++ row = 0; ++ if (col < 0) ++ col = 0; ++ if (left + width > SLtt_Screen_Cols) ++ width = SLtt_Screen_Cols - left; ++ if (top + height > SLtt_Screen_Rows) ++ height = SLtt_Screen_Rows - top; ++ n = 0; ++ for (j = 0; j < height + 3; j++, row++) { ++ SLsmg_gotorc(row, col); ++ SLsmg_read_raw(currentWindow->buffer + n, ++ currentWindow->width + 3); ++ n += currentWindow->width + 3; ++ } ++ ++ newtTrashScreen(); ++ ++ SLsmg_set_color(NEWT_COLORSET_BORDER); ++ SLsmg_set_char_set(1); ++ SLsmg_draw_box(top - 1, left - 1, height + 2, width + 2); ++ SLsmg_set_char_set(0); ++ ++ if (currentWindow->title) { ++ trim_string (currentWindow->title, width-4); ++ i = wstrlen(currentWindow->title,-1) + 4; ++ i = ((width - i) / 2) + left; ++ SLsmg_gotorc(top - 1, i); ++ SLsmg_set_char_set(1); ++ SLsmg_write_char(SLSMG_RTEE_CHAR); ++ SLsmg_set_char_set(0); ++ SLsmg_write_char(' '); ++ SLsmg_set_color(NEWT_COLORSET_TITLE); ++ write_string_int((char *)currentWindow->title, NULL); ++ SLsmg_set_color(NEWT_COLORSET_BORDER); ++ SLsmg_write_char(' '); ++ SLsmg_set_char_set(1); ++ SLsmg_write_char(SLSMG_LTEE_CHAR); ++ SLsmg_set_char_set(0); ++ } ++ ++ SLsmg_set_color(NEWT_COLORSET_WINDOW); ++ SLsmg_fill_region(top, left, height, width, ' '); ++ ++ SLsmg_set_color(NEWT_COLORSET_SHADOW); ++ SLsmg_fill_region(top + height + 1, left, 1, width + 2, ' '); ++ SLsmg_fill_region(top, left + width + 1, height + 1, 1, ' '); ++ ++ for (i = top; i < (top + height + 1); i++) { ++ SLsmg_gotorc(i, left + width + 1); ++ SLsmg_write_string(" "); ++ } ++ ++ return 0; ++} ++ ++/** ++ * @brief Draw a centered window. ++ * @param width - width in char cells ++ * @param height - no. of char cells. ++ * @param title - fixed title ++ * @returns 0. No errors reported ++ */ ++int newtCenteredWindow(unsigned int width,unsigned int height, ++ const char * title) { ++ unsigned int top, left; ++ ++ top = (SLtt_Screen_Rows - height) / 2; ++ ++ /* I don't know why, but this seems to look better */ ++ if ((SLtt_Screen_Rows % 2) && (top % 2)) top--; ++ ++ left = (SLtt_Screen_Cols - width) / 2; ++ ++ newtOpenWindow(left, top, width, height, title); ++ ++ return 0; ++} ++ ++/** ++ * @brief Remove the top window ++ */ ++void newtPopWindow(void) { ++ int j, row, col; ++ int n = 0; ++ ++ row = col = 0; ++ ++ row = currentWindow->top - 1; ++ col = currentWindow->left - 1; ++ if (row < 0) ++ row = 0; ++ if (col < 0) ++ col = 0; ++ for (j = 0; j < currentWindow->height + 3; j++, row++) { ++ SLsmg_gotorc(row, col); ++ SLsmg_write_raw(currentWindow->buffer + n, ++ currentWindow->width + 3); ++ n += currentWindow->width + 3; ++ } ++ ++ free(currentWindow->buffer); ++ free(currentWindow->title); ++ ++ if (currentWindow == windowStack) ++ currentWindow = NULL; ++ else ++ currentWindow--; ++ ++ SLsmg_set_char_set(0); ++ ++ newtTrashScreen(); ++ ++ newtRefresh(); ++} ++ ++void newtGetWindowPos(int * x, int * y) { ++ if (currentWindow) { ++ *x = currentWindow->left; ++ *y = currentWindow->top; ++ } else ++ *x = *y = 0; ++} ++ ++void newtGetrc(int * row, int * col) { ++ *row = cursorRow; ++ *col = cursorCol; ++} ++ ++void newtGotorc(int newRow, int newCol) { ++ if (currentWindow) { ++ newRow += currentWindow->top; ++ newCol += currentWindow->left; ++ } ++ ++ cursorRow = newRow; ++ cursorCol = newCol; ++ SLsmg_gotorc(cursorRow, cursorCol); ++} ++ ++void newtDrawBox(int left, int top, int width, int height, int shadow) { ++ if (currentWindow) { ++ top += currentWindow->top; ++ left += currentWindow->left; ++ } ++ ++ SLsmg_draw_box(top, left, height, width); ++ ++ if (shadow) { ++ SLsmg_set_color(NEWT_COLORSET_SHADOW); ++ SLsmg_fill_region(top + height, left + 1, 1, width - 1, ' '); ++ SLsmg_fill_region(top + 1, left + width, height, 1, ' '); ++ } ++} ++ ++void newtClearBox(int left, int top, int width, int height) { ++ if (currentWindow) { ++ top += currentWindow->top; ++ left += currentWindow->left; ++ } ++ ++ SLsmg_fill_region(top, left, height, width, ' '); ++} ++ ++static void initKeymap(void) { ++ const struct keymap * curr; ++ ++ /* First bind built-in default bindings. They may be shadowed by ++ the termcap entries that get bound later. */ ++ for (curr = keymap; curr->code; curr++) { ++ if (curr->str) ++ newtBindKey(curr->str,curr->code); ++ } ++ ++ /* Then bind strings from termcap entries */ ++ for (curr = keymap; curr->code; curr++) { ++ if (curr->tc) { ++ char *pc = SLtt_tgetstr(curr->tc); ++ if (pc) { ++ newtBindKey(pc,curr->code); ++ } ++ } ++ } ++ ++ /* Finally, invent lowest-priority keybindings that correspond to ++ searching for esc-O-foo if esc-[-foo was not found and vice ++ versa. That is needed because of strong confusion among ++ different emulators of VTxxx terminals; some terminfo/termcap ++ descriptions are apparently written by people who were not ++ aware of the differences between "applicataion" and "terminal" ++ keypad modes. Or perhaps they were, but tried to make their ++ description work with a program that puts the keyboard in the ++ wrong emulation mode. In short, one needs this: */ ++ kmap_trie_fallback(kmap_trie_escO.contseq, &kmap_trie_escBrack.contseq); ++ kmap_trie_fallback(kmap_trie_escBrack.contseq, &kmap_trie_escO.contseq); ++} ++ ++/** ++ * @brief Delay for a specified number of usecs ++ * @param int - number of usecs to wait for. ++ */ ++void newtDelay(unsigned int usecs) { ++ fd_set set; ++ struct timeval tv; ++ ++ FD_ZERO(&set); ++ ++ tv.tv_sec = usecs / 1000000; ++ tv.tv_usec = usecs % 1000000; ++ ++ select(0, &set, &set, &set, &tv); ++} ++ ++struct eventResult newtDefaultEventHandler(newtComponent c, ++ struct event ev) { ++ struct eventResult er; ++ ++ er.result = ER_IGNORED; ++ return er; ++} ++ ++void newtRedrawHelpLine(void) { ++ char * buf; ++ ++ SLsmg_set_color(NEWT_COLORSET_HELPLINE); ++ ++ if (currentHelpline) { ++ /* buffer size needs to be wide enough to hold all the multibyte ++ currentHelpline + all the single byte ' ' to fill the line */ ++ int wlen = wstrlen(*currentHelpline, -1); ++ int len; ++ ++ if (wlen > SLtt_Screen_Cols) ++ wlen = SLtt_Screen_Cols; ++ len = strlen(*currentHelpline) + (SLtt_Screen_Cols - wlen); ++ buf = alloca(len + 1); ++ memset(buf, ' ', len); ++ memcpy(buf, *currentHelpline, strlen(*currentHelpline)); ++ buf[len] = '\0'; ++ } else { ++ buf = alloca(SLtt_Screen_Cols + 1); ++ memset(buf, ' ', SLtt_Screen_Cols); ++ buf[SLtt_Screen_Cols] = '\0'; ++ } ++ SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); ++ write_string_int(buf, NULL); ++} ++ ++void newtPushHelpLine(const char * text) { ++ if (!text) ++ text = defaultHelpLine; ++ ++ if (currentHelpline) ++ (*(++currentHelpline)) = strdup(text); ++ else { ++ currentHelpline = helplineStack; ++ *currentHelpline = strdup(text); ++ } ++ ++ newtRedrawHelpLine(); ++} ++ ++void newtPopHelpLine(void) { ++ if (!currentHelpline) return; ++ ++ free(*currentHelpline); ++ if (currentHelpline == helplineStack) ++ currentHelpline = NULL; ++ else ++ currentHelpline--; ++ ++ newtRedrawHelpLine(); ++} ++ ++void newtDrawRootText(int col, int row, const char * text) { ++ SLsmg_set_color(NEWT_COLORSET_ROOTTEXT); ++ ++ if (col < 0) { ++ col = SLtt_Screen_Cols + col; ++ } ++ ++ if (row < 0) { ++ row = SLtt_Screen_Rows + row; ++ } ++ ++ SLsmg_gotorc(row, col); ++ write_string_int((char *)text, NULL); ++} ++ ++int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense) { ++ switch (sense) { ++ case NEWT_FLAGS_SET: ++ return oldFlags | newFlags; ++ ++ case NEWT_FLAGS_RESET: ++ return oldFlags & (~newFlags); ++ ++ case NEWT_FLAGS_TOGGLE: ++ return oldFlags ^ newFlags; ++ ++ default: ++ return oldFlags; ++ } ++} ++ ++void newtBell(void) ++{ ++ SLtt_beep(); ++} ++ ++void newtGetScreenSize(int * cols, int * rows) { ++ if (rows) *rows = SLtt_Screen_Rows; ++ if (cols) *cols = SLtt_Screen_Cols; ++} ++ ++void newtDefaultPlaceHandler(newtComponent c, int newLeft, int newTop) { ++ c->left = newLeft; ++ c->top = newTop; ++} ++ ++void newtDefaultMappedHandler(newtComponent c, int isMapped) { ++ c->isMapped = isMapped; ++} ++ ++void newtCursorOff(void) { ++ cursorOn = 0; ++ SLtt_set_cursor_visibility (cursorOn); ++} ++ ++void newtCursorOn(void) { ++ cursorOn = 1; ++ SLtt_set_cursor_visibility (cursorOn); ++} ++ ++void newtTrashScreen(void) { ++ if (trashScreen) ++ SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); ++} ++ +diff -ruN newt-0.52.2-old/newt.h newt-0.52.2/newt.h +--- newt-0.52.2-old/newt.h 2005-09-21 09:32:01.000000000 +0000 ++++ newt-0.52.2/newt.h 2006-06-20 16:29:45.000000000 +0000 +@@ -115,7 +115,7 @@ + void newtClearKeyBuffer(void); + void newtDelay(unsigned int usecs); + /* top, left are *not* counting the border */ +-int newtOpenWindow(unsigned int left,unsigned int top, ++int newtOpenWindow(int left,int top, + unsigned int width,unsigned int height, + const char * title); + int newtCenteredWindow(unsigned int width,unsigned int height, const char * title); --- newt-0.52.2.orig/debian/patches/090_khmer.patch +++ newt-0.52.2/debian/patches/090_khmer.patch @@ -0,0 +1,45 @@ +diff -ruN newt-0.52.2-old/po/km.po newt-0.52.2/po/km.po +--- newt-0.52.2-old/po/km.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/km.po 2006-06-20 21:12:51.000000000 +0100 +@@ -0,0 +1,34 @@ ++# translation of newt_newt_po_km.po to Khmer ++# Hok Kakada , 2006. ++# auk piseth , 2006. ++# Khoem Sokhem , 2006. ++# Leang Chumsoben , 2006. ++msgid "" ++msgstr "" ++"Project-Id-Version: newt_newt_po_km\n" ++"Report-Msgid-Bugs-To: \n" ++"POT-Creation-Date: 2005-12-12 18:15-0700\n" ++"PO-Revision-Date: 2006-03-27 16:11+0700\n" ++"Last-Translator: Khoem Sokhem \n" ++"Language-Team: Khmer \n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"X-Generator: KBabel 1.11\n" ++ ++#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 ++msgid "Ok" ++msgstr "យល់ព្រម" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "បោះបង់" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "បាទ/ចាស" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "ទេ" ++ +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2006-06-20 21:12:51.000000000 +0100 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 21:13:17.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bn bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh + --- newt-0.52.2.orig/debian/patches/110_a11y.patch +++ newt-0.52.2/debian/patches/110_a11y.patch @@ -0,0 +1,22 @@ +diff -ruN newt-0.52.2-old/scale.c newt-0.52.2/scale.c +--- newt-0.52.2-old/scale.c 2002-06-11 13:52:11.000000000 +0100 ++++ newt-0.52.2/scale.c 2006-04-11 20:41:47.000000000 +0100 +@@ -82,4 +82,6 @@ + else + SLsmg_write_char(' '); + } ++ /* put cursor at beginning of text for better accessibility */ ++ newtGotorc(co->top, co->left + xlabel); + } +diff -ruN newt-0.52.2-old/textbox.c newt-0.52.2/textbox.c +--- newt-0.52.2-old/textbox.c 2006-04-11 20:41:29.000000000 +0100 ++++ newt-0.52.2/textbox.c 2006-04-11 20:41:47.000000000 +0100 +@@ -376,6 +376,8 @@ + if (!*tb->lines[i + tb->topLine]) + dir = 'N'; + } ++ /* put cursor at beginning of text for better accessibility */ ++ newtGotorc(c->top, c->left); + } + + static struct eventResult textboxEvent(newtComponent co, --- newt-0.52.2.orig/debian/patches/020_bidi.patch +++ newt-0.52.2/debian/patches/020_bidi.patch @@ -0,0 +1,677 @@ +diff -ruN newt-0.52.2-old/button.c newt-0.52.2/button.c +--- newt-0.52.2-old/button.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/button.c 2006-01-19 20:34:41.000000000 +0000 +@@ -110,7 +110,7 @@ + SLsmg_set_color(NEWT_COLORSET_BUTTON); + newtGotorc(co->top+ pushed, co->left + 1 + pushed); + SLsmg_write_char('<'); +- SLsmg_write_string(bu->text); ++ write_string_int(bu->text, NULL); + SLsmg_write_char('>'); + } else { + if (pushed) { +@@ -140,7 +140,7 @@ + + newtGotorc(co->top + 1 + pushed, co->left + 1 + pushed); + SLsmg_write_char(' '); +- SLsmg_write_string(bu->text); ++ write_string_int(bu->text, NULL); + SLsmg_write_char(' '); + } + +diff -ruN newt-0.52.2-old/checkbox.c newt-0.52.2/checkbox.c +--- newt-0.52.2-old/checkbox.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/checkbox.c 2006-01-19 20:34:41.000000000 +0000 +@@ -187,7 +187,7 @@ + break; + } + +- SLsmg_write_string(cb->text); ++ write_string_int(cb->text, NULL); + + if (cb->hasFocus) + SLsmg_set_color(cb->active); +diff -ruN newt-0.52.2-old/checkboxtree.c newt-0.52.2/checkboxtree.c +--- newt-0.52.2-old/checkboxtree.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/checkboxtree.c 2006-01-19 20:34:41.000000000 +0000 +@@ -482,12 +482,13 @@ + } else { + char tmp[5]; + snprintf(tmp,5,"[%c] ",ct->seq[(*item)->selected]); ++ /* BIDI: no need to use _int funcs here: only ASCII characters */ + SLsmg_write_string(tmp); + } + } + +- SLsmg_write_nstring((*item)->text, co->width - 4 - +- (3 * (*item)->depth)); ++ write_nstring_int((*item)->text, co->width - 4 - ++ (3 * (*item)->depth), NULL); + + SLsmg_set_color(NEWT_COLORSET_LISTBOX); + +diff -ruN newt-0.52.2-old/config.h.in newt-0.52.2/config.h.in +--- newt-0.52.2-old/config.h.in 2005-11-22 08:33:27.000000000 +0000 ++++ newt-0.52.2/config.h.in 2006-01-19 20:36:03.000000000 +0000 +@@ -7,6 +7,12 @@ + /* Define to 1 if you have the header file. */ + #undef HAVE_ALLOCA_H + ++/* Define if you have the header file. */ ++#undef HAVE_DLFCN_H ++ ++/* Define if you have the header file. */ ++#undef HAVE_FRIBIDI_FRIBIDI_H ++ + /* Define to 1 if you have the MacOS X function CFLocaleCopyCurrent in the + CoreFoundation framework. */ + #undef HAVE_CFLOCALECOPYCURRENT +diff -ruN newt-0.52.2-old/configure.in newt-0.52.2/configure.in +--- newt-0.52.2-old/configure.in 2005-11-22 08:33:12.000000000 +0000 ++++ newt-0.52.2/configure.in 2006-01-19 20:34:41.000000000 +0000 +@@ -17,7 +17,7 @@ + AC_PROG_LN_S + AM_GNU_GETTEXT([external]) + +-AC_CHECK_HEADERS(sys/select.h alloca.h) ++AC_CHECK_HEADERS(sys/select.h alloca.h fribidi/fribidi.h dlfcn.h) + + AC_ARG_WITH(gpm-support, [ --with-gpm-support Compile with GPM support]) + +diff -ruN newt-0.52.2-old/entry.c newt-0.52.2/entry.c +--- newt-0.52.2-old/entry.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/entry.c 2006-01-19 20:34:41.000000000 +0000 +@@ -196,12 +196,15 @@ + + if (len <= co->width) { + i = len; ++ /* BIDI: do not replaced, because it will not work. ++ * More work needed */ + SLsmg_write_string(chptr); + while (i < co->width) { + SLsmg_write_char('_'); + i++; + } + } else { ++ /* BIDI: will not work for RTL text */ + SLsmg_write_nstring(chptr, co->width); + } + +diff -ruN newt-0.52.2-old/label.c newt-0.52.2/label.c +--- newt-0.52.2-old/label.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/label.c 2006-01-19 20:34:41.000000000 +0000 +@@ -69,7 +69,9 @@ + SLsmg_set_color(COLORSET_LABEL); + + newtGotorc(co->top, co->left); +- SLsmg_write_string(la->text); ++ /* BIDI: need to check if nstring is really needed. ++ * Where it is used? */ ++ write_nstring_int(la->text, co->width, NULL); + } + + static void labelDestroy(newtComponent co) { +diff -ruN newt-0.52.2-old/listbox.c newt-0.52.2/listbox.c +--- newt-0.52.2-old/listbox.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/listbox.c 2006-01-19 20:34:41.000000000 +0000 +@@ -527,7 +527,7 @@ + else + SLsmg_set_color(NEWT_COLORSET_LISTBOX); + +- SLsmg_write_nstring(item->text, li->curWidth); ++ write_nstring_int(item->text, li->curWidth, NULL); + + } + newtGotorc(co->top + (li->currItem - li->startShowItem) + li->bdyAdjust, +diff -ruN newt-0.52.2-old/newt.c newt-0.52.2/newt.c +--- newt-0.52.2-old/newt.c 2006-01-19 20:34:41.000000000 +0000 ++++ newt-0.52.2/newt.c 2006-01-19 20:34:41.000000000 +0000 +@@ -18,6 +18,459 @@ + #include "newt.h" + #include "newt_pr.h" + ++#if defined(HAVE_FRIBIDI_FRIBIDI_H) && defined(HAVE_DLFCN_H) ++#include ++#include ++ ++/* No sense in enabling shaping if we don't have BIDI support. */ ++typedef struct ++{ ++ int is_shaped; ++ wchar_t isolated; ++ wchar_t initial; ++ wchar_t medial; ++ wchar_t final; ++} ++arabic_char_node; ++ ++#define ARABIC_BASE 0x621 ++#define ARABIC_END 0x64A ++ ++static const arabic_char_node arabic_shaping_table[] = { ++/* 0x621 */ { TRUE , 0xFE80, 0x0000, 0x0000, 0x0000}, ++/* 0x622 */ { TRUE , 0xFE81, 0x0000, 0x0000, 0xFE82}, ++/* 0x623 */ { TRUE , 0xFE83, 0x0000, 0x0000, 0xFE84}, ++/* 0x624 */ { TRUE , 0xFE85, 0x0000, 0x0000, 0xFE86}, ++/* 0x625 */ { TRUE , 0xFE87, 0x0000, 0x0000, 0xFE88}, ++/* 0x626 */ { TRUE , 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, ++/* 0x627 */ { TRUE , 0xFE8D, 0x0000, 0x0000, 0xFE8E}, ++/* 0x628 */ { TRUE , 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, ++/* 0x629 */ { TRUE , 0xFE93, 0x0000, 0x0000, 0xFE94}, ++/* 0x62A */ { TRUE , 0xFE95, 0xFE97, 0xFE98, 0xFE96}, ++/* 0x62B */ { TRUE , 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, ++/* 0x62C */ { TRUE , 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, ++/* 0x62D */ { TRUE , 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, ++/* 0x62E */ { TRUE , 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, ++/* 0x62F */ { TRUE , 0xFEA9, 0x0000, 0x0000, 0xFEAA}, ++/* 0x630 */ { TRUE , 0xFEAB, 0x0000, 0x0000, 0xFEAC}, ++/* 0x631 */ { TRUE , 0xFEAD, 0x0000, 0x0000, 0xFEAE}, ++/* 0x632 */ { TRUE , 0xFEAF, 0x0000, 0x0000, 0xFEB0}, ++/* 0x633 */ { TRUE , 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, ++/* 0x634 */ { TRUE , 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, ++/* 0x635 */ { TRUE , 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, ++/* 0x636 */ { TRUE , 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, ++/* 0x637 */ { TRUE , 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, ++/* 0x638 */ { TRUE , 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, ++/* 0x639 */ { TRUE , 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, ++/* 0x63A */ { TRUE , 0xFECD, 0xFECF, 0xFED0, 0xFECE}, ++/* 0x63B */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63C */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63D */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63E */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63F */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x640 */ { TRUE , 0x0640, 0x0640, 0x0640, 0x0640}, ++/* 0x641 */ { TRUE , 0xFED1, 0xFED3, 0xFED4, 0xFED2}, ++/* 0x642 */ { TRUE , 0xFED5, 0xFED7, 0xFED8, 0xFED6}, ++/* 0x643 */ { TRUE , 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, ++/* 0x644 */ { TRUE , 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, ++/* 0x645 */ { TRUE , 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, ++/* 0x646 */ { TRUE , 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, ++/* 0x647 */ { TRUE , 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, ++/* 0x648 */ { TRUE , 0xFEED, 0x0000, 0x0000, 0xFEEE}, ++/* 0x649 */ { TRUE , 0xFEEF, 0x0000, 0x0000, 0xFEF0}, ++/* 0x64A */ { TRUE , 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2} ++}; ++ ++typedef struct { ++ wchar_t c; ++ arabic_char_node ar_node; ++} ++extra_char_node; ++ ++#define EXTRA_BASE 0x67E ++#define EXTRA_END 0x6CC ++static const extra_char_node extra_shaping_table[] = { ++ {0x067E, {TRUE, 0xFB56, 0xFB58, 0xFB59, 0xFB57}}, ++ {0x0686, {TRUE, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}}, ++ {0x0698, {TRUE, 0xFB8A, 0x0000, 0x0000, 0xFB8B}}, ++ {0x06A9, {TRUE, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}}, ++ {0x06AF, {TRUE, 0xFB92, 0xFB94, 0xFB95, 0xFB93}}, ++ {0x06CC, {TRUE, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}}, ++ {0x0000, {FALSE, 0x0000, 0x0000, 0x0000, 0x0000}}, ++}; ++ ++static const arabic_char_node *get_char_node(wchar_t w) ++{ ++ if (w >= ARABIC_BASE && w <= ARABIC_END) ++ return &arabic_shaping_table[w - ARABIC_BASE]; ++ else if (w >= EXTRA_BASE && w <= EXTRA_END) { ++ const extra_char_node *node = extra_shaping_table; ++ ++ while (node->c) { ++ if (node->c == w) ++ return &node->ar_node; ++ node++; ++ } ++ return NULL; ++ } ++ return NULL; ++} ++ ++static int do_shaping(wchar_t *buf, int len) { ++ int i,j; ++ ++ wchar_t *newbuf; ++ ++ if (len < 1) ++ return 0; ++ ++ newbuf = (wchar_t *)malloc(sizeof(wchar_t)*len); ++ ++ for (i = 0, j = 0; i < len; i++, j++) { ++ int have_previous = FALSE, have_next = FALSE; ++ const arabic_char_node *node, *node1; ++ int prev, next; ++ ++ if (buf[i] == L'\0') ++ break; ++ ++ /* If it is non-joiner, ignore it */ ++ if (buf[i] == 0x200C) { ++ j--; ++ continue; ++ } ++ ++ newbuf[j] = buf[i]; ++ ++ /* If it's not in our range, skip it. */ ++ node = get_char_node(buf[i]); ++ if (!node) ++ { ++ continue; ++ } ++ ++ /* The character wasn't included in the unicode shaping table. */ ++ if (!node->is_shaped) ++ { ++ continue; ++ } ++ ++ for (prev = i - 1; prev >= 0; prev--) ++ if (wcwidth(buf[prev]) || buf[prev] == 0x200C) ++ break; ++ ++ if (prev >= 0 && (node1 = get_char_node(buf[prev])) ++ && ( node1->initial || node1->medial)) ++ { ++ have_previous = TRUE; ++ } ++ ++ for (next = i + 1; next < len; next++) ++ if (wcwidth(buf[next]) || buf[next] == 0x200C) ++ break; ++ ++ if (next < len && (node1 = get_char_node(buf[next])) ++ && (node1->medial || node1->final)) ++ { ++ have_next = TRUE; ++ } ++ ++ /* ++ * FIXME: do not make ligature if there are combining ++ * characters between two parts. ++ */ ++ if (buf[i] == 0x644 && have_next && next == i + 1) ++ { ++ switch (buf[next]) ++ { ++ case 0x622: ++ newbuf[j] = 0xFEF5 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x623: ++ newbuf[j] = 0xFEF7 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x625: ++ newbuf[j] = 0xFEF9 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x627: ++ newbuf[j] = 0xFEFB + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ default: ++ break; ++ } ++ } ++ ++ /** Medial **/ ++ if (have_previous && have_next && node->medial) ++ { ++ newbuf[j] = node->medial; ++ } ++ ++ /** Final **/ ++ else if (have_previous && node->final) ++ { ++ newbuf[j] = node->final; ++ } ++ ++ /** Initial **/ ++ else if (have_next && node->initial) ++ { ++ newbuf[j] = node->initial; ++ } ++ ++ /** Isolated **/ ++ else if (node->isolated) ++ { ++ newbuf[j] = node->isolated; ++ } ++ } ++ for (i = 0; i < len && i < j; i++) { ++ buf[i] = newbuf[i]; ++ } ++ while (i < len) { ++ buf[i++] = L'\0'; ++ } ++ ++ free(newbuf); ++ return 0; ++} ++ ++/* Converts bidi wchar text {in} to visual wchar text which is displayable ++ * in text mode. Uses {base_dir} as default base direction. ++ * Returns malloc'ed converted text or NULL in case of error or if {need_out} is ++ * not set. Modifies {base_dir} to reflect actual direction. ++ */ ++static wchar_t* wchar_to_textmod_visual(wchar_t *in,unsigned int len,FriBidiCharType *base_dir, int need_out) ++{ ++ FriBidiChar *out = NULL; ++ static void *handle = NULL; ++ ++ fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex, ++ FriBidiCharType *, FriBidiChar *, ++ FriBidiStrIndex *, FriBidiStrIndex *, ++ FriBidiLevel *); ++ ++ if (!handle) ++ handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); ++ if (!handle) ++ handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); ++ if (!handle) ++ return NULL; ++ ++ func_ptr = dlsym(handle, "fribidi_log2vis"); ++ if (!func_ptr) { ++ dlclose(handle); ++ handle = NULL; ++ return NULL; ++ } ++ ++ if (need_out) { ++ out = (FriBidiChar *)malloc(sizeof(FriBidiChar)*(len+1)); ++ if(!out) ++ { ++ dlclose(handle); ++ handle = NULL; ++ return (wchar_t *) out; ++ } ++ ++ do_shaping(in, len); ++ len = wcsnlen(in, len); ++ } ++ (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); ++ ++ return (wchar_t *) out; ++} ++ ++/* ++ * Converts text given in {str} from logical order to visual order. ++ * Uses {dir} as base direction ('N', 'R', 'L'). ++ * Returns malloc'ed converted string. Modifies {dir} to reflect actual ++ * direction. ++ */ ++static char *_newt_log2vis(const char *str, char *dir) ++{ ++ wchar_t *wcs; ++ char *rstr = NULL; ++ int len = strlen(str); ++ int ret; ++ FriBidiCharType basedir; ++ ++ switch (*dir) ++ { ++ case 'R': basedir = FRIBIDI_TYPE_R; ++ break; ++ case 'L': basedir = FRIBIDI_TYPE_L; ++ break; ++ default: basedir = FRIBIDI_TYPE_ON; ++ break; ++ } ++ ++ if (len) { ++ wchar_t *owcs; ++ int newlen; ++ ++ wcs = malloc(sizeof(*wcs) * (len + 1)); ++ if (!wcs) ++ return NULL; ++ ret = mbstowcs(wcs, str, len + 1); ++ if (ret < 0) { ++ free(wcs); ++ return NULL; ++ } ++ owcs = wchar_to_textmod_visual(wcs, ret, &basedir, 1); ++ if (FRIBIDI_DIR_TO_LEVEL(basedir)) ++ *dir = 'R'; ++ else ++ *dir = 'L'; ++ ++ free(wcs); ++ if (!owcs) ++ return NULL; ++ ++ newlen = wcstombs(NULL, owcs, 0); ++ if (newlen < 0) { ++ free(owcs); ++ return NULL; ++ } ++ rstr = malloc(newlen + 1); ++ if (!rstr) { ++ free(owcs); ++ return NULL; ++ } ++ ret = wcstombs(rstr, owcs, newlen + 1); ++ free(owcs); ++ if (ret < 0) { ++ free(rstr); ++ return NULL; ++ } ++ } ++ return rstr; ++} ++ ++/* Returns base direction of text given in {str}. ++ */ ++char get_text_direction(const char *str) ++{ ++ int len = strlen(str); ++ char dir = 'N'; ++ wchar_t *wcs; ++ int ret; ++ ++ FriBidiCharType basedir = FRIBIDI_TYPE_ON; ++ ++ if (len) { ++ wcs = malloc(sizeof(*wcs) * (len + 1)); ++ if (!wcs) ++ return dir; ++ ret = mbstowcs(wcs, str, len + 1); ++ if (ret < 0) { ++ free(wcs); ++ return dir; ++ } ++ wchar_to_textmod_visual(wcs, ret, &basedir, 1); ++ free(wcs); ++ if (FRIBIDI_DIR_TO_LEVEL(basedir)) ++ dir = 'R'; ++ else ++ dir = 'L'; ++ } ++ return dir; ++} ++ ++/* If width of string {str} is less then {width} adds ++ * final spaces to make it {width} position wide. ++ * Returns malloc'ed padded string or NULL in case of errors ++ * or if string does not need padding. ++ */ ++static char *pad_line(const char *str, int width) ++{ ++ int len = strlen(str); ++ int w = _newt_wstrlen(str, len); ++ ++ if (w < width) { ++ char *newstr = malloc(len + 1 + (width - w)); ++ if (!newstr) ++ return NULL; ++ memcpy(newstr, str, len); ++ memset(newstr + len, ' ', width - w); ++ newstr[len+width-w] = '\0'; ++ return newstr; ++ } ++ return NULL; ++} ++ ++/* ++ * Writes string {str}. Uses {dir} as default direction. ++ * Returns direction of the string in {dir}. ++ */ ++void write_string_int(const char *str, char *dir) ++{ ++ char dummy; ++ char *tmpstr; ++ ++ if (!dir) { ++ dummy = 'N'; ++ dir = &dummy; ++ } ++ ++ tmpstr = _newt_log2vis(str, dir); ++ if (tmpstr) ++ str = tmpstr; ++ SLsmg_write_string(str); ++ if (tmpstr) ++ free(tmpstr); ++} ++ ++/* Writes at most {n} positions of the string {str}. ++ * Adds final (logical) spaces if string width is less than {n}. ++ * Uses {dir} as default direction. ++ * Returns direction of the string in {dir} ++ */ ++void write_nstring_int(const char *str, int n, char *dir) ++{ ++ char dummy; ++ char *tmpstr, *tmpstr1; ++ ++ if (!dir) { ++ dummy = 'N'; ++ dir = &dummy; ++ } ++ ++ tmpstr1 = pad_line(str, n); ++ if (tmpstr1) ++ str = tmpstr1; ++ tmpstr = _newt_log2vis(str, dir); ++ if (tmpstr) { ++ free(tmpstr1); ++ str = tmpstr; ++ } ++ SLsmg_write_nstring(str, n); ++ if (tmpstr) ++ free(tmpstr); ++ else ++ free(tmpstr1); ++} ++#else ++void write_string_int(const char *str, char *dir) ++{ ++ SLsmg_write_string(str); ++} ++ ++void write_nstring_int(const char *str, int w, char *dir) ++{ ++ SLsmg_write_nstring(str, w); ++} ++ ++char get_text_direction(const char *str) ++{ ++ return 'L'; ++} ++#endif ++ + struct Window { + int height, width, top, left; + SLsmg_Char_Type * buffer; +@@ -677,7 +1130,7 @@ + SLsmg_set_char_set(0); + SLsmg_write_char(' '); + SLsmg_set_color(NEWT_COLORSET_TITLE); +- SLsmg_write_string((char *)currentWindow->title); ++ write_string_int((char *)currentWindow->title, NULL); + SLsmg_set_color(NEWT_COLORSET_BORDER); + SLsmg_write_char(' '); + SLsmg_set_char_set(1); +@@ -889,7 +1342,7 @@ + buf[SLtt_Screen_Cols] = '\0'; + } + SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); +- SLsmg_write_string(buf); ++ write_string_int(buf, NULL); + } + + void newtPushHelpLine(const char * text) { +@@ -930,7 +1383,7 @@ + } + + SLsmg_gotorc(row, col); +- SLsmg_write_string((char *)text); ++ write_string_int((char *)text, NULL); + } + + int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense) { +diff -ruN newt-0.52.2-old/newt_pr.h newt-0.52.2/newt_pr.h +--- newt-0.52.2-old/newt_pr.h 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/newt_pr.h 2006-01-19 20:34:41.000000000 +0000 +@@ -81,6 +81,10 @@ + struct event ev); + + int _newt_wstrlen(const char *str, int len); ++void write_string_int(const char *, char *); ++void write_nstring_int(const char *, int, char *); ++char get_text_direction(const char *); ++ + #define wstrlen(str,len) _newt_wstrlen((str),(len)) + + #endif /* H_NEWT_PR */ +diff -ruN newt-0.52.2-old/textbox.c newt-0.52.2/textbox.c +--- newt-0.52.2-old/textbox.c 2005-09-30 14:05:55.000000000 +0000 ++++ newt-0.52.2/textbox.c 2006-01-19 20:34:41.000000000 +0000 +@@ -339,20 +339,42 @@ + int i; + struct textbox * tb = c->data; + int size; +- ++ char dir = 'N'; ++ int newdir = 1; ++ int dw = 0; ++ + if (tb->sb) { + size = tb->numLines - c->height; + newtScrollbarSet(tb->sb, tb->topLine, size ? size : 0); + tb->sb->ops->draw(tb->sb); ++ dw = 2; + } + + SLsmg_set_color(NEWT_COLORSET_TEXTBOX); + ++ /* find direction of first visible paragraph */ ++ for (i = 0; i < tb->topLine; i++) { ++ if (!*tb->lines[i]) { ++ /* new line: new paragraph starts at the next line */ ++ newdir = 1; ++ dir = 'N'; ++ } ++ else if (newdir) { ++ /* get current paragraph direction, if possible */ ++ dir = get_text_direction(tb->lines[i]); ++ newdir = (dir == 'N') ? 1 : 0; ++ } ++ } ++ + for (i = 0; (i + tb->topLine) < tb->numLines && i < c->height; i++) { + newtGotorc(c->top + i, c->left); + SLsmg_write_string(tb->blankline); + newtGotorc(c->top + i, c->left); +- SLsmg_write_string(tb->lines[i + tb->topLine]); ++ /* BIDI: we need *nstring* here to properly align lines */ ++ write_nstring_int(tb->lines[i + tb->topLine], c->width - dw, &dir); ++ /* Does new paragraph follow? */ ++ if (!*tb->lines[i + tb->topLine]) ++ dir = 'N'; + } + } + --- newt-0.52.2.orig/debian/patches/002_version_fix.patch +++ newt-0.52.2/debian/patches/002_version_fix.patch @@ -0,0 +1,24 @@ +diff -ruN newt-0.52.2-old/configure newt-0.52.2/configure +--- newt-0.52.2-old/configure 2005-11-22 08:34:43.000000000 +0000 ++++ newt-0.52.2/configure 2006-01-19 21:24:23.000000000 +0000 +@@ -1308,7 +1308,7 @@ + + + PACKAGE=newt +-VERSION=0.52.1 ++VERSION=0.52.2 + SONAME=0.52 + + cat >>confdefs.h <<_ACEOF +diff -ruN newt-0.52.2-old/configure.in newt-0.52.2/configure.in +--- newt-0.52.2-old/configure.in 2005-11-22 08:33:12.000000000 +0000 ++++ newt-0.52.2/configure.in 2006-01-19 21:24:30.000000000 +0000 +@@ -4,7 +4,7 @@ + AC_CONFIG_HEADER(config.h) + + PACKAGE=newt +-VERSION=0.52.1 ++VERSION=0.52.2 + SONAME=0.52 + AC_DEFINE_UNQUOTED(VERSION, "$VERSION", [NEWT Version String]) + AC_SUBST(PACKAGE) --- newt-0.52.2.orig/debian/patches/015_slang2_utf8.patch +++ newt-0.52.2/debian/patches/015_slang2_utf8.patch @@ -0,0 +1,11 @@ +diff -ruN newt-0.52.2-old/newt.c newt-0.52.2/newt.c +--- newt-0.52.2-old/newt.c 2005-09-30 15:13:16.000000000 +0100 ++++ newt-0.52.2/newt.c 2005-10-23 08:17:21.000000000 +0100 +@@ -290,6 +290,7 @@ + + SLtt_get_terminfo(); + SLtt_get_screen_size(); ++ SLutf8_enable(-1); /* init. utf8 according to locale */ + + MonoValue = getenv(MonoEnv); + if ( MonoValue == NULL ) { --- newt-0.52.2.orig/debian/patches/035_topleft_a11y.patch +++ newt-0.52.2/debian/patches/035_topleft_a11y.patch @@ -0,0 +1,40 @@ +diff -ruN newt-0.52.2-old/whiptail.c newt-0.52.2/whiptail.c +--- newt-0.52.2-old/whiptail.c 2005-09-21 10:32:03.000000000 +0100 ++++ newt-0.52.2/whiptail.c 2005-11-19 12:05:07.000000000 +0000 +@@ -57,7 +57,8 @@ + "\t--output-fd output to fd, not stdout\n" + "\t--title display title\n" + "\t--backtitle <backtitle> display backtitle\n" +- "\t--scrolltext force verical scrollbars\n\n")); ++ "\t--scrolltext force verical scrollbars\n" ++ "\t--topleft put window in top-left corner\n\n")); + exit(err ? DLG_ERROR : 0 ); + } + +@@ -339,6 +340,7 @@ + int separateOutput = 0; + int fullButtons = 0; + int outputfd = 2; ++ int topLeft = 0; + FILE *output = stderr; + const char * result; + const char ** selections, ** next; +@@ -367,6 +369,7 @@ + { "separate-output", '\0', 0, &separateOutput, 0 }, + { "title", '\0', POPT_ARG_STRING, &title, 0 }, + { "textbox", '\0', 0, 0, OPT_TEXTBOX }, ++ { "topleft", '\0', 0, &topLeft, 0 }, + { "yesno", '\0', 0, 0, OPT_YESNO }, + { "passwordbox", '\0', 0, 0, OPT_PASSWORDBOX }, + { "output-fd", '\0', POPT_ARG_INT, &outputfd, 0 }, +@@ -500,8 +503,8 @@ + width -= 2; + height -= 2; + +- newtOpenWindow((SLtt_Screen_Cols - width) / 2, +- (SLtt_Screen_Rows - height) / 2, width, height, title); ++ newtOpenWindow(topLeft ? 1 : (SLtt_Screen_Cols - width) / 2, ++ topLeft ? 1 : (SLtt_Screen_Rows - height) / 2, width, height, title); + if (backtitle) + newtDrawRootText(0, 0, backtitle); + --- newt-0.52.2.orig/debian/patches/040_bengali.patch +++ newt-0.52.2/debian/patches/040_bengali.patch @@ -0,0 +1,43 @@ +diff -ruN newt-0.52.2-old/po/bn.po newt-0.52.2/po/bn.po +--- newt-0.52.2-old/po/bn.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/bn.po 2006-06-20 20:34:31.000000000 +0100 +@@ -0,0 +1,32 @@ ++# Bangla translation of newt_newt.pot. ++# Copyright (C) 2005, Debian Foundation. ++# This file is distributed under the same license as the Newt_Newt package. ++# Progga <progga@BengaLinux.Org>, 2005. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: Newt_Newt HEAD\n" ++"Report-Msgid-Bugs-To: \n" ++"POT-Creation-Date: 2005-11-02 09:15-0700\n" ++"PO-Revision-Date: 2005-11-20 19:00+0600\n" ++"Last-Translator: Progga <progga@BengaLinux.Org>\n" ++"Language-Team: Bangla <core@BengaLinux.Org>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++ ++#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 ++msgid "Ok" ++msgstr "ঠিক আছে" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "বাতিল" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "হ্যাঁ" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "না" +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2005-11-22 08:45:59.000000000 +0000 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 20:34:46.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja ko lt mg mk nb nl nn pa_IN pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja ko lt mg mk nb nl nn pa_IN pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh + --- newt-0.52.2.orig/debian/patches/045_snack_entrywindow.patch +++ newt-0.52.2/debian/patches/045_snack_entrywindow.patch @@ -0,0 +1,11 @@ +diff -ruN newt-0.52.2-old/snack.py newt-0.52.2/snack.py +--- newt-0.52.2-old/snack.py 2005-09-21 10:32:02.000000000 +0100 ++++ newt-0.52.2/snack.py 2005-11-25 20:50:04.000000000 +0000 +@@ -789,6 +789,7 @@ + for n in prompts: + if (type(n) == types.TupleType): + (n, e) = n ++ e = Entry(entryWidth, e) + else: + e = Entry(entryWidth) + --- newt-0.52.2.orig/debian/patches/050_updated_greek.patch +++ newt-0.52.2/debian/patches/050_updated_greek.patch @@ -0,0 +1,23 @@ +diff -ruN newt-0.52.2-old/po/el.po newt-0.52.2/po/el.po +--- newt-0.52.2-old/po/el.po 2005-11-22 08:46:24.000000000 +0000 ++++ newt-0.52.2/po/el.po 2006-01-19 21:33:49.000000000 +0000 +@@ -7,8 +7,8 @@ + msgid "" + msgstr "" + "Project-Id-Version: el\n" +-"Report-Msgid-Bugs-To: mckinstry@debian.org\n" +-"POT-Creation-Date: 2005-11-22 09:35+0100\n" ++"Report-Msgid-Bugs-To: \n" ++"POT-Creation-Date: 2005-12-19 03:15-0700\n" + "PO-Revision-Date: 2004-01-09 12:10EEST\n" + "Last-Translator: Konstantinos Margaritis <markos@debian.org>\n" + "Language-Team: Greek <debian-l10n-greek@lists.debian.org>\n" +@@ -19,7 +19,7 @@ + + #: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 + msgid "Ok" +-msgstr "Eντάξει" ++msgstr "Εντάξει" + + #: dialogboxes.c:51 + msgid "Cancel" --- newt-0.52.2.orig/debian/patches/060_pgupdown_crash.patch +++ newt-0.52.2/debian/patches/060_pgupdown_crash.patch @@ -0,0 +1,38 @@ +diff -ruN newt-0.52.2-old/checkboxtree.c newt-0.52.2/checkboxtree.c +--- newt-0.52.2-old/checkboxtree.c 2006-01-19 21:37:14.000000000 +0000 ++++ newt-0.52.2/checkboxtree.c 2006-01-19 21:37:29.000000000 +0000 +@@ -537,6 +537,18 @@ + free(co); + } + ++static void ctEnsureLimits( struct CheckboxTree *ct ) { ++ struct items **listEnd = ct->flatList + ct->flatCount - 1; ++ if (ct->firstItem < ct->flatList) ++ ct->firstItem = ct->flatList; ++ if (ct->currItem < ct->flatList) ++ ct->currItem = ct->flatList; ++ if (ct->firstItem > listEnd) { ++ ct->firstItem = listEnd; ++ ct->currItem = listEnd; ++ } ++} ++ + struct eventResult ctEvent(newtComponent co, struct event ev) { + struct CheckboxTree * ct = co->data; + struct eventResult er; +@@ -648,6 +660,7 @@ + ct->currItem -= co->height; + ct->firstItem -= co->height; + } ++ ctEnsureLimits( ct ); + + ctDraw(co); + if(co->callback) co->callback(co, co->callbackData); +@@ -664,6 +677,7 @@ + ct->currItem += co->height; + ct->firstItem += co->height; + } ++ ctEnsureLimits( ct ); + + ctDraw(co); + if(co->callback) co->callback(co, co->callbackData); --- newt-0.52.2.orig/debian/patches/065_scrollbars.patch +++ newt-0.52.2/debian/patches/065_scrollbars.patch @@ -0,0 +1,23 @@ +# Scrollbars patch applied in fedora NEWT 0.52.2-7 +# +diff -ruN newt-0.52.2-old/scrollbar.c newt-0.52.2/scrollbar.c +--- newt-0.52.2-old/scrollbar.c 2002-06-27 02:17:46.000000000 +0000 ++++ newt-0.52.2/scrollbar.c 2006-01-19 21:38:56.000000000 +0000 +@@ -47,7 +47,7 @@ + sb = malloc(sizeof(*sb)); + co->data = sb; + +- if (!strcmp(getenv("TERM"), "linux") && height >= 2) { ++ if (height >= 2) { + sb->arrows = 1; + sb->curr = 1; + } else { +@@ -100,7 +100,7 @@ + + static void sbDrawThumb(newtComponent co, int isOn) { + struct scrollbar * sb = co->data; +- SLtt_Char_Type ch = isOn ? '#' : SLSMG_CKBRD_CHAR; ++ SLtt_Char_Type ch = isOn ? SLSMG_BLOCK_CHAR : SLSMG_CKBRD_CHAR; + + if (!co->isMapped) return; + --- newt-0.52.2.orig/debian/patches/070_cursor_a11y.patch +++ newt-0.52.2/debian/patches/070_cursor_a11y.patch @@ -0,0 +1,23 @@ +diff -ruN newt-0.52.2-old/button.c newt-0.52.2/button.c +--- newt-0.52.2-old/button.c 2006-01-19 21:48:07.000000000 +0000 ++++ newt-0.52.2/button.c 2006-01-19 21:51:53.000000000 +0000 +@@ -112,7 +112,9 @@ + SLsmg_write_char('<'); + write_string_int(bu->text, NULL); + SLsmg_write_char('>'); +- } else { ++ /* put cursor at beginning of text for better accessibility */ ++ newtGotorc(co->top+ pushed, co->left + 1 + pushed + 1); ++} else { + if (pushed) { + SLsmg_set_color(NEWT_COLORSET_BUTTON); + newtDrawBox(co->left + 1, co->top + 1, co->width - 1, 3, 0); +@@ -142,6 +144,8 @@ + SLsmg_write_char(' '); + write_string_int(bu->text, NULL); + SLsmg_write_char(' '); ++ /* put cursor at beginning of text for better accessibility */ ++ newtGotorc(co->top + 1 + pushed, co->left + 1 + pushed + 1); + } + + static struct eventResult buttonEvent(newtComponent co, --- newt-0.52.2.orig/debian/patches/080_pa_rename.patch +++ newt-0.52.2/debian/patches/080_pa_rename.patch @@ -0,0 +1,85 @@ +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2006-06-20 21:09:19.000000000 +0100 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 21:12:18.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bn bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja ko lt mg mk nb nl nn pa_IN pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de el es et eu fi fr ga gl he hi hr hu id it ja ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh + +diff -ruN newt-0.52.2-old/po/pa_IN.po newt-0.52.2/po/pa_IN.po +--- newt-0.52.2-old/po/pa_IN.po 2005-11-22 08:46:24.000000000 +0000 ++++ newt-0.52.2/po/pa_IN.po 1970-01-01 01:00:00.000000000 +0100 +@@ -1,35 +0,0 @@ +-# translation of newt_newt_po.po to Panjabi +-# This file is distributed under the same license as the PACKAGE package. +-# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. +-# Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>, 2005. +-# Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>, 2005. +-# Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>, 2005. +-# +-msgid "" +-msgstr "" +-"Project-Id-Version: newt_newt_po\n" +-"Report-Msgid-Bugs-To: mckinstry@debian.org\n" +-"POT-Creation-Date: 2005-11-22 09:35+0100\n" +-"PO-Revision-Date: 2005-03-28 10:24+0530\n" +-"Last-Translator: Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>\n" +-"Language-Team: Panjabi <pa@li.org>\n" +-"MIME-Version: 1.0\n" +-"Content-Type: text/plain; charset=UTF-8\n" +-"Content-Transfer-Encoding: 8bit\n" +-"X-Generator: KBabel 1.9.1\n" +- +-#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 +-msgid "Ok" +-msgstr "ਠੀਕ ਹੈ" +- +-#: dialogboxes.c:51 +-msgid "Cancel" +-msgstr "ਰੱਦ ਕਰੋ" +- +-#: dialogboxes.c:498 +-msgid "Yes" +-msgstr "ਹਾਂ" +- +-#: dialogboxes.c:500 +-msgid "No" +-msgstr "ਨਹੀਂ" +diff -ruN newt-0.52.2-old/po/pa.po newt-0.52.2/po/pa.po +--- newt-0.52.2-old/po/pa.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/pa.po 2006-06-20 21:09:19.000000000 +0100 +@@ -0,0 +1,35 @@ ++# translation of newt_newt_po.po to Panjabi ++# This file is distributed under the same license as the PACKAGE package. ++# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER. ++# Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>, 2005. ++# Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>, 2005. ++# Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>, 2005. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: newt_newt_po\n" ++"Report-Msgid-Bugs-To: mckinstry@debian.org\n" ++"POT-Creation-Date: 2005-11-22 09:35+0100\n" ++"PO-Revision-Date: 2005-03-28 10:24+0530\n" ++"Last-Translator: Amanpreet Singh Alam[ਆਲਮ] <amanpreetalam@yahoo.com>\n" ++"Language-Team: Panjabi <pa@li.org>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"X-Generator: KBabel 1.9.1\n" ++ ++#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 ++msgid "Ok" ++msgstr "ਠੀਕ ਹੈ" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "ਰੱਦ ਕਰੋ" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "ਹਾਂ" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "ਨਹੀਂ" --- newt-0.52.2.orig/debian/patches/150_thai.patch +++ newt-0.52.2/debian/patches/150_thai.patch @@ -0,0 +1,43 @@ +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2006-06-20 21:14:30.000000000 +0100 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 21:14:50.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bn bs ca cs cy da de dz el es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de dz el es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv th tl tr uk vi wo zh_CN zh_TW xh + +diff -ruN newt-0.52.2-old/po/th.po newt-0.52.2/po/th.po +--- newt-0.52.2-old/po/th.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/th.po 2006-06-20 21:14:30.000000000 +0100 +@@ -0,0 +1,32 @@ ++# Thai translation of newt. ++# Copyright (C) 2006 Software in the Public Interest, Inc. ++# This file is distributed under the same license as debian-installer. ++# Theppitak Karoonboonyanan <thep@linux.thai.net>, 2006. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: newt\n" ++"Report-Msgid-Bugs-To: mckinstry@debian.org\n" ++"POT-Creation-Date: 2005-11-22 09:35+0100\n" ++"PO-Revision-Date: 2006-05-14 21:45+0700\n" ++"Last-Translator: Theppitak Karoonboonyanan <thep@linux.thai.net>\n" ++"Language-Team: Thai <l10n@opentle.org>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++ ++#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 ++msgid "Ok" ++msgstr "ตกลง" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "ยกเลิก" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "ใช่" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "ไม่" --- newt-0.52.2.orig/debian/patches/160_esperanto.patch +++ newt-0.52.2/debian/patches/160_esperanto.patch @@ -0,0 +1,48 @@ +diff -ruN newt-0.52.2-old/po/eo.po newt-0.52.2/po/eo.po +--- newt-0.52.2-old/po/eo.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/eo.po 2006-06-20 18:12:28.000000000 +0100 +@@ -0,0 +1,37 @@ ++# translation to Esperanto ++# Copyright (C) 2006 Free Software Foundation, Inc. ++# This file is distributed under the same license as the newt package. ++# Serge Leblanc <serge.leblanc@wanadoo.fr>, 2006. ++# ++msgid "" ++msgstr "" ++"Project-Id-Version: newt\n" ++"Report-Msgid-Bugs-To: mckinstry@debian.org\n" ++"POT-Creation-Date: 2005-11-22 09:35+0100\n" ++"PO-Revision-Date: 2006-04-18 14:00+0100\n" ++"Last-Translator: Serge Leblanc <serge.leblanc@wanadoo.fr>\n" ++"Language-Team: Esperanto <debian-l10n-esperanto@lists.debian.org>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=utf-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"X-Poedit-Language: Esperanto\n" ++"X-Poedit-SourceCharset: utf-8\n" ++ ++#: dialogboxes.c:43 ++#: dialogboxes.c:48 ++#: dialogboxes.c:493 ++msgid "Ok" ++msgstr "Akceptu" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "Nuligu" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "Jes" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "Ne" ++ +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2006-06-20 21:15:00.000000000 +0100 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 21:15:14.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bn bs ca cs cy da de dz el es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv th tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de dz el eo es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv th tl tr uk vi wo zh_CN zh_TW xh + --- newt-0.52.2.orig/debian/patches/180_cursor.patch +++ newt-0.52.2/debian/patches/180_cursor.patch @@ -0,0 +1,475 @@ +diff -ruN newt-0.52.2-old/entry.c newt-0.52.2/entry.c +--- newt-0.52.2-old/entry.c 2006-06-20 21:55:45.000000000 +0100 ++++ newt-0.52.2/entry.c 2006-06-20 21:56:05.000000000 +0100 +@@ -325,6 +325,7 @@ + switch (key) { + case '\r': /* Return */ + if (en->flags & NEWT_FLAG_RETURNEXIT) { ++ newtCursorOff(); + er.result = ER_EXITFORM; + } else { + er.result = ER_NEXTCOMP; +diff -ruN newt-0.52.2-old/entry.c.orig newt-0.52.2/entry.c.orig +--- newt-0.52.2-old/entry.c.orig 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/entry.c.orig 2006-06-20 21:55:45.000000000 +0100 +@@ -0,0 +1,460 @@ ++#include "config.h" ++ ++#ifdef HAVE_ALLOCA_H ++#include <alloca.h> ++#endif ++ ++#include <ctype.h> ++#include <slang.h> ++#include <stdlib.h> ++#include <string.h> ++#include <wchar.h> ++ ++#include "newt.h" ++#include "newt_pr.h" ++ ++struct entry { ++ int flags; ++ char * buf; ++ const char ** resultPtr; ++ int bufAlloced; ++ int bufUsed; /* amount of the buffer that's been used */ ++ int cursorPosition; /* cursor *in the string* on on screen */ ++ int firstChar; /* first character position being shown */ ++ newtEntryFilter filter; ++ void * filterData; ++}; ++ ++static void entryDraw(newtComponent co); ++static void entryDestroy(newtComponent co); ++static struct eventResult entryEvent(newtComponent co, ++ struct event ev); ++ ++static struct eventResult entryHandleKey(newtComponent co, int key); ++ ++static struct componentOps entryOps = { ++ entryDraw, ++ entryEvent, ++ entryDestroy, ++ newtDefaultPlaceHandler, ++ newtDefaultMappedHandler, ++} ; ++ ++void newtEntrySet(newtComponent co, const char * value, int cursorAtEnd) { ++ struct entry * en = co->data; ++ ++ if ((strlen(value) + 1) > (unsigned int)en->bufAlloced) { ++ free(en->buf); ++ en->bufAlloced = strlen(value) + 1; ++ en->buf = malloc(en->bufAlloced); ++ if (en->resultPtr) *en->resultPtr = en->buf; ++ } ++ memset(en->buf, 0, en->bufAlloced); /* clear the buffer */ ++ strcpy(en->buf, value); ++ en->bufUsed = strlen(value); ++ en->firstChar = 0; ++ if (cursorAtEnd) ++ en->cursorPosition = en->bufUsed; ++ else ++ en->cursorPosition = 0; ++ ++ entryDraw(co); ++} ; ++ ++newtComponent newtEntry(int left, int top, const char * initialValue, int width, ++ const char ** resultPtr, int flags) { ++ newtComponent co; ++ struct entry * en; ++ ++ co = malloc(sizeof(*co)); ++ en = malloc(sizeof(struct entry)); ++ co->data = en; ++ ++ co->top = top; ++ co->left = left; ++ co->height = 1; ++ co->width = width; ++ co->isMapped = 0; ++ co->callback = NULL; ++ ++ co->ops = &entryOps; ++ ++ en->flags = flags; ++ en->cursorPosition = 0; ++ en->firstChar = 0; ++ en->bufUsed = 0; ++ en->bufAlloced = width + 1; ++ en->filter = NULL; ++ ++ if (!(en->flags & NEWT_FLAG_DISABLED)) ++ co->takesFocus = 1; ++ else ++ co->takesFocus = 0; ++ ++ if (initialValue && strlen(initialValue) > (unsigned int)width) { ++ en->bufAlloced = strlen(initialValue) + 1; ++ } ++ en->buf = malloc(en->bufAlloced); ++ en->resultPtr = resultPtr; ++ if (en->resultPtr) *en->resultPtr = en->buf; ++ ++ memset(en->buf, 0, en->bufAlloced); ++ if (initialValue) { ++ strcpy(en->buf, initialValue); ++ en->bufUsed = strlen(initialValue); ++ en->cursorPosition = en->bufUsed; ++ } else { ++ *en->buf = '\0'; ++ en->bufUsed = 0; ++ en->cursorPosition = 0; ++ } ++ ++ return co; ++} ++ ++static int visible_width(const char *str, int start, int end) ++{ ++ int width = wstrlen(str + start, end-start); ++ int len, w = 0; ++ wchar_t wc; ++ ++ len = mbtowc(&wc, str+end, MB_CUR_MAX); ++ if (len == 0) ++ w = 1; ++ else if (len > 0) ++ w = wcwidth(wc); ++ return width + w; ++} ++ ++static void scroll(struct entry *en, int width) ++{ ++ wchar_t wc; ++ int len, w; ++ int newwidth = visible_width(en->buf, en->firstChar, en->cursorPosition); ++ ++ while (newwidth > width) { ++ len = mbtowc(&wc, en->buf+en->firstChar, MB_CUR_MAX); ++ if (!len) { ++ en->firstChar++; ++ break; ++ } ++ if (len < 0) ++ break; ++ w = wcwidth(wc); ++ if (w < 0) ++ break; ++ en->firstChar += len; ++ newwidth -= w; ++ } ++} ++ ++static void entryDraw(newtComponent co) { ++ struct entry * en = co->data; ++ int i; ++ char * chptr; ++ int len; ++ char *tmpptr = NULL; ++ ++ if (!co->isMapped) return; ++ ++ if (en->flags & NEWT_FLAG_DISABLED) ++ SLsmg_set_color(NEWT_COLORSET_DISENTRY); ++ else ++ SLsmg_set_color(NEWT_COLORSET_ENTRY); ++ ++ if (en->flags & NEWT_FLAG_HIDDEN) { ++ newtGotorc(co->top, co->left); ++ for (i = 0; i < co->width; i++) ++ SLsmg_write_char('_'); ++ newtGotorc(co->top, co->left); ++ ++ return; ++ } ++ ++ newtGotorc(co->top, co->left); ++ ++ if (en->cursorPosition < en->firstChar) { ++ /* scroll to the left */ ++ en->firstChar = en->cursorPosition; ++ } else { ++ /* scroll to the right */ ++ scroll(en, co->width); ++ } ++ ++ chptr = en->buf + en->firstChar; ++ ++ if (en->flags & NEWT_FLAG_PASSWORD) { ++ char *p; ++ tmpptr = alloca(strlen(chptr)+2); ++ strcpy(tmpptr, chptr); ++ for (p = tmpptr; *p; p++) ++ *p = '*'; ++ chptr = tmpptr; ++ } ++ ++ len = wstrlen(chptr, -1); ++ ++ if (len <= co->width) { ++ i = len; ++ /* BIDI: do not replaced, because it will not work. ++ * More work needed */ ++ SLsmg_write_string(chptr); ++ while (i < co->width) { ++ SLsmg_write_char('_'); ++ i++; ++ } ++ } else { ++ /* BIDI: will not work for RTL text */ ++ SLsmg_write_nstring(chptr, co->width); ++ } ++ ++ if (en->flags & NEWT_FLAG_HIDDEN) ++ newtGotorc(co->top, co->left); ++ else ++ newtGotorc(co->top, co->left + wstrlen(en->buf+en->firstChar, en->cursorPosition - en->firstChar)); ++} ++ ++void newtEntrySetFlags(newtComponent co, int flags, enum newtFlagsSense sense) { ++ struct entry * en = co->data; ++ int row, col; ++ ++ en->flags = newtSetFlags(en->flags, flags, sense); ++ ++ if (!(en->flags & NEWT_FLAG_DISABLED)) ++ co->takesFocus = 1; ++ else ++ co->takesFocus = 0; ++ ++ newtGetrc(&row, &col); ++ entryDraw(co); ++ newtGotorc(row, col); ++} ++ ++static void entryDestroy(newtComponent co) { ++ struct entry * en = co->data; ++ ++ free(en->buf); ++ free(en); ++ free(co); ++} ++ ++static struct eventResult entryEvent(newtComponent co, ++ struct event ev) { ++ struct entry * en = co->data; ++ struct eventResult er; ++ int ch; ++ ++ if (ev.when == EV_NORMAL) { ++ switch (ev.event) { ++ case EV_FOCUS: ++ newtCursorOn(); ++ if (en->flags & NEWT_FLAG_HIDDEN) ++ newtGotorc(co->top, co->left); ++ else ++ newtGotorc(co->top, co->left + ++ wstrlen(en->buf + en->firstChar, en->cursorPosition - en->firstChar)); ++ er.result = ER_SWALLOWED; ++ break; ++ ++ case EV_UNFOCUS: ++ newtCursorOff(); ++ newtGotorc(0, 0); ++ er.result = ER_SWALLOWED; ++ if (co->callback) ++ co->callback(co, co->callbackData); ++ break; ++ ++ case EV_KEYPRESS: ++ ch = ev.u.key; ++ if (en->filter) ++ ch = en->filter(co, en->filterData, ch, en->cursorPosition); ++ if (ch) er = entryHandleKey(co, ch); ++ break; ++ ++ case EV_MOUSE: ++ if ((ev.u.mouse.type == MOUSE_BUTTON_DOWN) && ++ (en->flags ^ NEWT_FLAG_HIDDEN)) { ++ if (strlen(en->buf) >= ev.u.mouse.x - co->left) { ++ en->cursorPosition = ev.u.mouse.x - co->left; ++ newtGotorc(co->top, ++ co->left +(en->cursorPosition - en->firstChar)); ++ } else { ++ en->cursorPosition = strlen(en->buf); ++ newtGotorc(co->top, ++ co->left +(en->cursorPosition - en->firstChar)); ++ } ++ } ++ break; ++ } ++ } else ++ er.result = ER_IGNORED; ++ ++ return er; ++} ++ ++static int previous_char(const char *buf, int pos) ++{ ++ int len = 0; ++ int off = 0; ++ ++ while (off < pos) { ++ len = mblen(buf+off, MB_CUR_MAX); ++ if (len <= 0) ++ return pos; ++ off+=len; ++ } ++ return off-len; ++} ++ ++static int next_char(const char *buf, int pos) ++{ ++ int len = mblen(buf + pos, MB_CUR_MAX); ++ if (len < 0) ++ return pos; ++ if (len == 0) ++ return ++pos; ++ return pos+len; ++} ++ ++static struct eventResult entryHandleKey(newtComponent co, int key) { ++ struct entry * en = co->data; ++ struct eventResult er; ++ char * chptr, * insPoint; ++ ++ er.result = ER_SWALLOWED; ++ switch (key) { ++ case '\r': /* Return */ ++ if (en->flags & NEWT_FLAG_RETURNEXIT) { ++ er.result = ER_EXITFORM; ++ } else { ++ er.result = ER_NEXTCOMP; ++ } ++ break; ++ ++ case '\001': /* ^A */ ++ case NEWT_KEY_HOME: ++ en->cursorPosition = 0; ++ break; ++ ++ case '\005': /* ^E */ ++ case NEWT_KEY_END: ++ en->cursorPosition = en->bufUsed; ++ break; ++ ++ case '\013': /* ^K */ ++ en->bufUsed = en->cursorPosition; ++ memset(en->buf + en->bufUsed, 0, en->bufAlloced - en->bufUsed); ++ break; ++ ++ case '\025': /* ^U */ ++ en->bufUsed -= en->cursorPosition; ++ memmove(en->buf, en->buf + en->cursorPosition, en->bufUsed); ++ en->cursorPosition = 0; ++ memset(en->buf + en->bufUsed, 0, en->bufAlloced - en->bufUsed); ++ break; ++ ++ case '\002': /* ^B */ ++ case NEWT_KEY_LEFT: ++ if (en->cursorPosition) ++ en->cursorPosition = previous_char(en->buf, en->cursorPosition); ++ break; ++ ++ case '\004': ++ case NEWT_KEY_DELETE: ++ chptr = en->buf + en->cursorPosition; ++ if (*chptr) { ++ int delta = next_char(en->buf, en->cursorPosition)-en->cursorPosition; ++ if (delta) { ++ chptr+=delta; ++ while (*chptr) { ++ *(chptr - delta) = *chptr; ++ chptr++; ++ } ++ memset(chptr - delta, 0, delta); ++ en->bufUsed-=delta; ++ } ++ } ++ break; ++ ++ case NEWT_KEY_BKSPC: { ++ int prev = previous_char(en->buf, en->cursorPosition); ++ if (en->cursorPosition != prev) { ++ /* if this isn't true, there's nothing to erase */ ++ int delta = en->cursorPosition - prev; ++ chptr = en->buf + en->cursorPosition; ++ en->bufUsed-=delta; ++ en->cursorPosition-=delta; ++ while (*chptr) { ++ *(chptr - delta) = *chptr; ++ chptr++; ++ } ++ memset(chptr - delta, 0, delta); ++ } ++ } ++ break; ++ ++ case '\006': /* ^B */ ++ case NEWT_KEY_RIGHT: ++ if (en->cursorPosition < en->bufUsed) ++ en->cursorPosition = next_char(en->buf, en->cursorPosition); ++ break; ++ ++ default: ++ if ((key >= 0x20 && key <= 0x7e) || (key >= 0x80 && key <= 0xff)) { ++ if (!(en->flags & NEWT_FLAG_SCROLL) && wstrlen(en->buf, -1) >= co->width) { ++ /* FIXME this is broken */ ++ SLtt_beep(); ++ break; ++ } ++ ++ if ((en->bufUsed + 1) == en->bufAlloced) { ++ en->bufAlloced += 20; ++ en->buf = realloc(en->buf, en->bufAlloced); ++ if (en->resultPtr) *en->resultPtr = en->buf; ++ memset(en->buf + en->bufUsed + 1, 0, 20); ++ } ++ ++ if (en->cursorPosition == en->bufUsed) { ++ en->bufUsed++; ++ } else { ++ /* insert the new character */ ++ ++ /* chptr is the last character in the string */ ++ chptr = (en->buf + en->bufUsed) - 1; ++ if ((en->bufUsed + 1) == en->bufAlloced) { ++ /* this string fills the buffer, so clip it */ ++ chptr--; ++ } else ++ en->bufUsed++; ++ ++ insPoint = en->buf + en->cursorPosition; ++ ++ while (chptr >= insPoint) { ++ *(chptr + 1) = *chptr; ++ chptr--; ++ } ++ ++ } ++ /* FIXME */ ++ en->buf[en->cursorPosition++] = key; ++ } else { ++ er.result = ER_IGNORED; ++ } ++ } ++ ++ entryDraw(co); ++ ++ return er; ++} ++ ++char * newtEntryGetValue(newtComponent co) { ++ struct entry * en = co->data; ++ ++ return en->buf; ++} ++ ++void newtEntrySetFilter(newtComponent co, newtEntryFilter filter, void * data) { ++ struct entry * en = co->data; ++ en->filter = filter; ++ en->filterData = data; ++} --- newt-0.52.2.orig/debian/patches/170_nepali.patch +++ newt-0.52.2/debian/patches/170_nepali.patch @@ -0,0 +1,43 @@ +diff -ruN newt-0.52.2-old/po/LINGUAS newt-0.52.2/po/LINGUAS +--- newt-0.52.2-old/po/LINGUAS 2006-06-20 21:17:30.000000000 +0100 ++++ newt-0.52.2/po/LINGUAS 2006-06-20 21:18:04.000000000 +0100 +@@ -1,2 +1,2 @@ +-ar bg bn bs ca cs cy da de dz el eo es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb nl nn pa pl pt pt_BR ro ru sk sl sq sv th tl tr uk vi wo zh_CN zh_TW xh ++ar bg bn bs ca cs cy da de dz el eo es et eu fi fr ga gl he hi hr hu id it ja km ko lt mg mk nb ne nl nn pa pl pt pt_BR ro ru sk sl sq sv th tl tr uk vi wo zh_CN zh_TW xh + +diff -ruN newt-0.52.2-old/po/ne.po newt-0.52.2/po/ne.po +--- newt-0.52.2-old/po/ne.po 1970-01-01 01:00:00.000000000 +0100 ++++ newt-0.52.2/po/ne.po 2006-06-20 21:18:12.000000000 +0100 +@@ -0,0 +1,32 @@ ++# translation of newt_newt_po.po to Nepali ++# Shyam Krishna Bal <shyamkrishna_bal@yahoo.com>, 2006. ++msgid "" ++msgstr "" ++"Project-Id-Version: newt_newt_po\n" ++"Report-Msgid-Bugs-To: mckinstry@debian.org\n" ++"POT-Creation-Date: 2005-11-22 09:35+0100\n" ++"PO-Revision-Date: 2006-05-22 00:11+0545\n" ++"Last-Translator: Shyam Krishna Bal <shyamkrishna_bal@yahoo.com>\n" ++"Language-Team: Nepali <info@mpp.org.np>\n" ++"MIME-Version: 1.0\n" ++"Content-Type: text/plain; charset=UTF-8\n" ++"Content-Transfer-Encoding: 8bit\n" ++"Plural-Forms: nplurals=2;plural=(n!=1)\n" ++"X-Generator: KBabel 1.10.2\n" ++ ++#: dialogboxes.c:43 dialogboxes.c:48 dialogboxes.c:493 ++msgid "Ok" ++msgstr "ठीक छ" ++ ++#: dialogboxes.c:51 ++msgid "Cancel" ++msgstr "रद्द गर्नुहोस्" ++ ++#: dialogboxes.c:498 ++msgid "Yes" ++msgstr "हो" ++ ++#: dialogboxes.c:500 ++msgid "No" ++msgstr "होइन" ++ --- newt-0.52.2.orig/debian/patches/190_focus.patch +++ newt-0.52.2/debian/patches/190_focus.patch @@ -0,0 +1,2122 @@ +diff -ruN newt-0.52.2-old/checkboxtree.c newt-0.52.2/checkboxtree.c +--- newt-0.52.2-old/checkboxtree.c 2006-06-20 21:58:34.000000000 +0100 ++++ newt-0.52.2/checkboxtree.c 2006-06-20 22:08:48.000000000 +0100 +@@ -25,6 +25,7 @@ + int sbAdjust; + int curWidth; + int userHasSetWidth; ++ int isActive; + char * seq; + char * result; + }; +@@ -339,6 +340,7 @@ + co->width = 0; + co->isMapped = 0; + ct->curWidth = 0; ++ ct->isActive = 0; + ct->userHasSetWidth = 0; + ct->itemlist = NULL; + ct->firstItem = NULL; +@@ -460,11 +462,7 @@ + + while (*item && i < co->height) { + newtGotorc(co->top + i, co->left); +- if (*item == *ct->currItem) { +- SLsmg_set_color(NEWT_COLORSET_ACTLISTBOX); +- currRow = co->top + i; +- } else +- SLsmg_set_color(NEWT_COLORSET_LISTBOX); ++ SLsmg_set_color(NEWT_COLORSET_LISTBOX); + + for (j = 0; j < (*item)->depth; j++) + SLsmg_write_string(" "); +@@ -477,7 +475,7 @@ + } else { + if (ct->flags & NEWT_CHECKBOXTREE_HIDE_BOX) { + if ((*item)->selected) +- SLsmg_set_color(NEWT_COLORSET_ACTLISTBOX); ++ SLsmg_set_color(NEWT_COLORSET_SELLISTBOX); + SLsmg_write_string(" "); + } else { + char tmp[5]; +@@ -486,11 +484,15 @@ + SLsmg_write_string(tmp); + } + } ++ if (*item == *ct->currItem) { ++ SLsmg_set_color(ct->isActive ? ++ NEWT_COLORSET_ACTSELLISTBOX : NEWT_COLORSET_ACTLISTBOX); ++ currRow = co->top + i; ++ } + + write_nstring_int((*item)->text, co->width - 4 - + (3 * (*item)->depth), NULL); + +- SLsmg_set_color(NEWT_COLORSET_LISTBOX); + + item++; + i++; +@@ -687,11 +689,13 @@ + break; + + case EV_FOCUS: ++ ct->isActive = 1; + ctDraw(co); + er.result = ER_SWALLOWED; + break; + + case EV_UNFOCUS: ++ ct->isActive = 0; + ctDraw(co); + er.result = ER_SWALLOWED; + break; +diff -ruN newt-0.52.2-old/entry.c.orig newt-0.52.2/entry.c.orig +--- newt-0.52.2-old/entry.c.orig 2006-06-20 21:58:34.000000000 +0100 ++++ newt-0.52.2/entry.c.orig 1970-01-01 01:00:00.000000000 +0100 +@@ -1,460 +0,0 @@ +-#include "config.h" +- +-#ifdef HAVE_ALLOCA_H +-#include <alloca.h> +-#endif +- +-#include <ctype.h> +-#include <slang.h> +-#include <stdlib.h> +-#include <string.h> +-#include <wchar.h> +- +-#include "newt.h" +-#include "newt_pr.h" +- +-struct entry { +- int flags; +- char * buf; +- const char ** resultPtr; +- int bufAlloced; +- int bufUsed; /* amount of the buffer that's been used */ +- int cursorPosition; /* cursor *in the string* on on screen */ +- int firstChar; /* first character position being shown */ +- newtEntryFilter filter; +- void * filterData; +-}; +- +-static void entryDraw(newtComponent co); +-static void entryDestroy(newtComponent co); +-static struct eventResult entryEvent(newtComponent co, +- struct event ev); +- +-static struct eventResult entryHandleKey(newtComponent co, int key); +- +-static struct componentOps entryOps = { +- entryDraw, +- entryEvent, +- entryDestroy, +- newtDefaultPlaceHandler, +- newtDefaultMappedHandler, +-} ; +- +-void newtEntrySet(newtComponent co, const char * value, int cursorAtEnd) { +- struct entry * en = co->data; +- +- if ((strlen(value) + 1) > (unsigned int)en->bufAlloced) { +- free(en->buf); +- en->bufAlloced = strlen(value) + 1; +- en->buf = malloc(en->bufAlloced); +- if (en->resultPtr) *en->resultPtr = en->buf; +- } +- memset(en->buf, 0, en->bufAlloced); /* clear the buffer */ +- strcpy(en->buf, value); +- en->bufUsed = strlen(value); +- en->firstChar = 0; +- if (cursorAtEnd) +- en->cursorPosition = en->bufUsed; +- else +- en->cursorPosition = 0; +- +- entryDraw(co); +-} ; +- +-newtComponent newtEntry(int left, int top, const char * initialValue, int width, +- const char ** resultPtr, int flags) { +- newtComponent co; +- struct entry * en; +- +- co = malloc(sizeof(*co)); +- en = malloc(sizeof(struct entry)); +- co->data = en; +- +- co->top = top; +- co->left = left; +- co->height = 1; +- co->width = width; +- co->isMapped = 0; +- co->callback = NULL; +- +- co->ops = &entryOps; +- +- en->flags = flags; +- en->cursorPosition = 0; +- en->firstChar = 0; +- en->bufUsed = 0; +- en->bufAlloced = width + 1; +- en->filter = NULL; +- +- if (!(en->flags & NEWT_FLAG_DISABLED)) +- co->takesFocus = 1; +- else +- co->takesFocus = 0; +- +- if (initialValue && strlen(initialValue) > (unsigned int)width) { +- en->bufAlloced = strlen(initialValue) + 1; +- } +- en->buf = malloc(en->bufAlloced); +- en->resultPtr = resultPtr; +- if (en->resultPtr) *en->resultPtr = en->buf; +- +- memset(en->buf, 0, en->bufAlloced); +- if (initialValue) { +- strcpy(en->buf, initialValue); +- en->bufUsed = strlen(initialValue); +- en->cursorPosition = en->bufUsed; +- } else { +- *en->buf = '\0'; +- en->bufUsed = 0; +- en->cursorPosition = 0; +- } +- +- return co; +-} +- +-static int visible_width(const char *str, int start, int end) +-{ +- int width = wstrlen(str + start, end-start); +- int len, w = 0; +- wchar_t wc; +- +- len = mbtowc(&wc, str+end, MB_CUR_MAX); +- if (len == 0) +- w = 1; +- else if (len > 0) +- w = wcwidth(wc); +- return width + w; +-} +- +-static void scroll(struct entry *en, int width) +-{ +- wchar_t wc; +- int len, w; +- int newwidth = visible_width(en->buf, en->firstChar, en->cursorPosition); +- +- while (newwidth > width) { +- len = mbtowc(&wc, en->buf+en->firstChar, MB_CUR_MAX); +- if (!len) { +- en->firstChar++; +- break; +- } +- if (len < 0) +- break; +- w = wcwidth(wc); +- if (w < 0) +- break; +- en->firstChar += len; +- newwidth -= w; +- } +-} +- +-static void entryDraw(newtComponent co) { +- struct entry * en = co->data; +- int i; +- char * chptr; +- int len; +- char *tmpptr = NULL; +- +- if (!co->isMapped) return; +- +- if (en->flags & NEWT_FLAG_DISABLED) +- SLsmg_set_color(NEWT_COLORSET_DISENTRY); +- else +- SLsmg_set_color(NEWT_COLORSET_ENTRY); +- +- if (en->flags & NEWT_FLAG_HIDDEN) { +- newtGotorc(co->top, co->left); +- for (i = 0; i < co->width; i++) +- SLsmg_write_char('_'); +- newtGotorc(co->top, co->left); +- +- return; +- } +- +- newtGotorc(co->top, co->left); +- +- if (en->cursorPosition < en->firstChar) { +- /* scroll to the left */ +- en->firstChar = en->cursorPosition; +- } else { +- /* scroll to the right */ +- scroll(en, co->width); +- } +- +- chptr = en->buf + en->firstChar; +- +- if (en->flags & NEWT_FLAG_PASSWORD) { +- char *p; +- tmpptr = alloca(strlen(chptr)+2); +- strcpy(tmpptr, chptr); +- for (p = tmpptr; *p; p++) +- *p = '*'; +- chptr = tmpptr; +- } +- +- len = wstrlen(chptr, -1); +- +- if (len <= co->width) { +- i = len; +- /* BIDI: do not replaced, because it will not work. +- * More work needed */ +- SLsmg_write_string(chptr); +- while (i < co->width) { +- SLsmg_write_char('_'); +- i++; +- } +- } else { +- /* BIDI: will not work for RTL text */ +- SLsmg_write_nstring(chptr, co->width); +- } +- +- if (en->flags & NEWT_FLAG_HIDDEN) +- newtGotorc(co->top, co->left); +- else +- newtGotorc(co->top, co->left + wstrlen(en->buf+en->firstChar, en->cursorPosition - en->firstChar)); +-} +- +-void newtEntrySetFlags(newtComponent co, int flags, enum newtFlagsSense sense) { +- struct entry * en = co->data; +- int row, col; +- +- en->flags = newtSetFlags(en->flags, flags, sense); +- +- if (!(en->flags & NEWT_FLAG_DISABLED)) +- co->takesFocus = 1; +- else +- co->takesFocus = 0; +- +- newtGetrc(&row, &col); +- entryDraw(co); +- newtGotorc(row, col); +-} +- +-static void entryDestroy(newtComponent co) { +- struct entry * en = co->data; +- +- free(en->buf); +- free(en); +- free(co); +-} +- +-static struct eventResult entryEvent(newtComponent co, +- struct event ev) { +- struct entry * en = co->data; +- struct eventResult er; +- int ch; +- +- if (ev.when == EV_NORMAL) { +- switch (ev.event) { +- case EV_FOCUS: +- newtCursorOn(); +- if (en->flags & NEWT_FLAG_HIDDEN) +- newtGotorc(co->top, co->left); +- else +- newtGotorc(co->top, co->left + +- wstrlen(en->buf + en->firstChar, en->cursorPosition - en->firstChar)); +- er.result = ER_SWALLOWED; +- break; +- +- case EV_UNFOCUS: +- newtCursorOff(); +- newtGotorc(0, 0); +- er.result = ER_SWALLOWED; +- if (co->callback) +- co->callback(co, co->callbackData); +- break; +- +- case EV_KEYPRESS: +- ch = ev.u.key; +- if (en->filter) +- ch = en->filter(co, en->filterData, ch, en->cursorPosition); +- if (ch) er = entryHandleKey(co, ch); +- break; +- +- case EV_MOUSE: +- if ((ev.u.mouse.type == MOUSE_BUTTON_DOWN) && +- (en->flags ^ NEWT_FLAG_HIDDEN)) { +- if (strlen(en->buf) >= ev.u.mouse.x - co->left) { +- en->cursorPosition = ev.u.mouse.x - co->left; +- newtGotorc(co->top, +- co->left +(en->cursorPosition - en->firstChar)); +- } else { +- en->cursorPosition = strlen(en->buf); +- newtGotorc(co->top, +- co->left +(en->cursorPosition - en->firstChar)); +- } +- } +- break; +- } +- } else +- er.result = ER_IGNORED; +- +- return er; +-} +- +-static int previous_char(const char *buf, int pos) +-{ +- int len = 0; +- int off = 0; +- +- while (off < pos) { +- len = mblen(buf+off, MB_CUR_MAX); +- if (len <= 0) +- return pos; +- off+=len; +- } +- return off-len; +-} +- +-static int next_char(const char *buf, int pos) +-{ +- int len = mblen(buf + pos, MB_CUR_MAX); +- if (len < 0) +- return pos; +- if (len == 0) +- return ++pos; +- return pos+len; +-} +- +-static struct eventResult entryHandleKey(newtComponent co, int key) { +- struct entry * en = co->data; +- struct eventResult er; +- char * chptr, * insPoint; +- +- er.result = ER_SWALLOWED; +- switch (key) { +- case '\r': /* Return */ +- if (en->flags & NEWT_FLAG_RETURNEXIT) { +- er.result = ER_EXITFORM; +- } else { +- er.result = ER_NEXTCOMP; +- } +- break; +- +- case '\001': /* ^A */ +- case NEWT_KEY_HOME: +- en->cursorPosition = 0; +- break; +- +- case '\005': /* ^E */ +- case NEWT_KEY_END: +- en->cursorPosition = en->bufUsed; +- break; +- +- case '\013': /* ^K */ +- en->bufUsed = en->cursorPosition; +- memset(en->buf + en->bufUsed, 0, en->bufAlloced - en->bufUsed); +- break; +- +- case '\025': /* ^U */ +- en->bufUsed -= en->cursorPosition; +- memmove(en->buf, en->buf + en->cursorPosition, en->bufUsed); +- en->cursorPosition = 0; +- memset(en->buf + en->bufUsed, 0, en->bufAlloced - en->bufUsed); +- break; +- +- case '\002': /* ^B */ +- case NEWT_KEY_LEFT: +- if (en->cursorPosition) +- en->cursorPosition = previous_char(en->buf, en->cursorPosition); +- break; +- +- case '\004': +- case NEWT_KEY_DELETE: +- chptr = en->buf + en->cursorPosition; +- if (*chptr) { +- int delta = next_char(en->buf, en->cursorPosition)-en->cursorPosition; +- if (delta) { +- chptr+=delta; +- while (*chptr) { +- *(chptr - delta) = *chptr; +- chptr++; +- } +- memset(chptr - delta, 0, delta); +- en->bufUsed-=delta; +- } +- } +- break; +- +- case NEWT_KEY_BKSPC: { +- int prev = previous_char(en->buf, en->cursorPosition); +- if (en->cursorPosition != prev) { +- /* if this isn't true, there's nothing to erase */ +- int delta = en->cursorPosition - prev; +- chptr = en->buf + en->cursorPosition; +- en->bufUsed-=delta; +- en->cursorPosition-=delta; +- while (*chptr) { +- *(chptr - delta) = *chptr; +- chptr++; +- } +- memset(chptr - delta, 0, delta); +- } +- } +- break; +- +- case '\006': /* ^B */ +- case NEWT_KEY_RIGHT: +- if (en->cursorPosition < en->bufUsed) +- en->cursorPosition = next_char(en->buf, en->cursorPosition); +- break; +- +- default: +- if ((key >= 0x20 && key <= 0x7e) || (key >= 0x80 && key <= 0xff)) { +- if (!(en->flags & NEWT_FLAG_SCROLL) && wstrlen(en->buf, -1) >= co->width) { +- /* FIXME this is broken */ +- SLtt_beep(); +- break; +- } +- +- if ((en->bufUsed + 1) == en->bufAlloced) { +- en->bufAlloced += 20; +- en->buf = realloc(en->buf, en->bufAlloced); +- if (en->resultPtr) *en->resultPtr = en->buf; +- memset(en->buf + en->bufUsed + 1, 0, 20); +- } +- +- if (en->cursorPosition == en->bufUsed) { +- en->bufUsed++; +- } else { +- /* insert the new character */ +- +- /* chptr is the last character in the string */ +- chptr = (en->buf + en->bufUsed) - 1; +- if ((en->bufUsed + 1) == en->bufAlloced) { +- /* this string fills the buffer, so clip it */ +- chptr--; +- } else +- en->bufUsed++; +- +- insPoint = en->buf + en->cursorPosition; +- +- while (chptr >= insPoint) { +- *(chptr + 1) = *chptr; +- chptr--; +- } +- +- } +- /* FIXME */ +- en->buf[en->cursorPosition++] = key; +- } else { +- er.result = ER_IGNORED; +- } +- } +- +- entryDraw(co); +- +- return er; +-} +- +-char * newtEntryGetValue(newtComponent co) { +- struct entry * en = co->data; +- +- return en->buf; +-} +- +-void newtEntrySetFilter(newtComponent co, newtEntryFilter filter, void * data) { +- struct entry * en = co->data; +- en->filter = filter; +- en->filterData = data; +-} +diff -ruN newt-0.52.2-old/listbox.c newt-0.52.2/listbox.c +--- newt-0.52.2-old/listbox.c 2006-06-20 21:58:33.000000000 +0100 ++++ newt-0.52.2/listbox.c 2006-06-20 21:59:30.000000000 +0100 +@@ -518,7 +518,7 @@ + + newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust); + if(j + i == li->currItem) { +- if(item->isSelected) ++ if(li->isActive) + SLsmg_set_color(NEWT_COLORSET_ACTSELLISTBOX); + else + SLsmg_set_color(NEWT_COLORSET_ACTLISTBOX); +@@ -529,6 +529,12 @@ + + write_nstring_int(item->text, li->curWidth, NULL); + ++ if (li->flags & NEWT_FLAG_MULTIPLE) { ++ newtGotorc(co->top + i + li->bdyAdjust, co->left + li->bdxAdjust); ++ SLsmg_set_color(item->isSelected ? ++ NEWT_COLORSET_SELLISTBOX : NEWT_COLORSET_LISTBOX); ++ SLsmg_write_nstring(item->text, 1); ++ } + } + newtGotorc(co->top + (li->currItem - li->startShowItem) + li->bdyAdjust, + co->left + li->bdxAdjust); +diff -ruN newt-0.52.2-old/newt.c.orig newt-0.52.2/newt.c.orig +--- newt-0.52.2-old/newt.c.orig 2006-06-20 21:58:34.000000000 +0100 ++++ newt-0.52.2/newt.c.orig 1970-01-01 01:00:00.000000000 +0100 +@@ -1,1438 +0,0 @@ +-#include "config.h" +- +-#include <slang.h> +-#include <stdio.h> +-#include <stdlib.h> +-#include <string.h> +-#include <sys/signal.h> +-#include <sys/time.h> +-#include <sys/types.h> +-#include <termios.h> +-#include <unistd.h> +-#include <wchar.h> +- +-#ifdef HAVE_ALLOCA_H +-#include <alloca.h> +-#endif +- +-#include "newt.h" +-#include "newt_pr.h" +- +-#if defined(HAVE_FRIBIDI_FRIBIDI_H) && defined(HAVE_DLFCN_H) +-#include <fribidi/fribidi.h> +-#include <dlfcn.h> +- +-/* No sense in enabling shaping if we don't have BIDI support. */ +-typedef struct +-{ +- int is_shaped; +- wchar_t isolated; +- wchar_t initial; +- wchar_t medial; +- wchar_t final; +-} +-arabic_char_node; +- +-#define ARABIC_BASE 0x621 +-#define ARABIC_END 0x64A +- +-static const arabic_char_node arabic_shaping_table[] = { +-/* 0x621 */ { TRUE , 0xFE80, 0x0000, 0x0000, 0x0000}, +-/* 0x622 */ { TRUE , 0xFE81, 0x0000, 0x0000, 0xFE82}, +-/* 0x623 */ { TRUE , 0xFE83, 0x0000, 0x0000, 0xFE84}, +-/* 0x624 */ { TRUE , 0xFE85, 0x0000, 0x0000, 0xFE86}, +-/* 0x625 */ { TRUE , 0xFE87, 0x0000, 0x0000, 0xFE88}, +-/* 0x626 */ { TRUE , 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, +-/* 0x627 */ { TRUE , 0xFE8D, 0x0000, 0x0000, 0xFE8E}, +-/* 0x628 */ { TRUE , 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, +-/* 0x629 */ { TRUE , 0xFE93, 0x0000, 0x0000, 0xFE94}, +-/* 0x62A */ { TRUE , 0xFE95, 0xFE97, 0xFE98, 0xFE96}, +-/* 0x62B */ { TRUE , 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, +-/* 0x62C */ { TRUE , 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, +-/* 0x62D */ { TRUE , 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, +-/* 0x62E */ { TRUE , 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, +-/* 0x62F */ { TRUE , 0xFEA9, 0x0000, 0x0000, 0xFEAA}, +-/* 0x630 */ { TRUE , 0xFEAB, 0x0000, 0x0000, 0xFEAC}, +-/* 0x631 */ { TRUE , 0xFEAD, 0x0000, 0x0000, 0xFEAE}, +-/* 0x632 */ { TRUE , 0xFEAF, 0x0000, 0x0000, 0xFEB0}, +-/* 0x633 */ { TRUE , 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, +-/* 0x634 */ { TRUE , 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, +-/* 0x635 */ { TRUE , 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, +-/* 0x636 */ { TRUE , 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, +-/* 0x637 */ { TRUE , 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, +-/* 0x638 */ { TRUE , 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, +-/* 0x639 */ { TRUE , 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, +-/* 0x63A */ { TRUE , 0xFECD, 0xFECF, 0xFED0, 0xFECE}, +-/* 0x63B */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +-/* 0x63C */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +-/* 0x63D */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +-/* 0x63E */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +-/* 0x63F */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, +-/* 0x640 */ { TRUE , 0x0640, 0x0640, 0x0640, 0x0640}, +-/* 0x641 */ { TRUE , 0xFED1, 0xFED3, 0xFED4, 0xFED2}, +-/* 0x642 */ { TRUE , 0xFED5, 0xFED7, 0xFED8, 0xFED6}, +-/* 0x643 */ { TRUE , 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, +-/* 0x644 */ { TRUE , 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, +-/* 0x645 */ { TRUE , 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, +-/* 0x646 */ { TRUE , 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, +-/* 0x647 */ { TRUE , 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, +-/* 0x648 */ { TRUE , 0xFEED, 0x0000, 0x0000, 0xFEEE}, +-/* 0x649 */ { TRUE , 0xFEEF, 0x0000, 0x0000, 0xFEF0}, +-/* 0x64A */ { TRUE , 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2} +-}; +- +-typedef struct { +- wchar_t c; +- arabic_char_node ar_node; +-} +-extra_char_node; +- +-#define EXTRA_BASE 0x67E +-#define EXTRA_END 0x6CC +-static const extra_char_node extra_shaping_table[] = { +- {0x067E, {TRUE, 0xFB56, 0xFB58, 0xFB59, 0xFB57}}, +- {0x0686, {TRUE, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}}, +- {0x0698, {TRUE, 0xFB8A, 0x0000, 0x0000, 0xFB8B}}, +- {0x06A9, {TRUE, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}}, +- {0x06AF, {TRUE, 0xFB92, 0xFB94, 0xFB95, 0xFB93}}, +- {0x06CC, {TRUE, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}}, +- {0x0000, {FALSE, 0x0000, 0x0000, 0x0000, 0x0000}}, +-}; +- +-static const arabic_char_node *get_char_node(wchar_t w) +-{ +- if (w >= ARABIC_BASE && w <= ARABIC_END) +- return &arabic_shaping_table[w - ARABIC_BASE]; +- else if (w >= EXTRA_BASE && w <= EXTRA_END) { +- const extra_char_node *node = extra_shaping_table; +- +- while (node->c) { +- if (node->c == w) +- return &node->ar_node; +- node++; +- } +- return NULL; +- } +- return NULL; +-} +- +-static int do_shaping(wchar_t *buf, int len) { +- int i,j; +- +- wchar_t *newbuf; +- +- if (len < 1) +- return 0; +- +- newbuf = (wchar_t *)malloc(sizeof(wchar_t)*len); +- +- for (i = 0, j = 0; i < len; i++, j++) { +- int have_previous = FALSE, have_next = FALSE; +- const arabic_char_node *node, *node1; +- int prev, next; +- +- if (buf[i] == L'\0') +- break; +- +- /* If it is non-joiner, ignore it */ +- if (buf[i] == 0x200C) { +- j--; +- continue; +- } +- +- newbuf[j] = buf[i]; +- +- /* If it's not in our range, skip it. */ +- node = get_char_node(buf[i]); +- if (!node) +- { +- continue; +- } +- +- /* The character wasn't included in the unicode shaping table. */ +- if (!node->is_shaped) +- { +- continue; +- } +- +- for (prev = i - 1; prev >= 0; prev--) +- if (wcwidth(buf[prev]) || buf[prev] == 0x200C) +- break; +- +- if (prev >= 0 && (node1 = get_char_node(buf[prev])) +- && ( node1->initial || node1->medial)) +- { +- have_previous = TRUE; +- } +- +- for (next = i + 1; next < len; next++) +- if (wcwidth(buf[next]) || buf[next] == 0x200C) +- break; +- +- if (next < len && (node1 = get_char_node(buf[next])) +- && (node1->medial || node1->final)) +- { +- have_next = TRUE; +- } +- +- /* +- * FIXME: do not make ligature if there are combining +- * characters between two parts. +- */ +- if (buf[i] == 0x644 && have_next && next == i + 1) +- { +- switch (buf[next]) +- { +- case 0x622: +- newbuf[j] = 0xFEF5 + (have_previous ? 1 : 0); +- i++; +- continue; +- case 0x623: +- newbuf[j] = 0xFEF7 + (have_previous ? 1 : 0); +- i++; +- continue; +- case 0x625: +- newbuf[j] = 0xFEF9 + (have_previous ? 1 : 0); +- i++; +- continue; +- case 0x627: +- newbuf[j] = 0xFEFB + (have_previous ? 1 : 0); +- i++; +- continue; +- default: +- break; +- } +- } +- +- /** Medial **/ +- if (have_previous && have_next && node->medial) +- { +- newbuf[j] = node->medial; +- } +- +- /** Final **/ +- else if (have_previous && node->final) +- { +- newbuf[j] = node->final; +- } +- +- /** Initial **/ +- else if (have_next && node->initial) +- { +- newbuf[j] = node->initial; +- } +- +- /** Isolated **/ +- else if (node->isolated) +- { +- newbuf[j] = node->isolated; +- } +- } +- for (i = 0; i < len && i < j; i++) { +- buf[i] = newbuf[i]; +- } +- while (i < len) { +- buf[i++] = L'\0'; +- } +- +- free(newbuf); +- return 0; +-} +- +-/* Converts bidi wchar text {in} to visual wchar text which is displayable +- * in text mode. Uses {base_dir} as default base direction. +- * Returns malloc'ed converted text or NULL in case of error or if {need_out} is +- * not set. Modifies {base_dir} to reflect actual direction. +- */ +-static wchar_t* wchar_to_textmod_visual(wchar_t *in,unsigned int len,FriBidiCharType *base_dir, int need_out) +-{ +- FriBidiChar *out = NULL; +- static void *handle = NULL; +- +- fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex, +- FriBidiCharType *, FriBidiChar *, +- FriBidiStrIndex *, FriBidiStrIndex *, +- FriBidiLevel *); +- +- if (!handle) +- handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); +- if (!handle) +- handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); +- if (!handle) +- return NULL; +- +- func_ptr = dlsym(handle, "fribidi_log2vis"); +- if (!func_ptr) { +- dlclose(handle); +- handle = NULL; +- return NULL; +- } +- +- if (need_out) { +- out = (FriBidiChar *)malloc(sizeof(FriBidiChar)*(len+1)); +- if(!out) +- { +- dlclose(handle); +- handle = NULL; +- return (wchar_t *) out; +- } +- +- do_shaping(in, len); +- len = wcsnlen(in, len); +- } +- (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); +- +- return (wchar_t *) out; +-} +- +-/* +- * Converts text given in {str} from logical order to visual order. +- * Uses {dir} as base direction ('N', 'R', 'L'). +- * Returns malloc'ed converted string. Modifies {dir} to reflect actual +- * direction. +- */ +-static char *_newt_log2vis(const char *str, char *dir) +-{ +- wchar_t *wcs; +- char *rstr = NULL; +- int len = strlen(str); +- int ret; +- FriBidiCharType basedir; +- +- switch (*dir) +- { +- case 'R': basedir = FRIBIDI_TYPE_R; +- break; +- case 'L': basedir = FRIBIDI_TYPE_L; +- break; +- default: basedir = FRIBIDI_TYPE_ON; +- break; +- } +- +- if (len) { +- wchar_t *owcs; +- int newlen; +- +- wcs = malloc(sizeof(*wcs) * (len + 1)); +- if (!wcs) +- return NULL; +- ret = mbstowcs(wcs, str, len + 1); +- if (ret < 0) { +- free(wcs); +- return NULL; +- } +- owcs = wchar_to_textmod_visual(wcs, ret, &basedir, 1); +- if (FRIBIDI_DIR_TO_LEVEL(basedir)) +- *dir = 'R'; +- else +- *dir = 'L'; +- +- free(wcs); +- if (!owcs) +- return NULL; +- +- newlen = wcstombs(NULL, owcs, 0); +- if (newlen < 0) { +- free(owcs); +- return NULL; +- } +- rstr = malloc(newlen + 1); +- if (!rstr) { +- free(owcs); +- return NULL; +- } +- ret = wcstombs(rstr, owcs, newlen + 1); +- free(owcs); +- if (ret < 0) { +- free(rstr); +- return NULL; +- } +- } +- return rstr; +-} +- +-/* Returns base direction of text given in {str}. +- */ +-char get_text_direction(const char *str) +-{ +- int len = strlen(str); +- char dir = 'N'; +- wchar_t *wcs; +- int ret; +- +- FriBidiCharType basedir = FRIBIDI_TYPE_ON; +- +- if (len) { +- wcs = malloc(sizeof(*wcs) * (len + 1)); +- if (!wcs) +- return dir; +- ret = mbstowcs(wcs, str, len + 1); +- if (ret < 0) { +- free(wcs); +- return dir; +- } +- wchar_to_textmod_visual(wcs, ret, &basedir, 1); +- free(wcs); +- if (FRIBIDI_DIR_TO_LEVEL(basedir)) +- dir = 'R'; +- else +- dir = 'L'; +- } +- return dir; +-} +- +-/* If width of string {str} is less then {width} adds +- * final spaces to make it {width} position wide. +- * Returns malloc'ed padded string or NULL in case of errors +- * or if string does not need padding. +- */ +-static char *pad_line(const char *str, int width) +-{ +- int len = strlen(str); +- int w = _newt_wstrlen(str, len); +- +- if (w < width) { +- char *newstr = malloc(len + 1 + (width - w)); +- if (!newstr) +- return NULL; +- memcpy(newstr, str, len); +- memset(newstr + len, ' ', width - w); +- newstr[len+width-w] = '\0'; +- return newstr; +- } +- return NULL; +-} +- +-/* +- * Writes string {str}. Uses {dir} as default direction. +- * Returns direction of the string in {dir}. +- */ +-void write_string_int(const char *str, char *dir) +-{ +- char dummy; +- char *tmpstr; +- +- if (!dir) { +- dummy = 'N'; +- dir = &dummy; +- } +- +- tmpstr = _newt_log2vis(str, dir); +- if (tmpstr) +- str = tmpstr; +- SLsmg_write_string(str); +- if (tmpstr) +- free(tmpstr); +-} +- +-/* Writes at most {n} positions of the string {str}. +- * Adds final (logical) spaces if string width is less than {n}. +- * Uses {dir} as default direction. +- * Returns direction of the string in {dir} +- */ +-void write_nstring_int(const char *str, int n, char *dir) +-{ +- char dummy; +- char *tmpstr, *tmpstr1; +- +- if (!dir) { +- dummy = 'N'; +- dir = &dummy; +- } +- +- tmpstr1 = pad_line(str, n); +- if (tmpstr1) +- str = tmpstr1; +- tmpstr = _newt_log2vis(str, dir); +- if (tmpstr) { +- free(tmpstr1); +- str = tmpstr; +- } +- SLsmg_write_nstring(str, n); +- if (tmpstr) +- free(tmpstr); +- else +- free(tmpstr1); +-} +-#else +-void write_string_int(const char *str, char *dir) +-{ +- SLsmg_write_string(str); +-} +- +-void write_nstring_int(const char *str, int w, char *dir) +-{ +- SLsmg_write_nstring(str, w); +-} +- +-char get_text_direction(const char *str) +-{ +- return 'L'; +-} +-#endif +- +-struct Window { +- int height, width, top, left; +- SLsmg_Char_Type * buffer; +- char * title; +-}; +- +-struct keymap { +- char * str; +- int code; +- char * tc; +-}; +- +-static struct Window windowStack[20]; +-static struct Window * currentWindow = NULL; +- +-static char * helplineStack[20]; +-static char ** currentHelpline = NULL; +- +-static int cursorRow, cursorCol; +-static int needResize = 0; +-static int cursorOn = 1; +-static int trashScreen = 0; +- +-static const char * defaultHelpLine = +-" <Tab>/<Alt-Tab> between elements | <Space> selects | <F12> next screen" +-; +- +-const struct newtColors newtDefaultColorPalette = { +- "white", "blue", /* root fg, bg */ +- "black", "lightgray", /* border fg, bg */ +- "black", "lightgray", /* window fg, bg */ +- "white", "black", /* shadow fg, bg */ +- "red", "lightgray", /* title fg, bg */ +- "lightgray", "red", /* button fg, bg */ +- "red", "lightgray", /* active button fg, bg */ +- "lightgray", "blue", /* checkbox fg, bg */ +- "lightgray", "red", /* active checkbox fg, bg */ +- "lightgray", "blue", /* entry box fg, bg */ +- "blue", "lightgray", /* label fg, bg */ +- "black", "lightgray", /* listbox fg, bg */ +- "lightgray", "blue", /* active listbox fg, bg */ +- "black", "lightgray", /* textbox fg, bg */ +- "lightgray", "red", /* active textbox fg, bg */ +- "white", "blue", /* help line */ +- "lightgray", "blue", /* root text */ +- "blue", /* scale full */ +- "red", /* scale empty */ +- "blue", "lightgray", /* disabled entry fg, bg */ +- "black", "lightgray", /* compact button fg, bg */ +- "lightgray", "red", /* active & sel listbox */ +- "black", "brown" /* selected listbox */ +-}; +- +-static const struct keymap keymap[] = { +- { "\033OA", NEWT_KEY_UP, "ku" }, +- { "\020", NEWT_KEY_UP, NULL }, /* emacs ^P */ +- { "\033OB", NEWT_KEY_DOWN, "kd" }, +- { "\016", NEWT_KEY_DOWN, NULL }, /* emacs ^N */ +- { "\033OC", NEWT_KEY_RIGHT, "kr" }, +- { "\006", NEWT_KEY_RIGHT, NULL }, /* emacs ^F */ +- { "\033OD", NEWT_KEY_LEFT, "kl" }, +- { "\002", NEWT_KEY_LEFT, NULL }, /* emacs ^B */ +- { "\033OH", NEWT_KEY_HOME, "kh" }, +- { "\033[1~", NEWT_KEY_HOME, NULL }, +- { "\001", NEWT_KEY_HOME, NULL }, /* emacs ^A */ +- { "\033Ow", NEWT_KEY_END, "kH" }, +- { "\033[4~", NEWT_KEY_END, "@7" }, +- { "\005", NEWT_KEY_END, NULL }, /* emacs ^E */ +- +- { "\033[3~", NEWT_KEY_DELETE, "kD" }, +- { "\004", NEWT_KEY_DELETE, NULL }, /* emacs ^D */ +- { "\033[2~", NEWT_KEY_INSERT, "kI" }, +- +- { "\033\t", NEWT_KEY_UNTAB, "kB" }, +- +- { "\033[5~", NEWT_KEY_PGUP, "kP" }, +- { "\033[6~", NEWT_KEY_PGDN, "kN" }, +- { "\033V", NEWT_KEY_PGUP, NULL }, +- { "\033v", NEWT_KEY_PGUP, NULL }, +- { "\026", NEWT_KEY_PGDN, NULL }, +- +- { "\033[[A", NEWT_KEY_F1, NULL }, +- { "\033[[B", NEWT_KEY_F2, NULL }, +- { "\033[[C", NEWT_KEY_F3, NULL }, +- { "\033[[D", NEWT_KEY_F4, NULL }, +- { "\033[[E", NEWT_KEY_F5, NULL }, +- +- { "\033OP", NEWT_KEY_F1, NULL }, +- { "\033OQ", NEWT_KEY_F2, NULL }, +- { "\033OR", NEWT_KEY_F3, NULL }, +- { "\033OS", NEWT_KEY_F4, NULL }, +- +- { "\033[11~", NEWT_KEY_F1, "k1" }, +- { "\033[12~", NEWT_KEY_F2, "k2" }, +- { "\033[13~", NEWT_KEY_F3, "k3" }, +- { "\033[14~", NEWT_KEY_F4, "k4" }, +- { "\033[15~", NEWT_KEY_F5, "k5" }, +- { "\033[17~", NEWT_KEY_F6, "k6" }, +- { "\033[18~", NEWT_KEY_F7, "k7" }, +- { "\033[19~", NEWT_KEY_F8, "k8" }, +- { "\033[20~", NEWT_KEY_F9, "k9" }, +- { "\033[21~", NEWT_KEY_F10, "k;" }, +- { "\033[23~", NEWT_KEY_F11, "F1" }, +- { "\033[24~", NEWT_KEY_F12, "F2" }, +- { "\033", NEWT_KEY_ESCAPE, "@2" }, +- { "\033", NEWT_KEY_ESCAPE, "@9" }, +- +- { "\177", NEWT_KEY_BKSPC, NULL }, +- { "\010", NEWT_KEY_BKSPC, NULL }, +- +- { 0 }, /* LEAVE this one */ +-}; +-static void initKeymap(); +- +-static const char ident[] = // ident friendly +- "$Version: Newt windowing library v" VERSION " $" +- "$Copyright: (C) 1996-2003 Red Hat, Inc. Written by Erik Troan $" +- "$License: Lesser GNU Public License. $"; +- +-static newtSuspendCallback suspendCallback = NULL; +-static void * suspendCallbackData = NULL; +- +-void newtSetSuspendCallback(newtSuspendCallback cb, void * data) { +- suspendCallback = cb; +- suspendCallbackData = data; +-} +- +-static void handleSigwinch(int signum) { +- needResize = 1; +-} +- +-static int getkeyInterruptHook(void) { +- return -1; +-} +- +-int _newt_wstrlen(const char *str, int len) { +- mbstate_t ps; +- wchar_t tmp; +- int nchars = 0; +- +- if (!str) return 0; +- if (!len) return 0; +- if (len < 0) len = strlen(str); +- memset(&ps,0,sizeof(mbstate_t)); +- while (len > 0) { +- int x,y; +- +- x = mbrtowc(&tmp,str,len,&ps); +- if (x >0) { +- str += x; +- len -= x; +- y = wcwidth(tmp); +- if (y>0) +- nchars+=y; +- } else break; +- } +- return nchars; +-} +- +-/** Trim a string to fit +- * @param title - string. NULL will be inserted if necessary +- * @param chrs - available space. (character cells) +- */ +-void trim_string(char *title, int chrs) +-{ +- char *p = title; +- int ln = chrs; +- int x = 0,y = 0; +- wchar_t tmp; +- mbstate_t ps; +- +- memset(&ps, 0, sizeof(ps)); +- +- while (*p) { +- x = mbrtowc(&tmp, p, ln, &ps); +- if (x < 0) { // error +- *p = '\0'; +- return; +- } +- y = wcwidth(tmp); +- if (y > ln) { +- *p = '\0'; +- return; +- } else { +- p += x; +- ln -= y; +- } +- } +-} +- +-static int getkey() { +- int c; +- +- while ((c = SLang_getkey()) == '\xC') { /* if Ctrl-L redraw whole screen */ +- SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); +- SLsmg_refresh(); +- } +- return c; +- +-} +- +-void newtFlushInput(void) { +- while (SLang_input_pending(0)) { +- getkey(); +- } +-} +- +-/** +- * @brief Refresh the screen +- */ +-void newtRefresh(void) { +- SLsmg_refresh(); +-} +- +-void newtSuspend(void) { +- SLtt_set_cursor_visibility (1); +- SLsmg_suspend_smg(); +- SLang_reset_tty(); +- SLtt_set_cursor_visibility (cursorOn); +-} +- +-/** +- * @brief Return after suspension. +- * @return 0 on success. +- */ +-int newtResume(void) { +- SLsmg_resume_smg (); +- SLsmg_refresh(); +- return SLang_init_tty(0, 0, 0); +-} +- +-void newtCls(void) { +- SLsmg_set_color(NEWT_COLORSET_ROOT); +- SLsmg_gotorc(0, 0); +- SLsmg_erase_eos(); +- +- newtRefresh(); +-} +- +-/** +- * @brief Resize the screen +- * @param redraw - boolean - should we redraw the screen? +- */ +-void newtResizeScreen(int redraw) { +- SLtt_get_screen_size(); +- SLsmg_reinit_smg(); +- if (redraw) { +- SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); +- newtRefresh(); +- } +-} +- +-/** +- * @brief Initialize the newt library +- * @return int - 0 for success, else < 0 +- */ +-int newtInit(void) { +- char * MonoValue, * MonoEnv = "NEWT_MONO"; +- const char *lang; +- int ret; +- +- if ((lang = getenv("LC_ALL")) == NULL) +- if ((lang = getenv("LC_CTYPE")) == NULL) +- if ((lang = getenv("LANG")) == NULL) +- lang = ""; +- if (strstr (lang, ".euc") != NULL) +- trashScreen = 1; +- +- (void) strlen(ident); +- +- SLtt_get_terminfo(); +- SLtt_get_screen_size(); +- SLutf8_enable(-1); /* init. utf8 according to locale */ +- +- MonoValue = getenv(MonoEnv); +- if ( MonoValue == NULL ) { +- SLtt_Use_Ansi_Colors = 1; +- } else { +- SLtt_Use_Ansi_Colors = 0; +- } +- +- if ((ret = SLsmg_init_smg()) < 0) +- return ret; +- if ((ret = SLang_init_tty(0, 0, 0)) < 0) +- return ret; +- +- newtSetColors(newtDefaultColorPalette); +- newtCursorOff(); +- initKeymap(); +- +- /*memset(&sa, 0, sizeof(sa)); +- sa.sa_handler = handleSigwinch; +- sigaction(SIGWINCH, &sa, NULL);*/ +- +- SLsignal_intr(SIGWINCH, handleSigwinch); +- SLang_getkey_intr_hook = getkeyInterruptHook; +- +- return 0; +-} +- +-/** +- * @brief Closedown the newt library, tidying screen. +- * @returns int , 0. (no errors reported) +- */ +-int newtFinished(void) { +- SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); +- newtCursorOn(); +- SLsmg_refresh(); +- SLsmg_reset_smg(); +- SLang_reset_tty(); +- +- return 0; +-} +- +-/** +- * @brief Set the colors used. +- * @param colors - newtColor struct used. +- */ +-void newtSetColors(struct newtColors colors) { +- if (!SLtt_Use_Ansi_Colors) { +- int i; +- +- for (i = 2; i < 25; i++) +- SLtt_set_mono(i, NULL, 0); +- +- SLtt_set_mono(NEWT_COLORSET_SELLISTBOX, NULL, SLTT_BOLD_MASK); +- +- SLtt_set_mono(NEWT_COLORSET_ACTBUTTON, NULL, SLTT_REV_MASK); +- SLtt_set_mono(NEWT_COLORSET_ACTCHECKBOX, NULL, SLTT_REV_MASK); +- SLtt_set_mono(NEWT_COLORSET_ACTLISTBOX, NULL, SLTT_REV_MASK); +- SLtt_set_mono(NEWT_COLORSET_ACTTEXTBOX, NULL, SLTT_REV_MASK); +- +- SLtt_set_mono(NEWT_COLORSET_ACTSELLISTBOX, NULL, SLTT_REV_MASK | SLTT_BOLD_MASK); +- +- SLtt_set_mono(NEWT_COLORSET_DISENTRY, NULL, 0); // FIXME +- SLtt_set_mono(NEWT_COLORSET_FULLSCALE, NULL, SLTT_ULINE_MASK | SLTT_REV_MASK); +- SLtt_set_mono(NEWT_COLORSET_EMPTYSCALE, NULL, SLTT_ULINE_MASK); +- return; +- } +- SLtt_set_color(NEWT_COLORSET_ROOT, "", colors.rootFg, colors.rootBg); +- SLtt_set_color(NEWT_COLORSET_BORDER, "", colors.borderFg, colors.borderBg); +- SLtt_set_color(NEWT_COLORSET_WINDOW, "", colors.windowFg, colors.windowBg); +- SLtt_set_color(NEWT_COLORSET_SHADOW, "", colors.shadowFg, colors.shadowBg); +- SLtt_set_color(NEWT_COLORSET_TITLE, "", colors.titleFg, colors.titleBg); +- SLtt_set_color(NEWT_COLORSET_BUTTON, "", colors.buttonFg, colors.buttonBg); +- SLtt_set_color(NEWT_COLORSET_ACTBUTTON, "", colors.actButtonFg, +- colors.actButtonBg); +- SLtt_set_color(NEWT_COLORSET_CHECKBOX, "", colors.checkboxFg, +- colors.checkboxBg); +- SLtt_set_color(NEWT_COLORSET_ACTCHECKBOX, "", colors.actCheckboxFg, +- colors.actCheckboxBg); +- SLtt_set_color(NEWT_COLORSET_ENTRY, "", colors.entryFg, colors.entryBg); +- SLtt_set_color(NEWT_COLORSET_LABEL, "", colors.labelFg, colors.labelBg); +- SLtt_set_color(NEWT_COLORSET_LISTBOX, "", colors.listboxFg, +- colors.listboxBg); +- SLtt_set_color(NEWT_COLORSET_ACTLISTBOX, "", colors.actListboxFg, +- colors.actListboxBg); +- SLtt_set_color(NEWT_COLORSET_TEXTBOX, "", colors.textboxFg, +- colors.textboxBg); +- SLtt_set_color(NEWT_COLORSET_ACTTEXTBOX, "", colors.actTextboxFg, +- colors.actTextboxBg); +- SLtt_set_color(NEWT_COLORSET_HELPLINE, "", colors.helpLineFg, +- colors.helpLineBg); +- SLtt_set_color(NEWT_COLORSET_ROOTTEXT, "", colors.rootTextFg, +- colors.rootTextBg); +- +- SLtt_set_color(NEWT_COLORSET_EMPTYSCALE, "", "white", +- colors.emptyScale); +- SLtt_set_color(NEWT_COLORSET_FULLSCALE, "", "white", +- colors.fullScale); +- SLtt_set_color(NEWT_COLORSET_DISENTRY, "", colors.disabledEntryFg, +- colors.disabledEntryBg); +- +- SLtt_set_color(NEWT_COLORSET_COMPACTBUTTON, "", colors.compactButtonFg, +- colors.compactButtonBg); +- +- SLtt_set_color(NEWT_COLORSET_ACTSELLISTBOX, "", colors.actSelListboxFg, +- colors.actSelListboxBg); +- SLtt_set_color(NEWT_COLORSET_SELLISTBOX, "", colors.selListboxFg, +- colors.selListboxBg); +-} +- +-/* Keymap handling - rewritten by Henning Makholm <henning@makholm.net>, +- * November 2003. +- */ +- +-struct kmap_trie_entry { +- char c ; /* character got from terminal */ +- int code; /* newt key, or 0 if c does not make a complete sequence */ +- struct kmap_trie_entry *contseq; /* sub-trie for character following c */ +- struct kmap_trie_entry *next; /* try this if char received != c */ +-}; +-/* Here are some static entries that will help in handling esc O foo and +- esc [ foo as variants of each other: */ +-static struct kmap_trie_entry +- kmap_trie_escO = { 'O', 0, 0, 0 }, +- kmap_trie_escBrack = { '[', 0, 0, &kmap_trie_escO }, +- kmap_trie_root = { '\033', 0, &kmap_trie_escBrack, 0 }; +-static int keyreader_buf_len = 10 ; +-static unsigned char default_keyreader_buf[10]; +-static unsigned char *keyreader_buf = default_keyreader_buf; +- +-#if 0 /* for testing of the keymap manipulation code */ +-static void dumpkeys_recursive(struct kmap_trie_entry *curr, int i, FILE *f) { +- int j, ps ; +- char seen[256]={0}; +- if( curr && i >= keyreader_buf_len ) { +- fprintf(f,"ARGH! Too long sequence!\n") ; +- return ; +- } +- for(;curr;curr=curr->next) { +- keyreader_buf[i] = curr->c ; +- ps = seen[(unsigned char)curr->c]++ ; +- if( ps || curr->code || (!curr->code && !curr->contseq) ) { +- for(j=0;j<=i;j++) { +- if( keyreader_buf[j] > 32 && keyreader_buf[j]<127 && +- keyreader_buf[j] != '^' && keyreader_buf[j] != '\\' ) +- fprintf(f,"%c",keyreader_buf[j]); +- else if( keyreader_buf[j] > 0 && keyreader_buf[j]<=32 ) +- fprintf(f,"^%c",keyreader_buf[j] + 0x40); +- else +- fprintf(f,"\\%03o", +- (unsigned)(unsigned char)keyreader_buf[j]); +- } +- if( curr->code ) +- fprintf(f,": 0x%X\n",curr->code); +- else +- fprintf(f,": (just keymap)\n"); +- } +- dumpkeys_recursive(curr->contseq,i+1,f); +- } +-} +-static void dump_keymap(void) { +- FILE *f = fopen("newt.keydump","wt"); +- if (f) { +- dumpkeys_recursive(&kmap_trie_root,0,f); +- fclose(f); +- } +-} +-#endif +- +-/* newtBindKey may overwrite a binding that is there already */ +-static void newtBindKey(char *keyseq, int meaning) { +- struct kmap_trie_entry *root = &kmap_trie_root ; +- struct kmap_trie_entry **curptr = &root ; +- +- /* Try to make sure the common matching buffer is long enough. */ +- if( strlen(keyseq) > keyreader_buf_len ) { +- int i = strlen(keyseq)+10; +- unsigned char *newbuf = malloc(i); +- if (newbuf) { +- if (keyreader_buf != default_keyreader_buf) +- free(keyreader_buf); +- keyreader_buf = newbuf; +- keyreader_buf_len = i; +- } +- } +- +- if (*keyseq == 0) return; /* binding the empty sequence is meaningless */ +- +- while(1) { +- while ((*curptr) && (*curptr)->c != *keyseq) +- curptr = &(*curptr)->next; +- if ((*curptr)==0) { +- struct kmap_trie_entry* fresh +- = calloc(strlen(keyseq),sizeof(struct kmap_trie_entry)); +- if (fresh == 0) return; /* despair! */ +- *curptr = fresh; +- while (keyseq[1]) { +- fresh->contseq = fresh+1; +- (fresh++)->c = *(keyseq++); +- } +- fresh->c = *keyseq; +- fresh->code = meaning; +- return; +- } +- if (keyseq[1]==0) { +- (*curptr)->code = meaning; +- return; +- } else { +- curptr = &(*curptr)->contseq; +- keyseq++; +- } +- } +-} +- +-/* This function recursively inserts all entries in the "to" trie into +- corresponding positions in the "from" trie, except positions that +- are already defined in the "from" trie. */ +-static void kmap_trie_fallback(struct kmap_trie_entry *to, +- struct kmap_trie_entry **from) { +- if (*from == NULL) +- *from = to ; +- if (*from == to) +- return ; +- for (;to!=NULL;to=to->next) { +- struct kmap_trie_entry **fromcopy = from ; +- while ((*fromcopy) && (*fromcopy)->c != to->c) +- fromcopy = &(*fromcopy)->next ; +- if (*fromcopy) { +- if ((*fromcopy)->code == 0) +- (*fromcopy)->code = to->code; +- kmap_trie_fallback(to->contseq, &(*fromcopy)->contseq); +- } else { +- *fromcopy = malloc(sizeof(struct kmap_trie_entry)); +- if (*fromcopy) { +- **fromcopy = *to ; +- (*fromcopy)->next = 0 ; +- } +- } +- } +-} +- +-int newtGetKey(void) { +- int key; +- unsigned char *chptr = keyreader_buf, *lastmatch; +- int lastcode; +- struct kmap_trie_entry *curr = &kmap_trie_root; +- +- do { +- key = getkey(); +- if (key == SLANG_GETKEY_ERROR) { +- /* Either garbage was read, or stdin disappeared +- * (the parent terminal was proably closed) +- * if the latter, die. +- */ +- if (feof(stdin)) +- exit(1); +- if (needResize) { +- needResize = 0; +- return NEWT_KEY_RESIZE; +- } +- +- /* ignore other signals */ +- continue; +- } +- +- if (key == NEWT_KEY_SUSPEND && suspendCallback) +- suspendCallback(suspendCallbackData); +- } while (key == NEWT_KEY_SUSPEND); +- +- /* Read more characters, matching against the trie as we go */ +- lastcode = *chptr = key; +- lastmatch = chptr ; +- while(1) { +- while (curr->c != key) { +- curr = curr->next ; +- if (curr==NULL) goto break2levels; +- } +- if (curr->code) { +- lastcode = curr->code; +- lastmatch = chptr; +- } +- curr = curr->contseq; +- if (curr==NULL) break; +- +- if (SLang_input_pending(5) <= 0) +- break; +- +- if (chptr==keyreader_buf+keyreader_buf_len-1) break; +- *++chptr = key = getkey(); +- } +- break2levels: +- +- /* The last time the trie matched was at position lastmatch. Back +- * up if we have read too many characters. */ +- while (chptr > lastmatch) +- SLang_ungetkey(*chptr--); +- +- return lastcode; +-} +- +-/** +- * @brief Wait for a keystroke +- */ +-void newtWaitForKey(void) { +- newtRefresh(); +- +- getkey(); +- newtClearKeyBuffer(); +-} +- +-/** +- * @brief Clear the keybuffer +- */ +-void newtClearKeyBuffer(void) { +- while (SLang_input_pending(1)) { +- getkey(); +- } +-} +- +-/** +- * Open a new window. +- * @param left. unsigned int Size; _not_ including border +- * @param top: unsigned int size, _not_ including border +- * @param width unsigned int +- * @param height unsigned int +- * @param title - title string +- * @return zero on success (currently no errors reported) +- */ +-int newtOpenWindow(unsigned int left, unsigned int top, +- unsigned int width, unsigned int height, +- const char * title) { +- int j, row, col; +- int n; +- int i; +- +- newtFlushInput(); +- +- if (!currentWindow) { +- currentWindow = windowStack; +- } else { +- currentWindow++; +- } +- +- currentWindow->left = left; +- currentWindow->top = top; +- currentWindow->width = width; +- currentWindow->height = height; +- currentWindow->title = title ? strdup(title) : NULL; +- +- currentWindow->buffer = malloc(sizeof(SLsmg_Char_Type) * (width + 3) * (height + 3)); +- +- row = top - 1; +- col = left - 1; +- /* clip to the current screen bounds - msw */ +- if (row < 0) +- row = 0; +- if (col < 0) +- col = 0; +- if (left + width > SLtt_Screen_Cols) +- width = SLtt_Screen_Cols - left; +- if (top + height > SLtt_Screen_Rows) +- height = SLtt_Screen_Rows - top; +- n = 0; +- for (j = 0; j < height + 3; j++, row++) { +- SLsmg_gotorc(row, col); +- SLsmg_read_raw(currentWindow->buffer + n, +- currentWindow->width + 3); +- n += currentWindow->width + 3; +- } +- +- newtTrashScreen(); +- +- SLsmg_set_color(NEWT_COLORSET_BORDER); +- SLsmg_set_char_set(1); +- SLsmg_draw_box(top - 1, left - 1, height + 2, width + 2); +- SLsmg_set_char_set(0); +- +- if (currentWindow->title) { +- trim_string (currentWindow->title, width-4); +- i = wstrlen(currentWindow->title,-1) + 4; +- i = ((width - i) / 2) + left; +- SLsmg_gotorc(top - 1, i); +- SLsmg_set_char_set(1); +- SLsmg_write_char(SLSMG_RTEE_CHAR); +- SLsmg_set_char_set(0); +- SLsmg_write_char(' '); +- SLsmg_set_color(NEWT_COLORSET_TITLE); +- write_string_int((char *)currentWindow->title, NULL); +- SLsmg_set_color(NEWT_COLORSET_BORDER); +- SLsmg_write_char(' '); +- SLsmg_set_char_set(1); +- SLsmg_write_char(SLSMG_LTEE_CHAR); +- SLsmg_set_char_set(0); +- } +- +- SLsmg_set_color(NEWT_COLORSET_WINDOW); +- SLsmg_fill_region(top, left, height, width, ' '); +- +- SLsmg_set_color(NEWT_COLORSET_SHADOW); +- SLsmg_fill_region(top + height + 1, left, 1, width + 2, ' '); +- SLsmg_fill_region(top, left + width + 1, height + 1, 1, ' '); +- +- for (i = top; i < (top + height + 1); i++) { +- SLsmg_gotorc(i, left + width + 1); +- SLsmg_write_string(" "); +- } +- +- return 0; +-} +- +-/** +- * @brief Draw a centered window. +- * @param width - width in char cells +- * @param height - no. of char cells. +- * @param title - fixed title +- * @returns 0. No errors reported +- */ +-int newtCenteredWindow(unsigned int width,unsigned int height, +- const char * title) { +- unsigned int top, left; +- +- top = (SLtt_Screen_Rows - height) / 2; +- +- /* I don't know why, but this seems to look better */ +- if ((SLtt_Screen_Rows % 2) && (top % 2)) top--; +- +- left = (SLtt_Screen_Cols - width) / 2; +- +- newtOpenWindow(left, top, width, height, title); +- +- return 0; +-} +- +-/** +- * @brief Remove the top window +- */ +-void newtPopWindow(void) { +- int j, row, col; +- int n = 0; +- +- row = col = 0; +- +- row = currentWindow->top - 1; +- col = currentWindow->left - 1; +- if (row < 0) +- row = 0; +- if (col < 0) +- col = 0; +- for (j = 0; j < currentWindow->height + 3; j++, row++) { +- SLsmg_gotorc(row, col); +- SLsmg_write_raw(currentWindow->buffer + n, +- currentWindow->width + 3); +- n += currentWindow->width + 3; +- } +- +- free(currentWindow->buffer); +- free(currentWindow->title); +- +- if (currentWindow == windowStack) +- currentWindow = NULL; +- else +- currentWindow--; +- +- SLsmg_set_char_set(0); +- +- newtTrashScreen(); +- +- newtRefresh(); +-} +- +-void newtGetWindowPos(int * x, int * y) { +- if (currentWindow) { +- *x = currentWindow->left; +- *y = currentWindow->top; +- } else +- *x = *y = 0; +-} +- +-void newtGetrc(int * row, int * col) { +- *row = cursorRow; +- *col = cursorCol; +-} +- +-void newtGotorc(int newRow, int newCol) { +- if (currentWindow) { +- newRow += currentWindow->top; +- newCol += currentWindow->left; +- } +- +- cursorRow = newRow; +- cursorCol = newCol; +- SLsmg_gotorc(cursorRow, cursorCol); +-} +- +-void newtDrawBox(int left, int top, int width, int height, int shadow) { +- if (currentWindow) { +- top += currentWindow->top; +- left += currentWindow->left; +- } +- +- SLsmg_draw_box(top, left, height, width); +- +- if (shadow) { +- SLsmg_set_color(NEWT_COLORSET_SHADOW); +- SLsmg_fill_region(top + height, left + 1, 1, width - 1, ' '); +- SLsmg_fill_region(top + 1, left + width, height, 1, ' '); +- } +-} +- +-void newtClearBox(int left, int top, int width, int height) { +- if (currentWindow) { +- top += currentWindow->top; +- left += currentWindow->left; +- } +- +- SLsmg_fill_region(top, left, height, width, ' '); +-} +- +-static void initKeymap(void) { +- const struct keymap * curr; +- +- /* First bind built-in default bindings. They may be shadowed by +- the termcap entries that get bound later. */ +- for (curr = keymap; curr->code; curr++) { +- if (curr->str) +- newtBindKey(curr->str,curr->code); +- } +- +- /* Then bind strings from termcap entries */ +- for (curr = keymap; curr->code; curr++) { +- if (curr->tc) { +- char *pc = SLtt_tgetstr(curr->tc); +- if (pc) { +- newtBindKey(pc,curr->code); +- } +- } +- } +- +- /* Finally, invent lowest-priority keybindings that correspond to +- searching for esc-O-foo if esc-[-foo was not found and vice +- versa. That is needed because of strong confusion among +- different emulators of VTxxx terminals; some terminfo/termcap +- descriptions are apparently written by people who were not +- aware of the differences between "applicataion" and "terminal" +- keypad modes. Or perhaps they were, but tried to make their +- description work with a program that puts the keyboard in the +- wrong emulation mode. In short, one needs this: */ +- kmap_trie_fallback(kmap_trie_escO.contseq, &kmap_trie_escBrack.contseq); +- kmap_trie_fallback(kmap_trie_escBrack.contseq, &kmap_trie_escO.contseq); +-} +- +-/** +- * @brief Delay for a specified number of usecs +- * @param int - number of usecs to wait for. +- */ +-void newtDelay(unsigned int usecs) { +- fd_set set; +- struct timeval tv; +- +- FD_ZERO(&set); +- +- tv.tv_sec = usecs / 1000000; +- tv.tv_usec = usecs % 1000000; +- +- select(0, &set, &set, &set, &tv); +-} +- +-struct eventResult newtDefaultEventHandler(newtComponent c, +- struct event ev) { +- struct eventResult er; +- +- er.result = ER_IGNORED; +- return er; +-} +- +-void newtRedrawHelpLine(void) { +- char * buf; +- +- SLsmg_set_color(NEWT_COLORSET_HELPLINE); +- +- if (currentHelpline) { +- /* buffer size needs to be wide enough to hold all the multibyte +- currentHelpline + all the single byte ' ' to fill the line */ +- int wlen = wstrlen(*currentHelpline, -1); +- int len; +- +- if (wlen > SLtt_Screen_Cols) +- wlen = SLtt_Screen_Cols; +- len = strlen(*currentHelpline) + (SLtt_Screen_Cols - wlen); +- buf = alloca(len + 1); +- memset(buf, ' ', len); +- memcpy(buf, *currentHelpline, strlen(*currentHelpline)); +- buf[len] = '\0'; +- } else { +- buf = alloca(SLtt_Screen_Cols + 1); +- memset(buf, ' ', SLtt_Screen_Cols); +- buf[SLtt_Screen_Cols] = '\0'; +- } +- SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); +- write_string_int(buf, NULL); +-} +- +-void newtPushHelpLine(const char * text) { +- if (!text) +- text = defaultHelpLine; +- +- if (currentHelpline) +- (*(++currentHelpline)) = strdup(text); +- else { +- currentHelpline = helplineStack; +- *currentHelpline = strdup(text); +- } +- +- newtRedrawHelpLine(); +-} +- +-void newtPopHelpLine(void) { +- if (!currentHelpline) return; +- +- free(*currentHelpline); +- if (currentHelpline == helplineStack) +- currentHelpline = NULL; +- else +- currentHelpline--; +- +- newtRedrawHelpLine(); +-} +- +-void newtDrawRootText(int col, int row, const char * text) { +- SLsmg_set_color(NEWT_COLORSET_ROOTTEXT); +- +- if (col < 0) { +- col = SLtt_Screen_Cols + col; +- } +- +- if (row < 0) { +- row = SLtt_Screen_Rows + row; +- } +- +- SLsmg_gotorc(row, col); +- write_string_int((char *)text, NULL); +-} +- +-int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense) { +- switch (sense) { +- case NEWT_FLAGS_SET: +- return oldFlags | newFlags; +- +- case NEWT_FLAGS_RESET: +- return oldFlags & (~newFlags); +- +- case NEWT_FLAGS_TOGGLE: +- return oldFlags ^ newFlags; +- +- default: +- return oldFlags; +- } +-} +- +-void newtBell(void) +-{ +- SLtt_beep(); +-} +- +-void newtGetScreenSize(int * cols, int * rows) { +- if (rows) *rows = SLtt_Screen_Rows; +- if (cols) *cols = SLtt_Screen_Cols; +-} +- +-void newtDefaultPlaceHandler(newtComponent c, int newLeft, int newTop) { +- c->left = newLeft; +- c->top = newTop; +-} +- +-void newtDefaultMappedHandler(newtComponent c, int isMapped) { +- c->isMapped = isMapped; +-} +- +-void newtCursorOff(void) { +- cursorOn = 0; +- SLtt_set_cursor_visibility (cursorOn); +-} +- +-void newtCursorOn(void) { +- cursorOn = 1; +- SLtt_set_cursor_visibility (cursorOn); +-} +- +-void newtTrashScreen(void) { +- if (trashScreen) +- SLsmg_touch_lines (0, SLtt_Screen_Rows - 1); +-} +- +diff -ruN newt-0.52.2-old/textbox.c newt-0.52.2/textbox.c +--- newt-0.52.2-old/textbox.c 2006-06-20 21:58:34.000000000 +0100 ++++ newt-0.52.2/textbox.c 2006-06-20 22:02:39.000000000 +0100 +@@ -15,9 +15,10 @@ + char *blankline; + int linesAlloced; + int doWrap; +- newtComponent sb; ++ newtComponent sb_act, sb; + int topLine; + int textWidth; ++ int isActive; + }; + + static char * expandTabs(const char * text); +@@ -43,8 +44,10 @@ + struct textbox * tb = co->data; + + co->isMapped = isMapped; +- if (tb->sb) ++ if (tb->sb) { + tb->sb->ops->mapped(tb->sb, isMapped); ++ tb->sb_act->ops->mapped(tb->sb_act, isMapped); ++ } + } + + static void textboxPlace(newtComponent co, int newLeft, int newTop) { +@@ -53,8 +56,10 @@ + co->top = newTop; + co->left = newLeft; + +- if (tb->sb) ++ if (tb->sb) { + tb->sb->ops->place(tb->sb, co->left + co->width - 1, co->top); ++ tb->sb_act->ops->place(tb->sb_act, co->left + co->width - 1, co->top); ++ } + } + + void newtTextboxSetHeight(newtComponent co, int height) { +@@ -107,16 +112,20 @@ + tb->lines = NULL; + tb->topLine = 0; + tb->textWidth = width; ++ tb->isActive = 0; + tb->blankline = malloc(width+1); + memset(tb->blankline,' ',width); + tb->blankline[width] = '\0'; + + if (flags & NEWT_FLAG_SCROLL) { + co->width += 2; ++ tb->sb_act = newtVerticalScrollbar(co->left + co->width - 1, co->top, ++ co->height, COLORSET_ACTTEXTBOX, COLORSET_TEXTBOX); + tb->sb = newtVerticalScrollbar(co->left + co->width - 1, co->top, + co->height, COLORSET_TEXTBOX, COLORSET_TEXTBOX); ++ co->takesFocus = 1; + } else { +- tb->sb = NULL; ++ tb->sb_act = tb->sb = NULL; + } + + return co; +@@ -345,8 +354,13 @@ + + if (tb->sb) { + size = tb->numLines - c->height; +- newtScrollbarSet(tb->sb, tb->topLine, size ? size : 0); +- tb->sb->ops->draw(tb->sb); ++ if (tb->isActive) { ++ newtScrollbarSet(tb->sb_act, tb->topLine, size ? size : 0); ++ tb->sb_act->ops->draw(tb->sb_act); ++ } else { ++ newtScrollbarSet(tb->sb, tb->topLine, size ? size : 0); ++ tb->sb->ops->draw(tb->sb); ++ } + dw = 2; + } + +@@ -387,7 +401,11 @@ + + er.result = ER_IGNORED; + +- if (ev.when == EV_EARLY && ev.event == EV_KEYPRESS && tb->sb) { ++ if (!tb->sb || ev.when == EV_EARLY || ev.when == EV_LATE) ++ return er; ++ ++ switch(ev.event) { ++ case EV_KEYPRESS: + newtTrashScreen(); + switch (ev.u.key) { + case NEWT_KEY_UP: +@@ -419,8 +437,8 @@ + er.result = ER_SWALLOWED; + break; + } +- } +- if (ev.when == EV_EARLY && ev.event == EV_MOUSE && tb->sb) { ++ break; ++ case EV_MOUSE: + /* Top scroll arrow */ + if (ev.u.mouse.x == co->width && ev.u.mouse.y == co->top) { + if (tb->topLine) tb->topLine--; +@@ -436,6 +454,17 @@ + + er.result = ER_SWALLOWED; + } ++ break; ++ case EV_FOCUS: ++ tb->isActive = 1; ++ textboxDraw(co); ++ er.result = ER_SWALLOWED; ++ break; ++ case EV_UNFOCUS: ++ tb->isActive = 0; ++ textboxDraw(co); ++ er.result = ER_SWALLOWED; ++ break; + } + return er; + } --- newt-0.52.2.orig/debian/patches/200_cbtpos.patch +++ newt-0.52.2/debian/patches/200_cbtpos.patch @@ -0,0 +1,12 @@ +diff -ruN newt-0.52.2-old/checkboxtree.c newt-0.52.2/checkboxtree.c +--- newt-0.52.2-old/checkboxtree.c 2006-06-21 08:50:43.000000000 +0000 ++++ newt-0.52.2/checkboxtree.c 2006-06-21 08:50:59.000000000 +0000 +@@ -334,6 +334,8 @@ + ct = malloc(sizeof(struct CheckboxTree)); + co->callback = NULL; + co->data = ct; ++ co->left = left; ++ co->top = top; + co->ops = &ctOps; + co->takesFocus = 1; + co->height = height; --- newt-0.52.2.orig/debian/changelog +++ newt-0.52.2/debian/changelog @@ -0,0 +1,1018 @@ +newt (0.52.2-5.1ubuntu1) edgy; urgency=low + + * debian/patches/222_fix_gauge_crash.patch + - prevent a negative number input to the gauge dialog from crashing + whiptail by smashing the stack. + + -- Ryan Lortie <desrt@ubuntu.com> Thu, 3 Aug 2006 01:09:50 -0400 + +newt (0.52.2-5.1) unstable; urgency=low + + * NMU + * Apply patch from Eugeniy Meshcheryako to regenerate configure during build + so that bidi support is enabled again. Closes: #379566 + + -- Joey Hess <joeyh@debian.org> Mon, 24 Jul 2006 12:24:38 -0400 + +newt (0.52.2-5) unstable; urgency=low + + * Acknowledge NMU with thanks. Closes: #372811. + * Move to new Python policy. This package should now work on + python2.3 and python2.4. + * Move to Standards-Version: 3.7.2 : No changes required. + * Patches from Fedora 0.52.2-7 : + - Make the default colours more friendly to 8-color terminals + - handle listbox and checkboxtree focus better. Closes: #189038. + - turn off cursor when entry terminated form + - fix handling windows larger than screen size + - fix checkboxtree positioning. + * Translations: + - Thai, thanks to Theppitak Karoonboonyanan. Closes: #367230. + - Esperanto, thanks to Serge Leblanc. Closes: #366077, #369240. + - Nepali, thanks to Paras pradhan. Closes: #369357. + * Fixed bug that meant Bengali was not properly included. + * libnewt0.52: Move priority from required to standard, to match + overrides. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 20 Jun 2006 21:15:43 +0100 + +newt (0.52.2-4.1) experimental; urgency=low + + * Build for python2.4. + * Hardcode the python dependencies for this upload, so that we can build + without 2.4 as the default version. + + -- Matthias Klose <doko@debian.org> Sun, 11 Jun 2006 15:07:35 +0000 + +newt (0.52.2-4) unstable; urgency=low + + * Translations: + - Dzongkha, thanks to Pema Geyleg. Closes: #361793. + * Further accessability improvements by Samuel Thibault. Closes: #337171. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 11 Apr 2006 17:52:56 +0100 + +newt (0.52.2-3) unstable; urgency=low + + * Translations: + - Khmer, thanks to Khoem Sokhem. Closes: #359671. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 28 Mar 2006 21:52:06 +0100 + +newt (0.52.2-2) unstable; urgency=low + + * Change Punjabi from pa_IN to pa, following debian-i18n discussion. + Closes: #357611. + * Release as unstable, causing a transition to new libnewt0.52. + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 19 Mar 2006 14:25:06 +0000 + +newt (0.52.2-1) experimental; urgency=low + + * New upstream release. + * Change whiptail section: from base to utils to match override. + * Updated Greek translation from Kostas Papadimas. Closes: #344583. + * Patches from RedHat: + - pgupdown-crash: fixes crash in checkboxtree using pgup/down + - scrollbar: more pleasing scrollbars. + * Include cursor-a11y.patch for better accessability. Closes: #337171. + + -- Alastair McKinstry <mckinstry@debian.org> Thu, 19 Jan 2006 21:44:03 +0000 + +newt (0.52.1-3) experimental; urgency=low + + * New Bengali translation by Progga. Closes: #340650. + * snack.py: function EntryWindow now works with preset values for entries. + Closes: #340366. + + -- Alastair McKinstry <mckinstry@debian.org> Fri, 25 Nov 2005 20:50:49 +0000 + +newt (0.52.1-2) experimental; urgency=low + + * Include a11y patches by Samuel Thibault for accessability. + Closes: #337171. + * move to DH_COMPAT=5; include ${misc:Depends} to Dependencies. + + -- Alastair McKinstry <mckinstry@debian.org> Sat, 19 Nov 2005 12:05:48 +0000 + +newt (0.52.1-1) experimental; urgency=low + + * New upstream release. + * New Kurdish translation by Erdal Ronahi. Closes: #335077. + + -- Alastair McKinstry <mckinstry@debian.org> Sat, 22 Oct 2005 20:20:38 +0100 + +newt (0.51.6-31) unstable; urgency=low + + * don't free() a pointer that will be NULL if fribidi is not installed. + Closes: #317451, #326068. + * Build-Depend on libfribid-dev, libnewt0.51 recommends libfribidi0. + + -- Alastair McKinstry <mckinstry@debian.org> Thu, 8 Sep 2005 22:30:22 +0100 + +newt (0.51.6-30) unstable; urgency=low + + * Improved BIDI patch from Eugeniy Meshcheryakov. Closes: #323832. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 22 Aug 2005 19:03:02 +0100 + +newt (0.51.6-29) unstable; urgency=low + + * Translations: + - Xhosa thanks to Xhosa team and Canonical. Closes: #319480. + * Fixed syntax errors in changelog that lintian now complains of. + * Better dependency generation for whiptail; no doubled dependencies + on libnewt0.51 + + -- Alastair McKinstry <mckinstry@debian.org> Thu, 4 Aug 2005 18:56:34 +0100 + +newt (0.51.6-28) unstable; urgency=low + + * Patch from Eugeniy Meshcheryakov to do fribidi in newt. Closes: #318239. + + -- Alastair McKinstry <mckinstry@debian.org> Thu, 14 Jul 2005 21:54:38 +0100 + +newt (0.51.6-27) unstable; urgency=low + + * Translations: + - Wolof (wo) thanks to Mouhamadou Mamoune Mbacke. Closes: #317535. + * Add explanation to whiptail man page as to how to start text with a dash + '-'. Closes: #284708. + * Move to Standards-Version: 3.6.2 + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 10 Jul 2005 08:32:24 +0100 + +newt (0.51.6-26) unstable; urgency=low + + * Build against libslang2-dev (>= 2.0.4-2) for fribidi patch. + * Upload to unstable. + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 26 Jun 2005 10:20:18 +0100 + +newt (0.51.6-25) experimental; urgency=low + + * libslang2: use SLutf8_enable(-1) to enable UTF8 handling. + * Patch from Eugeniy Meshcheryakov to handle incorrect input in + non-ASCII modes. Closes: #304657. + * libnewt0.51: set priority to required, to match override. + * whiptail: set priority to important, to match override. + * Generate newt.pot during package build. Closes: #313523. + + -- Alastair McKinstry <mckinstry@debian.org> Sat, 25 Jun 2005 13:12:54 +0100 + +newt (0.51.6-24) experimental; urgency=low + + * Build against libslang2 + * Translations: + - Punjabi (pa_IN) thanks to Amanpreet Singh Alam. Closes: #309793. + - Estonian thanks to Siim Põder. Closes: #312465. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 13 Jun 2005 21:23:47 +0100 + +newt (0.51.6-23) unstable; urgency=low + + * Build against libc6 from unstable, not experimental. Closes: #308550. + + -- Alastair McKinstry <mckinstry@debian.org> Fri, 13 May 2005 07:43:48 +0100 + +newt (0.51.6-22) unstable; urgency=low + + * Translations: + - Vietnamese, thanks to Clytie Siddall. Closes: #306612. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 9 May 2005 20:53:22 +0100 + +newt (0.51.6-21) unstable; urgency=low + + * Translations: + - Tagalog, thanks to Eric Pareja. Closes: #288908. + * Corrections for typos in whiptail man page. Thanks to A. Costa. + Closes: #287349. + * whiptail: textbox help should say <file> not <text>. Closes: #287352. + * Interpret C-u as discard. Thanks to Matt Kraai for patch; + Closes: #275588. + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 20 Feb 2005 15:33:50 +0000 + +newt (0.51.6-20) unstable; urgency=low + + * Upgrade bug; lbnewt0.51 was supplying /usr/lib/libnewt.so in conflict + with libnewt-dev. Closes: #283185. + + -- Alastair McKinstry <mckinstry@debian.org> Sat, 27 Nov 2004 09:49:00 +0000 + +newt (0.51.6-19) unstable; urgency=low + + * Translations: + - Welsh, thanks to Dafydd Harries. Closes: #282178. + - Galician, thanks to Jacobo Tarrio. Closes: #282231. + - Albanian, thanks to Elian Myftiu. Closes: #282158. + - Malagasy, thanks to Jaonary Rabarisoa. Closes: #282444. + - Hindi, thanks to Ravishankar Shrivastava. Closes: #282445. + * Fix regression: Tradition Chinese translations that were over-written + by Simplified Chinese by mistake. Closes: #282948. + + -- Alastair McKinstry <mckinstry@debian.org> Thu, 25 Nov 2004 20:44:04 +0000 + +newt (0.51.6-18) unstable; urgency=low + + * Macedonian translation thanks to Georgi Stanojevski. Closes: #275778. + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 17 Oct 2004 20:18:57 +0100 + +newt (0.51.6-17) unstable; urgency=low + + * Romanian translation thanks to Eddy Petrisor. Closes: #275121. + * Traditional Chinese translation thanks to Tetralet. Closes: #272618. + + -- Alastair McKinstry <mckinstry@debian.org> Wed, 6 Oct 2004 20:52:22 +0100 + +newt (0.51.6-16) unstable; urgency=low + + * Include Bulgarian translation by Ognyan Kulev. + Closes: #271425, #272378. + * Remove reference to hot-key numbers (a dialog-only feature) from + whiptail man-page. Closes: #267965. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 20 Sep 2004 21:45:32 +0100 + +newt (0.51.6-15) unstable; urgency=low + + * Ensure whiptail depends on ${Source-Version} of libnewt0.51. + Closes: #269835. + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 5 Sep 2004 20:41:08 +0100 + +newt (0.51.6-12) unstable; urgency=low + + * Build for sid. + + -- Alastair McKinstry <mckinstry@debian.org> Fri, 27 Aug 2004 22:20:01 +0100 + +newt (0.51.6-6sarge) testing-proposed-updates; urgency=low + + * Set reset charset properly when doing line-drawing; Closes: #263780 + * FTBFS on AMD64,alpha. Closes: #265214. + * Build whiptail against shared libnewt.so; Closes: #265721 + + -- Alastair McKinstry <mckinstry@debian.org> Sat, 14 Aug 2004 23:08:41 +0100 + +newt (0.51.6-11) unstable; urgency=low + + * Acknowledging NMU: Closes: #262107. + # Ensure wstrlen is visible to newt binaries. Closes: #264723. + + -- Alastair McKinstry <mckinstry@debian.org> Fri, 13 Aug 2004 20:29:31 +0100 + +newt (0.51.6-10.1) unstable; urgency=high + + * NMU + * libnewt-dev should depend on 0.51, not itself. + + -- Joey Hess <joeyh@debian.org> Thu, 29 Jul 2004 15:01:19 -0400 + +newt (0.51.6-10) unstable; urgency=low + + * Tighten dependencies to latest versions of newt, slang. + Closes: #261314, #260992. + * Translations: + - ar.po thanks to Arabeyes project. Closes: #260646. + - hr.po thanks to Krunoslav Gernhard. Closes: #261421. + * Add debian/watch file. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 26 Jul 2004 22:32:54 +0100 + +newt (0.51.6-9) unstable; urgency=low + + * Build against the correct slang libraries. Closes: #259283. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 13 Jul 2004 22:44:40 +0100 + +newt (0.51.6-8) unstable; urgency=low + + * FIx garbled display in top line of boxes. Closes: #257488. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 12 Jul 2004 19:22:55 +0100 + +newt (0.51.6-7) unstable; urgency=low + + * Fix display problem with 'hidden' checkbox entries in whiptail being + shown. Closes: #257807. + * Used versioned symbols in libnewt. + + -- Alastair McKinstry <mckinstry@debian.org> Thu, 8 Jul 2004 20:49:22 +0100 + +newt (0.51.6-6) unstable; urgency=low + + * Echo '*' in password field in whiptail. Closes: #254411. + * Fix segfaults on bad parameters (box sizes). Closes: #253512. + * Update copyright file to point to better source. Closes: #254975. + * ENTER in multiselect (check and radio lists) now selects; + tabbing to OK not required. Closes: #252751. + * Removed XSI:'isms from python-newt.prerm.in ; Closes: #256508. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 28 Jun 2004 20:45:09 +0100 + +newt (0.51.6-5) unstable; urgency=low + + * Correction to Catalan translation. Closes: #251790. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 8 Jun 2004 22:29:40 +0100 + +newt (0.51.6-4) unstable; urgency=low + + * Change Catalan po file to reflect UTF-8 encoding. + Closes: #251790, #251811. + * Bosnian translationi by Safir Šećerović. Closes: #251138. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 31 May 2004 21:30:06 +0100 + +newt (0.51.6-3) unstable; urgency=low + + * Don't free ptr in entry.c twice. Closes: #246378. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 4 May 2004 20:24:09 +0100 + +newt (0.51.6-2) unstable; urgency=low + + * Translations: + - Portuguese by Miguel Figueiredo. Closes: #241311. + - Slovak by Peter Mann. Closes: #246099. + * Fix python indentation in snack.py. Closes: #236837. + * Don't truncate strings in UTF-8 mode in whiptail. Closes: #232426. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 26 Apr 2004 20:27:23 +0100 + +newt (0.51.6-1) unstable; urgency=low + + * New Upstream release. + * Switched to dbs: + - Cleanup of debian/rules + - broke 0.51.4 changes into debian/patches + * newt.c: Don't spin on the terminal window dying. Closes: #203988. + * Use terminfo bindings: patch from Henning Makholm. Closes: #219043. + * Trim long titles rather than failing. Closes: #236114. + * Add GNU options --help, --version to whiptail. + * Translations: + - Turkish by Recai Oktas. Closes: #239149. + - Korean by Changwoo Ryu. Closes: #241988. + - Indonesian by I Gede Wijaya S. Closes: #243454. + - Basque by Piarres Beobide Egaña. Closes: #243587. + - Hebrew by Lior Kaplan. + * Patch for non-ASCII input, thanks to Eugeniy Meshcheryakov. + Closes: #238873. + Special thanks to Eugeniy Meshcheryakov for fixes and testing. + + -- Alastair McKinstry <mckinstry@debian.org> Sun, 25 Apr 2004 19:12:19 +0000 + +newt (0.51.4-21) unstable; urgency=low + + * zh_CN.po: Simplified Chinese translation from Carlos Z.F. Liu. + Closes: #232134. + * whiptail.c: guessSize: fix wrapping/truncation of text when autosizing + dialogs. Closes: #224333, #231634. + * whiptail.c: Translate "\n" in text to newlines. Closes: #218991, #212255. + + -- Alastair McKinstry <mckinstry@debian.org> Wed, 11 Feb 2004 15:37:07 +0000 + +newt (0.51.4-20) unstable; urgency=low + + The "Further adventures in translation" release. + * cs.po: Czech translation from Miroslav Kure. Closes: #227116. + * nl.po: Dutch translation from Bart Cornelis. Closes: #227102. + * sl.po: Slovenian translation from Jure Cuhalev. Closes: #227519. + * lt.po: Lithuanian translation from Kęstutis Biliūnas. Closes: #227566. + * es.po: Improved Spanish translation from Carlos Valdivia Yagüe. + * da.po: Danish translation from Claus Hindsgaul. + + -- Alastair McKinstry <mckinstry@debian.org> Fri, 6 Feb 2004 18:04:25 +0000 + +newt (0.51.4-19) unstable; urgency=medium + + The "Do translators travel in packs?" release. + * fi.po: Finnish translation from Tommi Vainikainen. Closes: #226993. + * fr.po, ja.po: Fix comments; these are not German translations. + Closes: #226964. + * ga.po: Convert to UTF-8. + * it.po: Italian translation from Giuseppe Sacco, and build fix + for ja.po. + Closes: #226942, #226943. + * sl.po: Slovenian translation from Jure Cuhalev. Closes: #226901. + * hu.po: New Hungarian translation from VEROK Istvan. Closes: #226982. + * ru.po: New Russian translation from Nikolai Prokoschenko. Closes: #226945. + * sv.po: Fix spelling mistake. Thanks to André Dahlqvist. + * el.po: New Greek translation from Konstantinos Margaritis. + Closes: #226922. + * pl.po: New Polish translation from Bartosz Fenski aka fEnIo. + Closes: #226921. + + -- Alastair McKinstry <mckinstry@debian.org> Sat, 10 Jan 2004 07:28:36 +0000 + +newt (0.51.4-18) unstable; urgency=low + + * whiptail / whiptcl: Resize listboxes to fit on screen. + Closes: #201619, #206616. + * ESC key now works. Closes: #52477, #110268. + * Add examples to libnewt-dev. + * Update version, authors in whiptail(1). + + -- Alastair McKinstry <mckinstry@debian.org> Fri, 19 Sep 2003 20:52:48 +0000 + +newt (0.51.4-17) unstable; urgency=low + + * whiptail: Return -1 on error, to distinguish Ok, Cancel, Error. + Closes: #86400. Closes: #209029. + * Add documentation for python-newt. Closes: #151783. + * Fix build error for po/Makefile.in.in. Closes: #207047. + * newt should Build-Depend on gettext. Closes: #207477. + * Build-Depend on debhelper >= 4.1.1. Closes: #207037. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 15 Sep 2003 20:35:56 +0100 + +newt (0.51.4-16) unstable; urgency=low + + * Ship files for python2.3, not python2.2. Closes: #205481, #205505. + * Change es.po to UTF-8, to correct charset error + * Correct spelling in sv.po. + Closes: #206218, #206219, #206220, #206221. + + -- Alastair McKinstry <mckinstry@debian.org> Mon, 18 Aug 2003 22:02:11 +0100 + +newt (0.51.4-15) unstable; urgency=low + + * Removed unnecessary dependencies on python << 2.3; Closes: #204876. + * Changed maintainer email to mckinstry@debian.org + * Moved to Standards-Version: 3.6.0; no changes required. + + -- Alastair McKinstry <mckinstry@debian.org> Tue, 12 Aug 2003 22:09:43 +0100 + +newt (0.51.4-14) unstable; urgency=low + + * Added Brazilian Portugese translation from Andre Luis Lopes. + Closes: #202101. + * chmod +x ./mkinstalldirs. Closes: #202078. + + -- Alastair McKinstry <mckinstry@computer.org> Sun, 20 Jul 2003 09:28:44 +0100 + +newt (0.51.4-13) unstable; urgency=low + + * Fix installation of .mo files. Closes: #202003. + * Added french translation for whiptail from Christian Perrier. Closes: #201864. + * Added Japanese translation for whipatil from Tomohiro KUBOTA. Closes: #202005. + + -- Alastair McKinstry <mckinstry@computer.org> Sat, 19 Jul 2003 08:31:49 +0100 + +newt (0.51.4-12) unstable; urgency=low + + * Re-enabled Ctrl-U key. Closes: #184486, #191487. + * Enable i18n, with whiptail button translations to + Catalan, Spanish, Irish, German, Swedish and Norwegian. Closes: #54536. + + -- Alastair McKinstry <mckinstry@computer.org> Sun, 13 Jul 2003 12:33:58 +0100 + +newt (0.51.4-11) unstable; urgency=low + + * Fixed misleading colors in compact buttons. Closes: #195775,#198800. + * Updated to policy 3.6.0; no changes needed. + + -- Alastair McKinstry <mckinstry@computer.org> Mon, 14 Jul 2003 10:16:11 +0100 + +newt (0.51.4-10) unstable; urgency=low + + * libnewt0.51 replaces libnewt0, libnewt-utf8; whiptail can also use tcl8.4. + Closes: #196570. + * Add README.whiptail to document the purpose of whiptail. Closes: #67356. + * Added --default-item option added to whiptail, whiptcl. + Closes: #49352, #49796. + * Added shlibs fix from Daniel Schepler for whiptail dependency on alpha. + Closes: #196290. + * malloc, realloc failures in whiptail, whiptcl now generate a DLG_ERROR + return, not a segfault. + + -- Alastair McKinstry <mckinstry@computer.org> Mon, 16 Jun 2003 20:54:30 +0100 + +newt (0.51.4-9) unstable; urgency=low + + * libnewt0 replaces libnewt-utf8 + + -- Alastair McKinstry <mckinstry@computer.org> Sun, 8 Jun 2003 08:28:55 +0100 + +newt (0.51.4-8) unstable; urgency=low + + * Fix problem with cursor position when no border drawn. Closes: #195545. + * Add --notags option to whiptail. Closes: #45957. + * Change newt-tcl whiptcl.so to libwhiptcl.so. Closes: #21697. + * Fix shlib dependency calculation to ensure dependency for whiptail on + libnewt0.51 on sparc. Closes: #196290. + + -- Alastair McKinstry <mckinstry@computer.org> Fri, 6 Jun 2003 14:00:05 +0100 + +newt (0.51.4-7) unstable; urgency=low + + * Added --output-fd option. Closes: #153628. + * Use libc6.1 on Alpha rather than libc. Closes: #194877. + + -- Alastair McKinstry <mckinstry@computer.org> Fri, 30 May 2003 19:00:46 +0100 + +newt (0.51.4-6) unstable; urgency=low + + * Hardcode whiptail dependencies for the moment to ensure that + libnewt0.51 is included on !i386. Closes: #192767. + * Re-included --textbox, --passwordbox functionality that upstream had + dropped without mentioning it in documentation. + Closes: #191579, #191580, #192494, #192922, #192944, #193040. + + -- Alastair McKinstry <mckinstry@computer.org> Mon, 12 May 2003 22:31:37 +0100 + +newt (0.51.4-5) unstable; urgency=low + + * Re-insert code to ensure dialogboxes.o is -fPIC, this time to Makefile.in, + not Makefile. Closes: #192393. + + -- Alastair McKinstry <mckinstry@computer.org> Sun, 11 May 2003 13:51:18 +0100 + +newt (0.51.4-4) unstable; urgency=low + + * Reset screen before leaving on exit. Closes: #55638. + * Removed incorrect 'and is maintained by' line from debian/copyright. + * Ensure dialogboxes.o is built -fPIC: its included in shared objects. + Closes: #192393. + * Ensure whiptail dependency on libnewt0.51. Closes: #192767. + * Added libnewt.so->libnewt.so.0.51 symlink to libnewt-dev. Closes: #192884. + + -- Alastair McKinstry <mckinstry@computer.org> Mon, 5 May 2003 14:29:15 +0100 + +newt (0.51.4-3) unstable; urgency=low + + * Also remore dh_testroot from configure target. Closes: #191123. + * Change Sections to match overrides (devel->libdevel, interpreters->python) + * Fixed dependencies. Build-Depend, slang>>1.4.5-2; whiptail. + Closes: #162429. + * Re-inserted the guessSize() code for autosizing from 0.50.17, with a bugfix to + allow it to work with UTF8. Closes: #191627. + * newt.c: Window placement calc: Don't assume 80x24! instead, read from slang. + Closes: #191578 + * include newt.spec in /usr/share/doc as it includes important changelog + info. + * Documented the removal of whiptail features --passwordbox, --textbox; + added explanation on how to select items in checklists, radiolists in + whiptail.1. Closes: #184471. + * Removed debian-test testsuite, as the debian-test package has been removed. + + -- Alastair McKinstry <mckinstry@computer.org> Thu, 1 May 2003 12:33:01 +0100 + +newt (0.51.4-2) unstable; urgency=low + + * build target no longer needs root. Closes: #191123. + * Include snack.py in python-newt. Closes: #191445, #191446. + + -- Alastair McKinstry <mckinstry@computer.org> Wed, 30 Apr 2003 23:38:55 +0100 + +newt (0.51.4-1) unstable; urgency=low + + * New maintainer. + * Upgraded to new release 0.51.4, from RedHat, bumping SONAME to 0.51 + * Merged newt, newt-utf8 now that SONAME has changed. + + -- Alastair McKinstry <mckinstry@computer.org> Mon, 14 Apr 2003 10:20:02 +0100 + +newt (0.50.17-13) unstable; urgency=low + + * textbox.c(addLine,doReflow,newtTextbox) add checks to try and fix (closes: 169788) + * add debian-test script and install it, but I haven't actually figured + out how really to use it. + * debian/control{,.utf8}: + Build-Depend on sgmltools-lite rather than sgmltools-2, + and libnewt-utf8-pic and libnewt-pic conflicts explicitly with each other + * Install libnewt-utf8_pic.a as libnewt_pic.a, + I hope I don't break anybody's back with this change. + (closes: #182041) + * slightly update create-utf8.sh script. + * update README.Debian for a change. + + -- Junichi Uekawa <dancer@debian.org> Fri, 28 Feb 2003 17:32:33 +0900 + +newt (0.50.17-12) unstable; urgency=low + + * no stripping if nostrip is specified in DEB_BUILD_OPTS. + - change configure.in to accept --with-nostrip + - change Makefile.in to use @INSTALL_S@ instead of install -s. + * No buffer overflow in pushhelpline (partially fixes #66349, + that it doesn't segv anymore, but something is surely wrong.) + * Possible buffer overflow in newt.c for keyinput fixed (closes: #140404) + + -- Junichi Uekawa <dancer@debian.org> Wed, 27 Nov 2002 16:40:41 +0900 + +newt (0.50.17-11) unstable; urgency=low + + * Apply patch from Robert Milan (mostly) for hurd compatbility. + (closes: #149318) + + -- Junichi Uekawa <dancer@debian.org> Wed, 30 Oct 2002 17:22:23 +0900 + +newt (0.50.17-10) unstable; urgency=low + + * New maintainer + * Build newt-utf8 also. versions -9.7 and -9.8 were not uploaded + to Debian archive as utf-8 versions. + * Fix newt-utf8 portions that doko didn't touch. + * Fixed descriptions to clarify that newt-utf8 is not binary compatible, + and note that it's not wide-character support, but support for locales. + (closes: #135455, #152223) + * rename debian/README to debian/README.Debian + * update debian/copyright to include me. + + -- Junichi Uekawa <dancer@debian.org> Mon, 28 Oct 2002 22:46:25 +0900 + +newt (0.50.17-9.8) unstable; urgency=low + + * Makefile.in (PYVER): Set to 2.2 (closes: #158689). + + -- Matthias Klose <doko@debian.org> Fri, 30 Aug 2002 08:15:43 +0200 + +newt (0.50.17-9.7) unstable; urgency=low + + * NMU. + * Build using python2.2. + + -- Matthias Klose <doko@debian.org> Sat, 24 Aug 2002 14:07:14 +0200 + +newt (0.50.17-9.6) unstable; urgency=high + + * Fix possible buffer overflow. (closes: #138363, #140493) + At least, this no longer segfaults for me: + whiptail --menu "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" 30 120 0 aa aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa + + -- Junichi Uekawa <dancer@debian.org> Sun, 31 Mar 2002 09:38:18 +0900 + +newt (0.50.17-9.5) unstable; urgency=high + + * NMU + * An urgency high upload to fix mistakes introduced in -9.3, + and to let the fix trickle into testing. + * whiptail and whiptail-utf8 conflicts with each other + (closes: #135752, #136404) + * update build-depends to depend on slang 1.4.4-7.2 or greater + + -- Junichi Uekawa <dancer@debian.org> Sun, 3 Mar 2002 11:45:10 +0900 + +newt (0.50.17-9.4) unstable; urgency=low + + * NMU + * add setlocale(LC_ALL, ""); to whiptail, in utf8 mode. + mbrtowc most probably wants this. + Otherwise, we are getting question marks from whiptail-utf8. + + -- Junichi Uekawa <dancer@debian.org> Mon, 25 Feb 2002 02:51:17 +0900 + +newt (0.50.17-9.3) unstable; urgency=low + + * NMU + * "Creating the necessary binaries for building boot-floppies, and + fixing the non-arch porability" + * Makefile.in: fix some compilation warnings with -D_GNU_SOURCE for + UTF8 mode, so that the program will run on other arches. + (closes: #135386) + * newt_pr.h: added declaration for strwidth definition. + * debian/control: + - libnewt-dev conflicts with libnewt-dev, + libnewt-utf8-dev provides/conflicts libnewt-dev + introduce libnewt-utf8-dev + - whiptail conflicts/provides whiptail-provider + whiptail-utf8 conflicts/provides whiptail-provider + - whiptail-utf8 created (closes: #135382) + - libnewt-dev requires newt, and slang + - libnewt-utf8-dev requires newt-utf8 and slang-utf8 + - tcl8.3-dev added to build-depends for utf8. + - libnewt-utf8-pic depends on libnewt-utf8-dev + * debian/rules: + - add binary-runtime and binary-devel + to binarytarget for utf8. + - build document in utf8 also. + - remove *~ on clean + * Makefile.in: Accept BUILDING_UTF8=true as a sign of required UTF8 + flag. + * debian/create-utf8.sh: sed shlibs/shlibs.local so that + packages compiled against utf8 version will require utf8 + libs. + * debian/README: added some documentation on the package. + * debian/shlibs.local: update shlibs file to depend on utf8 version + greater than 0.50.17-9.3. + * With this, whiptail-utf8 should be used with slang1-utf8 + (closes: #124083) + + -- Junichi Uekawa <dancer@debian.org> Sun, 24 Feb 2002 14:09:53 +0900 + +newt (0.50.17-9.2) unstable; urgency=low + + * NMU + * Split out newt-utf8 and newt source packages (closes: #133936) + * debian/create-utf8.sh: created, to facilitate creation of newt-utf8 version + from newt. Portions ripped off from fetchmail sources. + * debian/control.utf8: for utf8 version. + * this version keeps the single -dev file. It might cause problems + if packages linked to newt try to use slang too. + * bump up the version build-dependency for slang1-*-dev + * libnewt-pic: Depends on libnewt-dev + + -- Junichi Uekawa <dancer@debian.org> Fri, 15 Feb 2002 18:50:36 +0900 + +newt (0.50.17-9.1) unstable; urgency=low + + * Non Maintainer Upload. + * fix problems with mono mode, patch thanks to + Klaus Weidner <kw@w-m-p.com> (closes: #128941) + * fixed char signedness problem patch thanks to + Martin Michlmayr <tbm@cyrius.com> (closes: #127105) + + -- David Kimdon <dwhedon@debian.org> Mon, 11 Feb 2002 21:55:10 -0800 + +newt (0.50.17-9) unstable; urgency=high + + * Oops, fix the memory leak that I created while trying to fix the + memory leak in newtTextboxSetText. (Closes: #124117) + + -- Enrique Zanardi <ezanard@debian.org> Tue, 18 Dec 2001 13:33:50 +0000 + +newt (0.50.17-8) unstable; urgency=high + + * MU, close the bugs fixed in NMUs. (Closes: #119815, #120245, #119281, #119354, #117455, #115409, #116566, #121062, #117878, #109441) + * libnewt.so points to libnewt.so.0.50 (Closes: #121893) + * -pic packages now depend on non-pic ones. (Closes: #123325) + * Fix memory leak in newtTextboxSetText. (Closes: #121505) + * Use the proper package name in the prerm script for python-newt. + (Closes: #121716) + + -- Enrique Zanardi <ezanard@debian.org> Wed, 12 Dec 2001 10:20:06 +0000 + +newt (0.50.17-7.3) unstable; urgency=high + + * NMU for woody deadline + * Include patch from Philip Blundell to fix UTF8. Closes: #119354 + * Remove snack.py~ and Makefile.in~ which seem to have been introduced + in the last NMU. + + -- Matthew Wilcox <willy@debian.org> Wed, 28 Nov 2001 09:28:01 -0700 + +newt (0.50.17-7.2) unstable; urgency=high + + * NMU to include corrected snack.py. (Closes: #119815, #120245, #119281) + + -- Chris Lawrence <lawrencc@debian.org> Sat, 24 Nov 2001 17:57:55 -0600 + +newt (0.50.17-7.1) unstable; urgency=low + + * NMU to build with python (2.1). Somewhat fixes #109441. + * Add postinst/prerm for python-newt to compile/remove .py files. + Closes: #117455. + * Build Tcl module for tcl8.3. + * Call ldconfig, only when configuring. + * Make libnewt0 depend on slang1-dev (>= 1.4.4-2) | slang1-utf8-dev + (Closes: #115409). + + -- Matthias Klose <doko@debian.org> Sun, 21 Oct 2001 19:33:50 +0200 + +newt (0.50.17-7) unstable; urgency=low + + * Changed colors for inactive buttons. (Closes: #99652, #54265, #60855, #61150) + + -- Enrique Zanardi <ezanard@debian.org> Mon, 4 Jun 2001 10:20:06 +0100 + +newt (0.50.17-6) unstable; urgency=low + + * Oops, there was a bug in the patch. + + -- Enrique Zanardi <ezanard@debian.org> Fri, 27 Apr 2001 08:44:37 +0100 + +newt (0.50.17-5) unstable; urgency=low + + * Some utf8-related fixes (Patch by Edmund Grimley Evans): + - remove all use of mbtowc and wctomb, which are evil in a library, + as they change an anonymous global state + - fix a possible segfault in doReflow() if !resultPtr + - remove some historical #if 0 code + + -- Enrique Zanardi <ezanard@debian.org> Thu, 26 Apr 2001 14:08:49 +0100 + +newt (0.50.17-4) unstable; urgency=low + + * Rebuilt with utf8 version of slang1. (Closes: #93276) + + -- Enrique Zanardi <ezanard@debian.org> Fri, 20 Apr 2001 10:02:54 +0100 + +newt (0.50.17-3) unstable; urgency=low + + * Builds utf8 versions of libnewt and libnewt-pic. (Closes: Bug#91963) + Patch by Edmund Grimley Evans. + + -- Enrique Zanardi <ezanard@debian.org> Wed, 11 Apr 2001 22:17:20 +0100 + +newt (0.50.17-2) unstable; urgency=low + + * Builds a PIC version of libnewt. (Closes: Bug#91951) + * Builds a directory of html files. (Closes: Bug#89906) + * Include the right file location in copyright file. (Closes: Bug#91962) + + -- Enrique Zanardi <ezanard@debian.org> Wed, 11 Apr 2001 20:21:04 +0100 + +newt (0.50.17-1) unstable; urgency=low + + * New upstream version + * Added a "abort signal" callback to libnewt, and a "suspend" callback + to whiptail. (Closes: Bug#52952, Bug#61807, Bug#84054) + * Closing ancient non-bug (just a difference in the way getopt and popt + handle arguments). (Closes: Bug#17786) + * Added Build-Depends. (Closes: Bug#70101) + * Added patch by Oskar Liljeblad <osk@hem.passagen.se> to handle + NEWT_KEY_{HOME,END}. (Closes: Bug#80961) + + -- Enrique Zanardi <ezanard@debian.org> Sun, 18 Feb 2001 10:32:49 +0000 + +newt (0.50.8-2) unstable; urgency=low + + * Added -I/usr/include/tcl8.2/ to the list of include dirs for whiptcl + and tcl8.2-dev >= 8.2.3-3. (Closes: Bug#67066) + * Added --scrolltext description to whiptail.1 manpage (Closes: Bug#75316) + * Fixed typo in whiptail.1 manpage (Closes: Bug#75653) + + -- Enrique Zanardi <ezanard@debian.org> Fri, 27 Oct 2000 09:52:53 +0100 + +newt (0.50.8-1) unstable; urgency=low + + * New upstream version. + * whiptcl doesn't have hardcoded terminal size (Closes: Bug#62252) + * Close bugs fixed in NMUs. (Closes: Bug#58059, Bug#47855, Bug#57651, + Bug#56710, Bug#58817) + * Whiptail remembers the state of the screen and restores it on exit + (Closes: Bug#57455) + * Latest stable version of newt. (Closes: Bug#52834, Bug#54474) + + -- Enrique Zanardi <ezanard@debian.org> Wed, 28 Jun 2000 13:38:38 +0100 + +newt (0.50-7) frozen unstable; urgency=high + + * Ctrl-U must clear the whole buffer! . Closes: Bug#62828 + + -- Enrique Zanardi <ezanard@debian.org> Sat, 22 Apr 2000 13:38:04 +0100 + +newt (0.50-6) frozen unstable; urgency=low + + * Use "-O2" on compilation to let it build on m68k and get rid of + RC bug 59150 as suggested by Bjoern Brill. + + -- Enrique Zanardi <ezanard@debian.org> Thu, 23 Mar 2000 19:37:15 +0000 + +newt (0.50-5.4) frozen unstable; urgency=low + + * Non-maintainer upload + * Fixes bad cursor position in listboxes, Closes: Bug#58059 + + -- Eric Delaunay <delaunay@lix.polytechnique.fr> Fri, 10 Mar 2000 22:11:16 +0100 + +newt (0.50-5.3) frozen unstable; urgency=low + + * Non-maintainer upload + * Don't install libnewt.a with install -s, Closes: Bug#57651 + + -- Wichert Akkerman <wakkerma@debian.org> Sun, 20 Feb 2000 15:38:54 +0100 + +newt (0.50-5.2) unstable; urgency=low + + * Non-maintainer upload + * Fixes dependency calculation on debian/rules. closes: #53181 + + -- Randolph Chung <tausq@debian.org> Wed, 22 Dec 1999 16:17:56 -0700 + +newt (0.50-5.1) unstable; urgency=low + + * Non-maintainer upload + * Adds clear line feature (c-u) to libnewt. closes: #36587 + * break lines properly, closes: #43270 + * Missing "val" in newt.h; "//" in form.c, closes: #47855 + * Fixes sizing code for menu dialogs, closes: #51019 + * Fixes whiptail dependencies, closes: #48475, #50165, #50346, #52311 + + -- Randolph Chung <tausq@debian.org> Tue, 14 Dec 1999 21:57:11 -0700 + +newt (0.50-5) unstable; urgency=low + + * If gpm is not running ignore gpm support. + + -- Enrique Zanardi <ezanard@debian.org> Sun, 7 Nov 1999 19:59:43 +0000 + +newt (0.50-4) unstable; urgency=low + + * (finally) enabled gpm support. + * fixed whiptail dependencies. + + -- Enrique Zanardi <ezanard@debian.org> Sat, 9 Oct 1999 22:32:23 +0100 + +newt (0.50-3) unstable; urgency=low + + * explicitly linked to libdl. + + -- Enrique Zanardi <ezanard@debian.org> Sat, 9 Oct 1999 21:22:16 +0100 + +newt (0.50-2) unstable; urgency=low + + * added a Replaces/Conflicts: newt0.25-dev to allow clean upgrades from + slink. (Closes: #47025). + + -- Enrique Zanardi <ezanard@debian.org> Sat, 9 Oct 1999 21:22:16 +0100 + +newt (0.50-1) unstable; urgency=low + + * new upstream version (Closes: #43427, #45955). + * linked to slang 1.3 (Closes: #46951) + * stripped debugging symbols from libnewt.a (Closes: #31246). + * whiptail is on its own base package (Closes: #36435). + * fixed documentation bug about "--clear" (Closes: #24972). + * newtRedrawHelpLine() now test for length before memcpy'ng + (Closes: #37032, #38602) + * manpage updated to describe new options (Closes: #41304). + * fixed typo in whiptail output (Closes: #44754). + * added support for "password boxes". Patch by Joey Hess + <joey@kitenet.net> (Closes: #45961). + + -- Enrique Zanardi <ezanard@debian.org> Tue, 5 Oct 1999 23:47:17 +0100 + +newt (0.30-1) unstable; urgency=low + + * New upstream version. + + -- Enrique Zanardi <ezanard@debian.org> Thu, 10 Dec 1998 14:28:40 +0000 + +newt (0.25-3) frozen unstable; urgency=low + + * Back ported bugfix from newt-0.30 to make whiptail display messages + properly. Without this fix, whiptail doesn't show the last word in a + message. + + -- Enrique Zanardi <ezanard@debian.org> Thu, 10 Dec 1998 12:26:13 +0000 + +newt (0.25-2) unstable; urgency=low + + * Excluded tcl and python wrappers. Added code to debian/rules and + debian/control-snippet to build a new package, newt-scripting, when + the wrappers are mature enough. + + -- Enrique Zanardi <ezanard@debian.org> Mon, 3 Aug 1998 13:52:29 +0100 + +newt (0.25-1) unstable; urgency=low + + * New upstream version. + + -- Enrique Zanardi <ezanard@debian.org> Thu, 30 Jul 1998 17:00:39 +0100 + +newt (0.21-6) unstable; urgency=low + + * debian/shlibs really fixed now. + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Wed, 4 Mar 1998 15:38:19 +0000 + +newt (0.21-5) unstable; urgency=low + + * Install shared lib mode 644. + * debian/shlibs file fixed. + * updated Standards-Version. + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Thu, 12 Feb 1998 11:44:44 +0000 + +newt (0.21-4) unstable; urgency=low + + * whiptail now has its own package, fixes: Bug#17476 + * newt0.21-dev now provides and conflicts newt-dev, fixes: Bug#17477 + * Added whiptail(1) manpage, fixes: Bug#16857 + * whiptail now uses full screen, fixes: Bug#17155 + * Defines the dependency on libc*-dev at build-time, fixes: Bug#17208 + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Sat, 30 Jan 1998 20:14:09 +0000 + +newt (0.21-3) unstable; urgency=low + + * Defined newtTextboxAddLine. + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Sat, 10 Jan 1998 03:18:20 +0000 + +newt (0.21-2) unstable; urgency=low + + * Added patches by Bruce Perens: + * - whiptail don't make over-size windows. + * - whiptail will scroll the text and/or the menu to fit on the screen. + * - some variables now defined as const. + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Wed, 7 Jan 1998 13:42:34 +0000 + +newt (0.21-1) unstable; urgency=low + + * New upstream version. + * Not included python support. + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Mon, 5 Jan 1998 16:56:29 +0000 + +newt (0.10-1) unstable; urgency=low + + * New package. + + -- Enrique Zanardi <ezanardi@molec1.dfis.ull.es> Fri, 26 Dec 1997 18:58:38 +0000 + --- newt-0.52.2.orig/debian/control +++ newt-0.52.2/debian/control @@ -0,0 +1,83 @@ +Source: newt +Section: devel +Priority: optional +Maintainer: Alastair McKinstry <mckinstry@debian.org> +Standards-Version: 3.7.2 +XS-Python-Version: all +Build-Depends: dbs, sgmltools-lite, libslang2-dev (>=2.0.4-2), libpopt-dev, debhelper (>=5.0.37.1), gettext, libfribidi-dev, tcl8.4-dev, python (>= 2.3.5-7), python-central (>= 0.4.10), python-all-dev, autoconf +Build-Conflicts: autoconf2.13 + +Package: libnewt-dev +Architecture: any +Section: libdevel +Priority: optional +Conflicts: newt0.30-dev, newt0.25-dev, libnewt-utf8-dev +Replaces: newt0.30-dev, newt0.25-dev, libnewt-utf8-dev +Depends: ${shlibs:Depends}, ${libcdev}, libslang2-dev (>= 2.0.2), libnewt0.52 (=${Source-Version}), ${misc:Depends} +Description: Developer's toolkit for newt windowing library + These are the header files and libraries for developing applications + which use newt. Newt is a windowing toolkit for text mode, which provides + many widgets and stackable windows. + +Package: libnewt-pic +Architecture: any +Section: libdevel +Priority: extra +Depends: ${shlibs:Depends}, libnewt-dev (=${Source-Version}), ${misc:Depends} +Conflicts: libnewt-utf8-pic +Replaces: libnewt-utf8-pic +Description: Not Erik's Windowing Toolkit, shared library subset kit + This is used to develop subsets of the newt shared libraries for use on + custom installation floppies and in embedded systems. Unless you're + making one of those, you won't need this package. + +Package: newt-tcl +Architecture: any +Section: interpreters +Priority: extra +Depends: libnewt0.52 (=${Source-Version}) , tcl8.3 | tcl8.4, ${misc:Depends} +Description: A newt module for Tcl + This module allows you to build a text UI for your Tcl scripts + using newt. + +Package: python-newt +Architecture: any +Section: python +Priority: standard +XB-Python-Version: ${python:Versions} +Provides: ${python:Provides} +Depends: libnewt0.52 (=${Source-Version}) , ${python:Depends}, ${misc:Depends} +Description: A NEWT module for Python + This module allows you to built a text UI for your Python scripts + using newt. + +Package: libnewt0.52 +Architecture: any +Section: base +Priority: standard +Replaces: libnewt-utf8, libnewt0, libnewt0.51 +Conflicts: libnewt0.51 +Depends: ${shlibs:Depends}, ${misc:Depends} +Recommends: libfribidi0 +Description: Not Erik's Windowing Toolkit - text mode windowing with slang + Newt is a windowing toolkit for text mode built from the slang library. + It allows color text mode applications to easily use stackable windows, + push buttons, check boxes, radio buttons, lists, entry fields, labels, + and displayable text. Scrollbars are supported, and forms may be nested + to provide extra functionality. This package contains the shared library + for programs that have been built with newt. + +Package: whiptail +Architecture: any +Section: utils +Priority: important +Depends: ${shlibs:Depends}, ${misc:Depends} +Replaces: newt0.10, newt0.21 (<< 0.21-4), whiptail-utf8 +Conflicts: whiptail-provider +Provides: whiptail-provider, whiptail-utf8 +Description: Displays user-friendly dialog boxes from shell scripts + Whiptail is a "dialog" replacement using newt instead of ncurses. It + provides a method of displaying several different types of dialog boxes + from shell scripts. This allows a developer of a script to interact with + the user in a much friendlier manner. + --- newt-0.52.2.orig/debian/postinst +++ newt-0.52.2/debian/postinst @@ -0,0 +1,3 @@ +#!/bin/sh + +#DEBHELPER# --- newt-0.52.2.orig/debian/prerm +++ newt-0.52.2/debian/prerm @@ -0,0 +1,3 @@ +#!/bin/sh + +#DEBHELPER# --- newt-0.52.2.orig/debian/libnewt-pic.install +++ newt-0.52.2/debian/libnewt-pic.install @@ -0,0 +1 @@ +libnewt_pic.a usr/lib --- newt-0.52.2.orig/debian/TODO +++ newt-0.52.2/debian/TODO @@ -0,0 +1,6 @@ +- Figure out #192767 -- why is libnewt0.51 not being included in the +dependencies for whiptail on !i386? + +For the moment this is hard-coded to allow builds to happen. + + - Alastair, 2003-05-12 --- newt-0.52.2.orig/debian/libnewt-dev.install +++ newt-0.52.2/debian/libnewt-dev.install @@ -0,0 +1,3 @@ +libnewt.a usr/lib +newt.h usr/include +tutorial/* usr/share/doc/libnewt-dev/tutorial.html --- newt-0.52.2.orig/debian/python-newt.install +++ newt-0.52.2/debian/python-newt.install @@ -0,0 +1,2 @@ +python2.4/_snackmodule.so usr/lib/python2.4/site-packages +snack.py usr/lib/python2.4/site-packages --- newt-0.52.2.orig/debian/python-newt.prerm.in +++ newt-0.52.2/debian/python-newt.prerm.in @@ -0,0 +1,15 @@ +#!/bin/sh + +if ( [ "$1" = "upgrade" ] || [ "$1" = "remove" ] ) && [ -L /usr/doc/__PKG__ ]; then + rm -f /usr/doc/__PKG__ +fi + +# sample prerm script for Debian python packages. +# Written 1998 by Gregor Hoffleit <flight@debian.org>. +# + +PACKAGE=python-newt + +dpkg --listfiles $PACKAGE | + awk '$0~/\.py$/ {print $0"c\n" $0"o"}' | + xargs rm -f >&2 --- newt-0.52.2.orig/debian/whiptail.install +++ newt-0.52.2/debian/whiptail.install @@ -0,0 +1 @@ +whiptail usr/bin --- newt-0.52.2.orig/debian/rules +++ newt-0.52.2/debian/rules @@ -0,0 +1,229 @@ +#!/usr/bin/make -f +# +# Created 20 December 1997 by Enrique Zanardi <ezanardi@ull.es> +# Modified 2002-2004 by Alastair McKinstry, <mckinstry@debian.org> +# +# Copying and modification is unlimited, provided that the modified +# version is marked as being modified. + +# Uncomment this to turn on verbose mode. +# export DH_VERBOSE=1 + +DEB_BUILD_GNU_SYSTEM = $(shell dpkg-architecture -qDEB_BUILD_GNU_SYSTEM) +DEB_BUILD_GNU_CPU = $(shell dpkg-architecture -qDEB_BUILD_GNU_CPU) + +VERSION=0.52.2 +SONAME=0.52 + +LIB_PKG=libnewt$(SONAME) +DEV_PKG=libnewt-dev +PIC_PKG=libnewt-pic +TCL_PKG=newt-tcl +PYTHON_PKG=python-newt +WHIPTAIL_PKG=whiptail + +# This is the debhelper compatability version to use. +export DH_COMPAT=5 + +# the dbs rules +TAR_DIR=newt-$(VERSION) +include /usr/share/dbs/dbs-build.mk + +ifeq (,$(DEB_BUILD_GNU_TYPE)) + include /usr/share/dbs/dpkg-arch.mk +endif +ARCH=$(shell dpkg --print-architecture) + +# get the items created here. +binarytarget=binary-devel binary-shared binary-runtime binary-tcl \ + binary-python binary-pic + +#target specific configurations come here: +LIBCDEV=libc-dev +GPMSUPPORT= + +ifeq ($(DEB_BUILD_GNU_SYSTEM),linux) +GPMSUPPORT= --with-gpm-support +LIBCDEV=libc6-dev +ifeq ($(DEB_BUILD_GNU_CPU),alpha) +LIBCDEV=libc6.1-dev +endif +ifeq ($(DEB_BUILD_GNU_CPU),ia64) +LIBCDEV=libc6.1-dev +endif +endif + +ifeq ($(DEB_BUILD_GNU_SYSTEM),gnu) +LIBCDEV=libc0.3-dev +endif + +ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) +NOSTRIP=--with-nostrip=no +else +NOSTRIP=--with-nostrip=yes +endif + +build-stamp=$(STAMP_DIR)/build-stamp +configure-stamp=$(STAMP_DIR)/configure-stamp + +$(configure-stamp): $(patched) + dh_testdir + cp newt.spec $(BUILD_TREE) + rm -f $(BUILD_TREE)/.depend + ( cd $(BUILD_TREE) && autoconf --force -i ) + ( cd $(BUILD_TREE) && ./configure $(GPMSUPPORT) $(NOSTRIP) ) + touch $@ + +build: $(build-stamp) +$(build-stamp): $(configure-stamp) + dh_testdir + ( cd $(BUILD_TREE) && sgmltools --backend html tutorial.sgml ) + $(MAKE) -C $(BUILD_TREE) + ( cd $(BUILD_TREE) && ar cqv libnewt_pic.a shared/*.o ) + # build POT file for translators + make -C $(BUILD_TREE)/po newt.pot + touch $@ + +clean: + dh_testdir + dh_testroot + dh_clean + rm -rf $(SOURCE_DIR) $(STAMP_DIR) + # rm -rf debian/substvars debian/*.bak debian/*~ *~ + +binary: binary-indep binary-arch + +binary-indep: + +binary-arch: $(LIB_PKG) $(DEV_PKG) $(PIC_PKG) $(TCL_PKG) $(PYTHON_PKG) $(WHIPTAIL_PKG) + +$(LIB_PKG): build + dh_testdir + dh_testroot + dh_installdirs -p $@ + dh_install -p $@ --sourcedir=$(BUILD_TREE) + chmod +x $(BUILD_TREE)/mkinstalldirs + $(MAKE) -C $(BUILD_TREE)/po prefix=/usr \ + DESTDIR=../../../debian/$@ HAVE_XGETTEXT=yes install + dh_strip -p $@ + dh_makeshlibs -p $@ + dh_shlibdeps -L $(LIB_PKG) -l debian/$@/usr/lib + dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec + dh_link -p $@ /usr/lib/libnewt.so.$(VERSION) /usr/lib/libnewt.so.$(SONAME) + rm debian/$@/usr/lib/libnewt.so + # Currently disabled, as debian-test has been removed. + # chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh + dh_installchangelogs -p $@ + dh_compress -p $@ + dh_installdeb -p $@ + dh_fixperms -p $@ + dh_gencontrol -p $@ + dh_md5sums -p $@ + dh_builddeb -p $@ + +$(PIC_PKG): build + dh_testdir + dh_testroot + dh_installdirs -p $@ + dh_install -p $@ --sourcedir=$(BUILD_TREE) + dh_strip -p $@ + dh_makeshlibs -p $@ + dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec + # Currently disabled, as debian-test has been removed. + # chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh + dh_installchangelogs -p $@ + dh_compress -p $@ + dh_shlibdeps -p $@ -ldebian/$@/usr/lib + dh_fixperms -p $@ + dh_installdeb -p $@ + dh_gencontrol -p $@ + dh_md5sums -p $@ + dh_builddeb -p $@ + +$(DEV_PKG): build + dh_testdir + dh_testroot + dh_installdirs -p $@ + dh_install -p $@ --sourcedir=$(BUILD_TREE) + dh_strip -p $@ + dh_makeshlibs -p $@ + dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec + dh_link -p $@ /usr/lib/libnewt.so.$(VERSION) /usr/lib/libnewt.so + dh_link -p $@ \ + /usr/share/doc/libnewt-dev/tutorial.html/t1.html \ + /usr/share/doc/libnewt-dev/tutorial.html/index.html + # Currently disabled, as debian-test has been removed. + # chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh + dh_installchangelogs -p $@ + dh_installexamples -p $@ + dh_compress -p $@ + dh_shlibdeps -p $@ -ldebian/$@/usr/lib + dh_fixperms -p $@ + dh_installdeb -p $@ + dh_gencontrol -p $@ + dh_md5sums -p $@ + dh_builddeb -p $@ + +$(TCL_PKG): build + dh_testdir + dh_testroot + dh_installdirs -p $@ + dh_install -p $@ --sourcedir=$(BUILD_TREE) + dh_strip -p $@ + dh_makeshlibs -p $@ + dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec + # Currently disabled, as debian-test has been removed. + # chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh + dh_installchangelogs -p $@ + dh_compress -p $@ + dh_shlibdeps -p $@ -ldebian/$@/usr/lib + dh_fixperms -p $@ + dh_installdeb -p $@ + dh_gencontrol -p $@ + dh_md5sums -p $@ + dh_builddeb -p $@ + +$(PYTHON_PKG): build + dh_testdir + dh_testroot + dh_installdirs -p $@ + dh_install -p $@ --sourcedir=$(BUILD_TREE) + dh_strip -p $@ + dh_makeshlibs -p $@ + dh_link -p $@ usr/lib/python2.4/site-packages/snack.py usr/lib/python2.3/site-packages/snack.py + dh_link -p $@ usr/lib/python2.4/site-packages/_snackmodule.so usr/lib/python2.3/site-packages/_snackmodule.so + dh_python -p $@ + dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec + # Currently disabled, as debian-test has been removed. + # chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh + dh_installchangelogs -p $@ + dh_installexamples -p $@ + dh_compress -p $@ + dh_shlibdeps -p $@ -ldebian/$@/usr/lib + dh_fixperms -p $@ + dh_installdeb -p $@ + dh_gencontrol -p $@ + dh_md5sums -p $@ + dh_builddeb -p $@ + +$(WHIPTAIL_PKG): build + dh_testdir + dh_testroot + dh_installdirs -p $@ + dh_install -p $@ --sourcedir=$(BUILD_TREE) + dh_strip -p $@ + dh_makeshlibs -V + dh_installdocs -p $@ -p $@ $(BUILD_TREE)/newt.spec debian/README.whiptail + dh_installman -p $@ $(BUILD_TREE)/whiptail.1 + # Currently disabled, as debian-test has been removed. + # chmod +x debian/whiptail/usr/lib/debian-test/tests/whiptail/test-newt.sh/test-newt.sh + dh_installchangelogs -p $@ + dh_compress -p $@ + dh_shlibdeps -p $@ -L $(LIB_PKG) -l debian/$(LIB_PKG)/usr/lib + dh_fixperms -p $@ + dh_installdeb -p $@ + dh_gencontrol -p $@ + dh_md5sums -p $@ + dh_builddeb -p $@ + +.PHONY: binary-arch clean source diff binary binary-indep --- newt-0.52.2.orig/debian/python-newt.dirs +++ newt-0.52.2/debian/python-newt.dirs @@ -0,0 +1,4 @@ +usr/lib/python2.3 +usr/lib/python2.3/site-packages +usr/lib/python2.4 +usr/lib/python2.4/site-packages --- newt-0.52.2.orig/debian/libnewt-dev.examples +++ newt-0.52.2/debian/libnewt-dev.examples @@ -0,0 +1,3 @@ +build-tree/newt-0.52.2/testtree.c +build-tree/newt-0.52.2/test.c +build-tree/newt-0.52.2/testgrid.c --- newt-0.52.2.orig/debian/newt-tcl.install +++ newt-0.52.2/debian/newt-tcl.install @@ -0,0 +1 @@ +whiptcl.so usr/lib/libwhiptcl.so --- newt-0.52.2.orig/debian/test-newt.sh +++ newt-0.52.2/debian/test-newt.sh @@ -0,0 +1,9 @@ +#!/bin/bash +# the following should work +set -x + +whiptail --msgbox 'hoge a You are a normal test' 10 20 +whiptail --msgbox 'hoge a You are a normal test' 10 20 +whiptail --msgbox ha 1 4 +whiptail --msgbox ha 1 5 + --- newt-0.52.2.orig/debian/README.whiptail +++ newt-0.52.2/debian/README.whiptail @@ -0,0 +1,14 @@ +whiptail(1) is a lightweight replacement for dialog(1), +to provide dialog boxes for shell scripts. It is built on the +newt windowing library rather than the ncurses library, allowing +it to be smaller in embedded enviroments such as installers, +rescue disks, etc. + +whiptail is designed to be drop-in compatible with dialog, but +has less features: some dialog boxes are not implemented, such +as tailbox, timebox, calendarbox, etc. + +Please see the whiptail(1) man page for details. + +Regards, +Alastair McKinstry, 2003-06-08. --- newt-0.52.2.orig/debian/copyright +++ newt-0.52.2/debian/copyright @@ -0,0 +1,12 @@ +This is the Debian version of the newt library. +newt was written by Erik Troan <ewt@redhat.com>. + +The original package was put together by Enrique Zanardi +<ezanard@debian.org>, from sources obtained from: + ftp://ftp.redhat.com/pub/redhat/redhat-7.0-en/os/i386/SRPMS/newt-0.50.17-1.src.rpm +Recent upstream versions can be found at: http://fedora.redhat.com/ + + +newt is available under the terms of the GNU Library General Public +License. On Debian GNU/Linux systems, the complete text of this +license can be found in `/usr/share/common-licenses/LGPL'. --- newt-0.52.2.orig/debian/python-newt.examples +++ newt-0.52.2/debian/python-newt.examples @@ -0,0 +1,2 @@ +build-tree/newt-0.52.2/peanuts.py +build-tree/newt-0.52.2/popcorn.py --- newt-0.52.2.orig/debian/README.Debian +++ newt-0.52.2/debian/README.Debian @@ -0,0 +1,15 @@ + +Note: this is an experimental version of Newt; for the moment, do not +build other packages in Debian against it, as the SONAME may change soon +(hopefully from 0.52 to 1). + +Please test it and report bugs. + + +Note that libnewt ships with some locale files. +These are not used by libnewt directly, but by whiptail, and its +derivatives newt-tcl and python-newt. It is simpler to include +them in the library, which is required by the other packages, than to create +a package exclusively for these small files. + +- Alastair McKinstry <mckinstry@debian.org> --- newt-0.52.2.orig/debian/old-patches/9998_bidi.patch +++ newt-0.52.2/debian/old-patches/9998_bidi.patch @@ -0,0 +1,5061 @@ +diff -ruN newt-0.52.1-old/button.c newt-0.52.1/button.c +--- newt-0.52.1-old/button.c 2005-09-09 07:02:45.559080000 +0100 ++++ newt-0.52.1/button.c 2005-09-09 07:02:46.414950776 +0100 +@@ -110,7 +110,7 @@ + SLsmg_set_color(NEWT_COLORSET_BUTTON); + newtGotorc(co->top+ pushed, co->left + 1 + pushed); + SLsmg_write_char('<'); +- SLsmg_write_string(bu->text); ++ write_string_int(bu->text, NULL); + SLsmg_write_char('>'); + } else { + if (pushed) { +@@ -140,7 +140,7 @@ + + newtGotorc(co->top + 1 + pushed, co->left + 1 + pushed); + SLsmg_write_char(' '); +- SLsmg_write_string(bu->text); ++ write_string_int(bu->text, NULL); + SLsmg_write_char(' '); + } + +diff -ruN newt-0.52.1-old/checkbox.c newt-0.52.1/checkbox.c +--- newt-0.52.1-old/checkbox.c 2005-09-09 07:02:45.953021000 +0100 ++++ newt-0.52.1/checkbox.c 2005-09-09 07:02:46.415950624 +0100 +@@ -187,7 +187,7 @@ + break; + } + +- SLsmg_write_string(cb->text); ++ write_string_int(cb->text, NULL); + + if (cb->hasFocus) + SLsmg_set_color(cb->active); +diff -ruN newt-0.52.1-old/checkboxtree.c newt-0.52.1/checkboxtree.c +--- newt-0.52.1-old/checkboxtree.c 2005-09-09 07:02:45.538084000 +0100 ++++ newt-0.52.1/checkboxtree.c 2005-09-09 07:02:46.415950624 +0100 +@@ -482,12 +482,13 @@ + } else { + char tmp[5]; + snprintf(tmp,5,"[%c] ",ct->seq[(*item)->selected]); ++ /* BIDI: no need to use _int funcs here: only ASCII characters */ + SLsmg_write_string(tmp); + } + } + +- SLsmg_write_nstring((*item)->text, co->width - 4 - +- (3 * (*item)->depth)); ++ write_nstring_int((*item)->text, co->width - 4 - ++ (3 * (*item)->depth), NULL); + + SLsmg_set_color(NEWT_COLORSET_LISTBOX); + +diff -ruN newt-0.52.1-old/config.h.in newt-0.52.1/config.h.in +--- newt-0.52.1-old/config.h.in 2005-09-09 07:02:45.762050000 +0100 ++++ newt-0.52.1/config.h.in 2005-09-09 07:02:46.415950624 +0100 +@@ -1,8 +1,14 @@ +-/* config.h.in. Generated automatically from configure.in by autoheader. */ ++/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ + + /* Define if you have the <alloca.h> header file. */ + #undef HAVE_ALLOCA_H + ++/* Define if you have the <dlfcn.h> header file. */ ++#undef HAVE_DLFCN_H ++ ++/* Define if you have the <fribidi/fribidi.h> header file. */ ++#undef HAVE_FRIBIDI_FRIBIDI_H ++ + /* Define if you have the <sys/select.h> header file. */ + #undef HAVE_SYS_SELECT_H + +diff -ruN newt-0.52.1-old/configure newt-0.52.1/configure +--- newt-0.52.1-old/configure 2003-08-19 21:32:07.000000000 +0100 ++++ newt-0.52.1/configure 2005-09-09 07:02:46.422949560 +0100 +@@ -1,310 +1,28 @@ + #! /bin/sh ++ + # Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.53. ++# Generated automatically using autoconf version 2.13 ++# Copyright (C) 1992, 93, 94, 95, 96 Free Software Foundation, Inc. + # +-# Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +-# Free Software Foundation, Inc. + # This configure script is free software; the Free Software Foundation + # gives unlimited permission to copy, distribute and modify it. + +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +- +-## --------------------- ## +-## M4sh Initialization. ## +-## --------------------- ## +- +-# Be Bourne compatible +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +- emulate sh +- NULLCMD=: +-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then +- set -o posix +-fi +- +-# NLS nuisances. +-# Support unset when possible. +-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +- as_unset=unset +-else +- as_unset=false +-fi +- +-(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && +- { $as_unset LANG || test "${LANG+set}" != set; } || +- { LANG=C; export LANG; } +-(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && +- { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || +- { LC_ALL=C; export LC_ALL; } +-(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && +- { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || +- { LC_TIME=C; export LC_TIME; } +-(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && +- { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || +- { LC_CTYPE=C; export LC_CTYPE; } +-(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && +- { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || +- { LANGUAGE=C; export LANGUAGE; } +-(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && +- { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || +- { LC_COLLATE=C; export LC_COLLATE; } +-(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && +- { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || +- { LC_NUMERIC=C; export LC_NUMERIC; } +-(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && +- { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || +- { LC_MESSAGES=C; export LC_MESSAGES; } +- +- +-# Name of the executable. +-as_me=`(basename "$0") 2>/dev/null || +-$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'` +- +-# PATH needs CR, and LINENO needs CR and PATH. +-# 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" >conftest.sh +- echo "exit 0" >>conftest.sh +- chmod +x conftest.sh +- if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then +- PATH_SEPARATOR=';' +- else +- PATH_SEPARATOR=: +- fi +- rm -f conftest.sh +-fi +- +- +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" || { +- # Find who we are. Look in the path if we contain no path at all +- # relative or not. +- 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 +- +- ;; +- 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_me: error: cannot find myself; rerun with an absolute path" >&2 +- { (exit 1); exit 1; }; } +- fi +- case $CONFIG_SHELL in +- '') +- 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=. +- for as_base in sh bash ksh sh5; do +- case $as_dir in +- /*) +- if ("$as_dir/$as_base" -c ' +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then +- CONFIG_SHELL=$as_dir/$as_base +- export CONFIG_SHELL +- exec "$CONFIG_SHELL" "$0" ${1+"$@"} +- fi;; +- esac +- done +-done +-;; +- esac +- +- # 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 before each line; the second 'sed' does the real +- # work. The second script uses 'N' to pair each line-number line +- # with the numbered line, 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 +- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) +- sed '=' <$as_myself | +- sed ' +- N +- s,$,-, +- : loop +- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, +- t loop +- s,-$,, +- s,^['$as_cr_digits']*\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 sensible to this). +- . ./$as_me.lineno +- # Exit status is that of the last command. +- exit +-} +- +- +-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in +- *c*,-n*) ECHO_N= ECHO_C=' +-' ECHO_T=' ' ;; +- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; +- *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +-esac +- +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-rm -f conf$$ conf$$.exe conf$$.file +-echo >conf$$.file +-if ln -s conf$$.file conf$$ 2>/dev/null; then +- # We could just check for DJGPP; but this test a) works b) is more generic +- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). +- if test -f conf$$.exe; then +- # Don't use ln at all; we don't have any links +- as_ln_s='cp -p' +- else +- as_ln_s='ln -s' +- fi +-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$$.file +- +-as_executable_p="test -f" +- +-# Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +- +- +-# IFS +-# We need space, tab and new line, in precisely that order. +-as_nl=' +-' +-IFS=" $as_nl" +- +-# CDPATH. +-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +- +- +-# 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` +- +-exec 6>&1 +- +-# +-# Initializations. +-# ++# Defaults: ++ac_help= + ac_default_prefix=/usr/local +-cross_compiling=no +-subdirs= +-MFLAGS= +-MAKEFLAGS= +-SHELL=${CONFIG_SHELL-/bin/sh} +- +-# Maximum number of lines to put in a shell here document. +-# This variable seems obsolete. It should probably be removed, and +-# only ac_max_sed_lines should be used. +-: ${ac_max_here_lines=38} +- +-# Identity of this package. +-PACKAGE_NAME= +-PACKAGE_TARNAME= +-PACKAGE_VERSION= +-PACKAGE_STRING= +-PACKAGE_BUGREPORT= +- +-ac_unique_file="newt_pr.h" +-# Factoring default headers for most tests. +-ac_includes_default="\ +-#include <stdio.h> +-#if HAVE_SYS_TYPES_H +-# include <sys/types.h> +-#endif +-#if HAVE_SYS_STAT_H +-# include <sys/stat.h> +-#endif +-#if STDC_HEADERS +-# include <stdlib.h> +-# include <stddef.h> +-#else +-# if HAVE_STDLIB_H +-# include <stdlib.h> +-# endif +-#endif +-#if HAVE_STRING_H +-# if !STDC_HEADERS && HAVE_MEMORY_H +-# include <memory.h> +-# endif +-# include <string.h> +-#endif +-#if HAVE_STRINGS_H +-# include <strings.h> +-#endif +-#if HAVE_INTTYPES_H +-# include <inttypes.h> +-#else +-# if HAVE_STDINT_H +-# include <stdint.h> +-# endif +-#endif +-#if HAVE_UNISTD_H +-# include <unistd.h> +-#endif" +- ++# Any additions from configure.in: ++ac_help="$ac_help ++ --with-gpm-support Compile with GPM support" + + # 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 ++build=NONE ++cache_file=./config.cache + exec_prefix=NONE ++host=NONE + no_create= ++nonopt=NONE + no_recursion= + prefix=NONE + program_prefix=NONE +@@ -313,15 +31,10 @@ + silent= + site= + srcdir= ++target=NONE + 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. + bindir='${exec_prefix}/bin' + sbindir='${exec_prefix}/sbin' + libexecdir='${exec_prefix}/libexec' +@@ -335,9 +48,17 @@ + infodir='${prefix}/info' + mandir='${prefix}/man' + ++# Initialize some other variables. ++subdirs= ++MFLAGS= MAKEFLAGS= ++SHELL=${CONFIG_SHELL-/bin/sh} ++# Maximum number of lines to put in a shell here document. ++ac_max_here_lines=12 ++ + ac_prev= + for ac_option + do ++ + # If the previous option needs an argument, assign it. + if test -n "$ac_prev"; then + eval "$ac_prev=\$ac_option" +@@ -345,59 +66,59 @@ + continue + fi + +- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` ++ case "$ac_option" in ++ -*=*) ac_optarg=`echo "$ac_option" | sed 's/[-_a-zA-Z0-9]*=//'` ;; ++ *) ac_optarg= ;; ++ esac + + # Accept the important Cygnus configure options, so we can diagnose typos. + +- case $ac_option in ++ case "$ac_option" in + + -bindir | --bindir | --bindi | --bind | --bin | --bi) + ac_prev=bindir ;; + -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) +- bindir=$ac_optarg ;; ++ bindir="$ac_optarg" ;; + + -build | --build | --buil | --bui | --bu) +- ac_prev=build_alias ;; ++ ac_prev=build ;; + -build=* | --build=* | --buil=* | --bui=* | --bu=*) +- build_alias=$ac_optarg ;; ++ build="$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 ;; ++ cache_file="$ac_optarg" ;; + + -datadir | --datadir | --datadi | --datad | --data | --dat | --da) + ac_prev=datadir ;; + -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ + | --da=*) +- datadir=$ac_optarg ;; ++ datadir="$ac_optarg" ;; + + -disable-* | --disable-*) +- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` ++ ac_feature=`echo $ac_option|sed -e 's/-*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" ;; ++ if test -n "`echo $ac_feature| sed 's/[-a-zA-Z0-9_]//g'`"; then ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ++ fi ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'` ++ eval "enable_${ac_feature}=no" ;; + + -enable-* | --enable-*) +- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` ++ ac_feature=`echo $ac_option|sed -e 's/-*enable-//' -e 's/=.*//'` + # 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'` +- case $ac_option in +- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; ++ if test -n "`echo $ac_feature| sed 's/[-_a-zA-Z0-9]//g'`"; then ++ { echo "configure: error: $ac_feature: invalid feature name" 1>&2; exit 1; } ++ fi ++ ac_feature=`echo $ac_feature| sed 's/-/_/g'` ++ case "$ac_option" in ++ *=*) ;; + *) ac_optarg=yes ;; + esac +- eval "enable_$ac_feature='$ac_optarg'" ;; ++ eval "enable_${ac_feature}='$ac_optarg'" ;; + + -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ + | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ +@@ -406,47 +127,95 @@ + -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ + | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ + | --exec=* | --exe=* | --ex=*) +- exec_prefix=$ac_optarg ;; ++ 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 ;; ++ -help | --help | --hel | --he) ++ # 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 << EOF ++Usage: configure [options] [host] ++Options: [defaults in brackets after descriptions] ++Configuration: ++ --cache-file=FILE cache test results in FILE ++ --help print this message ++ --no-create do not create output files ++ --quiet, --silent do not print \`checking...' messages ++ --version print the version of autoconf that created configure ++Directory and file names: ++ --prefix=PREFIX install architecture-independent files in PREFIX ++ [$ac_default_prefix] ++ --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX ++ [same as prefix] ++ --bindir=DIR user executables in DIR [EPREFIX/bin] ++ --sbindir=DIR system admin executables in DIR [EPREFIX/sbin] ++ --libexecdir=DIR program executables in DIR [EPREFIX/libexec] ++ --datadir=DIR read-only architecture-independent data in DIR ++ [PREFIX/share] ++ --sysconfdir=DIR read-only single-machine data in DIR [PREFIX/etc] ++ --sharedstatedir=DIR modifiable architecture-independent data in DIR ++ [PREFIX/com] ++ --localstatedir=DIR modifiable single-machine data in DIR [PREFIX/var] ++ --libdir=DIR object code libraries in DIR [EPREFIX/lib] ++ --includedir=DIR C header files in DIR [PREFIX/include] ++ --oldincludedir=DIR C header files for non-gcc in DIR [/usr/include] ++ --infodir=DIR info documentation in DIR [PREFIX/info] ++ --mandir=DIR man documentation in DIR [PREFIX/man] ++ --srcdir=DIR find the sources in DIR [configure dir or ..] ++ --program-prefix=PREFIX prepend PREFIX to installed program names ++ --program-suffix=SUFFIX append SUFFIX to installed program names ++ --program-transform-name=PROGRAM ++ run sed PROGRAM on installed program names ++EOF ++ cat << EOF ++Host type: ++ --build=BUILD configure for building on BUILD [BUILD=HOST] ++ --host=HOST configure for HOST [guessed] ++ --target=TARGET configure for TARGET [TARGET=HOST] ++Features and packages: ++ --disable-FEATURE do not include FEATURE (same as --enable-FEATURE=no) ++ --enable-FEATURE[=ARG] include FEATURE [ARG=yes] ++ --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] ++ --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) ++ --x-includes=DIR X include files are in DIR ++ --x-libraries=DIR X library files are in DIR ++EOF ++ if test -n "$ac_help"; then ++ echo "--enable and --with options recognized:$ac_help" ++ fi ++ exit 0 ;; + + -host | --host | --hos | --ho) +- ac_prev=host_alias ;; ++ ac_prev=host ;; + -host=* | --host=* | --hos=* | --ho=*) +- host_alias=$ac_optarg ;; ++ host="$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 ;; ++ includedir="$ac_optarg" ;; + + -infodir | --infodir | --infodi | --infod | --info | --inf) + ac_prev=infodir ;; + -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) +- infodir=$ac_optarg ;; ++ infodir="$ac_optarg" ;; + + -libdir | --libdir | --libdi | --libd) + ac_prev=libdir ;; + -libdir=* | --libdir=* | --libdi=* | --libd=*) +- libdir=$ac_optarg ;; ++ 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 ;; ++ libexecdir="$ac_optarg" ;; + + -localstatedir | --localstatedir | --localstatedi | --localstated \ + | --localstate | --localstat | --localsta | --localst \ +@@ -455,19 +224,19 @@ + -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ + | --localstate=* | --localstat=* | --localsta=* | --localst=* \ + | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) +- localstatedir=$ac_optarg ;; ++ localstatedir="$ac_optarg" ;; + + -mandir | --mandir | --mandi | --mand | --man | --ma | --m) + ac_prev=mandir ;; + -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) +- mandir=$ac_optarg ;; ++ 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-cr | --no-c) + no_create=yes ;; + + -no-recursion | --no-recursion | --no-recursio | --no-recursi \ +@@ -481,26 +250,26 @@ + -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ + | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ + | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) +- oldincludedir=$ac_optarg ;; ++ oldincludedir="$ac_optarg" ;; + + -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) + ac_prev=prefix ;; + -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) +- prefix=$ac_optarg ;; ++ 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_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_suffix="$ac_optarg" ;; + + -program-transform-name | --program-transform-name \ + | --program-transform-nam | --program-transform-na \ +@@ -517,7 +286,7 @@ + | --program-transfo=* | --program-transf=* \ + | --program-trans=* | --program-tran=* \ + | --progr-tra=* | --program-tr=* | --program-t=*) +- program_transform_name=$ac_optarg ;; ++ program_transform_name="$ac_optarg" ;; + + -q | -quiet | --quiet | --quie | --qui | --qu | --q \ + | -silent | --silent | --silen | --sile | --sil) +@@ -527,7 +296,7 @@ + ac_prev=sbindir ;; + -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ + | --sbi=* | --sb=*) +- sbindir=$ac_optarg ;; ++ sbindir="$ac_optarg" ;; + + -sharedstatedir | --sharedstatedir | --sharedstatedi \ + | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ +@@ -538,57 +307,58 @@ + | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ + | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ + | --sha=* | --sh=*) +- sharedstatedir=$ac_optarg ;; ++ sharedstatedir="$ac_optarg" ;; + + -site | --site | --sit) + ac_prev=site ;; + -site=* | --site=* | --sit=*) +- site=$ac_optarg ;; ++ site="$ac_optarg" ;; + + -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) + ac_prev=srcdir ;; + -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) +- srcdir=$ac_optarg ;; ++ 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 ;; ++ sysconfdir="$ac_optarg" ;; + + -target | --target | --targe | --targ | --tar | --ta | --t) +- ac_prev=target_alias ;; ++ ac_prev=target ;; + -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) +- target_alias=$ac_optarg ;; ++ target="$ac_optarg" ;; + + -v | -verbose | --verbose | --verbos | --verbo | --verb) + verbose=yes ;; + +- -version | --version | --versio | --versi | --vers | -V) +- ac_init_version=: ;; ++ -version | --version | --versio | --versi | --vers) ++ echo "configure generated by autoconf version 2.13" ++ exit 0 ;; + + -with-* | --with-*) +- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` ++ ac_package=`echo $ac_option|sed -e 's/-*with-//' -e 's/=.*//'` + # 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; }; } ++ if test -n "`echo $ac_package| sed 's/[-_a-zA-Z0-9]//g'`"; then ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ++ fi + ac_package=`echo $ac_package| sed 's/-/_/g'` +- case $ac_option in +- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; ++ case "$ac_option" in ++ *=*) ;; + *) ac_optarg=yes ;; + esac +- eval "with_$ac_package='$ac_optarg'" ;; ++ eval "with_${ac_package}='$ac_optarg'" ;; + + -without-* | --without-*) +- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` ++ ac_package=`echo $ac_option|sed -e 's/-*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" ;; ++ if test -n "`echo $ac_package| sed 's/[-a-zA-Z0-9_]//g'`"; then ++ { echo "configure: error: $ac_package: invalid package name" 1>&2; exit 1; } ++ fi ++ ac_package=`echo $ac_package| sed 's/-/_/g'` ++ eval "with_${ac_package}=no" ;; + + --x) + # Obsolete; use --with-x. +@@ -599,110 +369,99 @@ + 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_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 ;; ++ x_libraries="$ac_optarg" ;; + +- -*) { echo "$as_me: error: unrecognized option: $ac_option +-Try \`$0 --help' for more information." >&2 +- { (exit 1); exit 1; }; } ++ -*) { echo "configure: error: $ac_option: invalid option; use --help to show usage" 1>&2; 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; }; } +- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` +- 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} ++ if test -n "`echo $ac_option| sed 's/[-a-z0-9.]//g'`"; then ++ echo "configure: warning: $ac_option: invalid host type" 1>&2 ++ fi ++ if test "x$nonopt" != xNONE; then ++ { echo "configure: error: can only configure for one host and one target at a time" 1>&2; exit 1; } ++ fi ++ nonopt="$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; }; } ++ { echo "configure: error: missing argument to --`echo $ac_prev | sed 's/_/-/g'`" 1>&2; exit 1; } + fi + +-# Be sure to have absolute paths. +-for ac_var in exec_prefix prefix +-do +- eval ac_val=$`echo $ac_var` +- case $ac_val in +- [\\/$]* | ?:[\\/]* | NONE | '' ) ;; +- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 +- { (exit 1); exit 1; }; };; +- esac +-done ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ++ ++# File descriptor usage: ++# 0 standard input ++# 1 file creation ++# 2 errors and warnings ++# 3 some systems may open it to /dev/tty ++# 4 used on the Kubota Titan ++# 6 checking for... messages and results ++# 5 compiler messages saved in config.log ++if test "$silent" = yes; then ++ exec 6>/dev/null ++else ++ exec 6>&1 ++fi ++exec 5>./config.log ++ ++echo "\ ++This file contains any messages produced by compilers while ++running configure, to aid debugging if configure makes a mistake. ++" 1>&5 + +-# Be sure to have absolute paths. +-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ +- localstatedir libdir includedir oldincludedir infodir mandir ++# Strip out --no-create and --no-recursion so they do not pile up. ++# Also quote any args containing shell metacharacters. ++ac_configure_args= ++for ac_arg + do +- eval ac_val=$`echo $ac_var` +- case $ac_val in +- [\\/$]* | ?:[\\/]* ) ;; +- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 +- { (exit 1); exit 1; }; };; ++ case "$ac_arg" in ++ -no-create | --no-create | --no-creat | --no-crea | --no-cre \ ++ | --no-cr | --no-c) ;; ++ -no-recursion | --no-recursion | --no-recursio | --no-recursi \ ++ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) ;; ++ *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?]*) ++ ac_configure_args="$ac_configure_args '$ac_arg'" ;; ++ *) ac_configure_args="$ac_configure_args $ac_arg" ;; + esac + 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- ++# NLS nuisances. ++# Only set these to C if already set. These must not be set unconditionally ++# because not all systems understand e.g. LANG=C (notably SCO). ++# Fixing LC_MESSAGES prevents Solaris sh from translating var values in `set'! ++# Non-C LC_CTYPE values break the ctype check. ++if test "${LANG+set}" = set; then LANG=C; export LANG; fi ++if test "${LC_ALL+set}" = set; then LC_ALL=C; export LC_ALL; fi ++if test "${LC_MESSAGES+set}" = set; then LC_MESSAGES=C; export LC_MESSAGES; fi ++if test "${LC_CTYPE+set}" = set; then LC_CTYPE=C; export LC_CTYPE; fi + +-test "$silent" = yes && exec 6>/dev/null ++# confdefs.h avoids OS command line length limits that DEFS can exceed. ++rm -rf conftest* confdefs.h ++# AIX cpp loses on an empty file, so make sure it contains at least a newline. ++echo > confdefs.h + ++# A filename unique to this package, relative to the directory that ++# configure is in, which we can look for to find out if srcdir is correct. ++ac_unique_file=newt_pr.h + + # 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 its parent. +- ac_confdir=`(dirname "$0") 2>/dev/null || +-$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'` ++ ac_prog=$0 ++ ac_confdir=`echo $ac_prog|sed 's%/[^/][^/]*$%%'` ++ test "x$ac_confdir" = "x$ac_prog" && ac_confdir=. + srcdir=$ac_confdir + if test ! -r $srcdir/$ac_unique_file; then + srcdir=.. +@@ -712,367 +471,13 @@ + fi + if test ! -r $srcdir/$ac_unique_file; then + if test "$ac_srcdir_defaulted" = yes; then +- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +- { (exit 1); exit 1; }; } ++ { echo "configure: error: can not find sources in $ac_confdir or .." 1>&2; exit 1; } + else +- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +- { (exit 1); exit 1; }; } ++ { echo "configure: error: can not find sources in $srcdir" 1>&2; exit 1; } + fi + fi +-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +-ac_env_build_alias_set=${build_alias+set} +-ac_env_build_alias_value=$build_alias +-ac_cv_env_build_alias_set=${build_alias+set} +-ac_cv_env_build_alias_value=$build_alias +-ac_env_host_alias_set=${host_alias+set} +-ac_env_host_alias_value=$host_alias +-ac_cv_env_host_alias_set=${host_alias+set} +-ac_cv_env_host_alias_value=$host_alias +-ac_env_target_alias_set=${target_alias+set} +-ac_env_target_alias_value=$target_alias +-ac_cv_env_target_alias_set=${target_alias+set} +-ac_cv_env_target_alias_value=$target_alias +-ac_env_CC_set=${CC+set} +-ac_env_CC_value=$CC +-ac_cv_env_CC_set=${CC+set} +-ac_cv_env_CC_value=$CC +-ac_env_CFLAGS_set=${CFLAGS+set} +-ac_env_CFLAGS_value=$CFLAGS +-ac_cv_env_CFLAGS_set=${CFLAGS+set} +-ac_cv_env_CFLAGS_value=$CFLAGS +-ac_env_LDFLAGS_set=${LDFLAGS+set} +-ac_env_LDFLAGS_value=$LDFLAGS +-ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +-ac_cv_env_LDFLAGS_value=$LDFLAGS +-ac_env_CPPFLAGS_set=${CPPFLAGS+set} +-ac_env_CPPFLAGS_value=$CPPFLAGS +-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +-ac_cv_env_CPPFLAGS_value=$CPPFLAGS +-ac_env_CPP_set=${CPP+set} +-ac_env_CPP_value=$CPP +-ac_cv_env_CPP_set=${CPP+set} +-ac_cv_env_CPP_value=$CPP +- +-# +-# 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 this package 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 \`..'] +- +-_ACEOF +- +- cat <<_ACEOF +-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] +- --datadir=DIR read-only architecture-independent data [PREFIX/share] +- --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] +- --infodir=DIR info documentation [PREFIX/info] +- --mandir=DIR man documentation [PREFIX/man] +-_ACEOF +- +- cat <<\_ACEOF +-_ACEOF +-fi +- +-if test -n "$ac_init_help"; then +- +- cat <<\_ACEOF +- +-Optional Packages: +- --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] +- --without-PACKAGE do not use PACKAGE (same as --with-PACKAGE=no) +- --with-gpm-support Compile with GPM support +- +-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> +- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have +- headers in a nonstandard directory <include dir> +- CPP C preprocessor +- +-Use these variables to override the choices made by `configure' or to help +-it to find libraries and programs with nonstandard names/locations. +- +-_ACEOF +-fi +- +-if test "$ac_init_help" = "recursive"; then +- # If there are subdirs, report their specific --help. +- ac_popdir=`pwd` +- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue +- test -d $ac_dir || continue +- ac_builddir=. +- +-if test "$ac_dir" != .; then +- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` +- # A "../" for each directory in $ac_dir_suffix. +- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +-else +- ac_dir_suffix= ac_top_builddir= +-fi +- +-case $srcdir in +- .) # No --srcdir option. We are building in place. +- ac_srcdir=. +- if test -z "$ac_top_builddir"; then +- ac_top_srcdir=. +- else +- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` +- fi ;; +- [\\/]* | ?:[\\/]* ) # Absolute path. +- ac_srcdir=$srcdir$ac_dir_suffix; +- ac_top_srcdir=$srcdir ;; +- *) # Relative path. +- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix +- ac_top_srcdir=$ac_top_builddir$srcdir ;; +-esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +- +- cd $ac_dir +- # Check for guested configure; otherwise get Cygnus style 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 +- elif test -f $ac_srcdir/configure.ac || +- test -f $ac_srcdir/configure.in; then +- echo +- $ac_configure --help +- else +- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 +- fi +- cd $ac_popdir +- done +-fi +- +-test -n "$ac_init_help" && exit 0 +-if $ac_init_version; then +- cat <<\_ACEOF +- +-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001, 2002 +-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 0 +-fi +-exec 5>config.log +-cat >&5 <<_ACEOF +-This file contains any messages produced by compilers while +-running configure, to aid debugging if configure makes a mistake. +- +-It was created by $as_me, which was +-generated by GNU Autoconf 2.53. Invocation command line was ++srcdir=`echo "${srcdir}" | sed 's%\([^/]\)/*$%\1%'` + +- $ $0 $@ +- +-_ACEOF +-{ +-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` +-hostinfo = `(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 +- +-} >&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. +-# Also quote any args containing shell meta-characters. +-ac_configure_args= +-ac_sep= +-for ac_arg +-do +- case $ac_arg in +- -no-create | --no-create | --no-creat | --no-crea | --no-cre \ +- | --no-cr | --no-c | -n ) continue ;; +- -no-recursion | --no-recursion | --no-recursio | --no-recursi \ +- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) +- continue ;; +- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) +- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; +- esac +- case " $ac_configure_args " in +- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. +- *) ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" +- ac_sep=" " ;; +- esac +- # Get rid of the leading space. +-done +- +-# 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: Be sure not to use single quotes in there, as some shells, +-# such as our DU 5.0 friend, will then `close' the trap. +-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, +-{ +- (set) 2>&1 | +- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in +- *ac_space=\ *) +- sed -n \ +- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; +- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" +- ;; +- *) +- sed -n \ +- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" +- ;; +- esac; +-} +- echo +- if test -s confdefs.h; then +- cat <<\_ASBOX +-## ----------- ## +-## confdefs.h. ## +-## ----------- ## +-_ASBOX +- echo +- sed "/^$/d" 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 && +- rm -rf 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 -rf conftest* confdefs.h +-# AIX cpp loses on an empty file, so make sure it contains at least a newline. +-echo >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 -z "$CONFIG_SITE"; then + if test "x$prefix" != xNONE; then +@@ -1083,733 +488,257 @@ + fi + for ac_site_file in $CONFIG_SITE; 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 ++ echo "loading site script $ac_site_file" + . "$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 ++ echo "loading cache $cache_file" ++ . $cache_file + 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 `(set) 2>&1 | +- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; 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; }; } ++ echo "creating cache $cache_file" ++ > $cache_file + fi + + ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. + 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_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross + ++ac_exeext= ++ac_objext=o ++if (echo "testing\c"; echo 1,2,3) | grep c >/dev/null; then ++ # Stardent Vistra SVR4 grep lacks -e, says ghazi@caip.rutgers.edu. ++ if (echo -n testing; echo 1,2,3) | sed s/-n/xn/ | grep xn >/dev/null; then ++ ac_n= ac_c=' ++' ac_t=' ' ++ else ++ ac_n=-n ac_c= ac_t= ++ fi ++else ++ ac_n= ac_c='\c' ac_t= ++fi + + +-ac_config_headers="$ac_config_headers config.h" + + ++PACKAGE=newt + VERSION=$(awk '/^%define version/ {print $3}' $srcdir/newt.spec) + SONAME=0.51 + + +-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 ++ ++# Extract the first word of "gcc", so it can be a program name with args. ++set dummy gcc; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:538: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&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 $as_executable_p "$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="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CC="gcc" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" + fi + fi +-CC=$ac_cv_prog_CC ++CC="$ac_cv_prog_CC" + if test -n "$CC"; then +- echo "$as_me:$LINENO: result: $CC" >&5 +-echo "${ECHO_T}$CC" >&6 ++ echo "$ac_t""$CC" 1>&6 + else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 ++ echo "$ac_t""no" 1>&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 ++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 $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:568: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- if test -n "$ac_ct_CC"; then +- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. ++ 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 $as_executable_p "$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 ++ IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_prog_rejected=no ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ++ ac_prog_rejected=yes ++ continue ++ fi ++ ac_cv_prog_CC="cc" ++ break ++ fi ++ done ++ IFS="$ac_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 $# -gt 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 ++ set dummy "$ac_dir/$ac_word" "$@" ++ shift ++ ac_cv_prog_CC="$@" + fi +-done +-done +- + 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 +- +- CC=$ac_ct_CC ++CC="$ac_cv_prog_CC" ++if test -n "$CC"; then ++ echo "$ac_t""$CC" 1>&6 + else +- CC="$ac_cv_prog_CC" ++ echo "$ac_t""no" 1>&6 + 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 ++ if test -z "$CC"; then ++ case "`uname -s`" in ++ *win32* | *WIN32*) ++ # Extract the first word of "cl", so it can be a program name with args. ++set dummy cl; ac_word=$2 ++echo $ac_n "checking for $ac_word""... $ac_c" 1>&6 ++echo "configure:619: checking for $ac_word" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_CC'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&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 $as_executable_p "$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="${IFS= }"; ac_save_ifs="$IFS"; IFS=":" ++ ac_dummy="$PATH" ++ for ac_dir in $ac_dummy; do ++ test -z "$ac_dir" && ac_dir=. ++ if test -f $ac_dir/$ac_word; then ++ ac_cv_prog_CC="cl" ++ break ++ fi ++ done ++ IFS="$ac_save_ifs" + fi + fi +-CC=$ac_cv_prog_CC ++CC="$ac_cv_prog_CC" + if test -n "$CC"; then +- echo "$as_me:$LINENO: result: $CC" >&5 +-echo "${ECHO_T}$CC" >&6 ++ echo "$ac_t""$CC" 1>&6 + else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- ++ echo "$ac_t""no" 1>&6 + fi +-if test -z "$ac_cv_prog_CC"; then +- ac_ct_CC=$CC +- # Extract the first word of "cc", so it can be a program name with args. +-set dummy cc; ac_word=$2 +-echo "$as_me:$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 $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_ac_ct_CC="cc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 ++ ;; ++ esac + fi +-done +-done +- +-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 +- +- CC=$ac_ct_CC +-else +- CC="$ac_cv_prog_CC" ++ test -z "$CC" && { echo "configure: error: no acceptable cc found in \$PATH" 1>&2; exit 1; } + 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 $as_executable_p "$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 ++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works""... $ac_c" 1>&6 ++echo "configure:651: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) works" >&5 + +-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 +- set dummy "$as_dir/$ac_word" ${1+"$@"} +- shift +- ac_cv_prog_CC="$@" +- 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 ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross + +-fi +-if test -z "$CC"; then +- if test -n "$ac_tool_prefix"; then +- for ac_prog in cl +- 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 $as_executable_p "$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 ++cat > conftest.$ac_ext << EOF + +-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 ++#line 662 "configure" ++#include "confdefs.h" + +- test -n "$CC" && break +- done +-fi +-if test -z "$CC"; then +- ac_ct_CC=$CC +- for ac_prog in cl +-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 $as_executable_p "$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 ++main(){return(0);} ++EOF ++if { (eval echo configure:667: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then ++ ac_cv_prog_cc_works=yes ++ # If we can't run a trivial program, we are probably using a cross compiler. ++ if (./conftest; exit) 2>/dev/null; then ++ ac_cv_prog_cc_cross=no ++ else ++ ac_cv_prog_cc_cross=yes + fi +-done +-done +- +-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 +- +- CC=$ac_ct_CC +-fi +- ++ echo "configure: failed program was:" >&5 ++ cat conftest.$ac_ext >&5 ++ ac_cv_prog_cc_works=no + fi +- +- +-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH" >&5 +-echo "$as_me: error: no acceptable C compiler found in \$PATH" >&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` +-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 +- (eval $ac_compiler --version </dev/null >&5) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 +- (eval $ac_compiler -v </dev/null >&5) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 +- (eval $ac_compiler -V </dev/null >&5) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +- +-cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +- +-#ifdef F77_DUMMY_MAIN +-# ifdef __cplusplus +- extern "C" +-# endif +- int F77_DUMMY_MAIN() { return 1; } ++rm -fr conftest* ++ac_ext=c ++# CFLAGS is not in ac_cpp because -g, -O, etc. are not valid cpp options. ++ac_cpp='$CPP $CPPFLAGS' ++ac_compile='${CC-cc} -c $CFLAGS $CPPFLAGS conftest.$ac_ext 1>&5' ++ac_link='${CC-cc} -o conftest${ac_exeext} $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS 1>&5' ++cross_compiling=$ac_cv_prog_cc_cross ++ ++echo "$ac_t""$ac_cv_prog_cc_works" 1>&6 ++if test $ac_cv_prog_cc_works = no; then ++ { echo "configure: error: installation or configuration problem: C compiler cannot create executables." 1>&2; exit 1; } ++fi ++echo $ac_n "checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler""... $ac_c" 1>&6 ++echo "configure:693: checking whether the C compiler ($CC $CFLAGS $LDFLAGS) is a cross-compiler" >&5 ++echo "$ac_t""$ac_cv_prog_cc_cross" 1>&6 ++cross_compiling=$ac_cv_prog_cc_cross ++ ++echo $ac_n "checking whether we are using GNU C""... $ac_c" 1>&6 ++echo "configure:698: checking whether we are using GNU C" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_gcc'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ cat > conftest.c <<EOF ++#ifdef __GNUC__ ++ yes; + #endif +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-ac_clean_files_save=$ac_clean_files +-ac_clean_files="$ac_clean_files a.out a.exe" +-# Try to create an executable without -o first, disregard a.out. +-# It will help us diagnose broken compilers, and finding out an intuition +-# of exeext. +-echo "$as_me:$LINENO: checking for C compiler default output" >&5 +-echo $ECHO_N "checking for C compiler default output... $ECHO_C" >&6 +-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 +- (eval $ac_link_default) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then +- # Find the output, starting from the most likely. This scheme is +-# not robust to junk in `.', hence go to wildcards (a.*) only as a last +-# resort. +- +-# Be careful to initialize this variable, since it used to be cached. +-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +-ac_cv_exeext= +-for ac_file in `ls a_out.exe a.exe conftest.exe 2>/dev/null; +- ls a.out conftest 2>/dev/null; +- ls a.* conftest.* 2>/dev/null`; do +- case $ac_file in +- *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb | *.xSYM ) ;; +- a.out ) # We found the default executable, but exeext='' is most +- # certainly right. +- break;; +- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +- # FIXME: I believe we export ac_cv_exeext for Libtool --akim. +- export ac_cv_exeext +- break;; +- * ) break;; +- esac +-done ++EOF ++if { ac_try='${CC-cc} -E conftest.c'; { (eval echo configure:707: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }; } | egrep yes >/dev/null 2>&1; then ++ ac_cv_prog_gcc=yes + else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables" >&5 +-echo "$as_me: error: C compiler cannot create executables" >&2;} +- { (exit 77); exit 77; }; } +-fi +- +-ac_exeext=$ac_cv_exeext +-echo "$as_me:$LINENO: result: $ac_file" >&5 +-echo "${ECHO_T}$ac_file" >&6 +- +-# Check the compiler produces executables we can run. If not, either +-# the compiler is broken, or we cross compile. +-echo "$as_me:$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' +- { (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 +- 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'." >&5 +-echo "$as_me: error: cannot run C compiled programs. +-If you meant to cross compile, use \`--host'." >&2;} +- { (exit 1); exit 1; }; } +- fi +- fi ++ ac_cv_prog_gcc=no ++fi + fi +-echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6 + +-rm -f a.out a.exe conftest$ac_cv_exeext +-ac_clean_files=$ac_clean_files_save +-# Check the compiler produces executables we can run. If not, either +-# the compiler is broken, or we cross compile. +-echo "$as_me:$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 { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&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 `(ls conftest.exe; ls conftest; ls conftest.*) 2>/dev/null`; do +- case $ac_file in +- *.$ac_ext | *.o | *.obj | *.xcoff | *.tds | *.d | *.pdb ) ;; +- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +- export ac_cv_exeext +- break;; +- * ) break;; +- esac +-done +-else +- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link" >&5 +-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link" >&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 +-#line $LINENO "configure" +-#include "confdefs.h" ++echo "$ac_t""$ac_cv_prog_gcc" 1>&6 + +-#ifdef F77_DUMMY_MAIN +-# ifdef __cplusplus +- extern "C" +-# endif +- int F77_DUMMY_MAIN() { return 1; } +-#endif +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.o conftest.obj +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then +- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do +- case $ac_file in +- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb ) ;; +- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` +- break;; +- esac +-done +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile" >&5 +-echo "$as_me: error: cannot compute suffix of object files: cannot compile" >&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 ++if test $ac_cv_prog_gcc = yes; then ++ GCC=yes + else +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +- +-#ifdef F77_DUMMY_MAIN +-# ifdef __cplusplus +- extern "C" +-# endif +- int F77_DUMMY_MAIN() { return 1; } +-#endif +-int +-main () +-{ +-#ifndef __GNUC__ +- choke me +-#endif ++ GCC= ++fi + +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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_compiler_gnu=yes +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-ac_compiler_gnu=no +-fi +-rm -f 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 +-CFLAGS="-g" +-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 ++ac_test_CFLAGS="${CFLAGS+set}" ++ac_save_CFLAGS="$CFLAGS" ++CFLAGS= ++echo $ac_n "checking whether ${CC-cc} accepts -g""... $ac_c" 1>&6 ++echo "configure:726: checking whether ${CC-cc} accepts -g" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_cc_g'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +- +-#ifdef F77_DUMMY_MAIN +-# ifdef __cplusplus +- extern "C" +-# endif +- int F77_DUMMY_MAIN() { return 1; } +-#endif +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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 ++ echo 'void f(){}' > conftest.c ++if test -z "`${CC-cc} -g -c conftest.c 2>&1`"; then + ac_cv_prog_cc_g=yes + else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-ac_cv_prog_cc_g=no ++ ac_cv_prog_cc_g=no + fi +-rm -f conftest.$ac_objext conftest.$ac_ext ++rm -f conftest* ++ + fi +-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 ++ ++echo "$ac_t""$ac_cv_prog_cc_g" 1>&6 + if test "$ac_test_CFLAGS" = set; then +- CFLAGS=$ac_save_CFLAGS ++ CFLAGS="$ac_save_CFLAGS" + elif test $ac_cv_prog_cc_g = yes; then + if test "$GCC" = yes; then + CFLAGS="-g -O2" +@@ -1823,128 +752,6 @@ + CFLAGS= + fi + fi +-# Some people use a C++ compiler to compile C. Since we use `exit', +-# in C++ we need to declare it. In case someone uses the same compiler +-# for both compiling C and C++ we need to have the C++ compiler decide +-# the declaration of exit, since it's the most demanding environment. +-cat >conftest.$ac_ext <<_ACEOF +-#ifndef __cplusplus +- choke me +-#endif +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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 +- for ac_declaration in \ +- ''\ +- '#include <stdlib.h>' \ +- 'extern "C" void std::exit (int) throw (); using std::exit;' \ +- 'extern "C" void std::exit (int); using std::exit;' \ +- 'extern "C" void exit (int) throw ();' \ +- 'extern "C" void exit (int);' \ +- 'void exit (int);' +-do +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +-#include <stdlib.h> +-$ac_declaration +-#ifdef F77_DUMMY_MAIN +-# ifdef __cplusplus +- extern "C" +-# endif +- int F77_DUMMY_MAIN() { return 1; } +-#endif +-int +-main () +-{ +-exit (42); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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 +- : +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-continue +-fi +-rm -f conftest.$ac_objext conftest.$ac_ext +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +-$ac_declaration +-#ifdef F77_DUMMY_MAIN +-# ifdef __cplusplus +- extern "C" +-# endif +- int F77_DUMMY_MAIN() { return 1; } +-#endif +-int +-main () +-{ +-exit (42); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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 +- break +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-fi +-rm -f conftest.$ac_objext conftest.$ac_ext +-done +-rm -f conftest* +-if test -n "$ac_declaration"; then +- echo '#ifdef __cplusplus' >>confdefs.h +- echo $ac_declaration >>confdefs.h +- echo '#endif' >>confdefs.h +-fi +- +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-fi +-rm -f conftest.$ac_objext conftest.$ac_ext +-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_aux_dir= + for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do +@@ -1956,20 +763,14 @@ + 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 +-ac_config_guess="$SHELL $ac_aux_dir/config.guess" +-ac_config_sub="$SHELL $ac_aux_dir/config.sub" +-ac_configure="$SHELL $ac_aux_dir/configure" # This should be Cygnus configure. ++ { echo "configure: error: can not find install-sh or install.sh in $srcdir $srcdir/.. $srcdir/../.." 1>&2; exit 1; } ++fi ++ac_config_guess=$ac_aux_dir/config.guess ++ac_config_sub=$ac_aux_dir/config.sub ++ac_configure=$ac_aux_dir/configure # This should be Cygnus configure. + + # Find a good install program. We prefer a C program (faster), + # so one script is as good as another. But avoid the broken or +@@ -1978,1629 +779,579 @@ + # 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" + # ./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 ++echo $ac_n "checking for a BSD compatible install""... $ac_c" 1>&6 ++echo "configure:788: checking for a BSD compatible install" >&5 + if test -z "$INSTALL"; then +-if test "${ac_cv_path_install+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++if eval "test \"`echo '$''{'ac_cv_path_install'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&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/* | \ +- /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 $as_executable_p "$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 ++ IFS="${IFS= }"; ac_save_IFS="$IFS"; IFS=":" ++ for ac_dir in $PATH; do ++ # Account for people who put trailing slashes in PATH elements. ++ case "$ac_dir/" in ++ /|./|.//|/etc/*|/usr/sbin/*|/usr/etc/*|/sbin/*|/usr/afsws/bin/*|/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 ++ if test -f $ac_dir/$ac_prog; then ++ if test $ac_prog = install && ++ grep dspmsg $ac_dir/$ac_prog >/dev/null 2>&1; then ++ # AIX install. It has an incompatible calling convention. ++ : ++ else ++ ac_cv_path_install="$ac_dir/$ac_prog -c" ++ break 2 ++ fi ++ fi + done +- done +- ;; +-esac +-done +- ++ ;; ++ esac ++ done ++ IFS="$ac_save_IFS" + + fi + if test "${ac_cv_path_install+set}" = set; then +- INSTALL=$ac_cv_path_install ++ INSTALL="$ac_cv_path_install" + else + # As a last resort, use the slow shell script. We don't cache a + # path for INSTALL within a source directory, because that will + # break other packages using the cache if that directory is + # removed, or if the path is relative. +- INSTALL=$ac_install_sh ++ INSTALL="$ac_install_sh" + fi + fi +-echo "$as_me:$LINENO: result: $INSTALL" >&5 +-echo "${ECHO_T}$INSTALL" >&6 ++echo "$ac_t""$INSTALL" 1>&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_SCRIPT" && INSTALL_SCRIPT='${INSTALL_PROGRAM}' + + test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' + +-echo "$as_me:$LINENO: checking whether ln -s works" >&5 +-echo $ECHO_N "checking whether ln -s works... $ECHO_C" >&6 +-LN_S=$as_ln_s +-if test "$LN_S" = "ln -s"; then +- echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6 ++echo $ac_n "checking whether ln -s works""... $ac_c" 1>&6 ++echo "configure:841: checking whether ln -s works" >&5 ++if eval "test \"`echo '$''{'ac_cv_prog_LN_S'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 ++else ++ rm -f conftestdata ++if ln -s X conftestdata 2>/dev/null ++then ++ rm -f conftestdata ++ ac_cv_prog_LN_S="ln -s" + else +- echo "$as_me:$LINENO: result: no, using $LN_S" >&5 +-echo "${ECHO_T}no, using $LN_S" >&6 ++ ac_cv_prog_LN_S=ln ++fi ++fi ++LN_S="$ac_cv_prog_LN_S" ++if test "$ac_cv_prog_LN_S" = "ln -s"; then ++ echo "$ac_t""yes" 1>&6 ++else ++ echo "$ac_t""no" 1>&6 + 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 ++echo $ac_n "checking how to run the C preprocessor""... $ac_c" 1>&6 ++echo "configure:863: checking how to run the C preprocessor" >&5 + # 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 ++if eval "test \"`echo '$''{'ac_cv_prog_CPP'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&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. ++ # This must be in double quotes, not single quotes, because CPP may get ++ # substituted into the Makefile and "${CC-cc}" will confuse make. ++ CPP="${CC-cc} -E" + # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" ++ # not just through cpp. ++ cat > conftest.$ac_ext <<EOF ++#line 878 "configure" + #include "confdefs.h" + #include <assert.h> +- Syntax error +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- egrep -v '^ *\+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:884: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then + : + else +- echo "$as_me: failed program was:" >&5 +- cat 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 non-existent headers +- # can be detected and how. +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +-#include <ac_nonexistent.h> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- egrep -v '^ *\+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- # Broken: success on invalid input. +-continue +-else +- echo "$as_me: failed program was:" >&5 ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 + cat 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. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" ++ rm -rf conftest* ++ CPP="${CC-cc} -E -traditional-cpp" ++ cat > conftest.$ac_ext <<EOF ++#line 895 "configure" + #include "confdefs.h" + #include <assert.h> +- Syntax error +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- egrep -v '^ *\+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:901: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then + : + else +- echo "$as_me: failed program was:" >&5 ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 + cat 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 non-existent headers +- # can be detected and how. +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" ++ rm -rf conftest* ++ CPP="${CC-cc} -nologo -E" ++ cat > conftest.$ac_ext <<EOF ++#line 912 "configure" + #include "confdefs.h" +-#include <ac_nonexistent.h> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- egrep -v '^ *\+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- # Broken: success on invalid input. +-continue +-else +- echo "$as_me: failed program was:" >&5 +- cat 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 ++#include <assert.h> ++Syntax Error ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:918: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then + : + else +- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check" >&5 +-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check" >&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 ANSI C header files" >&5 +-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +-if test "${ac_cv_header_stdc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +-#include <stdlib.h> +-#include <stdarg.h> +-#include <string.h> +-#include <float.h> +- +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- egrep -v '^ *\+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- ac_cv_header_stdc=yes +-else +- echo "$as_me: failed program was:" >&5 ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- ac_cv_header_stdc=no +-fi +-rm -f conftest.err conftest.$ac_ext +- +-if test $ac_cv_header_stdc = yes; then +- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "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 ++ rm -rf conftest* ++ CPP=/lib/cpp + 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 +-#line $LINENO "configure" +-#include "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 ++rm -f conftest* + fi + rm -f conftest* +- ++ ac_cv_prog_CPP="$CPP" + 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 +-#line $LINENO "configure" +-#include "confdefs.h" +-#include <ctype.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)) +- exit(2); +- exit (0); +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (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 +- : ++ CPP="$ac_cv_prog_CPP" + else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-( exit $ac_status ) +-ac_cv_header_stdc=no ++ ac_cv_prog_CPP="$CPP" + fi +-rm -f core core.* *.core 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. +- +- +- +- +- +- ++echo "$ac_t""$CPP" 1>&6 + +- +- +-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ +- inttypes.h stdint.h unistd.h ++for ac_hdr in sys/select.h alloca.h fribidi/fribidi.h dlfcn.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 eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 ++ac_safe=`echo "$ac_hdr" | sed 'y%./+-%__p_%'` ++echo $ac_n "checking for $ac_hdr""... $ac_c" 1>&6 ++echo "configure:946: checking for $ac_hdr" >&5 ++if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then ++ echo $ac_n "(cached) $ac_c" 1>&6 + else +- cat >conftest.$ac_ext <<_ACEOF +-#line $LINENO "configure" +-#include "confdefs.h" +-$ac_includes_default +- +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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 "$as_ac_Header=yes" +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-eval "$as_ac_Header=no" +-fi +-rm -f conftest.$ac_objext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +-if test `eval echo '${'$as_ac_Header'}'` = yes; then +- cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +- +-done +- +- +- +- +-for ac_header in sys/select.h alloca.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 +-#line $LINENO "configure" ++ cat > conftest.$ac_ext <<EOF ++#line 951 "configure" + #include "confdefs.h" +-$ac_includes_default +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -s conftest.$ac_objext' +- { (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_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-cat conftest.$ac_ext >&5 +-ac_header_compiler=no +-fi +-rm -f 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 +-#line $LINENO "configure" +-#include "confdefs.h" +-#include <$ac_header> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- egrep -v '^ *\+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- else +- ac_cpp_err= +- fi ++#include <$ac_hdr> ++EOF ++ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out" ++{ (eval echo configure:956: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; } ++ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"` ++if test -z "$ac_err"; then ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=yes" + else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 ++ echo "$ac_err" >&5 ++ echo "configure: failed program was:" >&5 + cat conftest.$ac_ext >&5 +- ac_header_preproc=no ++ rm -rf conftest* ++ eval "ac_cv_header_$ac_safe=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 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 preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +- 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: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;};; +-esac +-echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=$ac_header_preproc" +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&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 +- ++rm -f conftest* ++fi ++if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then ++ echo "$ac_t""yes" 1>&6 ++ ac_tr_hdr=HAVE_`echo $ac_hdr | sed 'y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%'` ++ cat >> confdefs.h <<EOF ++#define $ac_tr_hdr 1 ++EOF ++ ++else ++ echo "$ac_t""no" 1>&6 + fi +- + done + + +- + # Check whether --with-gpm-support or --without-gpm-support was given. + if test "${with_gpm_support+set}" = set; then + withval="$with_gpm_support" ++ : ++fi + +-fi; + + if test "x$with_gpm_support" = "xyes"; then +- +-cat >>confdefs.h <<\_ACEOF ++ cat >> confdefs.h <<\EOF + #define USE_GPM 1 +-_ACEOF ++EOF + + fi + +-ac_config_files="$ac_config_files Makefile" +-cat >confcache <<\_ACEOF ++trap '' 1 2 15 ++cat > confcache <<\EOF + # 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. ++# scripts and configure runs. 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. ++# By default, configure uses ./config.cache as the cache file, ++# creating it if it does not exist already. You can give configure ++# the --cache-file=FILE option to use a different cache file; that is ++# what configure does when it calls configure scripts in ++# subdirectories, so they share the cache. ++# Giving --cache-file=/dev/null disables caching, for debugging configure. ++# 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 overriden when +-# loading this file, other *unset* `ac_cv_foo' will be assigned the +-# following values. +- +-_ACEOF +- ++EOF + # The following way of writing the cache mishandles newlines in values, + # but we know of no workaround that is simple, portable, and efficient. + # So, don't put newlines in cache variables' values. + # 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. +-{ +- (set) 2>&1 | +- case `(ac_space=' '; set | grep ac_space) 2>&1` in +- *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 \ +- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" +- ;; +- esac; +-} | +- sed ' +- t clear +- : clear +- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ +- t end +- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ +- : end' >>confcache +-if cmp -s $cache_file confcache; then :; else ++(set) 2>&1 | ++ case `(ac_space=' '; set | grep ac_space) 2>&1` in ++ *ac_space=\ *) ++ # `set' does not quote correctly, so add quotes (double-quote substitution ++ # turns \\\\ into \\, and sed turns \\ into \). ++ sed -n \ ++ -e "s/'/'\\\\''/g" \ ++ -e "s/^\\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\\)=\\(.*\\)/\\1=\${\\1='\\2'}/p" ++ ;; ++ *) ++ # `set' quotes correctly as required by POSIX, so do not add quotes. ++ sed -n -e 's/^\([a-zA-Z0-9_]*_cv_[a-zA-Z0-9_]*\)=\(.*\)/\1=${\1=\2}/p' ++ ;; ++ esac >> confcache ++if cmp -s $cache_file confcache; then ++ : ++else + if test -w $cache_file; then +- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" +- cat confcache >$cache_file ++ echo "updating cache $cache_file" ++ cat confcache > $cache_file + else + echo "not updating unwritable cache $cache_file" + fi + fi + rm -f confcache + ++trap 'rm -fr conftest* confdefs* core core.* *.core $ac_clean_files; exit 1' 1 2 15 ++ + test "x$prefix" = xNONE && prefix=$ac_default_prefix + # Let make expand exec_prefix. + test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' + +-# 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). ++# Any assignment to VPATH causes Sun make to only execute ++# the first set of double-colon rules, so remove it if not needed. ++# If there is a colon in the path, we need to keep it. + if test "x$srcdir" = x.; then +- ac_vpsub='/^[ ]*VPATH[ ]*=/{ +-s/:*\$(srcdir):*/:/; +-s/:*\${srcdir}:*/:/; +-s/:*@srcdir@:*/:/; +-s/^\([^=]*=[ ]*\):*/\1/; +-s/:*$//; +-s/^[^=]*=[ ]*$//; +-}' ++ ac_vpsub='/^[ ]*VPATH[ ]*=[^:]*$/d' + fi + +-DEFS=-DHAVE_CONFIG_H ++trap 'rm -f $CONFIG_STATUS conftest*; exit 1' 1 2 15 + ++DEFS=-DHAVE_CONFIG_H + ++# Without the "./", some shells look in PATH for config.status. + : ${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. ++ ++echo creating $CONFIG_STATUS ++rm -f $CONFIG_STATUS ++cat > $CONFIG_STATUS <<EOF ++#! /bin/sh ++# Generated automatically by configure. + # Run this file to recreate the current configuration. ++# This directory was configured as follows, ++# on host `(hostname || uname -n) 2>/dev/null | sed 1q`: ++# ++# $0 $ac_configure_args ++# + # Compiler output produced by configure, useful for debugging +-# configure, is in config.log if it exists. +- +-debug=false +-SHELL=\${CONFIG_SHELL-$SHELL} +-_ACEOF +- +-cat >>$CONFIG_STATUS <<\_ACEOF +- +-## --------------------- ## +-## M4sh Initialization. ## +-## --------------------- ## +- +-# Be Bourne compatible +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +- emulate sh +- NULLCMD=: +-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then +- set -o posix +-fi +- +-# NLS nuisances. +-# Support unset when possible. +-if (FOO=FOO; unset FOO) >/dev/null 2>&1; then +- as_unset=unset +-else +- as_unset=false +-fi +- +-(set +x; test -n "`(LANG=C; export LANG) 2>&1`") && +- { $as_unset LANG || test "${LANG+set}" != set; } || +- { LANG=C; export LANG; } +-(set +x; test -n "`(LC_ALL=C; export LC_ALL) 2>&1`") && +- { $as_unset LC_ALL || test "${LC_ALL+set}" != set; } || +- { LC_ALL=C; export LC_ALL; } +-(set +x; test -n "`(LC_TIME=C; export LC_TIME) 2>&1`") && +- { $as_unset LC_TIME || test "${LC_TIME+set}" != set; } || +- { LC_TIME=C; export LC_TIME; } +-(set +x; test -n "`(LC_CTYPE=C; export LC_CTYPE) 2>&1`") && +- { $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set; } || +- { LC_CTYPE=C; export LC_CTYPE; } +-(set +x; test -n "`(LANGUAGE=C; export LANGUAGE) 2>&1`") && +- { $as_unset LANGUAGE || test "${LANGUAGE+set}" != set; } || +- { LANGUAGE=C; export LANGUAGE; } +-(set +x; test -n "`(LC_COLLATE=C; export LC_COLLATE) 2>&1`") && +- { $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set; } || +- { LC_COLLATE=C; export LC_COLLATE; } +-(set +x; test -n "`(LC_NUMERIC=C; export LC_NUMERIC) 2>&1`") && +- { $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set; } || +- { LC_NUMERIC=C; export LC_NUMERIC; } +-(set +x; test -n "`(LC_MESSAGES=C; export LC_MESSAGES) 2>&1`") && +- { $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set; } || +- { LC_MESSAGES=C; export LC_MESSAGES; } +- +- +-# Name of the executable. +-as_me=`(basename "$0") 2>/dev/null || +-$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'` +- +-# PATH needs CR, and LINENO needs CR and PATH. +-# 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" >conftest.sh +- echo "exit 0" >>conftest.sh +- chmod +x conftest.sh +- if (PATH=".;."; conftest.sh) >/dev/null 2>&1; then +- PATH_SEPARATOR=';' +- else +- PATH_SEPARATOR=: +- fi +- rm -f conftest.sh +-fi +- +- +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" || { +- # Find who we are. Look in the path if we contain no path at all +- # relative or not. +- 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 +- +- ;; +- 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_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} +- { (exit 1); exit 1; }; } +- fi +- case $CONFIG_SHELL in +- '') +- 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=. +- for as_base in sh bash ksh sh5; do +- case $as_dir in +- /*) +- if ("$as_dir/$as_base" -c ' +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then +- CONFIG_SHELL=$as_dir/$as_base +- export CONFIG_SHELL +- exec "$CONFIG_SHELL" "$0" ${1+"$@"} +- fi;; +- esac +- done +-done +-;; +- esac +- +- # 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 before each line; the second 'sed' does the real +- # work. The second script uses 'N' to pair each line-number line +- # with the numbered line, 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 +- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) +- sed '=' <$as_myself | +- sed ' +- N +- s,$,-, +- : loop +- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, +- t loop +- s,-$,, +- s,^['$as_cr_digits']*\n,, +- ' >$as_me.lineno && +- chmod +x $as_me.lineno || +- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +-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 sensible to this). +- . ./$as_me.lineno +- # Exit status is that of the last command. +- exit +-} +- +- +-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in +- *c*,-n*) ECHO_N= ECHO_C=' +-' ECHO_T=' ' ;; +- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; +- *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +-esac +- +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-rm -f conf$$ conf$$.exe conf$$.file +-echo >conf$$.file +-if ln -s conf$$.file conf$$ 2>/dev/null; then +- # We could just check for DJGPP; but this test a) works b) is more generic +- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). +- if test -f conf$$.exe; then +- # Don't use ln at all; we don't have any links +- as_ln_s='cp -p' +- else +- as_ln_s='ln -s' +- fi +-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$$.file +- +-as_executable_p="test -f" +- +-# Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="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="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" +- +- +-# IFS +-# We need space, tab and new line, in precisely that order. +-as_nl=' +-' +-IFS=" $as_nl" +- +-# CDPATH. +-$as_unset CDPATH || test "${CDPATH+set}" != set || { CDPATH=$PATH_SEPARATOR; export CDPATH; } +- +-exec 6>&1 +- +-# Open the log real soon, to keep \$[0] and so on meaningful, and to +-# report actual input values of CONFIG_FILES etc. instead of their +-# values after options handling. Logging --version etc. is OK. +-exec 5>>config.log +-{ +- echo +- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +-## Running $as_me. ## +-_ASBOX +-} >&5 +-cat >&5 <<_CSEOF +- +-This file was extended by $as_me, which was +-generated by GNU Autoconf 2.53. Invocation command line was +- +- CONFIG_FILES = $CONFIG_FILES +- CONFIG_HEADERS = $CONFIG_HEADERS +- CONFIG_LINKS = $CONFIG_LINKS +- CONFIG_COMMANDS = $CONFIG_COMMANDS +- $ $0 $@ +- +-_CSEOF +-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +-echo >&5 +-_ACEOF ++# configure, is in ./config.log if it exists. + +-# Files that config.status was made for. +-if test -n "$ac_config_files"; then +- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +-fi +- +-if test -n "$ac_config_headers"; then +- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +-fi +- +-if test -n "$ac_config_links"; then +- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +-fi +- +-if test -n "$ac_config_commands"; then +- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +-fi +- +-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, then exit +- -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="\\ +-config.status +-configured by $0, generated by GNU Autoconf 2.53, +- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +- +-Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 +-Free Software Foundation, Inc. +-This config.status script is free software; the Free Software Foundation +-gives unlimited permission to copy, distribute and modify it." +-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 ++ac_cs_usage="Usage: $CONFIG_STATUS [--recheck] [--version] [--help]" ++for ac_option + do +- case $1 in +- --*=*) +- ac_option=`expr "x$1" : 'x\([^=]*\)='` +- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` +- shift +- set dummy "$ac_option" "$ac_optarg" ${1+"$@"} +- shift +- ;; +- -*);; +- *) # This is not an option, so the user has probably given explicit +- # arguments. +- ac_need_defaults=false;; +- esac +- +- case $1 in +- # Handling of the options. +-_ACEOF +-cat >>$CONFIG_STATUS <<_ACEOF ++ case "\$ac_option" in + -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) +- echo "running $SHELL $0 " $ac_configure_args " --no-create --no-recursion" +- exec $SHELL $0 $ac_configure_args --no-create --no-recursion ;; +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +- --version | --vers* | -V ) +- echo "$ac_cs_version"; exit 0 ;; +- --he | --h) +- # Conflict between --help and --header +- { { echo "$as_me:$LINENO: error: ambiguous option: $1 +-Try \`$0 --help' for more information." >&5 +-echo "$as_me: error: ambiguous option: $1 +-Try \`$0 --help' for more information." >&2;} +- { (exit 1); exit 1; }; };; +- --help | --hel | -h ) +- echo "$ac_cs_usage"; exit 0 ;; +- --debug | --d* | -d ) +- debug=: ;; +- --file | --fil | --fi | --f ) +- shift +- CONFIG_FILES="$CONFIG_FILES $1" +- ac_need_defaults=false;; +- --header | --heade | --head | --hea ) +- shift +- CONFIG_HEADERS="$CONFIG_HEADERS $1" +- ac_need_defaults=false;; +- +- # This is an error. +- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +-Try \`$0 --help' for more information." >&5 +-echo "$as_me: error: unrecognized option: $1 +-Try \`$0 --help' for more information." >&2;} +- { (exit 1); exit 1; }; } ;; +- +- *) ac_config_targets="$ac_config_targets $1" ;; +- ++ echo "running \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion" ++ exec \${CONFIG_SHELL-/bin/sh} $0 $ac_configure_args --no-create --no-recursion ;; ++ -version | --version | --versio | --versi | --vers | --ver | --ve | --v) ++ echo "$CONFIG_STATUS generated by autoconf version 2.13" ++ exit 0 ;; ++ -help | --help | --hel | --he | --h) ++ echo "\$ac_cs_usage"; exit 0 ;; ++ *) echo "\$ac_cs_usage"; exit 1 ;; + esac +- shift + done + +-_ACEOF +- +- +- +- +- +-cat >>$CONFIG_STATUS <<\_ACEOF +-for ac_config_target in $ac_config_targets +-do +- case "$ac_config_target" in +- # Handling of arguments. +- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; +- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; +- *) { { 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 +- +-# Create a temporary directory, and hook for its removal unless debugging. +-$debug || +-{ +- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 +- trap '{ (exit 1); exit 1; }' 1 2 13 15 +-} +- +-# Create a (secure) tmp directory for tmp files. +-: ${TMPDIR=/tmp} +-{ +- tmp=`(umask 077 && mktemp -d -q "$TMPDIR/csXXXXXX") 2>/dev/null` && +- test -n "$tmp" && test -d "$tmp" +-} || +-{ +- tmp=$TMPDIR/cs$$-$RANDOM +- (umask 077 && mkdir $tmp) +-} || +-{ +- echo "$me: cannot create a temporary directory in $TMPDIR" >&2 +- { (exit 1); exit 1; } +-} +- +-_ACEOF +- +-cat >>$CONFIG_STATUS <<_ACEOF +- +-# +-# CONFIG_FILES section. +-# ++ac_given_srcdir=$srcdir ++ac_given_INSTALL="$INSTALL" ++ ++trap 'rm -fr `echo "Makefile config.h" | sed "s/:[^ ]*//g"` conftest*; exit 1' 1 2 15 ++EOF ++cat >> $CONFIG_STATUS <<EOF ++ ++# Protect against being on the right side of a sed subst in config.status. ++sed 's/%@/@@/; s/@%/@@/; s/%g\$/@g/; /@g\$/s/[\\\\&%]/\\\\&/g; ++ s/@@/%@/; s/@@/@%/; s/@g\$/%g/' > conftest.subs <<\\CEOF ++$ac_vpsub ++$extrasub ++s%@SHELL@%$SHELL%g ++s%@CFLAGS@%$CFLAGS%g ++s%@CPPFLAGS@%$CPPFLAGS%g ++s%@CXXFLAGS@%$CXXFLAGS%g ++s%@FFLAGS@%$FFLAGS%g ++s%@DEFS@%$DEFS%g ++s%@LDFLAGS@%$LDFLAGS%g ++s%@LIBS@%$LIBS%g ++s%@exec_prefix@%$exec_prefix%g ++s%@prefix@%$prefix%g ++s%@program_transform_name@%$program_transform_name%g ++s%@bindir@%$bindir%g ++s%@sbindir@%$sbindir%g ++s%@libexecdir@%$libexecdir%g ++s%@datadir@%$datadir%g ++s%@sysconfdir@%$sysconfdir%g ++s%@sharedstatedir@%$sharedstatedir%g ++s%@localstatedir@%$localstatedir%g ++s%@libdir@%$libdir%g ++s%@includedir@%$includedir%g ++s%@oldincludedir@%$oldincludedir%g ++s%@infodir@%$infodir%g ++s%@mandir@%$mandir%g ++s%@PACKAGE@%$PACKAGE%g ++s%@VERSION@%$VERSION%g ++s%@SONAME@%$SONAME%g ++s%@CC@%$CC%g ++s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g ++s%@INSTALL_SCRIPT@%$INSTALL_SCRIPT%g ++s%@INSTALL_DATA@%$INSTALL_DATA%g ++s%@LN_S@%$LN_S%g ++s%@CPP@%$CPP%g + +-# 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 +- # Protect against being on the right side of a sed subst in config.status. +- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; +- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +-s,@SHELL@,$SHELL,;t t +-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +-s,@exec_prefix@,$exec_prefix,;t t +-s,@prefix@,$prefix,;t t +-s,@program_transform_name@,$program_transform_name,;t t +-s,@bindir@,$bindir,;t t +-s,@sbindir@,$sbindir,;t t +-s,@libexecdir@,$libexecdir,;t t +-s,@datadir@,$datadir,;t t +-s,@sysconfdir@,$sysconfdir,;t t +-s,@sharedstatedir@,$sharedstatedir,;t t +-s,@localstatedir@,$localstatedir,;t t +-s,@libdir@,$libdir,;t t +-s,@includedir@,$includedir,;t t +-s,@oldincludedir@,$oldincludedir,;t t +-s,@infodir@,$infodir,;t t +-s,@mandir@,$mandir,;t t +-s,@build_alias@,$build_alias,;t t +-s,@host_alias@,$host_alias,;t t +-s,@target_alias@,$target_alias,;t t +-s,@DEFS@,$DEFS,;t t +-s,@ECHO_C@,$ECHO_C,;t t +-s,@ECHO_N@,$ECHO_N,;t t +-s,@ECHO_T@,$ECHO_T,;t t +-s,@LIBS@,$LIBS,;t t +-s,@VERSION@,$VERSION,;t t +-s,@SONAME@,$SONAME,;t t +-s,@CC@,$CC,;t t +-s,@CFLAGS@,$CFLAGS,;t t +-s,@LDFLAGS@,$LDFLAGS,;t t +-s,@CPPFLAGS@,$CPPFLAGS,;t t +-s,@ac_ct_CC@,$ac_ct_CC,;t t +-s,@EXEEXT@,$EXEEXT,;t t +-s,@OBJEXT@,$OBJEXT,;t t +-s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t +-s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t +-s,@INSTALL_DATA@,$INSTALL_DATA,;t t +-s,@LN_S@,$LN_S,;t t +-s,@CPP@,$CPP,;t t + CEOF ++EOF + +-_ACEOF ++cat >> $CONFIG_STATUS <<\EOF + +- cat >>$CONFIG_STATUS <<\_ACEOF +- # Split the substitutions into bite-sized pieces for seds with +- # small command number limits, like on Digital OSF/1 and HP-UX. +- ac_max_sed_lines=48 +- ac_sed_frag=1 # Number of current file. +- ac_beg=1 # First line for current file. +- ac_end=$ac_max_sed_lines # Line after last line for current file. +- ac_more_lines=: +- ac_sed_cmds= +- while $ac_more_lines; do +- if test $ac_beg -gt 1; then +- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag +- else +- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag +- fi +- if test ! -s $tmp/subs.frag; then +- ac_more_lines=false ++# Split the substitutions into bite-sized pieces for seds with ++# small command number limits, like on Digital OSF/1 and HP-UX. ++ac_max_sed_cmds=90 # Maximum number of lines to put in a sed script. ++ac_file=1 # Number of current file. ++ac_beg=1 # First line for current file. ++ac_end=$ac_max_sed_cmds # Line after last line for current file. ++ac_more_lines=: ++ac_sed_cmds="" ++while $ac_more_lines; do ++ if test $ac_beg -gt 1; then ++ sed "1,${ac_beg}d; ${ac_end}q" conftest.subs > conftest.s$ac_file ++ else ++ sed "${ac_end}q" conftest.subs > conftest.s$ac_file ++ fi ++ if test ! -s conftest.s$ac_file; then ++ ac_more_lines=false ++ rm -f conftest.s$ac_file ++ else ++ if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds="sed -f conftest.s$ac_file" + else +- # The purpose of the label and of the branching condition is to +- # speed up the sed processing (if there are no `@' at all, there +- # is no need to browse any of the substitutions). +- # These are the two extra sed commands mentioned above. +- (echo ':t +- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed +- if test -z "$ac_sed_cmds"; then +- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" +- else +- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" +- fi +- ac_sed_frag=`expr $ac_sed_frag + 1` +- ac_beg=$ac_end +- ac_end=`expr $ac_end + $ac_max_sed_lines` ++ ac_sed_cmds="$ac_sed_cmds | sed -f conftest.s$ac_file" + fi +- done +- if test -z "$ac_sed_cmds"; then +- ac_sed_cmds=cat ++ ac_file=`expr $ac_file + 1` ++ ac_beg=$ac_end ++ ac_end=`expr $ac_end + $ac_max_sed_cmds` + fi +-fi # test -n "$CONFIG_FILES" +- +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue +- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +- case $ac_file in +- - | *:- | *:-:* ) # input from stdin +- cat >$tmp/stdin +- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- * ) ac_file_in=$ac_file.in ;; +- esac +- +- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. +- ac_dir=`(dirname "$ac_file") 2>/dev/null || +-$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'` +- { case "$ac_dir" in +- [\\/]* | ?:[\\/]* ) as_incr_dir=;; +- *) as_incr_dir=.;; +-esac +-as_dummy="$ac_dir" +-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do +- case $as_mkdir_dir in +- # Skip DOS drivespec +- ?:) as_incr_dir=$as_mkdir_dir ;; +- *) +- as_incr_dir=$as_incr_dir/$as_mkdir_dir +- test -d "$as_incr_dir" || +- mkdir "$as_incr_dir" || +- { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +-echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} +- { (exit 1); exit 1; }; } +- ;; +- esac +-done; } +- +- ac_builddir=. +- +-if test "$ac_dir" != .; then +- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` +- # A "../" for each directory in $ac_dir_suffix. +- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +-else +- ac_dir_suffix= ac_top_builddir= ++done ++if test -z "$ac_sed_cmds"; then ++ ac_sed_cmds=cat + fi ++EOF + +-case $srcdir in +- .) # No --srcdir option. We are building in place. +- ac_srcdir=. +- if test -z "$ac_top_builddir"; then +- ac_top_srcdir=. +- else +- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` +- fi ;; +- [\\/]* | ?:[\\/]* ) # Absolute path. +- ac_srcdir=$srcdir$ac_dir_suffix; +- ac_top_srcdir=$srcdir ;; +- *) # Relative path. +- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix +- ac_top_srcdir=$ac_top_builddir$srcdir ;; +-esac +-# Don't blindly perform a `cd "$ac_dir"/$ac_foo && pwd` since $ac_foo can be +-# absolute. +-ac_abs_builddir=`cd "$ac_dir" && cd $ac_builddir && pwd` +-ac_abs_top_builddir=`cd "$ac_dir" && cd $ac_top_builddir && pwd` +-ac_abs_srcdir=`cd "$ac_dir" && cd $ac_srcdir && pwd` +-ac_abs_top_srcdir=`cd "$ac_dir" && cd $ac_top_srcdir && pwd` +- ++cat >> $CONFIG_STATUS <<EOF + +- case $INSTALL in +- [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; +- *) ac_INSTALL=$ac_top_builddir$INSTALL ;; ++CONFIG_FILES=\${CONFIG_FILES-"Makefile"} ++EOF ++cat >> $CONFIG_STATUS <<\EOF ++for ac_file in .. $CONFIG_FILES; do if test "x$ac_file" != x..; then ++ # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". ++ case "$ac_file" in ++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; ++ *) ac_file_in="${ac_file}.in" ;; ++ esac ++ ++ # Adjust a relative srcdir, top_srcdir, and INSTALL for subdirectories. ++ ++ # Remove last slash and all that follows it. Not all systems have dirname. ++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` ++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then ++ # The file is in a subdirectory. ++ test ! -d "$ac_dir" && mkdir "$ac_dir" ++ ac_dir_suffix="/`echo $ac_dir|sed 's%^\./%%'`" ++ # A "../" for each directory in $ac_dir_suffix. ++ ac_dots=`echo $ac_dir_suffix|sed 's%/[^/]*%../%g'` ++ else ++ ac_dir_suffix= ac_dots= ++ fi ++ ++ case "$ac_given_srcdir" in ++ .) srcdir=. ++ if test -z "$ac_dots"; then top_srcdir=. ++ else top_srcdir=`echo $ac_dots|sed 's%/$%%'`; fi ;; ++ /*) srcdir="$ac_given_srcdir$ac_dir_suffix"; top_srcdir="$ac_given_srcdir" ;; ++ *) # Relative path. ++ srcdir="$ac_dots$ac_given_srcdir$ac_dir_suffix" ++ top_srcdir="$ac_dots$ac_given_srcdir" ;; + esac + +- if test x"$ac_file" != x-; then +- { echo "$as_me:$LINENO: creating $ac_file" >&5 +-echo "$as_me: creating $ac_file" >&6;} +- rm -f "$ac_file" +- fi +- # 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. */ +- if test x"$ac_file" = x-; then +- configure_input= +- else +- configure_input="$ac_file. " +- fi +- configure_input=$configure_input"Generated from `echo $ac_file_in | +- sed 's,.*/,,'` by configure." +- +- # First look for the input files in the build tree, otherwise in the +- # src tree. +- ac_file_inputs=`IFS=: +- for f in $ac_file_in; do +- case $f in +- -) echo $tmp/stdin ;; +- [\\/$]*) +- # Absolute (can't be DOS-style, as IFS=:) +- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- echo $f;; +- *) # Relative +- if test -f "$f"; then +- # Build tree +- echo $f +- elif test -f "$srcdir/$f"; then +- # Source tree +- echo $srcdir/$f +- else +- # /dev/null tree +- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- fi;; +- esac +- done` || { (exit 1); exit 1; } +-_ACEOF +-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,@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,@top_builddir@,$ac_top_builddir,;t t +-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +-s,@INSTALL@,$ac_INSTALL,;t t +-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out +- rm -f $tmp/stdin +- if test x"$ac_file" != x-; then +- mv $tmp/out $ac_file +- else +- cat $tmp/out +- rm -f $tmp/out +- fi +- +-done +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +- +-# +-# CONFIG_HEADER section. +-# ++ case "$ac_given_INSTALL" in ++ [/$]*) INSTALL="$ac_given_INSTALL" ;; ++ *) INSTALL="$ac_dots$ac_given_INSTALL" ;; ++ esac ++ ++ echo creating "$ac_file" ++ rm -f "$ac_file" ++ configure_input="Generated automatically from `echo $ac_file_in|sed 's%.*/%%'` by configure." ++ case "$ac_file" in ++ *Makefile*) ac_comsub="1i\\ ++# $configure_input" ;; ++ *) ac_comsub= ;; ++ esac ++ ++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` ++ sed -e "$ac_comsub ++s%@configure_input@%$configure_input%g ++s%@srcdir@%$srcdir%g ++s%@top_srcdir@%$top_srcdir%g ++s%@INSTALL@%$INSTALL%g ++" $ac_file_inputs | (eval "$ac_sed_cmds") > $ac_file ++fi; done ++rm -f conftest.s* + + # These sed commands are passed to sed as "A NAME B NAME C VALUE D", where + # NAME is the cpp macro being defined and VALUE is the value it is being given. + # + # ac_d sets the value in "#define NAME VALUE" lines. +-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +-ac_dB='[ ].*$,\1#\2' +-ac_dC=' ' +-ac_dD=',;t' +-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +-ac_uB='$,\1#\2define\3' ++ac_dA='s%^\([ ]*\)#\([ ]*define[ ][ ]*\)' ++ac_dB='\([ ][ ]*\)[^ ]*%\1#\2' ++ac_dC='\3' ++ac_dD='%g' ++# ac_u turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ++ac_uA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ++ac_uB='\([ ]\)%\1#\2define\3' + ac_uC=' ' +-ac_uD=',;t' +- +-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue ++ac_uD='\4%g' ++# ac_e turns "#undef NAME" without trailing blanks into "#define NAME VALUE". ++ac_eA='s%^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ++ac_eB='$%\1#\2define\3' ++ac_eC=' ' ++ac_eD='%g' ++ ++if test "${CONFIG_HEADERS+set}" != set; then ++EOF ++cat >> $CONFIG_STATUS <<EOF ++ CONFIG_HEADERS="config.h" ++EOF ++cat >> $CONFIG_STATUS <<\EOF ++fi ++for ac_file in .. $CONFIG_HEADERS; do if test "x$ac_file" != x..; then + # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +- case $ac_file in +- - | *:- | *:-:* ) # input from stdin +- cat >$tmp/stdin +- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- * ) ac_file_in=$ac_file.in ;; +- esac +- +- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +-echo "$as_me: creating $ac_file" >&6;} +- +- # First look for the input files in the build tree, otherwise in the +- # src tree. +- ac_file_inputs=`IFS=: +- for f in $ac_file_in; do +- case $f in +- -) echo $tmp/stdin ;; +- [\\/$]*) +- # Absolute (can't be DOS-style, as IFS=:) +- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- echo $f;; +- *) # Relative +- if test -f "$f"; then +- # Build tree +- echo $f +- elif test -f "$srcdir/$f"; then +- # Source tree +- echo $srcdir/$f +- else +- # /dev/null tree +- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- fi;; +- esac +- done` || { (exit 1); exit 1; } +- # Remove the trailing spaces. +- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in +- +-_ACEOF +- +-# Transform confdefs.h into two sed scripts, `conftest.defines' and +-# `conftest.undefs', that substitutes the proper values into +-# config.h.in to produce config.h. The first handles `#define' +-# templates, and the second `#undef' templates. +-# And first: Protect against being on the right side of a sed subst in +-# config.status. Protect against being in an unquoted here document +-# in config.status. +-rm -f conftest.defines conftest.undefs +-# Using a here document instead of a string reduces the quoting nightmare. +-# Putting comments in sed scripts is not portable. +-# +-# `end' is used to avoid that the second main sed command (meant for +-# 0-ary CPP macros) applies to n-ary macro definitions. +-# See the Autoconf documentation for `clear'. +-cat >confdef2sed.sed <<\_ACEOF +-s/[\\&,]/\\&/g +-s,[\\$`],\\&,g +-t clear +-: clear +-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +-t end +-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +-: end +-_ACEOF +-# If some macros were called several times there might be several times +-# the same #defines, which is useless. Nevertheless, we may not want to +-# sort them, since we want the *last* AC-DEFINE to be honored. +-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +-rm -f confdef2sed.sed ++ case "$ac_file" in ++ *:*) ac_file_in=`echo "$ac_file"|sed 's%[^:]*:%%'` ++ ac_file=`echo "$ac_file"|sed 's%:.*%%'` ;; ++ *) ac_file_in="${ac_file}.in" ;; ++ esac ++ ++ echo creating $ac_file ++ ++ rm -f conftest.frag conftest.in conftest.out ++ ac_file_inputs=`echo $ac_file_in|sed -e "s%^%$ac_given_srcdir/%" -e "s%:% $ac_given_srcdir/%g"` ++ cat $ac_file_inputs > conftest.in ++ ++EOF ++ ++# Transform confdefs.h into a sed script conftest.vals that substitutes ++# the proper values into config.h.in to produce config.h. And first: ++# Protect against being on the right side of a sed subst in config.status. ++# Protect against being in an unquoted here document in config.status. ++rm -f conftest.vals ++cat > conftest.hdr <<\EOF ++s/[\\&%]/\\&/g ++s%[\\$`]%\\&%g ++s%#define \([A-Za-z_][A-Za-z0-9_]*\) *\(.*\)%${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD}%gp ++s%ac_d%ac_u%gp ++s%ac_u%ac_e%gp ++EOF ++sed -n -f conftest.hdr confdefs.h > conftest.vals ++rm -f conftest.hdr + + # This sed command replaces #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. +-cat >>conftest.undefs <<\_ACEOF +-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +-_ACEOF +- +-# Break up conftest.defines because some shells have a limit on the size +-# of here documents, and old seds have small limits too (100 cmds). +-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +-echo ' if egrep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +-echo ' :' >>$CONFIG_STATUS +-rm -f conftest.tail +-while grep . conftest.defines >/dev/null +-do +- # Write a limited-size here document to $tmp/defines.sed. +- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS +- # Speed up: don't consider the non `#define' lines. +- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS +- # Work around the forget-to-reset-the-flag bug. +- echo 't clr' >>$CONFIG_STATUS +- echo ': clr' >>$CONFIG_STATUS +- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS +- echo 'CEOF +- sed -f $tmp/defines.sed $tmp/in >$tmp/out +- rm -f $tmp/in +- mv $tmp/out $tmp/in +-' >>$CONFIG_STATUS +- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail +- rm -f conftest.defines +- mv conftest.tail conftest.defines +-done +-rm -f conftest.defines +-echo ' fi # egrep' >>$CONFIG_STATUS +-echo >>$CONFIG_STATUS +- +-# Break up conftest.undefs because some shells have a limit on the size +-# of here documents, and old seds have small limits too (100 cmds). +-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS ++cat >> conftest.vals <<\EOF ++s%^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*%/* & */% ++EOF ++ ++# Break up conftest.vals because some shells have a limit on ++# the size of here documents, and old seds have small limits too. ++ + rm -f conftest.tail +-while grep . conftest.undefs >/dev/null ++while : + do +- # Write a limited-size here document to $tmp/undefs.sed. +- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS +- # Speed up: don't consider the non `#undef' +- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS +- # Work around the forget-to-reset-the-flag bug. +- echo 't clr' >>$CONFIG_STATUS +- echo ': clr' >>$CONFIG_STATUS +- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS ++ ac_lines=`grep -c . conftest.vals` ++ # grep -c gives empty output for an empty file on some AIX systems. ++ if test -z "$ac_lines" || test "$ac_lines" -eq 0; then break; fi ++ # Write a limited-size here document to conftest.frag. ++ echo ' cat > conftest.frag <<CEOF' >> $CONFIG_STATUS ++ sed ${ac_max_here_lines}q conftest.vals >> $CONFIG_STATUS + echo 'CEOF +- sed -f $tmp/undefs.sed $tmp/in >$tmp/out +- rm -f $tmp/in +- mv $tmp/out $tmp/in +-' >>$CONFIG_STATUS +- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail +- rm -f conftest.undefs +- mv conftest.tail conftest.undefs +-done +-rm -f conftest.undefs +- +-cat >>$CONFIG_STATUS <<\_ACEOF +- # 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. */ +- if test x"$ac_file" = x-; then +- echo "/* Generated by configure. */" >$tmp/config.h +- else +- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h +- fi +- cat $tmp/in >>$tmp/config.h +- rm -f $tmp/in +- if test x"$ac_file" != x-; then +- if cmp -s $ac_file $tmp/config.h 2>/dev/null; then +- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +-echo "$as_me: $ac_file is unchanged" >&6;} +- else +- ac_dir=`(dirname "$ac_file") 2>/dev/null || +-$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'` +- { case "$ac_dir" in +- [\\/]* | ?:[\\/]* ) as_incr_dir=;; +- *) as_incr_dir=.;; +-esac +-as_dummy="$ac_dir" +-for as_mkdir_dir in `IFS='/\\'; set X $as_dummy; shift; echo "$@"`; do +- case $as_mkdir_dir in +- # Skip DOS drivespec +- ?:) as_incr_dir=$as_mkdir_dir ;; +- *) +- as_incr_dir=$as_incr_dir/$as_mkdir_dir +- test -d "$as_incr_dir" || +- mkdir "$as_incr_dir" || +- { { echo "$as_me:$LINENO: error: cannot create \"$ac_dir\"" >&5 +-echo "$as_me: error: cannot create \"$ac_dir\"" >&2;} +- { (exit 1); exit 1; }; } +- ;; +- esac +-done; } +- +- rm -f $ac_file +- mv $tmp/config.h $ac_file ++ sed -f conftest.frag conftest.in > conftest.out ++ rm -f conftest.in ++ mv conftest.out conftest.in ++' >> $CONFIG_STATUS ++ sed 1,${ac_max_here_lines}d conftest.vals > conftest.tail ++ rm -f conftest.vals ++ mv conftest.tail conftest.vals ++done ++rm -f conftest.vals ++ ++cat >> $CONFIG_STATUS <<\EOF ++ rm -f conftest.frag conftest.h ++ echo "/* $ac_file. Generated automatically by configure. */" > conftest.h ++ cat conftest.in >> conftest.h ++ rm -f conftest.in ++ if cmp -s $ac_file conftest.h 2>/dev/null; then ++ echo "$ac_file is unchanged" ++ rm -f conftest.h ++ else ++ # Remove last slash and all that follows it. Not all systems have dirname. ++ ac_dir=`echo $ac_file|sed 's%/[^/][^/]*$%%'` ++ if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then ++ # The file is in a subdirectory. ++ test ! -d "$ac_dir" && mkdir "$ac_dir" + fi +- else +- cat $tmp/config.h +- rm -f $tmp/config.h ++ rm -f $ac_file ++ mv conftest.h $ac_file + fi +-done +-_ACEOF +- +-cat >>$CONFIG_STATUS <<\_ACEOF ++fi; done + +-{ (exit 0); exit 0; } +-_ACEOF +-chmod +x $CONFIG_STATUS +-ac_clean_files=$ac_clean_files_save ++EOF ++cat >> $CONFIG_STATUS <<EOF + ++EOF ++cat >> $CONFIG_STATUS <<\EOF + +-# 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=: +- exec 5>/dev/null +- $SHELL $CONFIG_STATUS || 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 ++exit 0 ++EOF ++chmod +x $CONFIG_STATUS ++rm -fr confdefs* $ac_clean_files ++test "$no_create" = yes || ${CONFIG_SHELL-/bin/sh} $CONFIG_STATUS || exit 1 + + +diff -ruN newt-0.52.1-old/configure.in newt-0.52.1/configure.in +--- newt-0.52.1-old/configure.in 2005-09-09 07:02:45.538084000 +0100 ++++ newt-0.52.1/configure.in 2005-09-09 07:02:46.423949408 +0100 +@@ -13,7 +13,7 @@ + AC_PROG_INSTALL + AC_PROG_LN_S + +-AC_CHECK_HEADERS(sys/select.h alloca.h) ++AC_CHECK_HEADERS(sys/select.h alloca.h fribidi/fribidi.h dlfcn.h) + + AC_ARG_WITH(gpm-support, [ --with-gpm-support Compile with GPM support]) + +diff -ruN newt-0.52.1-old/entry.c newt-0.52.1/entry.c +--- newt-0.52.1-old/entry.c 2005-09-09 07:02:45.898029000 +0100 ++++ newt-0.52.1/entry.c 2005-09-09 07:02:46.423949408 +0100 +@@ -196,12 +196,15 @@ + + if (len <= co->width) { + i = len; ++ /* BIDI: do not replaced, because it will not work. ++ * More work needed */ + SLsmg_write_string(chptr); + while (i < co->width) { + SLsmg_write_char('_'); + i++; + } + } else { ++ /* BIDI: will not work for RTL text */ + SLsmg_write_nstring(chptr, co->width); + } + +diff -ruN newt-0.52.1-old/label.c newt-0.52.1/label.c +--- newt-0.52.1-old/label.c 2003-02-05 07:11:35.000000000 +0000 ++++ newt-0.52.1/label.c 2005-09-09 07:02:46.423949408 +0100 +@@ -69,7 +69,9 @@ + SLsmg_set_color(COLORSET_LABEL); + + newtGotorc(co->top, co->left); +- SLsmg_write_string(la->text); ++ /* BIDI: need to check if nstring is really needed. ++ * Where it is used? */ ++ write_nstring_int(la->text, co->width, NULL); + } + + static void labelDestroy(newtComponent co) { +diff -ruN newt-0.52.1-old/listbox.c newt-0.52.1/listbox.c +--- newt-0.52.1-old/listbox.c 2003-08-19 21:12:22.000000000 +0100 ++++ newt-0.52.1/listbox.c 2005-09-09 07:02:46.424949256 +0100 +@@ -527,7 +527,7 @@ + else + SLsmg_set_color(NEWT_COLORSET_LISTBOX); + +- SLsmg_write_nstring(item->text, li->curWidth); ++ write_nstring_int(item->text, li->curWidth, NULL); + + } + newtGotorc(co->top + (li->currItem - li->startShowItem) + li->bdyAdjust, +diff -ruN newt-0.52.1-old/newt.c newt-0.52.1/newt.c +--- newt-0.52.1-old/newt.c 2005-09-09 07:02:46.213981000 +0100 ++++ newt-0.52.1/newt.c 2005-09-09 07:03:38.969961200 +0100 +@@ -18,6 +18,459 @@ + #include "newt.h" + #include "newt_pr.h" + ++#if defined(HAVE_FRIBIDI_FRIBIDI_H) && defined(HAVE_DLFCN_H) ++#include <fribidi/fribidi.h> ++#include <dlfcn.h> ++ ++/* No sense in enabling shaping if we don't have BIDI support. */ ++typedef struct ++{ ++ int is_shaped; ++ wchar_t isolated; ++ wchar_t initial; ++ wchar_t medial; ++ wchar_t final; ++} ++arabic_char_node; ++ ++#define ARABIC_BASE 0x621 ++#define ARABIC_END 0x64A ++ ++static const arabic_char_node arabic_shaping_table[] = { ++/* 0x621 */ { TRUE , 0xFE80, 0x0000, 0x0000, 0x0000}, ++/* 0x622 */ { TRUE , 0xFE81, 0x0000, 0x0000, 0xFE82}, ++/* 0x623 */ { TRUE , 0xFE83, 0x0000, 0x0000, 0xFE84}, ++/* 0x624 */ { TRUE , 0xFE85, 0x0000, 0x0000, 0xFE86}, ++/* 0x625 */ { TRUE , 0xFE87, 0x0000, 0x0000, 0xFE88}, ++/* 0x626 */ { TRUE , 0xFE89, 0xFE8B, 0xFE8C, 0xFE8A}, ++/* 0x627 */ { TRUE , 0xFE8D, 0x0000, 0x0000, 0xFE8E}, ++/* 0x628 */ { TRUE , 0xFE8F, 0xFE91, 0xFE92, 0xFE90}, ++/* 0x629 */ { TRUE , 0xFE93, 0x0000, 0x0000, 0xFE94}, ++/* 0x62A */ { TRUE , 0xFE95, 0xFE97, 0xFE98, 0xFE96}, ++/* 0x62B */ { TRUE , 0xFE99, 0xFE9B, 0xFE9C, 0xFE9A}, ++/* 0x62C */ { TRUE , 0xFE9D, 0xFE9F, 0xFEA0, 0xFE9E}, ++/* 0x62D */ { TRUE , 0xFEA1, 0xFEA3, 0xFEA4, 0xFEA2}, ++/* 0x62E */ { TRUE , 0xFEA5, 0xFEA7, 0xFEA8, 0xFEA6}, ++/* 0x62F */ { TRUE , 0xFEA9, 0x0000, 0x0000, 0xFEAA}, ++/* 0x630 */ { TRUE , 0xFEAB, 0x0000, 0x0000, 0xFEAC}, ++/* 0x631 */ { TRUE , 0xFEAD, 0x0000, 0x0000, 0xFEAE}, ++/* 0x632 */ { TRUE , 0xFEAF, 0x0000, 0x0000, 0xFEB0}, ++/* 0x633 */ { TRUE , 0xFEB1, 0xFEB3, 0xFEB4, 0xFEB2}, ++/* 0x634 */ { TRUE , 0xFEB5, 0xFEB7, 0xFEB8, 0xFEB6}, ++/* 0x635 */ { TRUE , 0xFEB9, 0xFEBB, 0xFEBC, 0xFEBA}, ++/* 0x636 */ { TRUE , 0xFEBD, 0xFEBF, 0xFEC0, 0xFEBE}, ++/* 0x637 */ { TRUE , 0xFEC1, 0xFEC3, 0xFEC4, 0xFEC2}, ++/* 0x638 */ { TRUE , 0xFEC5, 0xFEC7, 0xFEC8, 0xFEC6}, ++/* 0x639 */ { TRUE , 0xFEC9, 0xFECB, 0xFECC, 0xFECA}, ++/* 0x63A */ { TRUE , 0xFECD, 0xFECF, 0xFED0, 0xFECE}, ++/* 0x63B */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63C */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63D */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63E */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x63F */ { FALSE, 0x0000, 0x0000, 0x0000, 0x0000}, ++/* 0x640 */ { TRUE , 0x0640, 0x0640, 0x0640, 0x0640}, ++/* 0x641 */ { TRUE , 0xFED1, 0xFED3, 0xFED4, 0xFED2}, ++/* 0x642 */ { TRUE , 0xFED5, 0xFED7, 0xFED8, 0xFED6}, ++/* 0x643 */ { TRUE , 0xFED9, 0xFEDB, 0xFEDC, 0xFEDA}, ++/* 0x644 */ { TRUE , 0xFEDD, 0xFEDF, 0xFEE0, 0xFEDE}, ++/* 0x645 */ { TRUE , 0xFEE1, 0xFEE3, 0xFEE4, 0xFEE2}, ++/* 0x646 */ { TRUE , 0xFEE5, 0xFEE7, 0xFEE8, 0xFEE6}, ++/* 0x647 */ { TRUE , 0xFEE9, 0xFEEB, 0xFEEC, 0xFEEA}, ++/* 0x648 */ { TRUE , 0xFEED, 0x0000, 0x0000, 0xFEEE}, ++/* 0x649 */ { TRUE , 0xFEEF, 0x0000, 0x0000, 0xFEF0}, ++/* 0x64A */ { TRUE , 0xFEF1, 0xFEF3, 0xFEF4, 0xFEF2} ++}; ++ ++typedef struct { ++ wchar_t c; ++ arabic_char_node ar_node; ++} ++extra_char_node; ++ ++#define EXTRA_BASE 0x67E ++#define EXTRA_END 0x6CC ++static const extra_char_node extra_shaping_table[] = { ++ {0x067E, {TRUE, 0xFB56, 0xFB58, 0xFB59, 0xFB57}}, ++ {0x0686, {TRUE, 0xFB7A, 0xFB7C, 0xFB7D, 0xFB7B}}, ++ {0x0698, {TRUE, 0xFB8A, 0x0000, 0x0000, 0xFB8B}}, ++ {0x06A9, {TRUE, 0xFB8E, 0xFB90, 0xFB91, 0xFB8F}}, ++ {0x06AF, {TRUE, 0xFB92, 0xFB94, 0xFB95, 0xFB93}}, ++ {0x06CC, {TRUE, 0xFBFC, 0xFBFE, 0xFBFF, 0xFBFD}}, ++ {0x0000, {FALSE, 0x0000, 0x0000, 0x0000, 0x0000}}, ++}; ++ ++static const arabic_char_node *get_char_node(wchar_t w) ++{ ++ if (w >= ARABIC_BASE && w <= ARABIC_END) ++ return &arabic_shaping_table[w - ARABIC_BASE]; ++ else if (w >= EXTRA_BASE && w <= EXTRA_END) { ++ const extra_char_node *node = extra_shaping_table; ++ ++ while (node->c) { ++ if (node->c == w) ++ return &node->ar_node; ++ node++; ++ } ++ return NULL; ++ } ++ return NULL; ++} ++ ++static int do_shaping(wchar_t *buf, int len) { ++ int i,j; ++ ++ wchar_t *newbuf; ++ ++ if (len < 1) ++ return 0; ++ ++ newbuf = (wchar_t *)malloc(sizeof(wchar_t)*len); ++ ++ for (i = 0, j = 0; i < len; i++, j++) { ++ int have_previous = FALSE, have_next = FALSE; ++ const arabic_char_node *node, *node1; ++ int prev, next; ++ ++ if (buf[i] == L'\0') ++ break; ++ ++ /* If it is non-joiner, ignore it */ ++ if (buf[i] == 0x200C) { ++ j--; ++ continue; ++ } ++ ++ newbuf[j] = buf[i]; ++ ++ /* If it's not in our range, skip it. */ ++ node = get_char_node(buf[i]); ++ if (!node) ++ { ++ continue; ++ } ++ ++ /* The character wasn't included in the unicode shaping table. */ ++ if (!node->is_shaped) ++ { ++ continue; ++ } ++ ++ for (prev = i - 1; prev >= 0; prev--) ++ if (wcwidth(buf[prev]) || buf[prev] == 0x200C) ++ break; ++ ++ if (prev >= 0 && (node1 = get_char_node(buf[prev])) ++ && ( node1->initial || node1->medial)) ++ { ++ have_previous = TRUE; ++ } ++ ++ for (next = i + 1; next < len; next++) ++ if (wcwidth(buf[next]) || buf[next] == 0x200C) ++ break; ++ ++ if (next < len && (node1 = get_char_node(buf[next])) ++ && (node1->medial || node1->final)) ++ { ++ have_next = TRUE; ++ } ++ ++ /* ++ * FIXME: do not make ligature if there are combining ++ * characters between two parts. ++ */ ++ if (buf[i] == 0x644 && have_next && next == i + 1) ++ { ++ switch (buf[next]) ++ { ++ case 0x622: ++ newbuf[j] = 0xFEF5 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x623: ++ newbuf[j] = 0xFEF7 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x625: ++ newbuf[j] = 0xFEF9 + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ case 0x627: ++ newbuf[j] = 0xFEFB + (have_previous ? 1 : 0); ++ i++; ++ continue; ++ default: ++ break; ++ } ++ } ++ ++ /** Medial **/ ++ if (have_previous && have_next && node->medial) ++ { ++ newbuf[j] = node->medial; ++ } ++ ++ /** Final **/ ++ else if (have_previous && node->final) ++ { ++ newbuf[j] = node->final; ++ } ++ ++ /** Initial **/ ++ else if (have_next && node->initial) ++ { ++ newbuf[j] = node->initial; ++ } ++ ++ /** Isolated **/ ++ else if (node->isolated) ++ { ++ newbuf[j] = node->isolated; ++ } ++ } ++ for (i = 0; i < len && i < j; i++) { ++ buf[i] = newbuf[i]; ++ } ++ while (i < len) { ++ buf[i++] = L'\0'; ++ } ++ ++ free(newbuf); ++ return 0; ++} ++ ++/* Converts bidi wchar text {in} to visual wchar text which is displayable ++ * in text mode. Uses {base_dir} as default base direction. ++ * Returns malloc'ed converted text or NULL in case of error or if {need_out} is ++ * not set. Modifies {base_dir} to reflect actual direction. ++ */ ++static wchar_t* wchar_to_textmod_visual(wchar_t *in,unsigned int len,FriBidiCharType *base_dir, int need_out) ++{ ++ FriBidiChar *out = NULL; ++ static void *handle = NULL; ++ ++ fribidi_boolean (*func_ptr) (FriBidiChar *, FriBidiStrIndex, ++ FriBidiCharType *, FriBidiChar *, ++ FriBidiStrIndex *, FriBidiStrIndex *, ++ FriBidiLevel *); ++ ++ if (!handle) ++ handle = dlopen("/usr/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); ++ if (!handle) ++ handle = dlopen("/lib/libfribidi.so.0", RTLD_LAZY | RTLD_GLOBAL); ++ if (!handle) ++ return NULL; ++ ++ func_ptr = dlsym(handle, "fribidi_log2vis"); ++ if (!func_ptr) { ++ dlclose(handle); ++ handle = NULL; ++ return NULL; ++ } ++ ++ if (need_out) { ++ out = (FriBidiChar *)malloc(sizeof(FriBidiChar)*(len+1)); ++ if(!out) ++ { ++ dlclose(handle); ++ handle = NULL; ++ return (wchar_t *) out; ++ } ++ ++ do_shaping(in, len); ++ len = wcsnlen(in, len); ++ } ++ (*func_ptr)(in, len, base_dir, out, NULL, NULL, NULL); ++ ++ return (wchar_t *) out; ++} ++ ++/* ++ * Converts text given in {str} from logical order to visual order. ++ * Uses {dir} as base direction ('N', 'R', 'L'). ++ * Returns malloc'ed converted string. Modifies {dir} to reflect actual ++ * direction. ++ */ ++static char *_newt_log2vis(const char *str, char *dir) ++{ ++ wchar_t *wcs; ++ char *rstr = NULL; ++ int len = strlen(str); ++ int ret; ++ FriBidiCharType basedir; ++ ++ switch (*dir) ++ { ++ case 'R': basedir = FRIBIDI_TYPE_R; ++ break; ++ case 'L': basedir = FRIBIDI_TYPE_L; ++ break; ++ default: basedir = FRIBIDI_TYPE_ON; ++ break; ++ } ++ ++ if (len) { ++ wchar_t *owcs; ++ int newlen; ++ ++ wcs = malloc(sizeof(*wcs) * (len + 1)); ++ if (!wcs) ++ return NULL; ++ ret = mbstowcs(wcs, str, len + 1); ++ if (ret < 0) { ++ free(wcs); ++ return NULL; ++ } ++ owcs = wchar_to_textmod_visual(wcs, ret, &basedir, 1); ++ if (FRIBIDI_DIR_TO_LEVEL(basedir)) ++ *dir = 'R'; ++ else ++ *dir = 'L'; ++ ++ free(wcs); ++ if (!owcs) ++ return NULL; ++ ++ newlen = wcstombs(NULL, owcs, 0); ++ if (newlen < 0) { ++ free(owcs); ++ return NULL; ++ } ++ rstr = malloc(newlen + 1); ++ if (!rstr) { ++ free(owcs); ++ return NULL; ++ } ++ ret = wcstombs(rstr, owcs, newlen + 1); ++ free(owcs); ++ if (ret < 0) { ++ free(rstr); ++ return NULL; ++ } ++ } ++ return rstr; ++} ++ ++/* Returns base direction of text given in {str}. ++ */ ++char get_text_direction(const char *str) ++{ ++ int len = strlen(str); ++ char dir = 'N'; ++ wchar_t *wcs; ++ int ret; ++ ++ FriBidiCharType basedir = FRIBIDI_TYPE_ON; ++ ++ if (len) { ++ wcs = malloc(sizeof(*wcs) * (len + 1)); ++ if (!wcs) ++ return dir; ++ ret = mbstowcs(wcs, str, len + 1); ++ if (ret < 0) { ++ free(wcs); ++ return dir; ++ } ++ wchar_to_textmod_visual(wcs, ret, &basedir, 1); ++ free(wcs); ++ if (FRIBIDI_DIR_TO_LEVEL(basedir)) ++ dir = 'R'; ++ else ++ dir = 'L'; ++ } ++ return dir; ++} ++ ++/* If width of string {str} is less then {width} adds ++ * final spaces to make it {width} position wide. ++ * Returns malloc'ed padded string or NULL in case of errors ++ * or if string does not need padding. ++ */ ++static char *pad_line(const char *str, int width) ++{ ++ int len = strlen(str); ++ int w = _newt_wstrlen(str, len); ++ ++ if (w < width) { ++ char *newstr = malloc(len + 1 + (width - w)); ++ if (!newstr) ++ return NULL; ++ memcpy(newstr, str, len); ++ memset(newstr + len, ' ', width - w); ++ newstr[len+width-w] = '\0'; ++ return newstr; ++ } ++ return NULL; ++} ++ ++/* ++ * Writes string {str}. Uses {dir} as default direction. ++ * Returns direction of the string in {dir}. ++ */ ++void write_string_int(const char *str, char *dir) ++{ ++ char dummy; ++ char *tmpstr; ++ ++ if (!dir) { ++ dummy = 'N'; ++ dir = &dummy; ++ } ++ ++ tmpstr = _newt_log2vis(str, dir); ++ if (tmpstr) ++ str = tmpstr; ++ SLsmg_write_string(str); ++ if (tmpstr) ++ free(tmpstr); ++} ++ ++/* Writes at most {n} positions of the string {str}. ++ * Adds final (logical) spaces if string width is less than {n}. ++ * Uses {dir} as default direction. ++ * Returns direction of the string in {dir} ++ */ ++void write_nstring_int(const char *str, int n, char *dir) ++{ ++ char dummy; ++ char *tmpstr, *tmpstr1; ++ ++ if (!dir) { ++ dummy = 'N'; ++ dir = &dummy; ++ } ++ ++ tmpstr1 = pad_line(str, n); ++ if (tmpstr1) ++ str = tmpstr1; ++ tmpstr = _newt_log2vis(str, dir); ++ if (tmpstr) { ++ free(tmpstr1); ++ str = tmpstr; ++ } ++ SLsmg_write_nstring(str, n); ++ if (tmpstr) ++ free(tmpstr); ++ else ++ free(tmpstr1); ++} ++#else ++void write_string_int(const char *str, char *dir) ++{ ++ SLsmg_write_string(str); ++} ++ ++void write_nstring_int(const char *str, int w, char *dir) ++{ ++ SLsmg_write_nstring(str, w); ++} ++ ++char get_text_direction(const char *str) ++{ ++ return 'L'; ++} ++#endif ++ + struct Window { + int height, width, top, left; + SLsmg_Char_Type * buffer; +@@ -677,7 +1130,7 @@ + SLsmg_set_char_set(0); + SLsmg_write_char(' '); + SLsmg_set_color(NEWT_COLORSET_TITLE); +- SLsmg_write_string((char *)currentWindow->title); ++ write_string_int((char *)currentWindow->title, NULL); + SLsmg_set_color(NEWT_COLORSET_BORDER); + SLsmg_write_char(' '); + SLsmg_set_char_set(1); +@@ -889,7 +1342,7 @@ + buf[SLtt_Screen_Cols] = '\0'; + } + SLsmg_gotorc(SLtt_Screen_Rows - 1, 0); +- SLsmg_write_string(buf); ++ write_string_int(buf, NULL); + } + + void newtPushHelpLine(const char * text) { +@@ -930,7 +1383,7 @@ + } + + SLsmg_gotorc(row, col); +- SLsmg_write_string((char *)text); ++ write_string_int((char *)text, NULL); + } + + int newtSetFlags(int oldFlags, int newFlags, enum newtFlagsSense sense) { +diff -ruN newt-0.52.1-old/newt_pr.h newt-0.52.1/newt_pr.h +--- newt-0.52.1-old/newt_pr.h 2005-09-09 07:02:46.028009000 +0100 ++++ newt-0.52.1/newt_pr.h 2005-09-09 07:02:46.425949104 +0100 +@@ -81,6 +81,10 @@ + struct event ev); + + int _newt_wstrlen(const char *str, int len); ++void write_string_int(const char *, char *); ++void write_nstring_int(const char *, int, char *); ++char get_text_direction(const char *); ++ + #define wstrlen(str,len) _newt_wstrlen((str),(len)) + + #endif /* H_NEWT_PR */ +diff -ruN newt-0.52.1-old/textbox.c newt-0.52.1/textbox.c +--- newt-0.52.1-old/textbox.c 2005-09-09 07:02:45.935023000 +0100 ++++ newt-0.52.1/textbox.c 2005-09-09 07:02:46.425949104 +0100 +@@ -339,20 +339,42 @@ + int i; + struct textbox * tb = c->data; + int size; +- ++ char dir = 'N'; ++ int newdir = 1; ++ int dw = 0; ++ + if (tb->sb) { + size = tb->numLines - c->height; + newtScrollbarSet(tb->sb, tb->topLine, size ? size : 0); + tb->sb->ops->draw(tb->sb); ++ dw = 2; + } + + SLsmg_set_color(NEWT_COLORSET_TEXTBOX); + ++ /* find direction of first visible paragraph */ ++ for (i = 0; i < tb->topLine; i++) { ++ if (!*tb->lines[i]) { ++ /* new line: new paragraph starts at the next line */ ++ newdir = 1; ++ dir = 'N'; ++ } ++ else if (newdir) { ++ /* get current paragraph direction, if possible */ ++ dir = get_text_direction(tb->lines[i]); ++ newdir = (dir == 'N') ? 1 : 0; ++ } ++ } ++ + for (i = 0; (i + tb->topLine) < tb->numLines && i < c->height; i++) { + newtGotorc(c->top + i, c->left); + SLsmg_write_string(tb->blankline); + newtGotorc(c->top + i, c->left); +- SLsmg_write_string(tb->lines[i + tb->topLine]); ++ /* BIDI: we need *nstring* here to properly align lines */ ++ write_nstring_int(tb->lines[i + tb->topLine], c->width - dw, &dir); ++ /* Does new paragraph follow? */ ++ if (!*tb->lines[i + tb->topLine]) ++ dir = 'N'; + } + } + --- newt-0.52.2.orig/debian/old-patches/002_version_fix.patch +++ newt-0.52.2/debian/old-patches/002_version_fix.patch @@ -0,0 +1,9 @@ +diff -ruN newt-0.52.2-old/config.h.in newt-0.52.1/config.h.in +--- newt-0.52.2-old/config.h.in 2005-09-30 15:05:55.000000000 +0100 ++++ newt-0.52.2/config.h.in 2005-10-22 20:50:15.000000000 +0100 +@@ -12,4 +12,4 @@ + #define PACKAGE "newt" + #define ENABLE_NLS 1 + +-#define VERSION "0.51.6" ++#define VERSION "0.52.2" --- newt-0.52.2.orig/debian/libnewt0.52.install +++ newt-0.52.2/debian/libnewt0.52.install @@ -0,0 +1 @@ +libnewt.so* usr/lib --- newt-0.52.2.orig/debian/pycompat +++ newt-0.52.2/debian/pycompat @@ -0,0 +1 @@ +2