luit-20240910/0000755000000000000000000000000014670153005011431 5ustar rootrootluit-20240910/charset.h0000644000000000000000000000652312107021725013235 0ustar rootroot/* $XTermId: charset.h,v 1.17 2013/02/13 23:37:57 tom Exp $ */ /* Copyright (c) 2013 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUIT_CHARSET_H #define LUIT_CHARSET_H 1 #include typedef enum { T_FAILED = 0 ,T_94 /* 94 codepoints */ ,T_96 /* 96 codepoints */ ,T_128 /* 128 codepoints */ ,T_9494 /* 94x94 codepoints */ ,T_9696 /* 96x96 codepoints */ /* Big 5 */ ,T_94192 /* 94x192 codepoints */ ,T_OTHER /* legal, but unused in practice */ } T_CodePoints; /* True for charsets that pass control chars unchanged, at least in the first byte */ #define CHARSET_REGULAR(c) ((c)->type != T_128) typedef struct _Charset { const char *name; int type; unsigned char final; unsigned int (*recode) (unsigned int, const struct _Charset * self); int (*reverse) (unsigned int, const struct _Charset * self); const void *data; int (*other_stack) (unsigned c, OtherStatePtr aux); OtherState *other_aux; unsigned int (*other_recode) (unsigned int c, OtherStatePtr aux); unsigned int (*other_reverse) (unsigned int c, OtherStatePtr aux); struct _Charset *next; } CharsetRec, *CharsetPtr; typedef struct _FontencCharset { const char *name; int type; unsigned char final; const char *xlfd; unsigned shift; FontMapPtr mapping; FontMapReversePtr reverse; } FontencCharsetRec, *FontencCharsetPtr; typedef struct _LocaleCharset { const char *name; int gl; int gr; const char *g0; const char *g1; const char *g2; const char *g3; const char *other; } LocaleCharsetRec, *LocaleCharsetPtr; int isOtherCharset(const char *); int lcStrCmp(const char *, const char *); const CharsetRec *getUnknownCharset(int); const CharsetRec *getCharset(unsigned, int); const CharsetRec *getCharsetByName(const char *); const FontencCharsetRec *getFontencByName(const char *); const FontencCharsetRec *getCompositePart(const char *, unsigned); const char *getCompositeCharset(const char *); void reportCharsets(void); int getLocaleState(const char *locale, const char *charset, int *gl_return, int *gr_return, const CharsetRec * *g0_return, const CharsetRec * *g1_return, const CharsetRec * *g2_return, const CharsetRec * *g3_return, const CharsetRec * *other_return); #endif /* LUIT_CHARSET_H */ luit-20240910/other.h0000644000000000000000000000600311474014135012721 0ustar rootroot/* $XTermId: other.h,v 1.12 2010/11/26 20:28:13 tom Exp $ */ /* Copyright (c) 2002 by Tomohiro KUBOTA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUIT_OTHER_H #define LUIT_OTHER_H 1 #include /* include this, for self-contained headers */ #include #include #undef UCHAR #define UCHAR unsigned char #undef UINT #define UINT unsigned int #define UChar(n) ((UCHAR)(n)) typedef struct { FontMapPtr mapping; FontMapReversePtr reverse; int buf; } aux_gbk; typedef struct { UCHAR buf[4]; int buf_ptr, len; } aux_utf8; typedef struct { FontMapPtr x0208mapping; FontMapPtr x0201mapping; FontMapReversePtr x0208reverse; FontMapReversePtr x0201reverse; int buf; } aux_sjis; typedef struct { FontMapPtr mapping; FontMapReversePtr reverse; int buf; } aux_hkscs; typedef struct { FontMapPtr cs0_mapping; /* gb18030.2000-0 */ FontMapReversePtr cs0_reverse; FontMapPtr cs1_mapping; /* gb18030.2000-1 */ FontMapReversePtr cs1_reverse; int linear; /* set to '1' if stack_gb18030 linearized a 4bytes seq */ int buf[3]; int buf_ptr; } aux_gb18030; typedef union { aux_gbk gbk; aux_utf8 utf8; aux_sjis sjis; aux_hkscs hkscs; aux_gb18030 gb18030; } OtherState, *OtherStatePtr; int init_gbk(OtherStatePtr); UINT mapping_gbk(UINT, OtherStatePtr); UINT reverse_gbk(UINT, OtherStatePtr); int stack_gbk(UINT, OtherStatePtr); int init_utf8(OtherStatePtr); UINT mapping_utf8(UINT, OtherStatePtr); UINT reverse_utf8(UINT, OtherStatePtr); int stack_utf8(UINT, OtherStatePtr); int init_sjis(OtherStatePtr); UINT mapping_sjis(UINT, OtherStatePtr); UINT reverse_sjis(UINT, OtherStatePtr); int stack_sjis(UINT, OtherStatePtr); int init_hkscs(OtherStatePtr); UINT mapping_hkscs(UINT, OtherStatePtr); UINT reverse_hkscs(UINT, OtherStatePtr); int stack_hkscs(UINT, OtherStatePtr); int init_gb18030(OtherStatePtr); UINT mapping_gb18030(UINT, OtherStatePtr); UINT reverse_gb18030(UINT, OtherStatePtr); int stack_gb18030(UINT, OtherStatePtr); #endif /* LUIT_OTHER_H */ luit-20240910/iso2022.c0000644000000000000000000006415414366575651012730 0ustar rootroot/* $XTermId: iso2022.c,v 1.42 2023/02/01 23:54:17 tom Exp $ */ /* Copyright 2011-2018,2023 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #define BUFFERED_INPUT_SIZE 4 static unsigned char buffered_input[BUFFERED_INPUT_SIZE]; static int buffered_input_count = 0; static void terminateEsc(Iso2022Ptr, int, unsigned char *, unsigned); static void terminate(Iso2022Ptr, int); #define OUTBUF_FREE(is, count) ((is)->outbuf_count + (count) <= BUFFER_SIZE) #define OUTBUF_MAKE_FREE(is, fd, count) \ if(!OUTBUF_FREE((is), (count))) outbuf_flush((is), (fd)) #ifdef OPT_TRACE static void trace_charset(const char *tag, const CharsetRec * ptr) { if (ptr != NULL) { TRACE(("%s:", NonNull(tag))); TRACE((" name:%s", NonNull(ptr->name))); TRACE((" type:%d", ptr->type)); if (ptr->final) TRACE((" final:%c", ptr->final)); if (ptr->data != NULL) TRACE((" data")); if (ptr->recode != NULL) TRACE((" recode")); if (ptr->reverse != NULL) TRACE((" reverse")); if (ptr->other_stack != NULL) TRACE((" other_stack")); if (ptr->other_aux != NULL) TRACE((" other_aux")); if (ptr->other_recode != NULL) TRACE((" other_recode")); if (ptr->other_reverse != NULL) TRACE((" other_reverse")); TRACE(("\n")); } } static void trace_iso2022(const char *tag, const Iso2022Ptr ptr) { TRACE(("%s:\n", NonNull(tag))); trace_charset("\tGL()", GL(ptr)); trace_charset("\tGR()", GR(ptr)); trace_charset("\tG0()", G0(ptr)); trace_charset("\tG1()", G1(ptr)); trace_charset("\tG2()", G2(ptr)); trace_charset("\tG3()", G3(ptr)); trace_charset("\tOTHER()", OTHER(ptr)); } #else #define trace_iso2022(tag, ptr) /* nothing */ #endif static void outbuf_flush(Iso2022Ptr is, int fd) { int rc; unsigned i = 0; if (olog >= 0) IGNORE_RC(write(olog, is->outbuf, is->outbuf_count)); while (i < is->outbuf_count) { rc = (int) write(fd, is->outbuf + i, is->outbuf_count - i); if (rc > 0) { i += (unsigned) rc; } else { if (rc < 0 && errno == EINTR) continue; else if ((rc == 0) || ((rc < 0) && (errno == EAGAIN))) { if (waitForOutput(fd) == IO_Closed) break; continue; } else break; } } is->outbuf_count = 0; } static void outbufOne(Iso2022Ptr is, int fd, unsigned c) { OUTBUF_MAKE_FREE(is, fd, 1); is->outbuf[is->outbuf_count++] = UChar(c); } /* Discards null codepoints */ static void outbufUTF8(Iso2022Ptr is, int fd, unsigned c) { if (c == 0) return; if (c <= 0x7F) { OUTBUF_MAKE_FREE(is, fd, 1); is->outbuf[is->outbuf_count++] = UChar(c); } else if (c <= 0x7FF) { OUTBUF_MAKE_FREE(is, fd, 2); is->outbuf[is->outbuf_count++] = UChar(0xC0 | ((c >> 6) & 0x1F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | (c & 0x3F)); } else if (c <= 0xFFFF) { OUTBUF_MAKE_FREE(is, fd, 3); is->outbuf[is->outbuf_count++] = UChar(0xE0 | ((c >> 12) & 0x0F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 6) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | (c & 0x3F)); } else if (c <= 0x1FFFFF) { OUTBUF_MAKE_FREE(is, fd, 4); is->outbuf[is->outbuf_count++] = UChar(0xF0 | ((c >> 18) & 0x07)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 12) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 6) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | (c & 0x3F)); } else if (c <= 0x03FFFFFF) { OUTBUF_MAKE_FREE(is, fd, 5); is->outbuf[is->outbuf_count++] = UChar(0xF8 | ((c >> 24) & 0x03)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 18) & 0x3f)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 12) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 6) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | (c & 0x3F)); } else if (c <= 0x7FFFFFFF) { OUTBUF_MAKE_FREE(is, fd, 6); is->outbuf[is->outbuf_count++] = UChar(0xFC | ((c >> 30) & 0x01)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 24) & 0x3f)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 18) & 0x3f)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 12) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | ((c >> 6) & 0x3F)); is->outbuf[is->outbuf_count++] = UChar(0x80 | (c & 0x3F)); } else { /* "21 bits ought to be enough for anybody!" -- The Unicode Consortium */ Warning("ignoring character beyond UTF-8's 31-bit range: 0x%X.\n", c); } } static void buffer(Iso2022Ptr is, unsigned c) { if (is->buffered == NULL) { is->buffered_len = 10; is->buffered = malloc(is->buffered_len); if (is->buffered == NULL) FatalError("Couldn't allocate buffered.\n"); } if (is->buffered_count >= is->buffered_len) { is->buffered = realloc(is->buffered, 2 * is->buffered_len + 1); if (is->buffered == NULL) { FatalError("Couldn't grow buffered.\n"); } is->buffered_len = 2 * is->buffered_len + 1; } is->buffered[is->buffered_count++] = UChar(c); } static void outbuf_buffered_carefully(Iso2022Ptr is, int fd) { /* This should never happen in practice */ unsigned i = 0; while (i < is->buffered_count) { OUTBUF_MAKE_FREE(is, fd, 1); is->outbuf[is->outbuf_count++] = is->buffered[i++]; } is->buffered_count = 0; } static void outbuf_buffered(Iso2022Ptr is, int fd) { if (is->buffered_count > BUFFER_SIZE) outbuf_buffered_carefully(is, fd); OUTBUF_MAKE_FREE(is, fd, is->buffered_count); memcpy(is->outbuf + is->outbuf_count, is->buffered, is->buffered_count); is->outbuf_count += is->buffered_count; is->buffered_count = 0; } static void discard_buffered(Iso2022Ptr is) { is->buffered_count = 0; } Iso2022Ptr allocIso2022(void) { Iso2022Ptr is; is = TypeCalloc(Iso2022Rec); if (!is) return NULL; is->glp = is->grp = NULL; G0(is) = G1(is) = G2(is) = G3(is) = OTHER(is) = NULL; is->parserState = P_NORMAL; is->shiftState = S_NORMAL; is->inputFlags = IF_EIGHTBIT | IF_SS | IF_SSGR; is->outputFlags = OF_SS | OF_LS | OF_SELECT; is->buffered = NULL; is->buffered_len = 0; is->buffered_count = 0; is->buffered_ku = -1; is->outbuf = malloc((size_t) BUFFER_SIZE); if (!is->outbuf) { free(is); return NULL; } is->outbuf_count = 0; return is; } #ifdef NO_LEAKS void destroyIso2022(Iso2022Ptr is) { if (is->buffered) free(is->buffered); if (is->outbuf) free(is->outbuf); free(is); } #endif static int identifyCharset(Iso2022Ptr i, const CharsetRec * *p) { if (p == &G0(i)) { return 0; } else if (p == &G1(i)) { return 1; } else if (p == &G2(i)) { return 2; } else if (p == &G3(i)) { return 3; } else { abort(); /* NOTREACHED */ } } #define G_name(n) ((i != 0 && i->g[n] != 0) ? NonNull(i->g[n]->name) : "unset") void reportIso2022(const char *tag, Iso2022Ptr i) { Message("%s: ", tag); if (OTHER(i) != NULL) { Message("%s, non-ISO-2022 encoding.\n", OTHER(i)->name); return; } Message("G0 is %s, ", G_name(0)); Message("G1 is %s, ", G_name(1)); Message("G2 is %s, ", G_name(2)); Message("G3 is %s.\n", G_name(3)); Message("GL is G%d, ", identifyCharset(i, i->glp)); Message("GR is G%d.\n", identifyCharset(i, i->grp)); } int initIso2022(const char *locale, const char *charset, Iso2022Ptr i) { int gl = 0, gr = 2; const CharsetRec *g0 = NULL; const CharsetRec *g1 = NULL; const CharsetRec *g2 = NULL; const CharsetRec *g3 = NULL; const CharsetRec *other = NULL; int rc; TRACE(("initIso2022(locale=%s, charset=%s)\n", NonNull(locale), NonNull(charset))); rc = getLocaleState(locale, charset, &gl, &gr, &g0, &g1, &g2, &g3, &other); if (rc < 0) { if (charset) { Warning("couldn't find charset %s; " "using ISO 8859-1.\n", charset); } else if (ignore_locale) { Warning("couldn't find charset data for %s; " "using ISO 8859-1.\n", locale); } else { Warning("couldn't find charset data for locale %s; " "using ISO 8859-1.\n", locale); } } if (G0(i) == NULL) { if (g0) G0(i) = g0; else G0(i) = getCharsetByName("ASCII"); } if (G1(i) == NULL) { if (g1) G1(i) = g1; else G1(i) = getUnknownCharset(T_94); } if (G2(i) == NULL) { if (g2) G2(i) = g2; else G2(i) = getCharsetByName("ISO 8859-1"); } if (G3(i) == NULL) { if (g3) G3(i) = g3; else G3(i) = getUnknownCharset(T_94); } if (OTHER(i) == NULL) { if (other) OTHER(i) = other; else OTHER(i) = NULL; } if (i->glp == NULL) { i->glp = &i->g[gl]; } if (i->grp == NULL) { i->grp = &i->g[gr]; } trace_iso2022("...initIso2022", i); return 0; } int mergeIso2022(Iso2022Ptr d, Iso2022Ptr s) { if (G0(d) == NULL) G0(d) = G0(s); if (G1(d) == NULL) G1(d) = G1(s); if (G2(d) == NULL) G2(d) = G2(s); if (G3(d) == NULL) G3(d) = G3(s); if (OTHER(d) == NULL) OTHER(d) = OTHER(s); if (d->glp == NULL) d->glp = &(d->g[identifyCharset(s, s->glp)]); if (d->grp == NULL) d->grp = &(d->g[identifyCharset(s, s->grp)]); trace_iso2022("...mergeIso2022", d); return 0; } static int utf8Count(unsigned c) { /* All return values must be less than BUFFERED_INPUT_SIZE */ if ((c & 0x80) == 0) return 1; else if ((c & 0x40) == 0) return 1; /* incorrect UTF-8 */ else if ((c & 0x60) == 0x40) return 2; else if ((c & 0x70) == 0x60) return 3; else if ((c & 0x78) == 0x70) return 4; else return 1; } static int fromUtf8(unsigned char *b) { if ((b[0] & 0x80) == 0) return b[0]; else if ((b[0] & 0x40) == 0) return -1; /* incorrect UTF-8 */ else if ((b[0] & 0x60) == 0x40) return ((b[0] & 0x1F) << 6) | (b[1] & 0x3F); else if ((b[0] & 0x70) == 0x60) return (((b[0] & 0x0F) << 12) | ((b[1] & 0x3F) << 6) | ((b[2] & 0x3F))); else if ((b[0] & 0x78) == 0x70) return (((b[0] & 0x03) << 18) | ((b[1] & 0x3F) << 12) | ((b[2] & 0x3F) << 6) | ((b[3] & 0x3F))); else return -1; } void copyIn(Iso2022Ptr is, int fd, unsigned char *buf, int count) { unsigned char *c; int codepoint, rem; c = buf; rem = count; #define NEXT do {c++; rem--;} while(0) while (rem > 0) { codepoint = -1; if (is->parserState == P_ESC) { assert(buffered_input_count == 0); codepoint = *c; NEXT; if (*c == CSI_7) is->parserState = P_CSI; else if (IS_FINAL_ESC(codepoint)) is->parserState = P_NORMAL; } else if (is->parserState == P_CSI) { assert(buffered_input_count == 0); codepoint = *c; NEXT; if (IS_FINAL_CSI(codepoint)) is->parserState = P_NORMAL; } else if (!(*c & 0x80)) { if (buffered_input_count > 0) { buffered_input_count = 0; continue; } else { codepoint = *c; NEXT; if (codepoint == ESC) is->parserState = P_ESC; } } else if ((*c & 0x40)) { if (buffered_input_count > 0) { buffered_input_count = 0; continue; } else { buffered_input[buffered_input_count] = *c; buffered_input_count++; NEXT; } } else { if (buffered_input_count <= 0) { buffered_input_count = 0; NEXT; continue; } else { buffered_input[buffered_input_count] = *c; buffered_input_count++; NEXT; if (buffered_input_count >= utf8Count(buffered_input[0])) { codepoint = fromUtf8(buffered_input); buffered_input_count = 0; if (codepoint == CSI) is->parserState = P_CSI; } } } #undef NEXT if (codepoint >= 0) { int i; unsigned ucode = (unsigned) codepoint; unsigned char obuf[4]; #define WRITE_1(i) do { \ obuf[0] = UChar(i); \ IGNORE_RC(write(fd, obuf, (size_t) 1)); \ } while(0) #define WRITE_2(i) do { \ obuf[0] = UChar(((i) >> 8) & 0xFF); \ obuf[1] = UChar((i) & 0xFF); \ IGNORE_RC(write(fd, obuf, (size_t) 2)); \ } while(0) #define WRITE_3(i) do { \ obuf[0] = UChar(((i) >> 16) & 0xFF); \ obuf[1] = UChar(((i) >> 8) & 0xFF); \ obuf[2] = UChar((i) & 0xFF); \ IGNORE_RC(write(fd, obuf, (size_t) 3)); \ } while(0) #define WRITE_4(i) do { \ obuf[0] = UChar(((i) >> 24) & 0xFF); \ obuf[1] = UChar(((i) >> 16) & 0xFF); \ obuf[2] = UChar(((i) >> 8) & 0xFF); \ obuf[3] = UChar((i) & 0xFF); \ IGNORE_RC(write(fd, obuf, (size_t) 4)); \ } while(0) #define WRITE_1_P_8bit(p, i) { \ obuf[0] = UChar(p); \ obuf[1] = UChar(i); \ IGNORE_RC(write(fd, obuf, (size_t) 2)); \ } #define WRITE_1_P_7bit(p, i) { \ obuf[0] = ESC; \ obuf[1] = UChar((p) - 0x40); \ obuf[2] = UChar(i); \ IGNORE_RC(write(fd, obuf, (size_t) 3)); \ } #define WRITE_1_P(p,i) do { \ if(is->inputFlags & IF_EIGHTBIT) \ WRITE_1_P_8bit(p,i) else \ WRITE_1_P_7bit(p,i) \ } while(0) #define WRITE_2_P_8bit(p, i) { \ obuf[0] = UChar(p); \ obuf[1] = UChar(((i) >> 8) & 0xFF); \ obuf[2] = UChar((i) & 0xFF); \ IGNORE_RC(write(fd, obuf, (size_t) 3)); \ } #define WRITE_2_P_7bit(p, i) { \ obuf[0] = ESC; \ obuf[1] = UChar((p) - 0x40); \ obuf[2] = UChar(((i) >> 8) & 0xFF); \ obuf[3] = UChar((i) & 0xFF); \ IGNORE_RC(write(fd, obuf, (size_t) 4)); \ } #define WRITE_2_P(p,i) do { \ if(is->inputFlags & IF_EIGHTBIT) \ WRITE_2_P_8bit(p,i) \ else \ WRITE_2_P_7bit(p,i) \ } while(0) #define WRITE_1_P_S(p,i,s) do { \ obuf[0] = UChar(p); \ obuf[1] = UChar((i) & 0xFF); \ obuf[2] = UChar(s); \ IGNORE_RC(write(fd, obuf, (size_t) 3)); \ } while(0) #define WRITE_2_P_S(p,i,s) do { \ obuf[0] = UChar(p); \ obuf[1] = UChar(((i) >> 8) & 0xFF); \ obuf[2] = UChar((i) & 0xFF); \ obuf[3] = UChar(s); \ IGNORE_RC(write(fd, obuf, (size_t) 4)); \ } while(0) if (ucode < 0x20 || (OTHER(is) == NULL && CHARSET_REGULAR(GR(is)) && (ucode >= 0x80 && ucode < 0xA0))) { WRITE_1(ucode); continue; } if (OTHER(is) != NULL && OTHER(is)->other_reverse != NULL) { unsigned int c2; c2 = OTHER(is)->other_reverse(ucode, OTHER(is)->other_aux); if (c2 >> 24) WRITE_4(c2); else if (c2 >> 16) WRITE_3(c2); else if (c2 >> 8) WRITE_2(c2); else if (c2) WRITE_1(c2); continue; } i = (GL(is)->reverse) (ucode, GL(is)); if (i >= 0) { switch (GL(is)->type) { case T_94: case T_96: case T_128: if (i >= 0x20) WRITE_1(i); break; case T_9494: case T_9696: case T_94192: if (i >= 0x2020) WRITE_2(i); break; default: abort(); /* NOTREACHED */ } continue; } if (is->inputFlags & IF_EIGHTBIT) { i = GR(is)->reverse(ucode, GR(is)); if (i >= 0) { switch (GR(is)->type) { case T_94: case T_96: case T_128: /* we allow C1 characters if T_128 in GR */ WRITE_1(i | 0x80); break; case T_9494: case T_9696: WRITE_2(i | 0x8080); break; case T_94192: WRITE_2(i | 0x8000); break; default: abort(); /* NOTREACHED */ } continue; } } if (is->inputFlags & IF_SS) { i = G2(is)->reverse(ucode, G2(is)); if (i >= 0) { switch (GR(is)->type) { case T_94: case T_96: case T_128: if (i >= 0x20) { if ((is->inputFlags & IF_EIGHTBIT) && (is->inputFlags & IF_SSGR)) i |= 0x80; WRITE_1_P(SS2, i); } break; case T_9494: case T_9696: if (i >= 0x2020) { if ((is->inputFlags & IF_EIGHTBIT) && (is->inputFlags & IF_SSGR)) i |= 0x8080; WRITE_2_P(SS2, i); } break; case T_94192: if (i >= 0x2020) { if ((is->inputFlags & IF_EIGHTBIT) && (is->inputFlags & IF_SSGR)) i |= 0x8000; WRITE_2_P(SS2, i); } break; default: abort(); /* NOTREACHED */ } continue; } } if (is->inputFlags & IF_SS) { i = G3(is)->reverse(ucode, G3(is)); switch (GR(is)->type) { case T_94: case T_96: case T_128: if (i >= 0x20) { if ((is->inputFlags & IF_EIGHTBIT) && (is->inputFlags & IF_SSGR)) i |= 0x80; WRITE_1_P(SS3, i); } break; case T_9494: case T_9696: if (i >= 0x2020) { if ((is->inputFlags & IF_EIGHTBIT) && (is->inputFlags & IF_SSGR)) i |= 0x8080; WRITE_2_P(SS3, i); } break; case T_94192: if (i >= 0x2020) { if ((is->inputFlags & IF_EIGHTBIT) && (is->inputFlags & IF_SSGR)) i |= 0x8000; WRITE_2_P(SS3, i); } break; default: abort(); /* NOTREACHED */ } continue; } if (is->inputFlags & IF_LS) { i = GR(is)->reverse(ucode, GR(is)); if (i >= 0) { switch (GR(is)->type) { case T_94: case T_96: case T_128: WRITE_1_P_S(LS1, i, LS0); break; case T_9494: case T_9696: WRITE_2_P_S(LS1, i, LS0); break; case T_94192: WRITE_2_P_S(LS1, i, LS0); break; default: abort(); /* NOTREACHED */ } continue; } } #undef WRITE_1 #undef WRITE_2 #undef WRITE_1_P #undef WRITE_1_P_7bit #undef WRITE_1_P_8bit #undef WRITE_2_P #undef WRITE_2_P_7bit #undef WRITE_2_P_8bit } } } #define PAIR(a,b) ((unsigned) ((a) << 8) | (b)) void copyOut(Iso2022Ptr is, int fd, unsigned char *buf, unsigned count) { unsigned char *s = buf; if (ilog >= 0) IGNORE_RC(write(ilog, buf, (size_t) count)); while (s < buf + count) { switch (is->parserState) { case P_NORMAL: resynch: if (is->buffered_ku < 0) { if (*s == ESC) { buffer(is, *s++); is->parserState = P_ESC; } else if (OTHER(is) != NULL && OTHER(is)->other_recode != NULL && OTHER(is)->other_stack != NULL && OTHER(is)->other_aux != NULL) { int c = OTHER(is)->other_stack(*s, OTHER(is)->other_aux); if (c >= 0) { unsigned ucode = (unsigned) c; outbufUTF8(is, fd, OTHER(is)->other_recode(ucode, OTHER(is)->other_aux)); is->shiftState = S_NORMAL; } s++; } else if (*s == CSI && CHARSET_REGULAR(GR(is))) { buffer(is, *s++); is->parserState = P_CSI; } else if ((*s == SS2 || *s == SS3 || *s == LS0 || *s == LS1) && CHARSET_REGULAR(GR(is))) { buffer(is, *s++); terminate(is, fd); is->parserState = P_NORMAL; } else if (*s <= 0x20 && is->shiftState == S_NORMAL) { /* Pass through C0 when GL is not regular */ outbufOne(is, fd, *s); s++; } else { const CharsetRec *charset; unsigned char code = 0; if (*s <= 0x7F) { switch (is->shiftState) { case S_NORMAL: charset = GL(is); break; case S_SS2: charset = G2(is); break; case S_SS3: charset = G3(is); break; default: abort(); /* NOTREACHED */ } code = *s; } else { switch (is->shiftState) { case S_NORMAL: charset = GR(is); break; case S_SS2: charset = G2(is); break; case S_SS3: charset = G3(is); break; default: abort(); /* NOTREACHED */ } code = UChar(*s - 0x80); } switch (charset->type) { case T_94: if (code >= 0x21 && code <= 0x7E) outbufUTF8(is, fd, charset->recode(code, charset)); else outbufUTF8(is, fd, *s); s++; is->shiftState = S_NORMAL; break; case T_96: if (code >= 0x20) outbufUTF8(is, fd, charset->recode(code, charset)); else outbufUTF8(is, fd, *s); is->shiftState = S_NORMAL; s++; break; case T_128: outbufUTF8(is, fd, charset->recode(code, charset)); is->shiftState = S_NORMAL; s++; break; default: /* First byte of a multibyte sequence */ is->buffered_ku = *s; s++; } } } else { /* buffered_ku */ const CharsetRec *charset; unsigned char ku_code; unsigned code = 0; if (is->buffered_ku <= 0x7F) { switch (is->shiftState) { case S_NORMAL: charset = GL(is); break; case S_SS2: charset = G2(is); break; case S_SS3: charset = G3(is); break; default: abort(); /* NOTREACHED */ } ku_code = UChar(is->buffered_ku); if (*s < 0x80) code = *s; } else { switch (is->shiftState) { case S_NORMAL: charset = GR(is); break; case S_SS2: charset = G2(is); break; case S_SS3: charset = G3(is); break; default: abort(); /* NOTREACHED */ } ku_code = UChar(is->buffered_ku - 0x80); if (*s >= 0x80) code = UChar(*s - 0x80); } switch (charset->type) { case T_94: case T_96: case T_128: abort(); /* NOTREACHED */ break; case T_9494: if (code >= 0x21 && code <= 0x7E) { outbufUTF8(is, fd, charset->recode(PAIR(ku_code, code), charset)); is->buffered_ku = -1; is->shiftState = S_NORMAL; } else { is->buffered_ku = -1; is->shiftState = S_NORMAL; goto resynch; } s++; break; case T_9696: if (code >= 0x20) { outbufUTF8(is, fd, charset->recode(PAIR(ku_code, code), charset)); is->buffered_ku = -1; is->shiftState = S_NORMAL; } else { is->buffered_ku = -1; is->shiftState = S_NORMAL; goto resynch; } s++; break; case T_94192: /* Use *s, not code */ if (((*s >= 0x21) && (*s <= 0x7E)) || ((*s >= 0xA1) && (*s <= 0xFE))) { unsigned ucode = PAIR(ku_code, *s); outbufUTF8(is, fd, charset->recode(ucode, charset)); is->buffered_ku = -1; is->shiftState = S_NORMAL; } else { is->buffered_ku = -1; is->shiftState = S_NORMAL; goto resynch; } s++; break; default: abort(); /* NOTREACHED */ } } break; case P_ESC: assert(is->buffered_ku == -1); if (*s == CSI_7) { buffer(is, *s++); is->parserState = P_CSI; } else if (IS_FINAL_ESC(*s)) { buffer(is, *s++); terminate(is, fd); is->parserState = P_NORMAL; } else { buffer(is, *s++); } break; case P_CSI: if (IS_FINAL_CSI(*s)) { buffer(is, *s++); terminate(is, fd); is->parserState = P_NORMAL; } else { buffer(is, *s++); } break; default: abort(); /* NOTREACHED */ } } outbuf_flush(is, fd); } static void terminate(Iso2022Ptr is, int fd) { if (is->outputFlags & OF_PASSTHRU) { outbuf_buffered(is, fd); return; } switch (is->buffered[0]) { case SS2: if (is->outputFlags & OF_SS) is->shiftState = S_SS2; discard_buffered(is); return; case SS3: if (is->outputFlags & OF_SS) is->shiftState = S_SS3; discard_buffered(is); return; case LS0: if (is->outputFlags & OF_LS) is->glp = &G0(is); discard_buffered(is); return; case LS1: if (is->outputFlags & OF_LS) is->glp = &G1(is); discard_buffered(is); return; case ESC: assert(is->buffered_count >= 2); switch (is->buffered[1]) { case SS2_7: if (is->outputFlags & OF_SS) is->shiftState = S_SS2; discard_buffered(is); return; case SS3_7: if (is->outputFlags & OF_SS) is->shiftState = S_SS3; discard_buffered(is); return; case LS2_7: if (is->outputFlags & OF_SS) is->glp = &G2(is); discard_buffered(is); return; case LS3_7: if (is->outputFlags & OF_LS) is->glp = &G3(is); discard_buffered(is); return; case LS1R_7: if (is->outputFlags & OF_LS) is->grp = &G1(is); discard_buffered(is); return; case LS2R_7: if (is->outputFlags & OF_LS) is->grp = &G2(is); discard_buffered(is); return; case LS3R_7: if (is->outputFlags & OF_LS) is->grp = &G3(is); discard_buffered(is); return; default: terminateEsc(is, fd, is->buffered + 1, (unsigned) (is->buffered_count - 1)); break; } return; default: outbuf_buffered(is, fd); } } static void terminateEsc(Iso2022Ptr is, int fd, unsigned char *s_start, unsigned count) { const CharsetRec *charset; /* ISO 2022 doesn't allow 2C, but Emacs/MULE uses it in 7-bit mode */ if ((s_start[0] == 0x28 || s_start[0] == 0x29 || s_start[0] == 0x2A || s_start[0] == 0x2B || s_start[0] == 0x2C || s_start[0] == 0x2D || s_start[0] == 0x2E || s_start[0] == 0x2F) && count >= 2) { if (is->outputFlags & OF_SELECT) { if (s_start[0] <= 0x2B) charset = getCharset(s_start[1], T_94); else charset = getCharset(s_start[1], T_96); switch (s_start[0]) { case 0x28: case 0x2C: G0(is) = charset; break; case 0x29: case 0x2D: G1(is) = charset; break; case 0x2A: case 0x2E: G2(is) = charset; break; case 0x2B: case 0x2F: G3(is) = charset; break; } } discard_buffered(is); } else if (s_start[0] == 0x24 && count == 2) { if (is->outputFlags & OF_SELECT) { charset = getCharset(s_start[1], T_9494); G0(is) = charset; } discard_buffered(is); } else if (s_start[0] == 0x24 && count >= 2 && (s_start[1] == 0x28 || s_start[1] == 0x29 || s_start[1] == 0x2A || s_start[1] == 0x2B || s_start[1] == 0x2D || s_start[1] == 0x2E || s_start[1] == 0x2F) && count >= 3) { if (is->outputFlags & OF_SELECT) { if (s_start[1] <= 0x2B) charset = getCharset(s_start[2], T_9494); else charset = getCharset(s_start[2], T_9696); switch (s_start[1]) { case 0x28: G0(is) = charset; break; case 0x29: case 0x2D: G1(is) = charset; break; case 0x2A: case 0x2E: G2(is) = charset; break; case 0x2B: case 0x2F: G3(is) = charset; break; } } discard_buffered(is); } else outbuf_buffered(is, fd); } #ifdef NO_LEAKS void iso2022_leaks(void) { } #endif luit-20240910/luitconv.c0000644000000000000000000011064214670144444013453 0ustar rootroot/* $XTermId: luitconv.c,v 1.128 2024/09/10 22:33:08 tom Exp $ */ /* Copyright 2010-2022,2024 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #ifdef HAVE_LANGINFO_CODESET #include #include #endif #ifndef ICONV_CONST #define ICONV_CONST /* nothing */ #endif /* * This uses a similar approach to vile's support for wide/narrow locales. * * We use the iconv library to construct a mapping forward for each byte, * into UTF-8, and then use that mapping to construct the reverse mapping * from UTF-8 into the original set of single byte values. */ #define MAX8 0x100 #define MAX16 0x10000 #define NO_ICONV (iconv_t)(-1) static LuitConv *all_conversions; /******************************************************************************/ static int ConvToUTF32(unsigned *target, const char *source, size_t limit) { #define CH(n) (UCHAR)((*target) >> ((n) * 8)) int rc = 0; int j; UINT mask = 0; /* * Find the number of bytes we will need from the source. */ if ((*source & 0x80) == 0) { rc = 1; mask = (UINT) * source; } else if ((*source & 0xe0) == 0xc0) { rc = 2; mask = (UINT) (*source & 0x1f); } else if ((*source & 0xf0) == 0xe0) { rc = 3; mask = (UINT) (*source & 0x0f); } else if ((*source & 0xf8) == 0xf0) { rc = 4; mask = (UINT) (*source & 0x07); } else if ((*source & 0xfc) == 0xf8) { rc = 5; mask = (UINT) (*source & 0x03); } else if ((*source & 0xfe) == 0xfc) { rc = 6; mask = (UINT) (*source & 0x01); } if ((size_t) rc > limit) { /* whatever it is, we cannot decode it */ TRACE2(("limit failed %d/%ld in vl_conv_to_utf32\n", rc, limit)); rc = 0; } /* * sanity-check. */ if (rc > 1) { for (j = 1; j < rc; j++) { if ((source[j] & 0xc0) != 0x80) break; } if (j != rc) { TRACE2(("check failed %d/%d in vl_conv_to_utf32\n", j, rc)); rc = 0; } } if (target != 0) { int shift = 0; *target = 0; for (j = 1; j < rc; j++) { *target |= (UINT) (source[rc - j] & 0x3f) << shift; shift += 6; } *target |= mask << shift; TRACE2(("encode %2d:%.*s -> %#08x %02X.%02X.%02X.%02X\n", rc, rc, source, *target, CH(3), CH(2), CH(1), CH(0))); } return rc; #undef CH } static int ConvToUTF8(UCHAR * target, UINT source, size_t limit) { #define CH(n) (UCHAR)((source) >> ((n) * 8)) int rc = 0; if (source <= 0x0000007f) rc = 1; else if (source <= 0x000007ff) rc = 2; else if (source <= 0x0000ffff) rc = 3; else if (source <= 0x001fffff) rc = 4; else if (source <= 0x03ffffff) rc = 5; else /* (source <= 0x7fffffff) */ rc = 6; if ((size_t) rc > limit) { /* whatever it is, we cannot decode it */ TRACE2(("limit failed in vl_conv_to_utf8 %d/%ld %#06x\n", rc, limit, source)); rc = 0; } if (target != 0) { switch (rc) { case 1: target[0] = (UCHAR) CH(0); break; case 2: target[1] = (UCHAR) (0x80 | (CH(0) & 0x3f)); target[0] = (UCHAR) (0xc0 | (CH(0) >> 6) | ((CH(1) & 0x07) << 2)); break; case 3: target[2] = (UCHAR) (0x80 | (CH(0) & 0x3f)); target[1] = (UCHAR) (0x80 | (CH(0) >> 6) | ((CH(1) & 0x0f) << 2)); target[0] = (UCHAR) (0xe0 | ((int) (CH(1) & 0xf0) >> 4)); break; case 4: target[3] = (UCHAR) (0x80 | (CH(0) & 0x3f)); target[2] = (UCHAR) (0x80 | (CH(0) >> 6) | ((CH(1) & 0x0f) << 2)); target[1] = (UCHAR) (0x80 | ((int) (CH(1) & 0xf0) >> 4) | ((int) (CH(2) & 0x03) << 4)); target[0] = (UCHAR) (0xf0 | ((int) (CH(2) & 0x1f) >> 2)); break; case 5: target[4] = (UCHAR) (0x80 | (CH(0) & 0x3f)); target[3] = (UCHAR) (0x80 | (CH(0) >> 6) | ((CH(1) & 0x0f) << 2)); target[2] = (UCHAR) (0x80 | ((int) (CH(1) & 0xf0) >> 4) | ((int) (CH(2) & 0x03) << 4)); target[1] = (UCHAR) (0x80 | (CH(2) >> 2)); target[0] = (UCHAR) (0xf8 | (CH(3) & 0x03)); break; case 6: target[5] = (UCHAR) (0x80 | (CH(0) & 0x3f)); target[4] = (UCHAR) (0x80 | (CH(0) >> 6) | ((CH(1) & 0x0f) << 2)); target[3] = (UCHAR) (0x80 | (CH(1) >> 4) | ((CH(2) & 0x03) << 4)); target[2] = (UCHAR) (0x80 | (CH(2) >> 2)); target[1] = (UCHAR) (0x80 | (CH(3) & 0x3f)); target[0] = (UCHAR) (0xfc | ((int) (CH(3) & 0x40) >> 6)); break; } TRACE2(("decode %#08x %02X.%02X.%02X.%02X %d:%.*s\n", source, CH(3), CH(2), CH(1), CH(0), rc, rc, target)); } return rc; /* number of bytes needed in target */ #undef CH } /******************************************************************************/ static LuitConv * newLuitConv(size_t elts) { LuitConv *result = TypeCalloc(LuitConv); if (result != 0) { TRACE(("newLuitConv(%u)\n", (unsigned) elts)); result->table_size = elts; result->table_utf8 = TypeCallocN(MappingData, elts); result->rev_index = TypeCallocN(ReverseData, elts); } return result; } /* * Try to open a conversion from UTF-8 to the given encoding name. This is * iconv(), and different implementations expect different syntax for the * name. So if we do not at first succeed, try permuting the common * variations. */ static iconv_t try_iconv_open(const char *guess, char **alias) { int chcase; int mkcase; char *encoding_name = NULL; char *encoding_temp = NULL; char *p; iconv_t result; if (guess == NULL || (encoding_name = malloc(strlen(guess) + 2)) == NULL || (encoding_temp = malloc(strlen(guess) + 2)) == NULL) { free(encoding_name); return NO_ICONV; } strcpy(encoding_name, guess); TRACE(("try_iconv_open(%s)\n", NonNull(encoding_name))); result = iconv_open("UTF-8", encoding_name); /* * If the first try did not succeed, retry after changing the case of * the name and/or inserting a marker between the leading alphabetic * prefix and number. */ if (result == NO_ICONV) { for (chcase = 0; chcase <= 2; ++chcase) { strcpy(encoding_name, guess); switch (chcase) { case 0: /* no change */ break; case 1: /* uppercase */ for (p = encoding_name; *p != '\0'; ++p) { *p = (char) toupper(UChar(*p)); } break; case 2: /* lowercase */ for (p = encoding_name; *p != '\0'; ++p) { *p = (char) tolower(UChar(*p)); } break; } for (mkcase = 0; mkcase <= 3; ++mkcase) { switch (mkcase) { case 0: /* no change */ break; case 1: /* remove delimiter */ for (p = encoding_name; *p != '\0'; ++p) { if (*p == ' ' || *p == '-') { if (p != encoding_name && isalpha(UChar(p[-1])) && isdigit(UChar(p[1]))) { while ((p[0] = p[1]) != '\0') { ++p; } } break; } } break; case 2: /* insert '-' */ for (p = encoding_name; *p != '\0'; ++p) { if (*p == '-') break; if (isalpha(UChar(p[0])) && isdigit(UChar(p[1]))) { strcpy(encoding_temp, p + 1); p[1] = '-'; strcpy(p + 2, encoding_temp); break; } } break; case 3: /* change to ' ' */ for (p = encoding_name; *p != '\0'; ++p) { if (*p == '-') { *p = ' '; break; } } break; } result = iconv_open("UTF-8", encoding_name); if (result != NO_ICONV) { TRACE(("...iconv_open'd with different name \"%s\"\n", NonNull(encoding_name))); break; } } if (result != NO_ICONV) { break; } } } if (strcmp(encoding_name, guess)) { if (result != NO_ICONV) { *alias = encoding_name; } else { free(encoding_name); } } else { free(encoding_name); } free(encoding_temp); return result; } /******************************************************************************/ static int cmp_rindex(const void *a, const void *b) { const ReverseData *p = (const ReverseData *) a; const ReverseData *q = (const ReverseData *) b; return (int) (p)->ucs - (int) (q)->ucs; } #ifdef OPT_TRACE static void trace_convert(LuitConv * data, size_t which, unsigned gs) { size_t j; char gsbuf[20]; if (gs) { sprintf(gsbuf, "G%u ", gs); } else { gsbuf[0] = '\0'; } TRACE(("convert %s%04X:%d:%04X:", gsbuf, (unsigned) which, (int) data->table_utf8[which].size, data->table_utf8[which].ucs)); if (data->table_utf8[which].size) { for (j = 0; j < data->table_utf8[which].size; ++j) { TRACE(("%c", data->table_utf8[which].text[j])); } } TRACE(("\n")); } #else #define trace_convert(data,n,gs) /* nothing */ #endif /* * Assuming single-byte encoding, count the number of successful translations * to UTF-8 from the 0..255 range. */ static unsigned count8bitIconv(iconv_t my_desc) { unsigned result = 0; int n; for (n = 0; n < MAX8; ++n) { size_t converted; char input[80]; ICONV_CONST char *ip = input; char output[80]; char *op = output; size_t in_bytes = 1; size_t out_bytes = sizeof(output); input[0] = (char) n; input[1] = 0; (void) iconv(my_desc, NULL, NULL, NULL, NULL); converted = iconv(my_desc, &ip, &in_bytes, &op, &out_bytes); if (converted != (size_t) (-1)) { ++result; } } TRACE(("count8bitIconv -> %u\n", result)); return result; } #define legalUCode(n) ((n) < 0xd800 || (n) > 0xdfff) /* * Given an encoding name, check to see if it is a single-byte encoding. * Return a suitable table-size, depending. * * iconv() provides no function for this purpose. For demonstration purposes * (though it is claimed to be slow...) we can use iconv to convert a series * of UTF-8 codes to the given encoding, checking if any of those give more * than one byte. * * If we knew this was always ISO-2022 encoding, we could shorten the scan; * however luit does handle a few which are not. * * As a quick check, we first count the number of codes going _to_ UTF-8 in the * series 0..255, and if that is 256 there is no need for this function. * * FIXME: improve this by constructing a table of known single-byte encoding * names. */ static unsigned sizeofIconvTable(const char *encoding_name, unsigned limit) { unsigned result = MAX8; iconv_t my_desc = iconv_open(encoding_name, "UTF-8"); if (my_desc != NO_ICONV) { unsigned n; unsigned total = 0; size_t in_bytes; UCHAR input[80]; ICONV_CONST char *ip; size_t out_bytes; char output[80]; char *op; TRACE(("sizeofIconvTable(%s, %u) opened...\n", NonNull(encoding_name), limit)); for (n = 0; n < MAX16; ++n) { if (!legalUCode(n)) continue; if ((in_bytes = (size_t) ConvToUTF8(input, n, sizeof(input))) == 0) { continue; } ip = (ICONV_CONST char *) input; op = output; input[in_bytes] = 0; out_bytes = sizeof(output); (void) iconv(my_desc, NULL, NULL, NULL, NULL); if (iconv(my_desc, &ip, &in_bytes, &op, &out_bytes) == (size_t) -1) { continue; } ++total; /* if we have found all codes that the fast check could, quit */ if ((limit == 256) && (total >= limit)) { result = limit; break; } } iconv_close(my_desc); TRACE(("...total codes %u\n", total)); if (total > 256) result = MAX16; } TRACE(("sizeofIconvTable(%s, %u) = %u\n", NonNull(encoding_name), limit, result)); return result; } /* * Build forward/reverse mappings for single-byte encoding. */ static void initialize8bitTable(LuitConv * data) { unsigned n; TRACE(("initialize8bitTable\n")); data->len_index = 0; for (n = 0; n < MAX8; ++n) { size_t converted; char input[80]; ICONV_CONST char *ip = input; char output[80]; char *op = output; size_t in_bytes = 1; size_t out_bytes = sizeof(output); input[0] = (char) n; input[1] = 0; (void) iconv(data->iconv_desc, NULL, NULL, NULL, NULL); converted = iconv(data->iconv_desc, &ip, &in_bytes, &op, &out_bytes); if (converted == (size_t) (-1)) { TRACE(("convert err %d\n", n)); } else { output[sizeof(output) - out_bytes] = 0; data->table_utf8[n].size = sizeof(output) - out_bytes; data->table_utf8[n].text = malloc(data->table_utf8[n].size); memcpy(data->table_utf8[n].text, output, data->table_utf8[n].size); if (ConvToUTF32((UINT *) 0, data->table_utf8[n].text, data->table_utf8[n].size)) { ConvToUTF32(&(data->table_utf8[n].ucs), data->table_utf8[n].text, data->table_utf8[n].size); } trace_convert(data, (size_t) n, 0); data->rev_index[data->len_index].ucs = data->table_utf8[n].ucs; data->rev_index[data->len_index].ch = n; data->len_index++; } } } static UINT dbcsDecode(const char *buffer, int length, int euc, unsigned *gs) { UINT result = UChar(buffer[0]); switch (result) { case SS2: *gs = (unsigned) ((length > 1) ? 2 : 1); break; case SS3: *gs = (unsigned) ((length > 1) ? 3 : 1); break; default: *gs = (unsigned) ((result >= 128)); break; } switch (*gs) { case 2: /* FALLTHRU */ case 3: ++buffer; --length; /* FALLTHRU */ default: switch (length) { case 0: break; case 1: result = UChar(buffer[0]); break; default: result = (UINT) (((UChar(buffer[0]) << 8) | UChar(buffer[1]))); if (euc) result ^= 0x8080; break; } break; } return result; } /* * Build forward/reverse mappings for multi-byte encoding. * * As in sizeofIconvTable(), scan the encodings using a translation from UTF-8 * to the target. That gives us the reverse-mapping information, from which * we later construct the forward-mapping. * * TODO: update charset size as needed for -show-iconv */ static void initialize16bitTable(const char *charset, LuitConv ** datap, unsigned gmax) { unsigned n; unsigned gs; LuitConv *data; iconv_t my_desc = iconv_open(charset, "UTF-8"); TRACE(("initialize16bitTable(%s) gmax %d\n", NonNull(charset), gmax)); for (n = 0; n < gmax; ++n) { if (datap[n] != 0) { datap[n]->len_index = 0; } } if (my_desc != NO_ICONV) { int euc = !isOtherCharset(charset); TRACE(("...assume %s index\n", euc ? "EUC" : "non-EUC")); for (n = 0; n < MAX16; ++n) { UCHAR input[80]; ICONV_CONST char *ip; char output[80]; char *op = output; size_t in_bytes; size_t out_bytes = sizeof(output); unsigned my_code; if (!legalUCode(n)) continue; if ((in_bytes = (size_t) ConvToUTF8(input, n, sizeof(input))) == 0) { continue; } ip = (ICONV_CONST char *) input; op = output; input[in_bytes] = 0; out_bytes = sizeof(output); (void) iconv(my_desc, NULL, NULL, NULL, NULL); if (iconv(my_desc, &ip, &in_bytes, &op, &out_bytes) == (size_t) -1) { continue; } my_code = dbcsDecode(output, (int) (op - output), euc, &gs); if (gs >= gmax) { data = (gs == 1) ? datap[0] : 0; } else { data = datap[gs]; } if ((data == 0) || (my_code >= data->table_size) || data->table_utf8[my_code].text != NULL) { TRACE(("skip %d:%#x\n", gs, my_code)); continue; } data->table_utf8[my_code].size = strlen((char *) input); data->table_utf8[my_code].text = strmalloc((char *) input); data->table_utf8[my_code].ucs = n; trace_convert(data, (size_t) my_code, gs); data->rev_index[data->len_index].ucs = n; data->rev_index[data->len_index].ch = my_code; data->len_index++; } iconv_close(my_desc); } } static unsigned luitReverse(unsigned code, void *client_data GCC_UNUSED) { unsigned result = code; LuitConv *data = (LuitConv *) client_data; TRACE(("luitReverse 0x%04X %p\n", code, (void *) data)); if (data != 0) { static const ReverseData zero_key; ReverseData *p; ReverseData key = zero_key; key.ucs = (UINT) code; p = (ReverseData *) bsearch(&key, data->rev_index, data->len_index, sizeof(data->rev_index[0]), cmp_rindex); if (p != 0) { result = p->ch; TRACE(("...mapped %#x\n", result)); } } return result; } /* * Translate one of luit's encoding names to one which is more likely to * work with iconv. */ static const char * findEncodingAlias(const char *encoding_name) { /* *INDENT-OFF* */ static const struct { const char *luit_name; const char *iconv_name; } table[] = { /* 8-bit character sets */ { "KOI8-E", "ISO-IR-111" }, { "TCVN-0", "TCVN5712-1:1993" }, { "ibm-cp437", "cp437" }, { "ibm-cp850", "cp850" }, { "ibm-cp865", "cp865" }, { "ibm-cp866", "cp866" }, { "iso646.1973-0", "US-ASCII" }, { "ISO 646 (1973)", "US-ASCII" }, { "microsoft-cp1250", "windows-1250" }, { "microsoft-cp1251", "windows-1251" }, { "microsoft-cp1252", "windows-1252" }, /* EUC aliases */ { "ksx1001.1997-0", "eucKR" }, /* fontenc -> ksc5601.1987-0 */ { "ksxjohab-1", "JOHAB" }, /* other (non-ISO-2022) character sets */ { "gb2312.1980-0", "GB2312" }, { "big5.eten-0", "BIG-5" }, { "big5hkscs-0", "BIG5-HKSCS" }, { "gbk-0", "GBK" }, { "gb18030.2000-0", "GB18030" }, #if 0 { "gb18030.2000-1", "GB18030" }, #endif }; /* *INDENT-ON* */ size_t n; const char *result = 0; TRACE(("findEncodingAlias(%s)\n", NonNull(encoding_name))); for (n = 0; n < SizeOf(table); ++n) { if (!lcStrCmp(encoding_name, table[n].luit_name)) { result = table[n].iconv_name; TRACE(("... matched '%s'\n", NonNull(result))); break; } } return result; } static void initializeBuiltInTable(LuitConv * data, const BuiltInCharsetRec * builtIn, int enc_file) { UCHAR buffer[20]; size_t n; size_t need; TRACE(("initializing %s '%s'\n", enc_file ? "external" : "built-in", NonNull(builtIn->name))); (void) enc_file; data->len_index = 0; for (n = 0; n < builtIn->length; ++n) { data->table_utf8[n].ucs = (unsigned) n; } for (n = 0; n < builtIn->length; ++n) { if (builtIn->table[n].source < data->table_size) { size_t j = builtIn->table[n].source; data->table_utf8[j].ucs = builtIn->table[n].target; if ((need = (size_t) ConvToUTF8(buffer, data->table_utf8[j].ucs, sizeof(buffer) - 1)) != 0) { data->table_utf8[j].text = malloc(need + 1); data->table_utf8[j].size = need; memcpy(data->table_utf8[j].text, buffer, need); } trace_convert(data, j, 0); data->rev_index[data->len_index].ucs = data->table_utf8[j].ucs; data->rev_index[data->len_index].ch = (unsigned) j; data->len_index++; } } } static const BuiltInCharsetRec * findBuiltinEncoding(const char *encoding_name) { size_t n; const BuiltInCharsetRec *result = 0; for (n = 0; builtin_encodings[n].name != 0; ++n) { if (!lcStrCmp(encoding_name, builtin_encodings[n].name)) { result = &(builtin_encodings[n]); break; } } return result; } /******************************************************************************/ LuitConv * luitLookupEncoding(FontMapPtr mapping) { LuitConv *latest; LuitConv *result = 0; for (latest = all_conversions; latest != 0; latest = latest->next) { if (&(latest->mapping) == mapping) { result = latest; } } return result; } /* * Provide all of the data, needed for -show-iconv option to construct a ".enc" * representation. */ FontEncPtr luitGetFontEnc(const char *name, UM_MODE mode) { FontEncPtr result = 0; FontMapPtr mp = 0; FontMapPtr mp2 = 0; FontEncSimpleMapPtr mq = 0; UCode *map = 0; LuitConv *lc; int n; if ((mp = luitLookupMapping(name, mode, usANY)) != 0 && (lc = luitLookupEncoding(mp)) != 0 && (mp2 = TypeCalloc(FontMapRec)) != 0 && (mq = TypeCalloc(FontEncSimpleMapRec)) != 0 && (map = TypeCallocN(UCode, lc->table_size)) != 0 && (result = TypeCalloc(FontEncRec)) != 0) { int max_chr = (MIN_UCODE - 1); int min_chr = (MAX_UCODE + 1); result->name = strmalloc(name); result->size = (int) lc->table_size; result->mappings = mp2; *mp2 = *mp; mp2->client_data = mq; mp2->next = 0; mq->len = (unsigned) lc->table_size; mq->map = map; for (n = 0; n < (int) lc->table_size; ++n) { unsigned ch = lc->rev_index[n].ch; if (ch < mq->len) { map[ch] = (UCode) lc->rev_index[n].ucs; if (ch != lc->rev_index[n].ucs) { if ((int) ch < min_chr) min_chr = (int) ch; if ((int) ch > max_chr) max_chr = (int) ch; } } } result->size = max_chr + 1; if (result->size > 256) result->first = min_chr; else result->size = 256; } else { if (mp2) free(mp2); if (mq) free(mq); if (map) free(map); } return result; } /* * Free the data allocated in luitGetFontEnc(). */ void luitFreeFontEnc(FontEncPtr data) { if (data != 0) { FontMapPtr mp; FontEncSimpleMapPtr mq; if ((mp = data->mappings) != 0) { if ((mq = mp->client_data) != 0) { free(mq->map); free(mq); } free(mp); } free(data->name); free(data); } } static void finishIconvTable(LuitConv * latest) { latest->next = all_conversions; latest->mapping.type = FONT_ENCODING_UNICODE; latest->mapping.recode = luitRecode; latest->reverse.reverse = luitReverse; latest->reverse.data = latest; all_conversions = latest; TRACE(("...finished LuitConv table for \"%s\"\n", NonNull(latest->encoding_name))); } static FontMapPtr initLuitConv(const char *encoding_name, iconv_t my_desc, const BuiltInCharsetRec * builtIn, int enc_file, US_SIZE size) { FontMapPtr result = 0; LuitConv *latest; unsigned fast; size_t length = MAX8; switch (size) { case us8BIT: length = MAX8; break; case us16BIT: length = MAX16; break; default: if (builtIn) { if (builtIn->length != 0) { size_t n; for (n = 0; n < builtIn->length; ++n) { if (builtIn->table[n].source >= MAX8) { length = MAX16; break; } } } else { length = MAX16; } } else if ((fast = count8bitIconv(my_desc)) < 256) { length = sizeofIconvTable(encoding_name, fast); } break; } TRACE(("initLuitConv(%s) %u\n", NonNull(encoding_name), (unsigned) length)); if ((latest = newLuitConv(length)) != 0) { latest->encoding_name = strmalloc(encoding_name); latest->iconv_desc = my_desc; if (builtIn != 0) { initializeBuiltInTable(latest, builtIn, enc_file); } else if (length == MAX16) { initialize16bitTable(latest->encoding_name, &latest, 1); } else { initialize8bitTable(latest); } finishIconvTable(latest); result = &(latest->mapping); /* sort the reverse-index, to allow using bsearch */ if (result != 0) { qsort(latest->rev_index, latest->len_index, sizeof(latest->rev_index[0]), cmp_rindex); } } return result; } /* * This uses as input the data loaded from an external ".enc" file to construct * a table that initLuitConv() can use. */ static FontMapPtr convertFontEnc(FontEncPtr fontenc) { FontMapPtr mp = fontenc->mappings; FontEncSimpleMapPtr mq; BuiltInMapping *mapping; FontMapPtr result = 0; TRACE(("convertFontEnc: %s\n", NonNull(fontenc->name))); while (mp != 0) { if (mp->type == FONT_ENCODING_UNICODE) break; mp = mp->next; } if (mp != 0 && (mq = mp->client_data) != 0 && mq->len && (mapping = TypeCallocN(BuiltInMapping, mq->len + 1)) != 0) { unsigned j, k; BuiltInCharsetRec builtIn; US_SIZE size = ((fontenc->size <= 256 && fontenc->row_size == 0) ? us8BIT : us16BIT); TRACE(("...found mapping for %d items (size:%d)\n", mq->len, size)); memset(&builtIn, 0, sizeof(builtIn)); builtIn.name = fontenc->name; builtIn.table = mapping; builtIn.length = mq->len; for (j = k = 0; j < mq->len; ++j) { unsigned code = luitRecode(j, mq); mapping[k].source = j; mapping[k].target = code ? code : j; ++k; } result = initLuitConv(fontenc->name, NO_ICONV, &builtIn, 1, size); free(mapping); } return result; } static int knownCharset(const FontencCharsetRec * fc) { int result = 0; if (!strcmp(fc->name, "ASCII")) result = 1; return result; } /* * Portable iconv provides an "EUC-JP" which combines the information for the * JIS-X encodings. For this case we can deduce the separate encodings. Do * that, and return true if successful. */ static int loadCompositeCharset(iconv_t my_desc, const char *composite_name) { LuitConv *work[4]; unsigned g; unsigned gmax = 0; unsigned csize = 0; /* * This is the first time we have tried for the composite. Make * a list of the parts, first. */ memset(work, 0, sizeof(work)); for (g = 0; g < 4; ++g) { const FontencCharsetRec *fc = getCompositePart(composite_name, g); work[g] = 0; if (fc != 0 && !knownCharset(fc)) { TRACE(("part %d:%s (%s)\n", g, NonNull(fc->name), NonNull(fc->xlfd))); switch (fc->type) { case T_94: case T_96: case T_128: csize = MAX8; break; case T_9494: case T_9696: case T_94192: csize = MAX16; break; default: TRACE(("...ignoring for now\n")); break; } if ((work[g] = newLuitConv((size_t) csize)) == 0) break; work[g]->encoding_name = strmalloc(fc->name); work[g]->iconv_desc = my_desc; gmax = g + 1; } } /* * Now, load the charset, filling out the appropriate forward mapping * in each one according to the shift-information embedded in the * reverse mapping string. */ initialize16bitTable(composite_name, work, gmax); /* * Finally, link the parts into the list of loaded charsets so we * will not repeat this process. */ for (g = 0; g < 4; ++g) { if (work[g] != 0) { work[g]->iconv_desc = NO_ICONV; finishIconvTable(work[g]); } } return 0; } static FontMapPtr getFontMapByName(const char *encoding_name) { FontMapPtr result = 0; LuitConv *latest; for (latest = all_conversions; latest != 0; latest = latest->next) { if (!lcStrCmp(encoding_name, latest->encoding_name)) { result = &(latest->mapping); break; } } TRACE(("getFontMapByName(%s) %s\n", NonNull(encoding_name), result ? "OK" : "FAIL")); return result; } static FontMapPtr lookupIconv(const char **encoding_name, char **aliased, US_SIZE size) { LuitConv *latest; FontMapPtr result = 0; iconv_t my_desc; iconv_t check; const FontencCharsetRec *fc; const char *alias; const char *full; my_desc = try_iconv_open(*encoding_name, aliased); if (my_desc == NO_ICONV && (alias = findEncodingAlias(*encoding_name)) != 0) { if (alias != 0) { if (*aliased) { free(*aliased); *aliased = 0; } *encoding_name = alias; TRACE(("...retry '%s'\n", NonNull(*encoding_name))); my_desc = try_iconv_open(*encoding_name, aliased); } } if (my_desc != NO_ICONV) { TRACE(("...iconv_open succeeded\n")); result = initLuitConv(*encoding_name, my_desc, NULL, -1, size); iconv_close(my_desc); if ((latest = luitLookupEncoding(result)) != 0) { latest->iconv_desc = NO_ICONV; } } else if ((full = getCompositeCharset(*encoding_name)) != 0 && (check = try_iconv_open(full, aliased)) != NO_ICONV) { loadCompositeCharset(check, full); iconv_close(check); if ((fc = getFontencByName(*encoding_name)) != 0) { result = getFontMapByName(fc->name); } } return result; } FontMapPtr luitLookupMapping(const char *encoding_name, UM_MODE mode, US_SIZE size) { FontMapPtr result = 0; FontEncPtr fontenc; const BuiltInCharsetRec *builtIn; char *aliased = 0; TRACE(("luitLookupMapping '%s' mode %u size %u\n", NonNull(encoding_name), mode, size)); if ((result = getFontMapByName(encoding_name)) != 0) { TRACE(("...found in cache\n")); } else { int n; for (n = 0; lookup_order[n] != umNONE; ++n) { if (!(mode & lookup_order[n])) continue; switch (lookup_order[n]) { case umICONV: result = lookupIconv(&encoding_name, &aliased, size); if (result != 0) { TRACE(("...lookupIconv succeeded\n")); } break; case umFONTENC: if ((fontenc = lookupOneFontenc(encoding_name)) != 0) { result = convertFontEnc(fontenc); if (result != 0) { TRACE(("...convertFontEnc succeeded\n")); } } break; case umBUILTIN: if ((builtIn = findBuiltinEncoding(encoding_name)) != 0) { TRACE(("...use built-in charset\n")); result = initLuitConv(encoding_name, NO_ICONV, builtIn, 0, us8BIT); } break; case umPOSIX: { unsigned ch; BuiltInMapping mapping[MAX8]; BuiltInCharsetRec posix; TRACE(("...fallback to POSIX\n")); memset(&posix, 0, sizeof(posix)); posix.name = encoding_name; posix.length = SizeOf(mapping); posix.table = mapping; for (ch = 0; ch < posix.length; ++ch) { mapping[ch].source = ch; mapping[ch].target = (ch < 128) ? ch : 0; } result = initLuitConv(encoding_name, NO_ICONV, &posix, 0, us8BIT); } break; default: break; } if (result != 0) break; } } if (aliased) { free(aliased); } TRACE(("...luitLookupMapping ->%p\n", (void *) result)); return result; } FontMapReversePtr luitLookupReverse(FontMapPtr fontmap_ptr) { FontMapReversePtr result = 0; LuitConv *search; TRACE(("luitLookupReverse %p\n", (void *) fontmap_ptr)); for (search = all_conversions; search != 0; search = search->next) { if (fontmap_ptr == &(search->mapping)) { TRACE(("...found %s\n", NonNull(search->encoding_name))); result = &(search->reverse); break; } } return result; } unsigned luitMapCodeValue(unsigned code, FontMapPtr fontmap_ptr) { unsigned result; LuitConv *search; result = code; for (search = all_conversions; search != 0; search = search->next) { if (&(search->mapping) == fontmap_ptr) { if (code < search->table_size) { result = search->table_utf8[code].ucs; if (result == 0 && code != 0) result = code; } break; } } TRACE2(("luitMapCodeValue 0x%04X '%c' 0x%04X\n", code, isprint(code) ? code : ' ', result)); return result; } #if defined(HAVE_LANGINFO_CODESET) typedef struct { char *encoding; char **locales; size_t length; /* amount used in locales[] */ size_t actual; /* allocated size of locales[] */ } CODESET_LOCALE; static int compare_encodings(const void *a, const void *b) { const CODESET_LOCALE *p = a; const CODESET_LOCALE *q = b; return strcmp(p->encoding, q->encoding); } static int compare_locales(const void *a, const void *b) { const char *const *p = a; const char *const *q = b; return strcmp(*p, *q); } #endif /* * Report a list of the built-in encodings (used for fallback) */ int reportBuiltinCharsets(void) { size_t j, k; printf("These encodings are used if iconv/fontenc data are missing:\n"); printf("\n"); for (j = 0; builtin_encodings[j].name != 0; ++j) { const BuiltInCharsetRec *p = &(builtin_encodings[j]); unsigned lo = p->table[0].source; unsigned hi = lo; printf("%s\n", builtin_encodings[j].name); for (k = 1; k < p->length; ++k) { if (lo > p->table[k].source) lo = p->table[k].source; if (hi < p->table[k].source) hi = p->table[k].source; } printf("\tData: [%04X..%04X] defined %u\n", lo, hi, (unsigned) p->length); } return EXIT_SUCCESS; } /* * Obtain a list of supported locales, and for each obtain the corresponding * charset. */ int reportIconvCharsets(void) { #if !defined(HAVE_LANGINFO_CODESET) int rc = EXIT_FAILURE; Message("nl_langinfo(CODESET) not supported\n"); #else int rc = EXIT_SUCCESS; FILE *fp; char *old_locale; char **allLs = 0; size_t numLs = 0; size_t useLs = 0; /* save our current locale */ if ((old_locale = setlocale(LC_CTYPE, NULL)) != 0) old_locale = strmalloc(old_locale); /* * next, obtain the list of locales. Their order does not matter. */ if ((fp = popen("locale -a", "r")) != 0) { char buffer[BUFSIZ]; char *s; while (fgets(buffer, (int) sizeof(buffer) - 1, fp) != 0) { s = buffer + strlen(buffer); while (s != buffer) { --s; if (isspace(UChar(*s))) *s = '\0'; else break; } if ((long) useLs >= (long) numLs) { numLs = (useLs + 32) * 3 / 2; allLs = realloc(allLs, (numLs + 2) * sizeof(*allLs)); if (allLs == NULL) { FatalError("Couldn't grow allLs array.\n"); } } allLs[useLs++] = strmalloc(buffer); allLs[useLs] = 0; } pclose(fp); } /* now, for each locale, set our locale to that and ask for the charset */ if (allLs != 0) { int j, k, enc, loc; char *resolved; CODESET_LOCALE *allEs = 0; size_t n, t, col, now; size_t useEs = 0; size_t numEs = 0; for (j = 0; allLs[j] != 0; ++j) { setlocale(LC_CTYPE, allLs[j]); if ((resolved = nl_langinfo(CODESET)) != 0) { enc = -1; for (k = 0; k < (int) useEs; ++k) { if (!strcmp(resolved, allEs[k].encoding)) { enc = k; break; } } if (enc < 0) { if ((long) useEs >= (long) numEs) { numEs = (useEs + 32) * 3 / 2; allEs = realloc(allEs, numEs * sizeof(*allEs)); if (allEs == NULL) { FatalError("Couldn't grow allEs array.\n"); } } allEs[useEs].encoding = strmalloc(resolved); allEs[useEs].locales = 0; allEs[useEs].actual = 0; allEs[useEs].length = 0; enc = (int) useEs; ++useEs; } loc = -1; for (k = 0; k < (int) allEs[enc].length; ++k) { if (!strcmp(allLs[j], allEs[enc].locales[k])) { loc = k; break; } } if (loc < 0) { if ((long) allEs[enc].length >= (long) allEs[enc].actual) { allEs[enc].actual = ((allEs[enc].length + 32) * 3 / 2); allEs[enc].locales = realloc(allEs[enc].locales, (allEs[enc].actual + 2) * sizeof(char *)); } loc = (int) allEs[enc].length; allEs[enc].length++; } allEs[enc].locales[loc] = allLs[j]; allEs[enc].locales[loc + 1] = 0; } } /* set our locale back to the starting one */ setlocale(LC_CTYPE, old_locale); /* print the result */ if (useEs != 0) { printf("Iconv supports %ld encodings\n", (long) useEs); qsort(allEs, useEs, sizeof(allEs[0]), compare_encodings); for (n = 0; n < useEs; ++n) { printf(" %s\n", allEs[n].encoding); qsort(allEs[n].locales, allEs[n].length, sizeof(char *), compare_locales); col = 0; for (t = 0; t < allEs[n].length; ++t) { now = strlen(allEs[n].locales[t]); if (col + now + 2 > MAXCOLS) { printf("\n"); col = 0; } if (col == 0) { printf(" "); col = 4; } printf("%s", allEs[n].locales[t]); col += now; if (t + 1 < allEs[n].length) { printf(", "); col += 2; } } if (col) printf("\n"); } #ifdef NO_LEAKS for (n = 0; n < useEs; ++n) { free(allEs[n].encoding); free(allEs[n].locales); } free(allEs); #endif } else { Message("No encodings found\n"); rc = EXIT_FAILURE; } #ifdef NO_LEAKS for (n = 0; n < useLs; ++n) { free(allLs[n]); } free(allLs); #endif } else { Message("No locales found\n"); rc = EXIT_FAILURE; } /* cleanup */ free(old_locale); #endif return rc; } #ifdef NO_LEAKS /* * Given a reverse-pointer, remove all of the corresponding cached information * from this module. */ void luitDestroyReverse(FontMapReversePtr reverse) { LuitConv *p, *q; size_t n; for (p = all_conversions, q = 0; p != 0; q = p, p = p->next) { if (&(p->reverse) == reverse) { free(p->encoding_name); if (p->iconv_desc != NO_ICONV) iconv_close(p->iconv_desc); for (n = 0; n < p->table_size; ++n) { if (p->table_utf8[n].text) { free(p->table_utf8[n].text); } } /* delink and destroy */ if (q != 0) q->next = p->next; else all_conversions = p->next; free(p->table_utf8); free(p->rev_index); free(p); break; } } } void luitconv_leaks(void) { TRACE(("luitconv_leaks %p\n", (void *) all_conversions)); while (all_conversions != 0) { luitDestroyReverse(&(all_conversions->reverse)); } } #endif luit-20240910/trace.h0000644000000000000000000000306113414465267012713 0ustar rootroot/* $XTermId: trace.h,v 1.9 2019/01/06 20:53:11 tom Exp $ */ /* Copyright 2010-2018,2019 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef TRACE_H #define TRACE_H #include void Trace(const char *fmt, ...) GCC_PRINTFLIKE(1,2); #ifdef OPT_TRACE #define TRACE(params) Trace params #if OPT_TRACE > 1 #define TRACE2(params) Trace params #else #define TRACE2(params) /* nothing */ #endif #else #define TRACE(params) /* nothing */ #define TRACE2(params) /* nothing */ #endif #define TRACE_ERR(msg) TRACE((msg ": %s\n", NonNull(strerror(errno)))) #endif /* TRACE_H */ luit-20240910/luitconv.h0000644000000000000000000001274614013537250013456 0ustar rootroot/* $XTermId: luitconv.h,v 1.37 2021/02/18 19:23:20 tom Exp $ */ /* Copyright 2010-2019,2021 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUITCONV_H #define LUITCONV_H #ifdef USE_ICONV #include #include typedef enum { umNONE = 0 ,umPOSIX = 1 ,umBUILTIN = 2 ,umFONTENC = 4 ,umICONV = 8 ,umANY = (umPOSIX | umBUILTIN | umFONTENC | umICONV) } UM_MODE; typedef enum { usANY = 1 ,us8BIT = 2 ,us16BIT = 4 } US_SIZE; #define FONT_ENCODING_UNICODE 1 typedef struct _FontMap { int type; unsigned (*recode) (unsigned, void *); /* mapping function */ void *client_data; /* second parameter of the two above */ struct _FontMap *next; /* link to next element in list */ } FontMapRec, *FontMapPtr; typedef struct _FontMapReverse { unsigned int (*reverse) (unsigned, void *); void *data; } FontMapReverseRec, *FontMapReversePtr; typedef struct _FontEnc { char *name; /* the name of the encoding */ char **aliases; /* its aliases, null terminated */ int size; /* its size, either in bytes or rows */ int row_size; /* the size of a row, or 0 if bytes */ FontMapPtr mappings; /* linked list of mappings */ struct _FontEnc *next; /* link to next element */ /* the following two were added in version 0.2 of the font interface */ /* they should be kept at the end to preserve binary compatibility */ int first; /* first byte or row */ int first_col; /* first column in each row */ } FontEncRec, *FontEncPtr; typedef struct { size_t size; /* length of text[] */ char *text; /* value, in UTF-8 */ unsigned ucs; /* corresponding Unicode value */ } MappingData; typedef struct { unsigned ucs; unsigned ch; } ReverseData; typedef struct _LuitConv { struct _LuitConv *next; char *encoding_name; iconv_t iconv_desc; /* internal tables for input/output */ MappingData *table_utf8; /* UTF-8 equivalents of 8-bit codes */ ReverseData *rev_index; /* reverse-index */ size_t len_index; /* index length */ size_t table_size; /* length of table_utf8[] and rev_index[] */ /* data expected by caller */ FontMapRec mapping; FontMapReverseRec reverse; } LuitConv; typedef struct { unsigned source; unsigned target; } BuiltInMapping; typedef struct _BuiltInCharset { const char *name; /* table name, for lookups */ const BuiltInMapping *table; size_t length; /* length of table[] */ } BuiltInCharsetRec; extern UM_MODE lookup_order[]; extern FontEncPtr luitGetFontEnc(const char *, UM_MODE); extern FontMapPtr luitLookupMapping(const char *, UM_MODE, US_SIZE); extern FontMapReversePtr luitLookupReverse(FontMapPtr); extern LuitConv *luitLookupEncoding(FontMapPtr); extern const BuiltInCharsetRec builtin_encodings[]; extern unsigned luitMapCodeValue(unsigned, FontMapPtr); extern void luitFreeFontEnc(FontEncPtr); #ifdef NO_LEAKS extern void luitDestroyReverse(FontMapReversePtr); #endif #define LookupMapping(encoding_name,usize) \ luitLookupMapping(encoding_name, umANY, usize) #define LookupReverse(fontmap_ptr) \ luitLookupReverse(fontmap_ptr) #define MapCodeValue(code, fontmap_ptr) \ luitMapCodeValue(code, fontmap_ptr) #else /* !USE_ICONV */ #include #define LookupMapping(encoding_name,usize) \ FontEncMapFind(encoding_name, FONT_ENCODING_UNICODE, -1, -1, NULL) #define LookupReverse(fontmap_ptr) \ FontMapReverse(fontmap_ptr) #define MapCodeValue(code, fontmap_ptr) \ FontEncRecode(code, fontmap_ptr) #endif /* USE_ICONV */ typedef unsigned short UCode; typedef struct _FontEncSimpleMap { unsigned len; /* might be 0x10000 */ UCode row_size; UCode first; UCode *map; /* fontenc makes this const */ } FontEncSimpleMapRec, *FontEncSimpleMapPtr; #ifdef FONT_ENCODING_POSTSCRIPT typedef struct _FontEncSimpleName { unsigned len; UCode first; char **map; } FontEncSimpleNameRec, *FontEncSimpleNamePtr; #endif /* FONT_ENCODING_POSTSCRIPT */ #define MIN_UCODE 0x0000 #define MAX_UCODE 0xffff #define rowOf(code) ((code) / 0x100) #define colOf(code) ((code) & 0xff) extern FontEncPtr lookupOneFontenc(const char *); extern int reportBuiltinCharsets(void); extern int reportFontencCharsets(void); extern int reportIconvCharsets(void); extern int showBuiltinCharset(const char *); extern int showFontencCharset(const char *); extern int showIconvCharset(const char *); extern int typeOfFontenc(FontEncPtr); extern unsigned luitRecode(unsigned, void *); extern unsigned shiftOfFontenc(FontEncPtr); #endif /* LUITCONV_H */ luit-20240910/sys.h0000644000000000000000000000512613777670204012440 0ustar rootroot/* $XTermId: sys.h,v 1.23 2021/01/13 22:13:24 tom Exp $ */ /* Copyright 2010-2013,2021 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUIT_SYS_H #define LUIT_SYS_H 1 #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) #define USE_IGNORE_RC extern int ignore_unused; #define IGNORE_RC(func) ignore_unused = (int) func #else #define IGNORE_RC(func) (void) func #endif /* gcc workarounds */ #define IO_CanRead 1 #define IO_CanWrite 2 #define IO_Closed 4 #define TypeCalloc(type) (type *) calloc((size_t) 1, sizeof(type)) #define TypeCallocN(type,n) (type *) calloc((size_t) (n), sizeof(type)) #define SizeOf(v) (sizeof(v) / sizeof(v[0])) int waitForOutput(int fd); int waitForInput(int fd1, int fd2); int setWindowSize(int sfd, int dfd); int installHandler(int signum, void (*handler) (int)); int copyTermios(int sfd, int dfd); int restoreTermios(int sfd); int setRawTermios(int sfd); char *my_basename(char *path); int allocatePty(int *pty_return, char **line_return); int openTty(char *line); int droppriv(void); char *strmalloc(const char *value); #ifdef HAVE_STRCASECMP #define StrCaseCmp(a,b) strcasecmp(a,b) #else int my_strcasecmp(const char *a, const char *b); #define StrCaseCmp(a,b) my_strcasecmp(a,b) #endif #ifdef NO_LEAKS void luit_leaks(void); void charset_leaks(void); void fontenc_leaks(void); void iso2022_leaks(void); void luitconv_leaks(void); void ExitProgram(int code) GCC_NORETURN; #else #define ExitProgram(code) exit(code) #endif #define ExitSuccess() ExitProgram(EXIT_SUCCESS) #define ExitFailure() ExitProgram(EXIT_FAILURE) #endif /* LUIT_SYS_H */ luit-20240910/configure.in0000644000000000000000000001030114667661442013754 0ustar rootrootdnl $XTermId: configure.in,v 1.55 2024/09/09 21:05:38 tom Exp $ dnl dnl --------------------------------------------------------------------------- dnl dnl Copyright 2006-2023,2024 by Thomas E. Dickey dnl dnl All Rights Reserved dnl dnl Permission to use, copy, modify, and distribute this software and its dnl documentation for any purpose and without fee is hereby granted, dnl provided that the above copyright notice appear in all copies and that dnl both that copyright notice and this permission notice appear in dnl supporting documentation, and that the name of the above listed dnl copyright holder(s) not be used in advertising or publicity pertaining dnl to distribution of the software without specific, written prior dnl permission. dnl dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl dnl --------------------------------------------------------------------------- AC_PREREQ(2.52.20240618) AC_INIT(luit.c) AC_CONFIG_HEADER(config.h:config_h.in) CF_CHECK_CACHE CF_WITH_SYSTYPE CF_GLOB_FULLPATH AC_ARG_PROGRAM CF_PROG_CC AC_PROG_CPP AC_PROG_INSTALL CF_PROG_LINT CF_MAKE_TAGS AC_CONST AC_PATH_XTRA CF_XOPEN_SOURCE(600) AC_CHECK_DECL(exit) CF_SIGWINCH CF_SVR4 CF_SYSV AC_TYPE_UID_T CF_WITHOUT_X CF_DISABLE_ECHO CF_ENABLE_WARNINGS(Wwrite-strings Wconversion) AC_CHECK_HEADERS( \ poll.h \ pty.h \ stropts.h \ sys/ioctl.h \ sys/param.h \ sys/poll.h \ sys/select.h \ sys/time.h \ termios.h \ ) AC_CHECK_FUNCS(\ poll \ putenv \ select \ strdup \ strcasecmp \ ) CF_FUNC_SETGROUPS CF_CHECK_TYPE([nfds_t],[unsigned long],[ #include #ifdef HAVE_SYS_POLL_H #include #endif ]) CF_SYS_TIME_SELECT # workaround for divergence of xterm/luit in the [CF_FUNC_GRANTPT] macro... AC_CHECK_FUNCS(grantpt) disable_openpty=$ac_cv_func_grantpt CF_FUNC_GRANTPT CF_FUNC_POLL AC_MSG_CHECKING(if you want to use fontenc) CF_ARG_ENABLE(fontenc, [ --enable-fontenc enable/disable use of fontenc], [with_fontenc=yes], [with_fontenc=maybe]) AC_MSG_RESULT($with_fontenc) AC_MSG_CHECKING(if you want to use iconv) CF_ARG_DISABLE(iconv, [ --disable-iconv enable/disable use of iconv], [with_iconv=no], [with_iconv=maybe]) AC_MSG_RESULT($with_iconv) case $with_iconv in yes) case $with_fontenc in yes) with_fontenc=no AC_MSG_WARN(overriding deprecated fontenc) ;; maybe|no) with_fontenc=no AC_MSG_NOTICE(using iconv) ;; esac ;; no) case $with_fontenc in yes) ;; no) AC_MSG_ERROR(you must choose between iconv and fontenc) ;; maybe) with_fontenc=yes AC_MSG_NOTICE(using fontenc) ;; esac ;; maybe) case $with_fontenc in yes) with_iconv=no AC_MSG_NOTICE(using fontenc) ;; no|maybe) with_iconv=yes with_fontenc=no AC_MSG_NOTICE(using iconv) ;; esac ;; esac CF_WITH_ZLIB if test "x$ac_cv_func_zError" = xyes then AC_DEFINE(USE_ZLIB,1,[Define to 1 if we can link with zlib]) fi if test "$with_fontenc" = yes then CF_X_FONTENC if test $cf_have_fontenc_libs = yes ; then AC_DEFINE(USE_FONTENC,1,[Define to 1 if font-encoding libraries can/should be used]) else AC_MSG_ERROR(cannot link with fontenc) fi fi AM_LANGINFO_CODESET # Since iconv is widely available, fallback to using it if fontenc is neither # requested nor available. if test "$with_iconv" = yes then AM_ICONV AC_DEFINE(USE_ICONV,1,[Define to 1 if iconv-libraries should be used]) CF_ADD_LIBS($LIBICONV) EXTRASRCS="$EXTRASRCS luitconv.c builtin.c" EXTRAOBJS="$EXTRAOBJS luitconv\$o builtin\$o" fi CF_WITH_ENCODINGS_DIR CF_WITH_LOCALE_ALIAS CF_WITH_MAN2HTML CF_DISABLE_LEAKS CF_ENABLE_TRACE if test "$with_trace" != no then EXTRASRCS="$EXTRASRCS trace.c" EXTRAOBJS="$EXTRAOBJS trace\$o" fi CF_DISABLE_RPATH_HACK AC_SUBST(EXTRASRCS) AC_SUBST(EXTRAOBJS) AC_OUTPUT(Makefile,,,cat) CF_MAKE_DOCS(luit,[\$(manext)]) luit-20240910/charset.c0000644000000000000000000007112414013543544013235 0ustar rootroot/* $XTermId: charset.c,v 1.83 2021/02/18 20:00:36 tom Exp $ */ /* Copyright 2010-2018,2021 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include static unsigned int IdentityRecode(unsigned int n, const CharsetRec * self GCC_UNUSED) { return n; } static int NullReverse(unsigned int n GCC_UNUSED, const CharsetRec * self GCC_UNUSED) { return -1; } static const CharsetRec Unknown94Charset = {"Unknown (94)", T_94, 0, IdentityRecode, NullReverse, 0, 0, 0, 0, 0, 0}; static const CharsetRec Unknown96Charset = {"Unknown (96)", T_96, 0, IdentityRecode, NullReverse, 0, 0, 0, 0, 0, 0}; static const CharsetRec Unknown9494Charset = {"Unknown (94x94)", T_9494, 0, IdentityRecode, NullReverse, 0, 0, 0, 0, 0, 0}; static const CharsetRec Unknown9696Charset = {"Unknown (96x96)", T_9696, 0, IdentityRecode, NullReverse, 0, 0, 0, 0, 0, 0}; #define EmptyFontenc {0, 0, 0, 0, 0, 0, 0} /* * The "name" given is useful on the command-line. * The "xlfd" column is the name given in the X font-encoding package, where * that has a corresponding built-in table or ".enc" file. Other names (such * as "dec-technical" are chosen for consistency with other entries in the * table. */ /* *INDENT-OFF* */ static FontencCharsetRec fontencCharsets[] = { {"ISO 646 (1973)", T_94, '@', "iso646.1973-0", 0x00, 0, 0}, {"ASCII", T_94, 'B', "iso8859-1", 0x00, 0, 0}, /* bug */ {"JIS X 0201:GL", T_94, 'J', "jisx0201.1976-0", 0x00, 0, 0}, {"JIS X 0201:GR", T_94, 'I', "jisx0201.1976-0", 0x80, 0, 0}, {"DEC Special", T_94, '0', "dec-special", 0x00, 0, 0}, {"DEC Technical", T_94, '>', "dec-technical", 0x00, 0, 0}, {"ISO 8859-1", T_96, 'A', "iso8859-1", 0x80, 0, 0}, {"ISO 8859-2", T_96, 'B', "iso8859-2", 0x80, 0, 0}, {"ISO 8859-3", T_96, 'C', "iso8859-3", 0x80, 0, 0}, {"ISO 8859-4", T_96, 'D', "iso8859-4", 0x80, 0, 0}, {"ISO 8859-5", T_96, 'L', "iso8859-5", 0x80, 0, 0}, {"ISO 8859-6", T_96, 'G', "iso8859-6", 0x80, 0, 0}, {"ISO 8859-7", T_96, 'F', "iso8859-7", 0x80, 0, 0}, {"ISO 8859-8", T_96, 'H', "iso8859-8", 0x80, 0, 0}, {"ISO 8859-9", T_96, 'M', "iso8859-9", 0x80, 0, 0}, {"ISO 8859-10", T_96, 'V', "iso8859-10", 0x80, 0, 0}, {"ISO 8859-11", T_96, 'T', "iso8859-11", 0x80, 0, 0}, {"TIS 620", T_96, 'T', "iso8859-11", 0x80, 0, 0}, {"ISO 8859-13", T_96, 'Y', "iso8859-13", 0x80, 0, 0}, {"ISO 8859-14", T_96, '_', "iso8859-14", 0x80, 0, 0}, {"ISO 8859-15", T_96, 'b', "iso8859-15", 0x80, 0, 0}, {"ISO 8859-16", T_96, 'f', "iso8859-16", 0x80, 0, 0}, {"KOI8-E", T_96, '@', "koi8-e", 0x80, 0, 0}, {"TCVN", T_96, 'Z', "tcvn-0", 0x80, 0, 0}, {"GB 2312", T_9494, 'A', "gb2312.1980-0", 0x0000, 0, 0}, {"JIS X 0208", T_9494, 'B', "jisx0208.1990-0", 0x0000, 0, 0}, {"KSC 5601", T_9494, 'C', "ksc5601.1987-0", 0x0000, 0, 0}, {"JIS X 0212", T_9494, 'D', "jisx0212.1990-0", 0x0000, 0, 0}, {"GB 2312", T_9696, 'A', "gb2312.1980-0", 0x0000, 0, 0}, {"JIS X 0208", T_9696, 'B', "jisx0208.1990-0", 0x0000, 0, 0}, {"KSC 5601", T_9696, 'C', "ksc5601.1987-0", 0x0000, 0, 0}, {"JIS X 0212", T_9696, 'D', "jisx0212.1990-0", 0x0000, 0, 0}, {"CNS11643-1", T_9494, 'G', "cns11643-1", 0x0000, 0, 0}, {"CNS11643-2", T_9494, 'H', "cns11643-2", 0x0000, 0, 0}, {"CNS11643-3", T_9494, 'I', "cns11643-3", 0x0000, 0, 0}, {"APL2", T_128, 0, "apl2", 0x80, 0, 0}, {"KOI8-R", T_128, 0, "koi8-r", 0x80, 0, 0}, {"KOI8-U", T_128, 0, "koi8-u", 0x80, 0, 0}, {"KOI8-RU", T_128, 0, "koi8-ru", 0x80, 0, 0}, {"CP 1250", T_128, 0, "microsoft-cp1250", 0x80, 0, 0}, {"CP 1251", T_128, 0, "microsoft-cp1251", 0x80, 0, 0}, {"CP 1252", T_128, 0, "microsoft-cp1252", 0x80, 0, 0}, {"CP 1255", T_128, 0, "microsoft-cp1255", 0x80, 0, 0}, {"CP 437", T_128, 0, "ibm-cp437", 0x80, 0, 0}, {"CP 850", T_128, 0, "ibm-cp850", 0x80, 0, 0}, {"CP 852", T_128, 0, "ibm-cp852", 0x80, 0, 0}, {"CP 865", T_128, 0, "ibm-cp865", 0x80, 0, 0}, {"CP 866", T_128, 0, "ibm-cp866", 0x80, 0, 0}, {"Big 5", T_94192, 0, "big5.eten-0", 0x8000, 0, 0}, /* * Several empty slots are reserved, to allow for non-ISO-2022 character * sets to be defined in ".enc" files. */ EmptyFontenc, /* G0, from ".enc" file */ EmptyFontenc, /* G1, from ".enc" file */ EmptyFontenc, /* G2, from ".enc" file */ EmptyFontenc, /* G3, from ".enc" file */ EmptyFontenc }; /* *INDENT-ON* */ typedef struct _OtherCharset { const char *name; int (*init) (OtherStatePtr); unsigned int (*mapping) (unsigned int, OtherStatePtr); unsigned int (*reverse) (unsigned int, OtherStatePtr); int (*stack) (unsigned, OtherStatePtr); } OtherCharsetRec, *OtherCharsetPtr; /* *INDENT-OFF* */ static const OtherCharsetRec otherCharsets[] = { {"GBK", init_gbk, mapping_gbk, reverse_gbk, stack_gbk}, {"UTF-8", init_utf8, mapping_utf8, reverse_utf8, stack_utf8}, {"SJIS", init_sjis, mapping_sjis, reverse_sjis, stack_sjis}, {"BIG5-HKSCS", init_hkscs, mapping_hkscs, reverse_hkscs, stack_hkscs}, {"GB18030", init_gb18030, mapping_gb18030, reverse_gb18030, stack_gb18030}, {0, 0, 0, 0, 0} }; /* *INDENT-ON* */ #define lcIgnore(c) \ (c && (isspace(UChar(c)) || c == '-' || c == '_' || c == '/')) int lcStrCmp(const char *s, const char *t) { int result = 0; while (*s || *t) { if (lcIgnore(*s)) s++; else if (lcIgnore(*t)) t++; else if (*s && *t && tolower(UChar(*s)) == tolower(UChar(*t))) { s++; t++; } else { result = 1; break; } } return result; } static int compare1(const char *s, const char *t, size_t n) { int result = 0; while (n && (*s || *t)) { --n; if (lcIgnore(*s)) s++; else if (lcIgnore(*t)) t++; else if (*s && *t && tolower(UChar(*s)) == tolower(UChar(*t))) { s++; t++; } else { result = 1; break; } } return result; } static unsigned int FontencCharsetRecode(unsigned int n, const CharsetRec * self) { const FontencCharsetRec *fc = (const FontencCharsetRec *) (self->data); unsigned result; result = MapCodeValue(n + fc->shift, fc->mapping); TRACE(("FontencCharsetRecode %#x ->%#x%s\n", n, result, (n != result) ? " map" : "")); return result; } static int FontencCharsetReverse(unsigned int i, const CharsetRec * self) { const FontencCharsetRec *fc = (const FontencCharsetRec *) (self->data); unsigned n; int result = -1; n = fc->reverse->reverse(i, fc->reverse->data); if (n != 0 && n >= fc->shift) { n -= fc->shift; #define IS_GL(n) ((n) >= 0x20 && (n) < 0x80) switch (self->type) { case T_94: case T_96: if (IS_GL(n)) result = (int) n; break; case T_128: if (n < 0x80) result = (int) n; break; case T_9494: case T_9696: if (IS_GL(n >> 8) && IS_GL(n & 0xFF)) result = (int) n; break; case T_94192: if (IS_GL(n >> 8) && IS_GL(n & 0x7F)) result = (int) n; break; default: abort(); /* NOTREACHED */ } #undef IS_GL } TRACE(("FontencCharsetReverse %#x ->%#x%s\n", i, result, ((int) i != result) ? " map" : "")); return result; } static CharsetPtr cachedCharsets = NULL; static CharsetPtr getCachedCharset(unsigned final, int type, const char *name) { CharsetPtr c; for (c = cachedCharsets; c; c = c->next) { if (((c->type == type && c->final == final) || (name && !lcStrCmp(c->name, name))) && (c->type != T_FAILED)) return c; } return NULL; } static void cacheCharset(CharsetPtr c) { c->next = cachedCharsets; cachedCharsets = c; VERBOSE(2, ("cachedCharset '%s'\n", c->name)); } #ifdef USE_ICONV static US_SIZE cpSize(FontencCharsetPtr fc) { US_SIZE result = usANY; switch (fc->type) { case T_94: case T_96: case T_128: result = us8BIT; break; case T_9494: case T_9696: case T_94192: result = us16BIT; break; } return result; } #endif static int addFontencCharset(const char *name, FontEncPtr f) { FontencCharsetPtr fc = fontencCharsets; FontencCharsetPtr limit = fc + SizeOf(fontencCharsets); int result = 0; int c_size = typeOfFontenc(f); int c_type; if (c_size <= 94) { c_type = T_94; } else if (c_size <= 96) { c_type = T_96; } else if (c_size <= 128) { c_type = T_128; } else { VERBOSE(1, ("unexpected character-set size: %d\n", c_size)); return 0; } while (fc->name) { fc++; } if (fc < (limit - 1)) { result = 1; fc->name = strdup(name); fc->xlfd = strdup(name); fc->type = c_type; fc->shift = shiftOfFontenc(f); } return result; } static CharsetPtr getFontencCharset(unsigned final, int type, const char *name) { FontencCharsetPtr fc; CharsetPtr c = NULL; FontMapPtr mapping; FontMapReversePtr reverse; CharsetPtr result = NULL; TRACE(("getFontencCharset(final %#x, type %d, name %s)\n", final, type, NonNull(name))); fc = fontencCharsets; while (fc->name) { if (((fc->type == type && fc->final == final) || (name && !lcStrCmp(fc->name, name))) && (fc->type != T_FAILED)) break; fc++; } if (!fc->name) { VERBOSE(2, ("...no match for '%s' in FontEnc charsets\n", NonNull(name))); } else if ((c = TypeCalloc(CharsetRec)) == 0) { VERBOSE(2, ("malloc failed\n")); } else if ((mapping = LookupMapping(fc->xlfd, cpSize(fc))) == NULL) { VERBOSE(2, ("...lookup mapping %s (%s) failed\n", NonNull(name), fc->xlfd)); fc->type = T_FAILED; } else if ((reverse = LookupReverse(mapping)) == NULL) { VERBOSE(2, ("...lookup reverse %s failed\n", NonNull(name))); fc->type = T_FAILED; } else { fc->mapping = mapping; fc->reverse = reverse; c->name = fc->name; c->type = fc->type; c->final = fc->final; c->recode = FontencCharsetRecode; c->reverse = FontencCharsetReverse; c->data = fc; cacheCharset(c); result = c; } if (result == NULL && c != NULL) free(c); return result; } static const OtherCharsetRec * findOtherCharset(const char *name) { const OtherCharsetRec *fc; fc = otherCharsets; while (fc->name) { if (name && !lcStrCmp(fc->name, name)) break; fc++; } return fc; } int isOtherCharset(const char *name) { const OtherCharsetRec *fc = findOtherCharset(name); int result = (fc->name != 0); if (!result) { result = (!lcStrCmp(name, "Big5") || !lcStrCmp(name, "JOHAB")); } return result; } static CharsetPtr getOtherCharset(const char *name) { const OtherCharsetRec *fc; CharsetPtr c = NULL; OtherStatePtr s = NULL; CharsetPtr result = NULL; fc = findOtherCharset(name); if (!fc->name) { VERBOSE(2, ("...no match for '%s' in Other charsets\n", NonNull(name))); } else if ((c = TypeCalloc(CharsetRec)) == NULL) { VERBOSE(2, ("malloc failed\n")); } else if ((s = TypeCalloc(OtherState)) == NULL) { VERBOSE(2, ("malloc failed\n")); } else { c->name = fc->name; c->type = T_OTHER; c->final = 0; c->data = fc; c->other_recode = fc->mapping; c->other_reverse = fc->reverse; c->other_stack = fc->stack; c->other_aux = s; if (!fc->init(s)) { VERBOSE(2, ("...initialization %s failed\n", NonNull(name))); c->type = T_FAILED; } else { cacheCharset(c); result = c; } } if (result == NULL) { if (c != NULL) free(c); if (s != NULL) free(s); } return result; } const CharsetRec * getUnknownCharset(int type) { TRACE(("getUnknownCharset(%d)\n", type)); switch (type) { case T_94: VERBOSE(2, ("using unknown 94-charset\n")); return &Unknown94Charset; case T_96: VERBOSE(2, ("using unknown 96-charset\n")); return &Unknown96Charset; case T_9494: VERBOSE(2, ("using unknown 9494-charset\n")); return &Unknown9494Charset; case T_9696: VERBOSE(2, ("using unknown 9696-charset\n")); return &Unknown9696Charset; default: VERBOSE(2, ("using unknown 94-charset\n")); return &Unknown94Charset; } } const CharsetRec * getCharset(unsigned final, int type) { const CharsetRec *c; TRACE(("getCharset(final=%c, type=%d)\n", final, type)); c = getCachedCharset(final, type, NULL); if (c) return c; c = getFontencCharset(final, type, NULL); if (c) return c; return getUnknownCharset(type); } const CharsetRec * getCharsetByName(const char *name) { const CharsetRec *c; FontEncPtr f; int type = T_94; VERBOSE(2, ("getCharsetByName(%s)\n", NonNull(name))); TRACE(("getCharsetByName(%s)\n", NonNull(name))); if (name == NULL) return getUnknownCharset(type); c = getCachedCharset(0, 0, name); if (c) return c; c = getFontencCharset(0, 0, name); if (c) return c; c = getOtherCharset(name); if (c) return c; /* * If we did not find the name in a table, look for a ".enc" * file. */ if ((f = lookupOneFontenc(name)) != 0) { if (addFontencCharset(name, f)) { c = getFontencCharset(0, 0, name); if (c) return c; } } return getUnknownCharset(type); } /* *INDENT-OFF* */ static const LocaleCharsetRec localeCharsets[] = { {"C", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, {"POSIX", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, {"US-ASCII", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, {"ISO8859-1", 0, 2, "ASCII", NULL, "ISO 8859-1", NULL, NULL}, {"ISO8859-2", 0, 2, "ASCII", NULL, "ISO 8859-2", NULL, NULL}, {"ISO8859-3", 0, 2, "ASCII", NULL, "ISO 8859-3", NULL, NULL}, {"ISO8859-4", 0, 2, "ASCII", NULL, "ISO 8859-4", NULL, NULL}, {"ISO8859-5", 0, 2, "ASCII", NULL, "ISO 8859-5", NULL, NULL}, {"ISO8859-6", 0, 2, "ASCII", NULL, "ISO 8859-6", NULL, NULL}, {"ISO8859-7", 0, 2, "ASCII", NULL, "ISO 8859-7", NULL, NULL}, {"ISO8859-8", 0, 2, "ASCII", NULL, "ISO 8859-8", NULL, NULL}, {"ISO8859-9", 0, 2, "ASCII", NULL, "ISO 8859-9", NULL, NULL}, {"ISO8859-10", 0, 2, "ASCII", NULL, "ISO 8859-10", NULL, NULL}, {"ISO8859-11", 0, 2, "ASCII", NULL, "ISO 8859-11", NULL, NULL}, {"TIS620", 0, 2, "ASCII", NULL, "ISO 8859-11", NULL, NULL}, {"ISO8859-13", 0, 2, "ASCII", NULL, "ISO 8859-13", NULL, NULL}, {"ISO8859-14", 0, 2, "ASCII", NULL, "ISO 8859-14", NULL, NULL}, {"ISO8859-15", 0, 2, "ASCII", NULL, "ISO 8859-15", NULL, NULL}, {"ISO8859-16", 0, 2, "ASCII", NULL, "ISO 8859-16", NULL, NULL}, {"KOI8-E", 0, 2, "ASCII", NULL, "KOI8-E", NULL, NULL}, {"KOI8-R", 0, 2, "ASCII", NULL, "KOI8-R", NULL, NULL}, {"KOI8-U", 0, 2, "ASCII", NULL, "KOI8-U", NULL, NULL}, {"KOI8-RU", 0, 2, "ASCII", NULL, "KOI8-RU", NULL, NULL}, {"CP1250", 0, 2, "ASCII", NULL, "CP 1250", NULL, NULL}, {"CP1251", 0, 2, "ASCII", NULL, "CP 1251", NULL, NULL}, {"CP1252", 0, 2, "ASCII", NULL, "CP 1252", NULL, NULL}, {"CP1255", 0, 2, "ASCII", NULL, "CP 1255", NULL, NULL}, {"CP437", 0, 2, "ASCII", NULL, "CP 437", NULL, NULL}, {"CP850", 0, 2, "ASCII", NULL, "CP 850", NULL, NULL}, {"CP852", 0, 2, "ASCII", NULL, "CP 852", NULL, NULL}, {"CP865", 0, 2, "ASCII", NULL, "CP 865", NULL, NULL}, {"CP866", 0, 2, "ASCII", NULL, "CP 866", NULL, NULL}, {"TCVN", 0, 2, "ASCII", NULL, "TCVN", NULL, NULL}, {"GB2312", 0, 1, "ASCII", "GB 2312", NULL, NULL, NULL}, {"eucJP", 0, 1, "ASCII", "JIS X 0208", "JIS X 0201:GR", "JIS X 0212", NULL}, {"eucKR", 0, 1, "ASCII", "KSC 5601", NULL, NULL, NULL}, {"eucCN", 0, 1, "ASCII", "GB 2312", NULL, NULL, NULL}, {"eucTW", 0, 1, "ASCII", "CNS11643-1", "CNS11643-2", "CNS11643-3", NULL}, {"Big5", 0, 1, "ASCII", "Big 5", NULL, NULL, NULL}, {"gbk", 0, 1, NULL, NULL, NULL, NULL, "GBK"}, {"UTF-8", 0, 1, NULL, NULL, NULL, NULL, "UTF-8"}, {"SJIS", 0, 1, NULL, NULL, NULL, NULL, "SJIS"}, {"Big5-HKSCS", 0, 1, NULL, NULL, NULL, NULL, "BIG5-HKSCS"}, {"gb18030", 0, 1, NULL, NULL, NULL, NULL, "GB18030"}, {0, 0, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ void reportCharsets(void) { const LocaleCharsetRec *p; FontencCharsetPtr q; printf("Known locale encodings:\n\n"); for (p = localeCharsets; p->name; p++) { if (p->other) { printf(" %s (non-ISO-2022 encoding)\n", p->other); continue; } printf(" %s: GL -> G%d, GR -> G%d", p->name, p->gl, p->gr); if (p->g0) printf(", G0: %s", p->g0); if (p->g1) printf(", G1: %s", p->g1); if (p->g2) printf(", G2: %s", p->g2); if (p->g3) printf(", G3: %s", p->g3); printf("\n"); } printf("\n\nKnown charsets (not all may be available):\n\n"); for (q = fontencCharsets; q->name; q++) { const char *csize = ""; printf(" %s", q->name); switch (q->type) { case T_94: csize = "94 codes"; break; case T_96: csize = "96 codes"; break; case T_128: csize = "128 codes"; break; case T_9494: csize = "94x94 codes"; break; case T_9696: csize = "94x96 codes"; break; case T_94192: csize = "94x192 codes"; break; } if (q->final) { printf(" (ISO 2022%s%s)", *csize ? ", " : "", csize); } else if (*csize) { printf(" (%s)", csize); } printf("\n"); } } #ifdef USE_ICONV static LocaleCharsetRec fakeLocaleCharset; static const LocaleCharsetRec * findLocaleByCharset(const char *charset) { const LocaleCharsetRec *lc; const LocaleCharsetRec *result = 0; for (lc = localeCharsets; lc->name != 0; ++lc) { if (lc->g1 == 0 && lc->g2 == 0) continue; if ((lc->g3 != 0 && !lcStrCmp(charset, lc->g3)) || (lc->g2 != 0 && !lcStrCmp(charset, lc->g2)) || (lc->g1 != 0 && !lcStrCmp(charset, lc->g1))) { result = lc; break; } } TRACE(("findLocaleByCharset(%s) ->%s\n", charset, result ? result->name : "?")); return result; } static const LocaleCharsetRec * closestLocaleCharset(FontEncPtr enc) { const LocaleCharsetRec *result = 0; if (enc != 0) { const FontencCharsetRec *fc = getFontencByName(enc->name); if (fc != 0) { result = findLocaleByCharset(fc->name); } else { result = findLocaleByCharset(enc->name); } } TRACE(("closestLocaleCharset(%s) ->%s\n", enc ? enc->name : "?", result ? result->name : "?")); return result; } static int canFakeLocaleCharset(FontEncPtr enc) { int result = 0; if (enc != 0 && enc->size <= 256 && enc->row_size == 0) { result = 1; } return result; } #endif static const LocaleCharsetRec * findLocaleCharset(const char *charset) { const LocaleCharsetRec *p; const LocaleCharsetRec *result = 0; for (p = localeCharsets; p->name; p++) { if (lcStrCmp(p->name, charset) == 0) { result = p; break; } } #ifdef USE_ICONV /* * The table is useful, but not complete. * If we can find a mapping for an 8-bit encoding, fake a table entry. */ if (result == 0) { FontEncPtr enc = luitGetFontEnc(charset, (UM_MODE) ((int) umICONV | (int) umFONTENC | (int) umBUILTIN)); if ((result = closestLocaleCharset(enc)) != 0) { TRACE(("...matched a LocaleCharset record for %s\n", NonNull(charset))); } else if (canFakeLocaleCharset(enc)) { LocaleCharsetRec *temp = &fakeLocaleCharset; TRACE(("...fake a LocaleCharset record for %s\n", NonNull(charset))); memset(temp, 0, sizeof(*temp)); temp->name = strmalloc(charset); temp->gr = 2; temp->g0 = "ASCII"; temp->g2 = temp->name; result = temp; } else { TRACE(("...do not know how to fake LocaleCharset for %s\n", NonNull(charset))); } luitFreeFontEnc(enc); } #endif return result; } static const LocaleCharsetRec * matchLocaleCharset(const char *charset) { static const struct { const char *source; const char *target; size_t source_len; size_t target_len; } prefixes[] = { #define DATA(source, target) { source, target, sizeof(source)-1, sizeof(target)-1 } DATA("ISO-", "ISO "), DATA("DEC ", "DEC-"), DATA("IBM-CP", "CP "), /* "ibm-cp866" -> "cp 866" (iconv) */ DATA("IBM", "CP "), DATA("MICROSOFT-CP", "CP "), DATA("MICROSOFT", "CP "), DATA("CP-", "CP "), DATA("ANSI", "CP "), /* e.g., Solaris ANSI1251 */ #undef DATA }; const LocaleCharsetRec *p = 0; TRACE(("matchLocaleCharset(%s)\n", NonNull(charset))); if (!IsEmpty(charset)) { char *euro; char source[MAX_KEYWORD_LENGTH + 1]; sprintf(source, "%.*s", MAX_KEYWORD_LENGTH, charset); if ((euro = strrchr(source, '@')) != 0 && !strcmp(euro, "@euro")) { Warning("the euro character may not be supported\n"); *euro = 0; } p = findLocaleCharset(source); if (p == 0) { size_t have = strlen(source); size_t n; char target[MAX_KEYWORD_LENGTH + 80]; for (n = 0; n < SizeOf(prefixes); ++n) { if (have > prefixes[n].source_len && have < MAX_KEYWORD_LENGTH && !compare1(source, prefixes[n].source, prefixes[n].source_len)) { strcpy(target, prefixes[n].target); strcpy(target + prefixes[n].target_len, source + prefixes[n].source_len); if ((p = findLocaleCharset(target)) != 0) { break; } } } } } return p; } int getLocaleState(const char *locale, const char *charset, int *gl_return, int *gr_return, const CharsetRec * *g0_return, const CharsetRec * *g1_return, const CharsetRec * *g2_return, const CharsetRec * *g3_return, const CharsetRec * *other_return) { int result = 0; char *resolved = 0; const LocaleCharsetRec *p; TRACE(("getLocaleState(locale=%s, charset=%s)\n", locale, NonNull(charset))); if (IsEmpty(charset)) { if (ignore_locale) { charset = locale; } else { resolved = resolveLocale(locale); if (!resolved) return -1; if ((charset = strrchr(resolved, '.')) != 0) { charset++; } else { charset = resolved; } } } if ((p = matchLocaleCharset(charset)) != 0) { *gl_return = p->gl; *gr_return = p->gr; *g0_return = getCharsetByName(p->g0); *g1_return = getCharsetByName(p->g1); *g2_return = getCharsetByName(p->g2); *g3_return = getCharsetByName(p->g3); if (p->other) *other_return = getCharsetByName(p->other); else *other_return = NULL; } else { result = -1; } if (resolved != 0) free(resolved); TRACE(("...getLocaleState ->%d\n", result)); return result; } #ifdef USE_ICONV /* * Given either a charset name, or the xlfd field (which is more likely to * match iconv), return a pointer to the entry in fontencCharsets which matches. */ const FontencCharsetRec * getFontencByName(const char *encoding_name) { const FontencCharsetRec *result = 0; const FontencCharsetRec *fc; char *gr_special; for (fc = fontencCharsets; fc->name != 0; ++fc) { if (!lcStrCmp(encoding_name, fc->name) || (strstr(fc->name, ":GL") == 0 && !lcStrCmp(encoding_name, fc->xlfd))) { result = fc; break; } } /* * Luit treats ":GR" specially in its charset tables, essentially to * distinguish the case it uses for JIS X 201 from other possibilities. */ if (result == 0 && strchr(encoding_name, ':') == 0 && (gr_special = malloc(strlen(encoding_name) + 4)) != 0) { sprintf(gr_special, "%s:GR", encoding_name); result = getFontencByName(gr_special); free(gr_special); } TRACE(("getFontencByName(%s) ->%s\n", encoding_name, result ? result->name : "?")); return result; } /* * Check (for EUC-JP specifically, but generally...) for a charset which * is part of a composite charset using G2/G3 via single-shifts. */ const char * getCompositeCharset(const char *encoding_name) { const char *result = 0; const FontencCharsetRec *fc; const LocaleCharsetRec *lc; if ((fc = getFontencByName(encoding_name)) != 0) { if ((lc = findLocaleByCharset(fc->name)) != 0) { result = lc->name; TRACE(("getCompositeCharset(%s) ->%s\n", NonNull(encoding_name), NonNull(result))); } } return result; } static const char * selectPart(const LocaleCharsetRec * data, unsigned g) { const char *result = 0; switch (g) { case 0: result = data->g0; break; case 1: result = data->g1; break; case 2: result = data->g2; break; case 3: result = data->g3; break; } return result; } /* * Given a composite name returned by getCompositeCharset, return a pointer to * the data which describes the encoding used for a given shift. */ const FontencCharsetRec * getCompositePart(const char *composite_name, unsigned g) { const FontencCharsetRec *result = 0; const LocaleCharsetRec *lc; const char *part_name; for (lc = localeCharsets; lc->name; ++lc) { if (!lcStrCmp(composite_name, lc->name)) { if ((part_name = selectPart(lc, g)) != 0) { const FontencCharsetRec *fc; for (fc = fontencCharsets; fc->name != 0; ++fc) { if (!lcStrCmp(part_name, fc->name)) { result = fc; break; } } } break; } } return result; } #endif #ifdef NO_LEAKS static int isUnknownCharsetPtr(CharsetPtr p) { return (p == &Unknown94Charset || p == &Unknown96Charset || p == &Unknown9494Charset || p == &Unknown9696Charset); } static void destroyFontencCharsetPtr(FontencCharsetPtr p) { #ifdef USE_ICONV if (p->reverse) { luitDestroyReverse(p->reverse); } #else p->mapping = 0; /* * This should, but does not work - * FontMapReverseFree(p->reverse) * * The iteration for map[] is based on reading the source of * FontMapReverse(). */ if (p->reverse) { int n; unsigned **map = p->reverse->data; for (n = 0; n < 256; ++n) { if (map[n]) free(map[n]); } free(p->reverse->data); free(p->reverse); p->reverse = 0; } #endif } static void destroyCharset(CharsetPtr p) { if (!isUnknownCharsetPtr(p)) { if (p->type == T_OTHER) { free(p->other_aux); } else { destroyFontencCharsetPtr((FontencCharsetPtr) p->data); } free(p); } } void charset_leaks(void) { while (cachedCharsets != 0) { CharsetPtr next = cachedCharsets->next; destroyCharset(cachedCharsets); cachedCharsets = next; } #ifdef USE_ICONV if (fakeLocaleCharset.name != 0) { free((void *) fakeLocaleCharset.name); fakeLocaleCharset.name = 0; } #endif } #endif /* NO_LEAKS */ luit-20240910/encodings/0000755000000000000000000000000014013442137013400 5ustar rootrootluit-20240910/encodings/koi8-u.enc0000644000000000000000000001320214011755464015211 0ustar rootroot# koi8-u STARTENCODING koi8-u SIZE 256 STARTMAPPING unicode 0x0080 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL 0x0081 0x2502 # BOX DRAWINGS LIGHT VERTICAL 0x0082 0x250C # BOX DRAWINGS LIGHT DOWN AND RIGHT 0x0083 0x2510 # BOX DRAWINGS LIGHT DOWN AND LEFT 0x0084 0x2514 # BOX DRAWINGS LIGHT UP AND RIGHT 0x0085 0x2518 # BOX DRAWINGS LIGHT UP AND LEFT 0x0086 0x251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0x0087 0x2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT 0x0088 0x252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0x0089 0x2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL 0x008A 0x253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0x008B 0x2580 # UPPER HALF BLOCK 0x008C 0x2584 # LOWER HALF BLOCK 0x008D 0x2588 # FULL BLOCK 0x008E 0x258C # LEFT HALF BLOCK 0x008F 0x2590 # RIGHT HALF BLOCK 0x0090 0x2591 # LIGHT SHADE 0x0091 0x2592 # MEDIUM SHADE 0x0092 0x2593 # DARK SHADE 0x0093 0x2320 # TOP HALF INTEGRAL 0x0094 0x25A0 # BLACK SQUARE 0x0095 0x2219 # BULLET OPERATOR 0x0096 0x221A # SQUARE ROOT 0x0097 0x2248 # ALMOST EQUAL TO 0x0098 0x2264 # LESS-THAN OR EQUAL TO 0x0099 0x2265 # GREATER-THAN OR EQUAL TO 0x009A 0x00A0 # NO-BREAK SPACE 0x009B 0x2321 # BOTTOM HALF INTEGRAL 0x009C 0x00B0 # DEGREE SIGN 0x009D 0x00B2 # SUPERSCRIPT TWO 0x009E 0x00B7 # MIDDLE DOT 0x009F 0x00F7 # DIVISION SIGN 0x00A0 0x2550 # BOX DRAWINGS DOUBLE HORIZONTAL 0x00A1 0x2551 # BOX DRAWINGS DOUBLE VERTICAL 0x00A2 0x2552 # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 0x00A3 0x0451 # CYRILLIC SMALL LETTER IO 0x00A4 0x0454 # CYRILLIC SMALL LETTER UKRAINIAN IE 0x00A5 0x2554 # BOX DRAWINGS DOUBLE DOWN AND RIGHT 0x00A6 0x0456 # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 0x00A7 0x0457 # CYRILLIC SMALL LETTER YI 0x00A8 0x2557 # BOX DRAWINGS DOUBLE DOWN AND LEFT 0x00A9 0x2558 # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 0x00AA 0x2559 # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 0x00AB 0x255A # BOX DRAWINGS DOUBLE UP AND RIGHT 0x00AC 0x255B # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 0x00AD 0x0491 # CYRILLIC SMALL LETTER GHE WITH UPTURN 0x00AE 0x255D # BOX DRAWINGS DOUBLE UP AND LEFT 0x00AF 0x255E # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 0x00B0 0x255F # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 0x00B1 0x2560 # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 0x00B2 0x2561 # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 0x00B3 0x0401 # CYRILLIC CAPITAL LETTER IO 0x00B4 0x0404 # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0x00B5 0x2563 # BOX DRAWINGS DOUBLE VERTICAL AND LEFT 0x00B6 0x0406 # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0x00B7 0x0407 # CYRILLIC CAPITAL LETTER YI 0x00B8 0x2566 # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 0x00B9 0x2567 # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 0x00BA 0x2568 # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 0x00BB 0x2569 # BOX DRAWINGS DOUBLE UP AND HORIZONTAL 0x00BC 0x256A # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 0x00BD 0x0490 # CYRILLIC CAPITAL LETTER GHE WITH UPTURN 0x00BE 0x256C # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL 0x00BF 0x00A9 # COPYRIGHT SIGN 0x00C0 0x044E # CYRILLIC SMALL LETTER YU 0x00C1 0x0430 # CYRILLIC SMALL LETTER A 0x00C2 0x0431 # CYRILLIC SMALL LETTER BE 0x00C3 0x0446 # CYRILLIC SMALL LETTER TSE 0x00C4 0x0434 # CYRILLIC SMALL LETTER DE 0x00C5 0x0435 # CYRILLIC SMALL LETTER IE 0x00C6 0x0444 # CYRILLIC SMALL LETTER EF 0x00C7 0x0433 # CYRILLIC SMALL LETTER GHE 0x00C8 0x0445 # CYRILLIC SMALL LETTER HA 0x00C9 0x0438 # CYRILLIC SMALL LETTER I 0x00CA 0x0439 # CYRILLIC SMALL LETTER SHORT I 0x00CB 0x043A # CYRILLIC SMALL LETTER KA 0x00CC 0x043B # CYRILLIC SMALL LETTER EL 0x00CD 0x043C # CYRILLIC SMALL LETTER EM 0x00CE 0x043D # CYRILLIC SMALL LETTER EN 0x00CF 0x043E # CYRILLIC SMALL LETTER O 0x00D0 0x043F # CYRILLIC SMALL LETTER PE 0x00D1 0x044F # CYRILLIC SMALL LETTER YA 0x00D2 0x0440 # CYRILLIC SMALL LETTER ER 0x00D3 0x0441 # CYRILLIC SMALL LETTER ES 0x00D4 0x0442 # CYRILLIC SMALL LETTER TE 0x00D5 0x0443 # CYRILLIC SMALL LETTER U 0x00D6 0x0436 # CYRILLIC SMALL LETTER ZHE 0x00D7 0x0432 # CYRILLIC SMALL LETTER VE 0x00D8 0x044C # CYRILLIC SMALL LETTER SOFT SIGN 0x00D9 0x044B # CYRILLIC SMALL LETTER YERU 0x00DA 0x0437 # CYRILLIC SMALL LETTER ZE 0x00DB 0x0448 # CYRILLIC SMALL LETTER SHA 0x00DC 0x044D # CYRILLIC SMALL LETTER E 0x00DD 0x0449 # CYRILLIC SMALL LETTER SHCHA 0x00DE 0x0447 # CYRILLIC SMALL LETTER CHE 0x00DF 0x044A # CYRILLIC SMALL LETTER HARD SIGN 0x00E0 0x042E # CYRILLIC CAPITAL LETTER YU 0x00E1 0x0410 # CYRILLIC CAPITAL LETTER A 0x00E2 0x0411 # CYRILLIC CAPITAL LETTER BE 0x00E3 0x0426 # CYRILLIC CAPITAL LETTER TSE 0x00E4 0x0414 # CYRILLIC CAPITAL LETTER DE 0x00E5 0x0415 # CYRILLIC CAPITAL LETTER IE 0x00E6 0x0424 # CYRILLIC CAPITAL LETTER EF 0x00E7 0x0413 # CYRILLIC CAPITAL LETTER GHE 0x00E8 0x0425 # CYRILLIC CAPITAL LETTER HA 0x00E9 0x0418 # CYRILLIC CAPITAL LETTER I 0x00EA 0x0419 # CYRILLIC CAPITAL LETTER SHORT I 0x00EB 0x041A # CYRILLIC CAPITAL LETTER KA 0x00EC 0x041B # CYRILLIC CAPITAL LETTER EL 0x00ED 0x041C # CYRILLIC CAPITAL LETTER EM 0x00EE 0x041D # CYRILLIC CAPITAL LETTER EN 0x00EF 0x041E # CYRILLIC CAPITAL LETTER O 0x00F0 0x041F # CYRILLIC CAPITAL LETTER PE 0x00F1 0x042F # CYRILLIC CAPITAL LETTER YA 0x00F2 0x0420 # CYRILLIC CAPITAL LETTER ER 0x00F3 0x0421 # CYRILLIC CAPITAL LETTER ES 0x00F4 0x0422 # CYRILLIC CAPITAL LETTER TE 0x00F5 0x0423 # CYRILLIC CAPITAL LETTER U 0x00F6 0x0416 # CYRILLIC CAPITAL LETTER ZHE 0x00F7 0x0412 # CYRILLIC CAPITAL LETTER VE 0x00F8 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN 0x00F9 0x042B # CYRILLIC CAPITAL LETTER YERU 0x00FA 0x0417 # CYRILLIC CAPITAL LETTER ZE 0x00FB 0x0428 # CYRILLIC CAPITAL LETTER SHA 0x00FC 0x042D # CYRILLIC CAPITAL LETTER E 0x00FD 0x0429 # CYRILLIC CAPITAL LETTER SHCHA 0x00FE 0x0427 # CYRILLIC CAPITAL LETTER CHE 0x00FF 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/koi8-r.enc0000644000000000000000000001327114011765171015210 0ustar rootroot# koi8-r STARTENCODING koi8-r SIZE 256 STARTMAPPING unicode 0x0080 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL 0x0081 0x2502 # BOX DRAWINGS LIGHT VERTICAL 0x0082 0x250C # BOX DRAWINGS LIGHT DOWN AND RIGHT 0x0083 0x2510 # BOX DRAWINGS LIGHT DOWN AND LEFT 0x0084 0x2514 # BOX DRAWINGS LIGHT UP AND RIGHT 0x0085 0x2518 # BOX DRAWINGS LIGHT UP AND LEFT 0x0086 0x251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0x0087 0x2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT 0x0088 0x252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0x0089 0x2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL 0x008A 0x253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0x008B 0x2580 # UPPER HALF BLOCK 0x008C 0x2584 # LOWER HALF BLOCK 0x008D 0x2588 # FULL BLOCK 0x008E 0x258C # LEFT HALF BLOCK 0x008F 0x2590 # RIGHT HALF BLOCK 0x0090 0x2591 # LIGHT SHADE 0x0091 0x2592 # MEDIUM SHADE 0x0092 0x2593 # DARK SHADE 0x0093 0x2320 # TOP HALF INTEGRAL 0x0094 0x25A0 # BLACK SQUARE 0x0095 0x2219 # BULLET OPERATOR 0x0096 0x221A # SQUARE ROOT 0x0097 0x2248 # ALMOST EQUAL TO 0x0098 0x2264 # LESS-THAN OR EQUAL TO 0x0099 0x2265 # GREATER-THAN OR EQUAL TO 0x009A 0x00A0 # NO-BREAK SPACE 0x009B 0x2321 # BOTTOM HALF INTEGRAL 0x009C 0x00B0 # DEGREE SIGN 0x009D 0x00B2 # SUPERSCRIPT TWO 0x009E 0x00B7 # MIDDLE DOT 0x009F 0x00F7 # DIVISION SIGN 0x00A0 0x2550 # BOX DRAWINGS DOUBLE HORIZONTAL 0x00A1 0x2551 # BOX DRAWINGS DOUBLE VERTICAL 0x00A2 0x2552 # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 0x00A3 0x0451 # CYRILLIC SMALL LETTER IO 0x00A4 0x2553 # BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE 0x00A5 0x2554 # BOX DRAWINGS DOUBLE DOWN AND RIGHT 0x00A6 0x2555 # BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE 0x00A7 0x2556 # BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE 0x00A8 0x2557 # BOX DRAWINGS DOUBLE DOWN AND LEFT 0x00A9 0x2558 # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 0x00AA 0x2559 # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 0x00AB 0x255A # BOX DRAWINGS DOUBLE UP AND RIGHT 0x00AC 0x255B # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 0x00AD 0x255C # BOX DRAWINGS UP DOUBLE AND LEFT SINGLE 0x00AE 0x255D # BOX DRAWINGS DOUBLE UP AND LEFT 0x00AF 0x255E # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 0x00B0 0x255F # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 0x00B1 0x2560 # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 0x00B2 0x2561 # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 0x00B3 0x0401 # CYRILLIC CAPITAL LETTER IO 0x00B4 0x2562 # BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE 0x00B5 0x2563 # BOX DRAWINGS DOUBLE VERTICAL AND LEFT 0x00B6 0x2564 # BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE 0x00B7 0x2565 # BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE 0x00B8 0x2566 # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 0x00B9 0x2567 # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 0x00BA 0x2568 # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 0x00BB 0x2569 # BOX DRAWINGS DOUBLE UP AND HORIZONTAL 0x00BC 0x256A # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 0x00BD 0x256B # BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE 0x00BE 0x256C # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL 0x00BF 0x00A9 # COPYRIGHT SIGN 0x00C0 0x044E # CYRILLIC SMALL LETTER YU 0x00C1 0x0430 # CYRILLIC SMALL LETTER A 0x00C2 0x0431 # CYRILLIC SMALL LETTER BE 0x00C3 0x0446 # CYRILLIC SMALL LETTER TSE 0x00C4 0x0434 # CYRILLIC SMALL LETTER DE 0x00C5 0x0435 # CYRILLIC SMALL LETTER IE 0x00C6 0x0444 # CYRILLIC SMALL LETTER EF 0x00C7 0x0433 # CYRILLIC SMALL LETTER GHE 0x00C8 0x0445 # CYRILLIC SMALL LETTER HA 0x00C9 0x0438 # CYRILLIC SMALL LETTER I 0x00CA 0x0439 # CYRILLIC SMALL LETTER SHORT I 0x00CB 0x043A # CYRILLIC SMALL LETTER KA 0x00CC 0x043B # CYRILLIC SMALL LETTER EL 0x00CD 0x043C # CYRILLIC SMALL LETTER EM 0x00CE 0x043D # CYRILLIC SMALL LETTER EN 0x00CF 0x043E # CYRILLIC SMALL LETTER O 0x00D0 0x043F # CYRILLIC SMALL LETTER PE 0x00D1 0x044F # CYRILLIC SMALL LETTER YA 0x00D2 0x0440 # CYRILLIC SMALL LETTER ER 0x00D3 0x0441 # CYRILLIC SMALL LETTER ES 0x00D4 0x0442 # CYRILLIC SMALL LETTER TE 0x00D5 0x0443 # CYRILLIC SMALL LETTER U 0x00D6 0x0436 # CYRILLIC SMALL LETTER ZHE 0x00D7 0x0432 # CYRILLIC SMALL LETTER VE 0x00D8 0x044C # CYRILLIC SMALL LETTER SOFT SIGN 0x00D9 0x044B # CYRILLIC SMALL LETTER YERU 0x00DA 0x0437 # CYRILLIC SMALL LETTER ZE 0x00DB 0x0448 # CYRILLIC SMALL LETTER SHA 0x00DC 0x044D # CYRILLIC SMALL LETTER E 0x00DD 0x0449 # CYRILLIC SMALL LETTER SHCHA 0x00DE 0x0447 # CYRILLIC SMALL LETTER CHE 0x00DF 0x044A # CYRILLIC SMALL LETTER HARD SIGN 0x00E0 0x042E # CYRILLIC CAPITAL LETTER YU 0x00E1 0x0410 # CYRILLIC CAPITAL LETTER A 0x00E2 0x0411 # CYRILLIC CAPITAL LETTER BE 0x00E3 0x0426 # CYRILLIC CAPITAL LETTER TSE 0x00E4 0x0414 # CYRILLIC CAPITAL LETTER DE 0x00E5 0x0415 # CYRILLIC CAPITAL LETTER IE 0x00E6 0x0424 # CYRILLIC CAPITAL LETTER EF 0x00E7 0x0413 # CYRILLIC CAPITAL LETTER GHE 0x00E8 0x0425 # CYRILLIC CAPITAL LETTER HA 0x00E9 0x0418 # CYRILLIC CAPITAL LETTER I 0x00EA 0x0419 # CYRILLIC CAPITAL LETTER SHORT I 0x00EB 0x041A # CYRILLIC CAPITAL LETTER KA 0x00EC 0x041B # CYRILLIC CAPITAL LETTER EL 0x00ED 0x041C # CYRILLIC CAPITAL LETTER EM 0x00EE 0x041D # CYRILLIC CAPITAL LETTER EN 0x00EF 0x041E # CYRILLIC CAPITAL LETTER O 0x00F0 0x041F # CYRILLIC CAPITAL LETTER PE 0x00F1 0x042F # CYRILLIC CAPITAL LETTER YA 0x00F2 0x0420 # CYRILLIC CAPITAL LETTER ER 0x00F3 0x0421 # CYRILLIC CAPITAL LETTER ES 0x00F4 0x0422 # CYRILLIC CAPITAL LETTER TE 0x00F5 0x0423 # CYRILLIC CAPITAL LETTER U 0x00F6 0x0416 # CYRILLIC CAPITAL LETTER ZHE 0x00F7 0x0412 # CYRILLIC CAPITAL LETTER VE 0x00F8 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN 0x00F9 0x042B # CYRILLIC CAPITAL LETTER YERU 0x00FA 0x0417 # CYRILLIC CAPITAL LETTER ZE 0x00FB 0x0428 # CYRILLIC CAPITAL LETTER SHA 0x00FC 0x042D # CYRILLIC CAPITAL LETTER E 0x00FD 0x0429 # CYRILLIC CAPITAL LETTER SHCHA 0x00FE 0x0427 # CYRILLIC CAPITAL LETTER CHE 0x00FF 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-9.enc0000644000000000000000000000062314011765270015372 0ustar rootroot# iso8859-9 STARTENCODING iso8859-9 SIZE 256 STARTMAPPING unicode 0x00D0 0x011E # LATIN CAPITAL LETTER G WITH BREVE 0x00DD 0x0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE 0x00DE 0x015E # LATIN CAPITAL LETTER S WITH CEDILLA 0x00F0 0x011F # LATIN SMALL LETTER G WITH BREVE 0x00FD 0x0131 # LATIN SMALL LETTER DOTLESS I 0x00FE 0x015F # LATIN SMALL LETTER S WITH CEDILLA ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/apl2.enc0000644000000000000000000001271414012263562014734 0ustar rootrootSTARTENCODING apl2 # Character set details are from "APL2 Programming: Language Reference", # Appendix A "The APL2 Character Set": # Figure 68 "ASCII Character Set (Workstations)", and # Figure 71 "ASCII, EBCDIC, Unicode, and Symbol Equivalents" SIZE 0x80 STARTMAPPING unicode 0x80 0x00C7 # LATIN CAPITAL LETTER C WITH CEDILLA 0x81 0x00FC # LATIN SMALL LETTER U WITH DIAERESIS 0x82 0x00E9 # LATIN SMALL LETTER E WITH ACUTE 0x83 0x00E2 # LATIN SMALL LETTER A WITH CIRCUMFLEX 0x84 0x00E4 # LATIN SMALL LETTER A WITH DIAERESIS 0x85 0x00E0 # LATIN SMALL LETTER A WITH GRAVE 0x86 0x00E5 # LATIN SMALL LETTER A WITH RING ABOVE 0x87 0x00E7 # LATIN SMALL LETTER C WITH CEDILLA 0x88 0x00EA # LATIN SMALL LETTER E WITH CIRCUMFLEX 0x89 0x00EB # LATIN SMALL LETTER E WITH DIAERESIS 0x8A 0x00E8 # LATIN SMALL LETTER E WITH GRAVE 0x8B 0x00EF # LATIN SMALL LETTER I WITH DIAERESIS 0x8C 0x00EE # LATIN SMALL LETTER I WITH CIRCUMFLEX 0x8D 0x00EC # LATIN SMALL LETTER I WITH GRAVE 0x8E 0x00C4 # LATIN CAPITAL LETTER A WITH DIAERESIS 0x8F 0x00C5 # LATIN CAPITAL LETTER A WITH RING ABOVE 0x90 0x25AF # WHITE VERTICAL RECTANGLE 0x91 0x235E # APL FUNCTIONAL SYMBOL QUOTE QUAD 0x92 0x2339 # APL FUNCTIONAL SYMBOL QUAD DIVIDE 0x93 0x00F4 # LATIN SMALL LETTER O WITH CIRCUMFLEX 0x94 0x00F6 # LATIN SMALL LETTER O WITH DIAERESIS 0x95 0x00F2 # LATIN SMALL LETTER O WITH GRAVE 0x96 0x00FB # LATIN SMALL LETTER U WITH CIRCUMFLEX 0x97 0x00F9 # LATIN SMALL LETTER U WITH GRAVE 0x98 0x22A4 # DOWN TACK 0x99 0x00D6 # LATIN CAPITAL LETTER O WITH DIAERESIS 0x9A 0x00DC # LATIN CAPITAL LETTER U WITH DIAERESIS 0x9B 0x00F8 # LATIN SMALL LETTER O WITH STROKE 0x9C 0x00A3 # POUND SIGN 0x9D 0x22A5 # UP TACK 0x9E 0x2376 # APL FUNCTIONAL SYMBOL ALPHA UNDERBAR 0x9F 0x2336 # APL FUNCTIONAL SYMBOL I-BEAM 0xA0 0x00E1 # LATIN SMALL LETTER A WITH ACUTE 0xA1 0x00ED # LATIN SMALL LETTER I WITH ACUTE 0xA2 0x00F3 # LATIN SMALL LETTER O WITH ACUTE 0xA3 0x00FA # LATIN SMALL LETTER U WITH ACUTE 0xA4 0x00F1 # LATIN SMALL LETTER N WITH TILDE 0xA5 0x00D1 # LATIN CAPITAL LETTER N WITH TILDE 0xA6 0x00AA # FEMININE ORDINAL INDICATOR 0xA7 0x00BA # MASCULINE ORDINAL INDICATOR 0xA8 0x00BF # INVERTED QUESTION MARK 0xA9 0x2308 # LEFT CEILING 0xAA 0x00AC # NOT SIGN 0xAB 0x00BD # VULGAR FRACTION ONE HALF 0xAC 0x222A # UNION 0xAD 0x00A1 # INVERTED EXCLAMATION MARK 0xAE 0x2355 # APL FUNCTIONAL SYMBOL UP TACK JOT 0xAF 0x234E # APL FUNCTIONAL SYMBOL DOWN TACK JOT 0xB0 0x2591 # LIGHT SHADE 0xB1 0x2592 # MEDIUM SHADE 0xB2 0x2593 # DARK SHADE 0xB3 0x2502 # BOX DRAWINGS LIGHT VERTICAL 0xB4 0x2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT 0xB5 0x235F # APL FUNCTIONAL SYMBOL CIRCLE STAR 0xB6 0x2206 # INCREMENT 0xB7 0x2207 # NABLA 0xB8 0x2192 # RIGHTWARDS ARROW 0xB9 0x2563 # BOX DRAWINGS DOUBLE VERTICAL AND LEFT 0xBA 0x2551 # BOX DRAWINGS DOUBLE VERTICAL 0xBB 0x2557 # BOX DRAWINGS DOUBLE DOWN AND LEFT 0xBC 0x255D # BOX DRAWINGS DOUBLE UP AND LEFT 0xBD 0x2190 # LEFTWARDS ARROW 0xBE 0x230A # LEFT FLOOR 0xBF 0x2510 # BOX DRAWINGS LIGHT DOWN AND LEFT 0xC0 0x2514 # BOX DRAWINGS LIGHT UP AND RIGHT 0xC1 0x2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL 0xC2 0x252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0xC3 0x251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0xC4 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL 0xC5 0x253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0xC6 0x2191 # UPWARDS ARROW 0xC7 0x2193 # DOWNWARDS ARROW 0xC8 0x255A # BOX DRAWINGS DOUBLE UP AND RIGHT 0xC9 0x2554 # BOX DRAWINGS DOUBLE DOWN AND RIGHT 0xCA 0x2569 # BOX DRAWINGS DOUBLE UP AND HORIZONTAL 0xCB 0x2566 # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 0xCC 0x2560 # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 0xCD 0x2550 # BOX DRAWINGS DOUBLE HORIZONTAL 0xCE 0x256C # BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL 0xCF 0x2261 # IDENTICAL TO 0xD0 0x2378 # APL FUNCTIONAL SYMBOL IOTA UNDERBAR 0xD1 0x2377 # APL FUNCTIONAL SYMBOL EPSILON UNDERBAR 0xD2 0x2235 # BECAUSE 0xD3 0x2337 # APL FUNCTIONAL SYMBOL SQUISH QUAD 0xD4 0x2342 # APL FUNCTIONAL SYMBOL QUAD BACKSLASH 0xD5 0x233B # APL FUNCTIONAL SYMBOL QUAD JOT 0xD6 0x22A2 # RIGHT TACK 0xD7 0x22A3 # LEFT TACK 0xD8 0x25CA # LOZENGE 0xD9 0x2518 # BOX DRAWINGS LIGHT UP AND LEFT 0xDA 0x250C # BOX DRAWINGS LIGHT DOWN AND RIGHT 0xDB 0x2588 # FULL BLOCK 0xDC 0x2584 # LOWER HALF BLOCK 0xDD 0x00A6 # BROKEN BAR 0xDE 0x00CC # LATIN CAPITAL LETTER I WITH GRAVE 0xDF 0x2580 # UPPER HALF BLOCK 0xE0 0x237A # APL FUNCTIONAL SYMBOL ALPHA 0xE1 0x2379 # APL FUNCTIONAL SYMBOL OMEGA UNDERBAR 0xE2 0x2282 # SUBSET OF 0xE3 0x2283 # SUPERSET OF 0xE4 0x235D # APL FUNCTIONAL SYMBOL UP SHOE JOT 0xE5 0x2372 # APL FUNCTIONAL SYMBOL UP CARET TILDE 0xE6 0x2374 # APL FUNCTIONAL SYMBOL RHO 0xE7 0x2371 # APL FUNCTIONAL SYMBOL DOWN CARET TILDE 0xE8 0x233D # APL FUNCTIONAL SYMBOL CIRCLE STILE 0xE9 0x2296 # CIRCLED MINUS 0xEA 0x25CB # WHITE CIRCLE 0xEB 0x2228 # LOGICAL OR 0xEC 0x2373 # APL FUNCTIONAL SYMBOL IOTA 0xED 0x2349 # APL FUNCTIONAL SYMBOL CIRCLE BACKSLASH 0xEE 0x220A # SMALL ELEMENT OF 0xEF 0x2229 # INTERSECTION 0xF0 0x233F # APL FUNCTIONAL SYMBOL SLASH BAR 0xF1 0x2340 # APL FUNCTIONAL SYMBOL BACKSLASH BAR 0xF2 0x2265 # GREATER-THAN OR EQUAL TO 0xF3 0x2264 # LESS-THAN OR EQUAL TO 0xF4 0x2260 # NOT EQUAL TO 0xF5 0x00D7 # MULTIPLICATION SIGN 0xF6 0x00F7 # DIVISION SIGN 0xF7 0x2359 # APL FUNCTIONAL SYMBOL DELTA UNDERBAR 0xF8 0x2218 # RING OPERATOR 0xF9 0x2375 # APL FUNCTIONAL SYMBOL OMEGA 0xFA 0x236B # APL FUNCTIONAL SYMBOL DEL TILDE 0xFB 0x234B # APL FUNCTIONAL SYMBOL DELTA STILE 0xFC 0x2352 # APL FUNCTIONAL SYMBOL DEL STILE 0xFD 0x00AF # MACRON 0xFE 0x00A8 # DIAERESIS 0xFF 0x00A0 # NO-BREAK SPACE ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-1.enc0000644000000000000000000000015012100503162015340 0ustar rootroot# iso8859-1 STARTENCODING iso8859-1 SIZE 256 STARTMAPPING unicode ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/koi8-ru.enc0000644000000000000000000001325014011764235015372 0ustar rootroot# koi8-ru STARTENCODING koi8-ru SIZE 256 STARTMAPPING unicode 0x0080 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL 0x0081 0x2502 # BOX DRAWINGS LIGHT VERTICAL 0x0082 0x250C # BOX DRAWINGS LIGHT DOWN AND RIGHT 0x0083 0x2510 # BOX DRAWINGS LIGHT DOWN AND LEFT 0x0084 0x2514 # BOX DRAWINGS LIGHT UP AND RIGHT 0x0085 0x2518 # BOX DRAWINGS LIGHT UP AND LEFT 0x0086 0x251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0x0087 0x2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT 0x0088 0x252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0x0089 0x2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL 0x008A 0x253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0x008B 0x2580 # UPPER HALF BLOCK 0x008C 0x2584 # LOWER HALF BLOCK 0x008D 0x2588 # FULL BLOCK 0x008E 0x258C # LEFT HALF BLOCK 0x008F 0x2590 # RIGHT HALF BLOCK 0x0090 0x2591 # LIGHT SHADE 0x0091 0x2592 # MEDIUM SHADE 0x0092 0x2593 # DARK SHADE 0x0093 0x201C # LEFT DOUBLE QUOTATION MARK 0x0094 0x25A0 # BLACK SQUARE 0x0095 0x2219 # BULLET OPERATOR 0x0096 0x201D # RIGHT DOUBLE QUOTATION MARK 0x0097 0x2014 # EM DASH 0x0098 0x2116 # NUMERO SIGN 0x0099 0x2122 # TRADE MARK SIGN 0x009A 0x00A0 # NO-BREAK SPACE 0x009B 0x00BB # RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK 0x009C 0x00AE # REGISTERED SIGN 0x009D 0x00AB # LEFT-POINTING DOUBLE ANGLE QUOTATION MARK 0x009E 0x00B7 # MIDDLE DOT 0x009F 0x00A4 # CURRENCY SIGN 0x00A0 0x2550 # BOX DRAWINGS DOUBLE HORIZONTAL 0x00A1 0x2551 # BOX DRAWINGS DOUBLE VERTICAL 0x00A2 0x2552 # BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE 0x00A3 0x0451 # CYRILLIC SMALL LETTER IO 0x00A4 0x0454 # CYRILLIC SMALL LETTER UKRAINIAN IE 0x00A5 0x2554 # BOX DRAWINGS DOUBLE DOWN AND RIGHT 0x00A6 0x0456 # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 0x00A7 0x0457 # CYRILLIC SMALL LETTER YI 0x00A8 0x2557 # BOX DRAWINGS DOUBLE DOWN AND LEFT 0x00A9 0x2558 # BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE 0x00AA 0x2559 # BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE 0x00AB 0x255A # BOX DRAWINGS DOUBLE UP AND RIGHT 0x00AC 0x255B # BOX DRAWINGS UP SINGLE AND LEFT DOUBLE 0x00AD 0x0491 # CYRILLIC SMALL LETTER GHE WITH UPTURN 0x00AE 0x045E # CYRILLIC SMALL LETTER SHORT U 0x00AF 0x255E # BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE 0x00B0 0x255F # BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE 0x00B1 0x2560 # BOX DRAWINGS DOUBLE VERTICAL AND RIGHT 0x00B2 0x2561 # BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE 0x00B3 0x0401 # CYRILLIC CAPITAL LETTER IO 0x00B4 0x0404 # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0x00B5 0x2563 # BOX DRAWINGS DOUBLE VERTICAL AND LEFT 0x00B6 0x0406 # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0x00B7 0x0407 # CYRILLIC CAPITAL LETTER YI 0x00B8 0x2566 # BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL 0x00B9 0x2567 # BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE 0x00BA 0x2568 # BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE 0x00BB 0x2569 # BOX DRAWINGS DOUBLE UP AND HORIZONTAL 0x00BC 0x256A # BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE 0x00BD 0x0490 # CYRILLIC CAPITAL LETTER GHE WITH UPTURN 0x00BE 0x040E # CYRILLIC CAPITAL LETTER SHORT U 0x00BF 0x00A9 # COPYRIGHT SIGN 0x00C0 0x044E # CYRILLIC SMALL LETTER YU 0x00C1 0x0430 # CYRILLIC SMALL LETTER A 0x00C2 0x0431 # CYRILLIC SMALL LETTER BE 0x00C3 0x0446 # CYRILLIC SMALL LETTER TSE 0x00C4 0x0434 # CYRILLIC SMALL LETTER DE 0x00C5 0x0435 # CYRILLIC SMALL LETTER IE 0x00C6 0x0444 # CYRILLIC SMALL LETTER EF 0x00C7 0x0433 # CYRILLIC SMALL LETTER GHE 0x00C8 0x0445 # CYRILLIC SMALL LETTER HA 0x00C9 0x0438 # CYRILLIC SMALL LETTER I 0x00CA 0x0439 # CYRILLIC SMALL LETTER SHORT I 0x00CB 0x043A # CYRILLIC SMALL LETTER KA 0x00CC 0x043B # CYRILLIC SMALL LETTER EL 0x00CD 0x043C # CYRILLIC SMALL LETTER EM 0x00CE 0x043D # CYRILLIC SMALL LETTER EN 0x00CF 0x043E # CYRILLIC SMALL LETTER O 0x00D0 0x043F # CYRILLIC SMALL LETTER PE 0x00D1 0x044F # CYRILLIC SMALL LETTER YA 0x00D2 0x0440 # CYRILLIC SMALL LETTER ER 0x00D3 0x0441 # CYRILLIC SMALL LETTER ES 0x00D4 0x0442 # CYRILLIC SMALL LETTER TE 0x00D5 0x0443 # CYRILLIC SMALL LETTER U 0x00D6 0x0436 # CYRILLIC SMALL LETTER ZHE 0x00D7 0x0432 # CYRILLIC SMALL LETTER VE 0x00D8 0x044C # CYRILLIC SMALL LETTER SOFT SIGN 0x00D9 0x044B # CYRILLIC SMALL LETTER YERU 0x00DA 0x0437 # CYRILLIC SMALL LETTER ZE 0x00DB 0x0448 # CYRILLIC SMALL LETTER SHA 0x00DC 0x044D # CYRILLIC SMALL LETTER E 0x00DD 0x0449 # CYRILLIC SMALL LETTER SHCHA 0x00DE 0x0447 # CYRILLIC SMALL LETTER CHE 0x00DF 0x044A # CYRILLIC SMALL LETTER HARD SIGN 0x00E0 0x042E # CYRILLIC CAPITAL LETTER YU 0x00E1 0x0410 # CYRILLIC CAPITAL LETTER A 0x00E2 0x0411 # CYRILLIC CAPITAL LETTER BE 0x00E3 0x0426 # CYRILLIC CAPITAL LETTER TSE 0x00E4 0x0414 # CYRILLIC CAPITAL LETTER DE 0x00E5 0x0415 # CYRILLIC CAPITAL LETTER IE 0x00E6 0x0424 # CYRILLIC CAPITAL LETTER EF 0x00E7 0x0413 # CYRILLIC CAPITAL LETTER GHE 0x00E8 0x0425 # CYRILLIC CAPITAL LETTER HA 0x00E9 0x0418 # CYRILLIC CAPITAL LETTER I 0x00EA 0x0419 # CYRILLIC CAPITAL LETTER SHORT I 0x00EB 0x041A # CYRILLIC CAPITAL LETTER KA 0x00EC 0x041B # CYRILLIC CAPITAL LETTER EL 0x00ED 0x041C # CYRILLIC CAPITAL LETTER EM 0x00EE 0x041D # CYRILLIC CAPITAL LETTER EN 0x00EF 0x041E # CYRILLIC CAPITAL LETTER O 0x00F0 0x041F # CYRILLIC CAPITAL LETTER PE 0x00F1 0x042F # CYRILLIC CAPITAL LETTER YA 0x00F2 0x0420 # CYRILLIC CAPITAL LETTER ER 0x00F3 0x0421 # CYRILLIC CAPITAL LETTER ES 0x00F4 0x0422 # CYRILLIC CAPITAL LETTER TE 0x00F5 0x0423 # CYRILLIC CAPITAL LETTER U 0x00F6 0x0416 # CYRILLIC CAPITAL LETTER ZHE 0x00F7 0x0412 # CYRILLIC CAPITAL LETTER VE 0x00F8 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN 0x00F9 0x042B # CYRILLIC CAPITAL LETTER YERU 0x00FA 0x0417 # CYRILLIC CAPITAL LETTER ZE 0x00FB 0x0428 # CYRILLIC CAPITAL LETTER SHA 0x00FC 0x042D # CYRILLIC CAPITAL LETTER E 0x00FD 0x0429 # CYRILLIC CAPITAL LETTER SHCHA 0x00FE 0x0427 # CYRILLIC CAPITAL LETTER CHE 0x00FF 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-3.enc0000644000000000000000000000274314011767502015371 0ustar rootroot# iso8859-3 STARTENCODING iso8859-3 SIZE 256 STARTMAPPING unicode 0x00A1 0x0126 # LATIN CAPITAL LETTER H WITH STROKE 0x00A2 0x02D8 # BREVE 0x00A6 0x0124 # LATIN CAPITAL LETTER H WITH CIRCUMFLEX 0x00A9 0x0130 # LATIN CAPITAL LETTER I WITH DOT ABOVE 0x00AA 0x015E # LATIN CAPITAL LETTER S WITH CEDILLA 0x00AB 0x011E # LATIN CAPITAL LETTER G WITH BREVE 0x00AC 0x0134 # LATIN CAPITAL LETTER J WITH CIRCUMFLEX 0x00AF 0x017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE 0x00B1 0x0127 # LATIN SMALL LETTER H WITH STROKE 0x00B6 0x0125 # LATIN SMALL LETTER H WITH CIRCUMFLEX 0x00B9 0x0131 # LATIN SMALL LETTER DOTLESS I 0x00BA 0x015F # LATIN SMALL LETTER S WITH CEDILLA 0x00BB 0x011F # LATIN SMALL LETTER G WITH BREVE 0x00BC 0x0135 # LATIN SMALL LETTER J WITH CIRCUMFLEX 0x00BF 0x017C # LATIN SMALL LETTER Z WITH DOT ABOVE 0x00C5 0x010A # LATIN CAPITAL LETTER C WITH DOT ABOVE 0x00C6 0x0108 # LATIN CAPITAL LETTER C WITH CIRCUMFLEX 0x00D5 0x0120 # LATIN CAPITAL LETTER G WITH DOT ABOVE 0x00D8 0x011C # LATIN CAPITAL LETTER G WITH CIRCUMFLEX 0x00DD 0x016C # LATIN CAPITAL LETTER U WITH BREVE 0x00DE 0x015C # LATIN CAPITAL LETTER S WITH CIRCUMFLEX 0x00E5 0x010B # LATIN SMALL LETTER C WITH DOT ABOVE 0x00E6 0x0109 # LATIN SMALL LETTER C WITH CIRCUMFLEX 0x00F5 0x0121 # LATIN SMALL LETTER G WITH DOT ABOVE 0x00F8 0x011D # LATIN SMALL LETTER G WITH CIRCUMFLEX 0x00FD 0x016D # LATIN SMALL LETTER U WITH BREVE 0x00FE 0x015D # LATIN SMALL LETTER S WITH CIRCUMFLEX 0x00FF 0x02D9 # DOT ABOVE ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-5.enc0000644000000000000000000001010714011767412015364 0ustar rootroot# iso8859-5 STARTENCODING iso8859-5 SIZE 256 STARTMAPPING unicode 0x00A1 0x0401 # CYRILLIC CAPITAL LETTER IO 0x00A2 0x0402 # CYRILLIC CAPITAL LETTER DJE 0x00A3 0x0403 # CYRILLIC CAPITAL LETTER GJE 0x00A4 0x0404 # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0x00A5 0x0405 # CYRILLIC CAPITAL LETTER DZE 0x00A6 0x0406 # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0x00A7 0x0407 # CYRILLIC CAPITAL LETTER YI 0x00A8 0x0408 # CYRILLIC CAPITAL LETTER JE 0x00A9 0x0409 # CYRILLIC CAPITAL LETTER LJE 0x00AA 0x040A # CYRILLIC CAPITAL LETTER NJE 0x00AB 0x040B # CYRILLIC CAPITAL LETTER TSHE 0x00AC 0x040C # CYRILLIC CAPITAL LETTER KJE 0x00AE 0x040E # CYRILLIC CAPITAL LETTER SHORT U 0x00AF 0x040F # CYRILLIC CAPITAL LETTER DZHE 0x00B0 0x0410 # CYRILLIC CAPITAL LETTER A 0x00B1 0x0411 # CYRILLIC CAPITAL LETTER BE 0x00B2 0x0412 # CYRILLIC CAPITAL LETTER VE 0x00B3 0x0413 # CYRILLIC CAPITAL LETTER GHE 0x00B4 0x0414 # CYRILLIC CAPITAL LETTER DE 0x00B5 0x0415 # CYRILLIC CAPITAL LETTER IE 0x00B6 0x0416 # CYRILLIC CAPITAL LETTER ZHE 0x00B7 0x0417 # CYRILLIC CAPITAL LETTER ZE 0x00B8 0x0418 # CYRILLIC CAPITAL LETTER I 0x00B9 0x0419 # CYRILLIC CAPITAL LETTER SHORT I 0x00BA 0x041A # CYRILLIC CAPITAL LETTER KA 0x00BB 0x041B # CYRILLIC CAPITAL LETTER EL 0x00BC 0x041C # CYRILLIC CAPITAL LETTER EM 0x00BD 0x041D # CYRILLIC CAPITAL LETTER EN 0x00BE 0x041E # CYRILLIC CAPITAL LETTER O 0x00BF 0x041F # CYRILLIC CAPITAL LETTER PE 0x00C0 0x0420 # CYRILLIC CAPITAL LETTER ER 0x00C1 0x0421 # CYRILLIC CAPITAL LETTER ES 0x00C2 0x0422 # CYRILLIC CAPITAL LETTER TE 0x00C3 0x0423 # CYRILLIC CAPITAL LETTER U 0x00C4 0x0424 # CYRILLIC CAPITAL LETTER EF 0x00C5 0x0425 # CYRILLIC CAPITAL LETTER HA 0x00C6 0x0426 # CYRILLIC CAPITAL LETTER TSE 0x00C7 0x0427 # CYRILLIC CAPITAL LETTER CHE 0x00C8 0x0428 # CYRILLIC CAPITAL LETTER SHA 0x00C9 0x0429 # CYRILLIC CAPITAL LETTER SHCHA 0x00CA 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN 0x00CB 0x042B # CYRILLIC CAPITAL LETTER YERU 0x00CC 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN 0x00CD 0x042D # CYRILLIC CAPITAL LETTER E 0x00CE 0x042E # CYRILLIC CAPITAL LETTER YU 0x00CF 0x042F # CYRILLIC CAPITAL LETTER YA 0x00D0 0x0430 # CYRILLIC SMALL LETTER A 0x00D1 0x0431 # CYRILLIC SMALL LETTER BE 0x00D2 0x0432 # CYRILLIC SMALL LETTER VE 0x00D3 0x0433 # CYRILLIC SMALL LETTER GHE 0x00D4 0x0434 # CYRILLIC SMALL LETTER DE 0x00D5 0x0435 # CYRILLIC SMALL LETTER IE 0x00D6 0x0436 # CYRILLIC SMALL LETTER ZHE 0x00D7 0x0437 # CYRILLIC SMALL LETTER ZE 0x00D8 0x0438 # CYRILLIC SMALL LETTER I 0x00D9 0x0439 # CYRILLIC SMALL LETTER SHORT I 0x00DA 0x043A # CYRILLIC SMALL LETTER KA 0x00DB 0x043B # CYRILLIC SMALL LETTER EL 0x00DC 0x043C # CYRILLIC SMALL LETTER EM 0x00DD 0x043D # CYRILLIC SMALL LETTER EN 0x00DE 0x043E # CYRILLIC SMALL LETTER O 0x00DF 0x043F # CYRILLIC SMALL LETTER PE 0x00E0 0x0440 # CYRILLIC SMALL LETTER ER 0x00E1 0x0441 # CYRILLIC SMALL LETTER ES 0x00E2 0x0442 # CYRILLIC SMALL LETTER TE 0x00E3 0x0443 # CYRILLIC SMALL LETTER U 0x00E4 0x0444 # CYRILLIC SMALL LETTER EF 0x00E5 0x0445 # CYRILLIC SMALL LETTER HA 0x00E6 0x0446 # CYRILLIC SMALL LETTER TSE 0x00E7 0x0447 # CYRILLIC SMALL LETTER CHE 0x00E8 0x0448 # CYRILLIC SMALL LETTER SHA 0x00E9 0x0449 # CYRILLIC SMALL LETTER SHCHA 0x00EA 0x044A # CYRILLIC SMALL LETTER HARD SIGN 0x00EB 0x044B # CYRILLIC SMALL LETTER YERU 0x00EC 0x044C # CYRILLIC SMALL LETTER SOFT SIGN 0x00ED 0x044D # CYRILLIC SMALL LETTER E 0x00EE 0x044E # CYRILLIC SMALL LETTER YU 0x00EF 0x044F # CYRILLIC SMALL LETTER YA 0x00F0 0x2116 # NUMERO SIGN 0x00F1 0x0451 # CYRILLIC SMALL LETTER IO 0x00F2 0x0452 # CYRILLIC SMALL LETTER DJE 0x00F3 0x0453 # CYRILLIC SMALL LETTER GJE 0x00F4 0x0454 # CYRILLIC SMALL LETTER UKRAINIAN IE 0x00F5 0x0455 # CYRILLIC SMALL LETTER DZE 0x00F6 0x0456 # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 0x00F7 0x0457 # CYRILLIC SMALL LETTER YI 0x00F8 0x0458 # CYRILLIC SMALL LETTER JE 0x00F9 0x0459 # CYRILLIC SMALL LETTER LJE 0x00FA 0x045A # CYRILLIC SMALL LETTER NJE 0x00FB 0x045B # CYRILLIC SMALL LETTER TSHE 0x00FC 0x045C # CYRILLIC SMALL LETTER KJE 0x00FD 0x00A7 # SECTION SIGN 0x00FE 0x045E # CYRILLIC SMALL LETTER SHORT U 0x00FF 0x045F # CYRILLIC SMALL LETTER DZHE ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-4.enc0000644000000000000000000000470414011767457015402 0ustar rootroot# iso8859-4 STARTENCODING iso8859-4 SIZE 256 STARTMAPPING unicode 0x00A1 0x0104 # LATIN CAPITAL LETTER A WITH OGONEK 0x00A2 0x0138 # LATIN SMALL LETTER KRA 0x00A3 0x0156 # LATIN CAPITAL LETTER R WITH CEDILLA 0x00A5 0x0128 # LATIN CAPITAL LETTER I WITH TILDE 0x00A6 0x013B # LATIN CAPITAL LETTER L WITH CEDILLA 0x00A9 0x0160 # LATIN CAPITAL LETTER S WITH CARON 0x00AA 0x0112 # LATIN CAPITAL LETTER E WITH MACRON 0x00AB 0x0122 # LATIN CAPITAL LETTER G WITH CEDILLA 0x00AC 0x0166 # LATIN CAPITAL LETTER T WITH STROKE 0x00AE 0x017D # LATIN CAPITAL LETTER Z WITH CARON 0x00B1 0x0105 # LATIN SMALL LETTER A WITH OGONEK 0x00B2 0x02DB # OGONEK 0x00B3 0x0157 # LATIN SMALL LETTER R WITH CEDILLA 0x00B5 0x0129 # LATIN SMALL LETTER I WITH TILDE 0x00B6 0x013C # LATIN SMALL LETTER L WITH CEDILLA 0x00B7 0x02C7 # CARON 0x00B9 0x0161 # LATIN SMALL LETTER S WITH CARON 0x00BA 0x0113 # LATIN SMALL LETTER E WITH MACRON 0x00BB 0x0123 # LATIN SMALL LETTER G WITH CEDILLA 0x00BC 0x0167 # LATIN SMALL LETTER T WITH STROKE 0x00BD 0x014A # LATIN CAPITAL LETTER ENG 0x00BE 0x017E # LATIN SMALL LETTER Z WITH CARON 0x00BF 0x014B # LATIN SMALL LETTER ENG 0x00C0 0x0100 # LATIN CAPITAL LETTER A WITH MACRON 0x00C7 0x012E # LATIN CAPITAL LETTER I WITH OGONEK 0x00C8 0x010C # LATIN CAPITAL LETTER C WITH CARON 0x00CA 0x0118 # LATIN CAPITAL LETTER E WITH OGONEK 0x00CC 0x0116 # LATIN CAPITAL LETTER E WITH DOT ABOVE 0x00CF 0x012A # LATIN CAPITAL LETTER I WITH MACRON 0x00D0 0x0110 # LATIN CAPITAL LETTER D WITH STROKE 0x00D1 0x0145 # LATIN CAPITAL LETTER N WITH CEDILLA 0x00D2 0x014C # LATIN CAPITAL LETTER O WITH MACRON 0x00D3 0x0136 # LATIN CAPITAL LETTER K WITH CEDILLA 0x00D9 0x0172 # LATIN CAPITAL LETTER U WITH OGONEK 0x00DD 0x0168 # LATIN CAPITAL LETTER U WITH TILDE 0x00DE 0x016A # LATIN CAPITAL LETTER U WITH MACRON 0x00E0 0x0101 # LATIN SMALL LETTER A WITH MACRON 0x00E7 0x012F # LATIN SMALL LETTER I WITH OGONEK 0x00E8 0x010D # LATIN SMALL LETTER C WITH CARON 0x00EA 0x0119 # LATIN SMALL LETTER E WITH OGONEK 0x00EC 0x0117 # LATIN SMALL LETTER E WITH DOT ABOVE 0x00EF 0x012B # LATIN SMALL LETTER I WITH MACRON 0x00F0 0x0111 # LATIN SMALL LETTER D WITH STROKE 0x00F1 0x0146 # LATIN SMALL LETTER N WITH CEDILLA 0x00F2 0x014D # LATIN SMALL LETTER O WITH MACRON 0x00F3 0x0137 # LATIN SMALL LETTER K WITH CEDILLA 0x00F9 0x0173 # LATIN SMALL LETTER U WITH OGONEK 0x00FD 0x0169 # LATIN SMALL LETTER U WITH TILDE 0x00FE 0x016B # LATIN SMALL LETTER U WITH MACRON 0x00FF 0x02D9 # DOT ABOVE ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/annotate-enc0000755000000000000000000001547314013442137015714 0ustar rootroot#!/usr/bin/env perl # $XTermId: annotate-enc,v 1.12 2021/02/18 10:41:35 tom Exp $ # ----------------------------------------------------------------------------- # Copyright 2021 by Thomas E. Dickey # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permission notice appear in # supporting documentation, and that the name of the above listed # copyright holder(s) not be used in advertising or publicity pertaining # to distribution of the software without specific, written prior # permission. # # THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # ----------------------------------------------------------------------------- # Annotate ".enc" files using the descriptions from the Unicode data file. # Also, check that the mapping is unique. use strict; use warnings; use Getopt::Std; $| = 1; our ( $opt_d, $opt_l, $opt_v ); our $UnicodeData = "UnicodeData.txt"; our %annotations; sub read_file($) { my $path = shift; open( FP, $path ) || die "cannot open $path"; my (@input) = ; close(FP); chomp @input; return @input; } sub codepoint($) { my $code = shift; $code =~ s/^0x//i; $code = uc $code; $code = "0" . $code while ( length($code) < 6 ); $code = "0x" . $code; return $code; } sub parse_unicode() { my @data = &read_file($UnicodeData); for my $n ( 0 .. $#data ) { next unless ( $data[$n] =~ /^[[:xdigit:]]+;.*;/ ); my $code = $data[$n]; $code =~ s/;.*//; $code = &codepoint($code); my $text = $data[$n]; $text =~ s/^[^;]*;//; $text =~ s/;.*//; $text = lc $text if ($opt_l); $annotations{$code} = $text; printf "'%s' ->%s\n", $code, $text if ($opt_d); } } sub private_use($) { my $value = shift; my $result = 0; my $lo = hex '0xE000'; my $hi = hex '0xF8FF'; $value = hex $value; $result = 1 if ( $value >= $lo and $value <= $hi ); return $result; } sub expected($$$$) { my $path = shift; my $line = shift; my $text = shift; my $want = shift; printf STDERR "expected %s\n", $want; printf STDERR "%s:%d:%s\n", $path, 1 + $line, $text; } sub parse_encoding($) { my $path = shift; my @data = &read_file($path); my $state = 0; my $ignore = 0; my %mapped; for my $n ( 0 .. $#data ) { my $data = $data[$n]; $data =~ s/^\s+//; $data =~ s/\s+$//; if ( $data =~ /^#/ ) { printf "[%d:%d]", $state, $n + 1 if ($opt_v); printf "%s\n", $data; next; } if ( $state == 0 ) { if ( $data =~ /^STARTENCODING\s+.*$/ ) { $state++; } else { &expected( $path, $n, $data, "STARTENCODING" ); } } elsif ( $state == 1 ) { if ( $data =~ /^SIZE\s+(0x)?[[:xdigit:]]+$/ ) { # ignore } elsif ( $data =~ /^ALIAS\s+[[:alnum:].-]+$/ ) { # ignore } elsif ( $data =~ /^STARTMAPPING\s+unicode$/ ) { $state++; $ignore = 0; } elsif ( $data =~ /^STARTMAPPING\s+[[:alnum:].-]+$/ ) { $state++; $ignore = 1; } else { &expected( $path, $n, $data, "STARTMAPPING" ); } } elsif ( $state == 2 ) { if ( $data =~ /^ENDMAPPING\b/ ) { $state++; } elsif ($ignore) { } elsif ( $data =~ /^UNDEFINE(\s+0x[[:xdigit:]]){1,2}/ ) { # ignore } elsif ( $data =~ /^0x[[:xdigit:]]+\s+0x[[:xdigit:]]+.*/ ) { my $source = $data; $source =~ s/\s.*//; $source = hex $source; my $target = $data; $target =~ s/^[^\s]+\s+//; $target =~ s/[\s#].*//; $target = &codepoint($target); if ( $target !~ /^0x[[:xdigit:]]+$/ ) { &expected( $path, $n, $data, "hex target, not $target" ); next; } my $expect = ""; if ( &private_use($target) ) { # ignore } elsif ( $annotations{$target} ) { $expect = $annotations{$target}; } else { &expected( $path, $n, $data, "Unicode for \"$target\"" ); next; } my $actual = ""; if ( $data =~ /#/ ) { $actual = $data; $actual =~ s/^[^#]*#\s*//; $actual = "" if ( $actual eq "XXX" ); } if ( $actual ne "" and index( $actual, $expect ) != 0 ) { &expected( $path, $n, $data, "Description: $expect" ); next; } $target = hex $target; next if ( $target == 0 ); if ( $mapped{$target} ) { &expected( $path, $n, $data, "distinct mapping of $target" ); } $mapped{$target} = $source; $data =~ s/\s*#.*//; $data .= "\t# $expect" if ( $expect ne "" ); } elsif ( $data =~ /^0x[[:xdigit:]]+(\s+0\b)?\s*(#.*)?$/ ) { #ignore } else { &expected( $path, $n, $data, "mapping" ); } } elsif ( $state == 4 ) { if ( $data =~ /^ENDENCODING\b/ ) { $state++; } } printf "[%d:%d]", $state, $n + 1 if ($opt_v); printf "%s\n", $data; } } sub main::HELP_MESSAGE() { printf STDERR <= 0 ) { &parse_encoding( shift @ARGV ); } 1; luit-20240910/encodings/dec-technical.enc0000644000000000000000000001101312101336763016551 0ustar rootrootSTARTENCODING dec-technical # derived from http://www.vt100.net/charsets/technical.html SIZE 0x80 STARTMAPPING unicode 0x21 0x23b7 # RADICAL SYMBOL BOTTOM Centred left to right, so that it joins up with 02/02 0x22 0x250c # BOX DRAWINGS LIGHT DOWN AND RIGHT 0x23 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL 0x24 0x2320 # TOP HALF INTEGRAL with the proviso that the stem is vertical, to join with 02/06 0x25 0x2321 # BOTTOM HALF INTEGRAL with the proviso above. 0x26 0x2502 # BOX DRAWINGS LIGHT VERTICAL 0x27 0x23a1 # LEFT SQUARE BRACKET UPPER CORNER Joins vertically to 02/06, 02/08. Doesn't join to its right. 0x28 0x23a3 # LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. 0x29 0x23a4 # RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. 0x2a 0x23a6 # RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. 0x2b 0x239b # LEFT PARENTHESIS UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. 0x2c 0x239d # LEFT PARENTHESIS LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. 0x2d 0x239e # RIGHT PARENTHESIS UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. 0x2e 0x23a0 # RIGHT PARENTHESIS LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. 0x2f 0x23a8 # LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. 0x30 0x23ac # RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. 0x31 0x2426 # Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. 0x32 0x2426 # Bottom Left Sigma. Joins to right with 02/03, 03/06. Joins diagonally above right with 03/04, 03/07. 0x33 0x2426 # Top Diagonal Sigma. Line for joining 03/01 to 03/04 or 03/07. 0x34 0x2426 # Bottom Diagonal Sigma. Line for joining 03/02 to 03/03 or 03/07. 0x35 0x2426 # Top Right Sigma. Joins to left with 02/03, 03/01. 0x36 0x2426 # Bottom Right Sigma. Joins to left with 02/03, 03/02. 0x37 0x2426 # Middle Sigma. Joins diagonally with 03/01, 03/02, 03/03, 03/04. 0x38 0x2426 # undefined 0x39 0x2426 # undefined 0x3a 0x2426 # undefined 0x3b 0x2426 # undefined 0x3c 0x2264 # LESS-THAN OR EQUAL TO 0x3d 0x2260 # NOT EQUAL TO 0x3e 0x2265 # GREATER-THAN OR EQUAL TO 0x3f 0x222B # INTEGRAL 0x40 0x2234 # THEREFORE 0x41 0x221d # PROPORTIONAL TO 0x42 0x221e # INFINITY 0x43 0x00f7 # DIVISION SIGN 0x44 0x039a # GREEK CAPITAL DELTA 0x45 0x2207 # NABLA 0x46 0x03a6 # GREEK CAPITAL LETTER PHI 0x47 0x0393 # GREEK CAPITAL LETTER GAMMA 0x48 0x223c # TILDE OPERATOR 0x49 0x2243 # ASYMPTOTICALLY EQUAL TO 0x4a 0x0398 # GREEK CAPITAL LETTER THETA 0x4b 0x00d7 # MULTIPLICATION SIGN 0x4c 0x039b # GREEK CAPITAL LETTER LAMDA 0x4d 0x21d4 # LEFT RIGHT DOUBLE ARROW 0x4e 0x21d2 # RIGHTWARDS DOUBLE ARROW 0x4f 0x2261 # IDENTICAL TO 0x50 0x03a0 # GREEK CAPITAL LETTER PI 0x51 0x03a8 # GREEK CAPITAL LETTER PSI 0x52 0x2426 # undefined 0x53 0x03a3 # GREEK CAPITAL LETTER SIGMA 0x54 0x2426 # undefined 0x55 0x2426 # undefined 0x56 0x221a # SQUARE ROOT 0x57 0x03a9 # GREEK CAPITAL LETTER OMEGA 0x58 0x039e # GREEK CAPITAL LETTER XI 0x59 0x03a5 # GREEK CAPITAL LETTER UPSILON 0x5a 0x2282 # SUBSET OF 0x5b 0x2283 # SUPERSET OF 0x5c 0x2229 # INTERSECTION 0x5d 0x222a # UNION 0x5e 0x2227 # LOGICAL AND 0x5f 0x2228 # LOGICAL OR 0x60 0x00ac # NOT SIGN 0x61 0x03b1 # GREEK SMALL LETTER ALPHA 0x62 0x03b2 # GREEK SMALL LETTER BETA 0x63 0x03c7 # GREEK SMALL LETTER CHI 0x64 0x03b4 # GREEK SMALL LETTER DELTA 0x65 0x03b5 # GREEK SMALL LETTER EPSILON 0x66 0x03c6 # GREEK SMALL LETTER PHI 0x67 0x03b3 # GREEK SMALL LETTER GAMMA 0x68 0x03b7 # GREEK SMALL LETTER ETA 0x69 0x03b9 # GREEK SMALL LETTER IOTA 0x6a 0x03b8 # GREEK SMALL LETTER THETA 0x6b 0x03ba # GREEK SMALL LETTER KAPPA 0x6c 0x03bb # GREEK SMALL LETTER LAMDA 0x6d 0x2426 # undefined 0x6e 0x03bd # GREEK SMALL LETTER NU 0x6f 0x2202 # PARTIAL DIFFERENTIAL 0x70 0x03c0 # GREEK SMALL LETTER PI 0x71 0x03c8 # GREEK SMALL LETTER PSI 0x72 0x03c1 # GREEK SMALL LETTER RHO 0x73 0x03c3 # GREEK SMALL LETTER SIGMA 0x74 0x03c4 # GREEK SMALL LETTER TAU 0x75 0x2426 # undefined 0x76 0x0192 # LATIN SMALL LETTER F WITH HOOK Probably chosen for its meaning of "function" 0x77 0x03c9 # GREEK SMALL LETTER OMEGA 0x78 0x03bE # GREEK SMALL LETTER XI 0x79 0x03c5 # GREEK SMALL LETTER UPSILON 0x7a 0x03b6 # GREEK SMALL LETTER ZETA 0x7b 0x2190 # LEFTWARDS ARROW 0x7c 0x2191 # UPWARDS ARROW 0x7d 0x2192 # RIGHTWARDS ARROW 0x7e 0x2193 # DOWNWARDS ARROW ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/koi8-e.enc0000644000000000000000000001010214011765243015161 0ustar rootroot# koi8-e STARTENCODING koi8-e SIZE 256 STARTMAPPING unicode 0x00A1 0x0452 # CYRILLIC SMALL LETTER DJE 0x00A2 0x0453 # CYRILLIC SMALL LETTER GJE 0x00A3 0x0451 # CYRILLIC SMALL LETTER IO 0x00A4 0x0454 # CYRILLIC SMALL LETTER UKRAINIAN IE 0x00A5 0x0455 # CYRILLIC SMALL LETTER DZE 0x00A6 0x0456 # CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I 0x00A7 0x0457 # CYRILLIC SMALL LETTER YI 0x00A8 0x0458 # CYRILLIC SMALL LETTER JE 0x00A9 0x0459 # CYRILLIC SMALL LETTER LJE 0x00AA 0x045A # CYRILLIC SMALL LETTER NJE 0x00AB 0x045B # CYRILLIC SMALL LETTER TSHE 0x00AC 0x045C # CYRILLIC SMALL LETTER KJE 0x00AE 0x045E # CYRILLIC SMALL LETTER SHORT U 0x00AF 0x045F # CYRILLIC SMALL LETTER DZHE 0x00B0 0x2116 # NUMERO SIGN 0x00B1 0x0402 # CYRILLIC CAPITAL LETTER DJE 0x00B2 0x0403 # CYRILLIC CAPITAL LETTER GJE 0x00B3 0x0401 # CYRILLIC CAPITAL LETTER IO 0x00B4 0x0404 # CYRILLIC CAPITAL LETTER UKRAINIAN IE 0x00B5 0x0405 # CYRILLIC CAPITAL LETTER DZE 0x00B6 0x0406 # CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I 0x00B7 0x0407 # CYRILLIC CAPITAL LETTER YI 0x00B8 0x0408 # CYRILLIC CAPITAL LETTER JE 0x00B9 0x0409 # CYRILLIC CAPITAL LETTER LJE 0x00BA 0x040A # CYRILLIC CAPITAL LETTER NJE 0x00BB 0x040B # CYRILLIC CAPITAL LETTER TSHE 0x00BC 0x040C # CYRILLIC CAPITAL LETTER KJE 0x00BD 0x00A4 # CURRENCY SIGN 0x00BE 0x040E # CYRILLIC CAPITAL LETTER SHORT U 0x00BF 0x040F # CYRILLIC CAPITAL LETTER DZHE 0x00C0 0x044E # CYRILLIC SMALL LETTER YU 0x00C1 0x0430 # CYRILLIC SMALL LETTER A 0x00C2 0x0431 # CYRILLIC SMALL LETTER BE 0x00C3 0x0446 # CYRILLIC SMALL LETTER TSE 0x00C4 0x0434 # CYRILLIC SMALL LETTER DE 0x00C5 0x0435 # CYRILLIC SMALL LETTER IE 0x00C6 0x0444 # CYRILLIC SMALL LETTER EF 0x00C7 0x0433 # CYRILLIC SMALL LETTER GHE 0x00C8 0x0445 # CYRILLIC SMALL LETTER HA 0x00C9 0x0438 # CYRILLIC SMALL LETTER I 0x00CA 0x0439 # CYRILLIC SMALL LETTER SHORT I 0x00CB 0x043A # CYRILLIC SMALL LETTER KA 0x00CC 0x043B # CYRILLIC SMALL LETTER EL 0x00CD 0x043C # CYRILLIC SMALL LETTER EM 0x00CE 0x043D # CYRILLIC SMALL LETTER EN 0x00CF 0x043E # CYRILLIC SMALL LETTER O 0x00D0 0x043F # CYRILLIC SMALL LETTER PE 0x00D1 0x044F # CYRILLIC SMALL LETTER YA 0x00D2 0x0440 # CYRILLIC SMALL LETTER ER 0x00D3 0x0441 # CYRILLIC SMALL LETTER ES 0x00D4 0x0442 # CYRILLIC SMALL LETTER TE 0x00D5 0x0443 # CYRILLIC SMALL LETTER U 0x00D6 0x0436 # CYRILLIC SMALL LETTER ZHE 0x00D7 0x0432 # CYRILLIC SMALL LETTER VE 0x00D8 0x044C # CYRILLIC SMALL LETTER SOFT SIGN 0x00D9 0x044B # CYRILLIC SMALL LETTER YERU 0x00DA 0x0437 # CYRILLIC SMALL LETTER ZE 0x00DB 0x0448 # CYRILLIC SMALL LETTER SHA 0x00DC 0x044D # CYRILLIC SMALL LETTER E 0x00DD 0x0449 # CYRILLIC SMALL LETTER SHCHA 0x00DE 0x0447 # CYRILLIC SMALL LETTER CHE 0x00DF 0x044A # CYRILLIC SMALL LETTER HARD SIGN 0x00E0 0x042E # CYRILLIC CAPITAL LETTER YU 0x00E1 0x0410 # CYRILLIC CAPITAL LETTER A 0x00E2 0x0411 # CYRILLIC CAPITAL LETTER BE 0x00E3 0x0426 # CYRILLIC CAPITAL LETTER TSE 0x00E4 0x0414 # CYRILLIC CAPITAL LETTER DE 0x00E5 0x0415 # CYRILLIC CAPITAL LETTER IE 0x00E6 0x0424 # CYRILLIC CAPITAL LETTER EF 0x00E7 0x0413 # CYRILLIC CAPITAL LETTER GHE 0x00E8 0x0425 # CYRILLIC CAPITAL LETTER HA 0x00E9 0x0418 # CYRILLIC CAPITAL LETTER I 0x00EA 0x0419 # CYRILLIC CAPITAL LETTER SHORT I 0x00EB 0x041A # CYRILLIC CAPITAL LETTER KA 0x00EC 0x041B # CYRILLIC CAPITAL LETTER EL 0x00ED 0x041C # CYRILLIC CAPITAL LETTER EM 0x00EE 0x041D # CYRILLIC CAPITAL LETTER EN 0x00EF 0x041E # CYRILLIC CAPITAL LETTER O 0x00F0 0x041F # CYRILLIC CAPITAL LETTER PE 0x00F1 0x042F # CYRILLIC CAPITAL LETTER YA 0x00F2 0x0420 # CYRILLIC CAPITAL LETTER ER 0x00F3 0x0421 # CYRILLIC CAPITAL LETTER ES 0x00F4 0x0422 # CYRILLIC CAPITAL LETTER TE 0x00F5 0x0423 # CYRILLIC CAPITAL LETTER U 0x00F6 0x0416 # CYRILLIC CAPITAL LETTER ZHE 0x00F7 0x0412 # CYRILLIC CAPITAL LETTER VE 0x00F8 0x042C # CYRILLIC CAPITAL LETTER SOFT SIGN 0x00F9 0x042B # CYRILLIC CAPITAL LETTER YERU 0x00FA 0x0417 # CYRILLIC CAPITAL LETTER ZE 0x00FB 0x0428 # CYRILLIC CAPITAL LETTER SHA 0x00FC 0x042D # CYRILLIC CAPITAL LETTER E 0x00FD 0x0429 # CYRILLIC CAPITAL LETTER SHCHA 0x00FE 0x0427 # CYRILLIC CAPITAL LETTER CHE 0x00FF 0x042A # CYRILLIC CAPITAL LETTER HARD SIGN ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-15.enc0000644000000000000000000000072014011767545015454 0ustar rootroot# iso8859-15 STARTENCODING iso8859-15 SIZE 256 STARTMAPPING unicode 0x00A4 0x20AC # EURO SIGN 0x00A6 0x0160 # LATIN CAPITAL LETTER S WITH CARON 0x00A8 0x0161 # LATIN SMALL LETTER S WITH CARON 0x00B4 0x017D # LATIN CAPITAL LETTER Z WITH CARON 0x00B8 0x017E # LATIN SMALL LETTER Z WITH CARON 0x00BC 0x0152 # LATIN CAPITAL LIGATURE OE 0x00BD 0x0153 # LATIN SMALL LIGATURE OE 0x00BE 0x0178 # LATIN CAPITAL LETTER Y WITH DIAERESIS ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-7.enc0000644000000000000000000000666714011765363015411 0ustar rootroot# iso8859-7 STARTENCODING iso8859-7 SIZE 256 STARTMAPPING unicode 0x00A1 0x2018 # LEFT SINGLE QUOTATION MARK 0x00A2 0x2019 # RIGHT SINGLE QUOTATION MARK 0x00A4 0x20AC # EURO SIGN 0x00A5 0x20AF # DRACHMA SIGN 0x00AA 0x037A # GREEK YPOGEGRAMMENI 0x00AF 0x2015 # HORIZONTAL BAR 0x00B4 0x0384 # GREEK TONOS 0x00B5 0x0385 # GREEK DIALYTIKA TONOS 0x00B6 0x0386 # GREEK CAPITAL LETTER ALPHA WITH TONOS 0x00B8 0x0388 # GREEK CAPITAL LETTER EPSILON WITH TONOS 0x00B9 0x0389 # GREEK CAPITAL LETTER ETA WITH TONOS 0x00BA 0x038A # GREEK CAPITAL LETTER IOTA WITH TONOS 0x00BC 0x038C # GREEK CAPITAL LETTER OMICRON WITH TONOS 0x00BE 0x038E # GREEK CAPITAL LETTER UPSILON WITH TONOS 0x00BF 0x038F # GREEK CAPITAL LETTER OMEGA WITH TONOS 0x00C0 0x0390 # GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS 0x00C1 0x0391 # GREEK CAPITAL LETTER ALPHA 0x00C2 0x0392 # GREEK CAPITAL LETTER BETA 0x00C3 0x0393 # GREEK CAPITAL LETTER GAMMA 0x00C4 0x0394 # GREEK CAPITAL LETTER DELTA 0x00C5 0x0395 # GREEK CAPITAL LETTER EPSILON 0x00C6 0x0396 # GREEK CAPITAL LETTER ZETA 0x00C7 0x0397 # GREEK CAPITAL LETTER ETA 0x00C8 0x0398 # GREEK CAPITAL LETTER THETA 0x00C9 0x0399 # GREEK CAPITAL LETTER IOTA 0x00CA 0x039A # GREEK CAPITAL LETTER KAPPA 0x00CB 0x039B # GREEK CAPITAL LETTER LAMDA 0x00CC 0x039C # GREEK CAPITAL LETTER MU 0x00CD 0x039D # GREEK CAPITAL LETTER NU 0x00CE 0x039E # GREEK CAPITAL LETTER XI 0x00CF 0x039F # GREEK CAPITAL LETTER OMICRON 0x00D0 0x03A0 # GREEK CAPITAL LETTER PI 0x00D1 0x03A1 # GREEK CAPITAL LETTER RHO 0x00D3 0x03A3 # GREEK CAPITAL LETTER SIGMA 0x00D4 0x03A4 # GREEK CAPITAL LETTER TAU 0x00D5 0x03A5 # GREEK CAPITAL LETTER UPSILON 0x00D6 0x03A6 # GREEK CAPITAL LETTER PHI 0x00D7 0x03A7 # GREEK CAPITAL LETTER CHI 0x00D8 0x03A8 # GREEK CAPITAL LETTER PSI 0x00D9 0x03A9 # GREEK CAPITAL LETTER OMEGA 0x00DA 0x03AA # GREEK CAPITAL LETTER IOTA WITH DIALYTIKA 0x00DB 0x03AB # GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA 0x00DC 0x03AC # GREEK SMALL LETTER ALPHA WITH TONOS 0x00DD 0x03AD # GREEK SMALL LETTER EPSILON WITH TONOS 0x00DE 0x03AE # GREEK SMALL LETTER ETA WITH TONOS 0x00DF 0x03AF # GREEK SMALL LETTER IOTA WITH TONOS 0x00E0 0x03B0 # GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS 0x00E1 0x03B1 # GREEK SMALL LETTER ALPHA 0x00E2 0x03B2 # GREEK SMALL LETTER BETA 0x00E3 0x03B3 # GREEK SMALL LETTER GAMMA 0x00E4 0x03B4 # GREEK SMALL LETTER DELTA 0x00E5 0x03B5 # GREEK SMALL LETTER EPSILON 0x00E6 0x03B6 # GREEK SMALL LETTER ZETA 0x00E7 0x03B7 # GREEK SMALL LETTER ETA 0x00E8 0x03B8 # GREEK SMALL LETTER THETA 0x00E9 0x03B9 # GREEK SMALL LETTER IOTA 0x00EA 0x03BA # GREEK SMALL LETTER KAPPA 0x00EB 0x03BB # GREEK SMALL LETTER LAMDA 0x00EC 0x03BC # GREEK SMALL LETTER MU 0x00ED 0x03BD # GREEK SMALL LETTER NU 0x00EE 0x03BE # GREEK SMALL LETTER XI 0x00EF 0x03BF # GREEK SMALL LETTER OMICRON 0x00F0 0x03C0 # GREEK SMALL LETTER PI 0x00F1 0x03C1 # GREEK SMALL LETTER RHO 0x00F2 0x03C2 # GREEK SMALL LETTER FINAL SIGMA 0x00F3 0x03C3 # GREEK SMALL LETTER SIGMA 0x00F4 0x03C4 # GREEK SMALL LETTER TAU 0x00F5 0x03C5 # GREEK SMALL LETTER UPSILON 0x00F6 0x03C6 # GREEK SMALL LETTER PHI 0x00F7 0x03C7 # GREEK SMALL LETTER CHI 0x00F8 0x03C8 # GREEK SMALL LETTER PSI 0x00F9 0x03C9 # GREEK SMALL LETTER OMEGA 0x00FA 0x03CA # GREEK SMALL LETTER IOTA WITH DIALYTIKA 0x00FB 0x03CB # GREEK SMALL LETTER UPSILON WITH DIALYTIKA 0x00FC 0x03CC # GREEK SMALL LETTER OMICRON WITH TONOS 0x00FD 0x03CD # GREEK SMALL LETTER UPSILON WITH TONOS 0x00FE 0x03CE # GREEK SMALL LETTER OMEGA WITH TONOS ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/make-tables0000755000000000000000000000657112101446105015517 0ustar rootroot#!/usr/bin/perl -w # $XTermId: make-tables,v 1.4 2013/01/28 10:00:37 tom Exp $ # ----------------------------------------------------------------------------- # Copyright 2013 by Thomas E. Dickey # # All Rights Reserved # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose and without fee is hereby granted, # provided that the above copyright notice appear in all copies and that # both that copyright notice and this permission notice appear in # supporting documentation, and that the name of the above listed # copyright holder(s) not be used in advertising or publicity pertaining # to distribution of the software without specific, written prior # permission. # # THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD # TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY # AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE # LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES # WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN # ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF # OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. # ----------------------------------------------------------------------------- # Convert ".enc" files into C code, using that as a fallback when iconv lacks # information for a given encoding. our @table_names; our $indent = " "; sub trim_enc($) { my $name = $_[0]; $name =~ s/\.enc$//; return $name; } sub table_name($) { my $name = &trim_enc($_[0]); $name =~ s/[-.]/_/g; return $name; } sub do_file($) { my $name = $_[0]; my $n = $#table_names + 1; $table_names[$n++] = $name; my $table = &table_name($name); printf <; close(FP); my $ignore = 1; my $comment; my $source; my $target; my $converted = 0; for $n (0..$#input) { chomp $input[$n]; if ( $input[$n] =~ /startmapping\s+unicode/i ) { $ignore = 0; } elsif ( $input[$n] =~ /endmapping\s+unicode/i ) { $ignore = 1; } my $comment = $input[$n]; if ( $comment =~ /#/ ) { $comment =~ s/^[^#]*#\s*//; } else { $comment = ""; } if ( $ignore ) { printf "%s/* %s */\n", $indent, $comment if ( $comment ne "" ); } elsif ( $input[$n] =~ /^\s*0x[[:xdigit:]]+/i ) { $source = $input[$n]; $source =~ s/#.*//; $source =~ s/^\s+//; $target = $source; $source =~ s/\s+.*//; $target =~ s/^[^[:blank:]]+\s+//; $target =~ s/\s+.*//; if ( $comment ne "" ) { printf "%s{%s, %s},\t/* %s */\n", $indent, $source, $target, $comment; } else { printf "%s{%s, %s},\n", $indent, $source, $target; } $converted++; } } if ($converted == 0) { printf "%s{0, 0},\t/* empty table is illegal syntax */\n", $indent; } printf < #include #include EOF } sub end_file() { my $name; printf <= 0 ) { &do_file ( shift @ARGV ); } &end_file; luit-20240910/encodings/iso8859-10.enc0000644000000000000000000000447014011767601015446 0ustar rootroot# iso8859-10 STARTENCODING iso8859-10 SIZE 256 STARTMAPPING unicode 0x00A1 0x0104 # LATIN CAPITAL LETTER A WITH OGONEK 0x00A2 0x0112 # LATIN CAPITAL LETTER E WITH MACRON 0x00A3 0x0122 # LATIN CAPITAL LETTER G WITH CEDILLA 0x00A4 0x012A # LATIN CAPITAL LETTER I WITH MACRON 0x00A5 0x0128 # LATIN CAPITAL LETTER I WITH TILDE 0x00A6 0x0136 # LATIN CAPITAL LETTER K WITH CEDILLA 0x00A8 0x013B # LATIN CAPITAL LETTER L WITH CEDILLA 0x00A9 0x0110 # LATIN CAPITAL LETTER D WITH STROKE 0x00AA 0x0160 # LATIN CAPITAL LETTER S WITH CARON 0x00AB 0x0166 # LATIN CAPITAL LETTER T WITH STROKE 0x00AC 0x017D # LATIN CAPITAL LETTER Z WITH CARON 0x00AE 0x016A # LATIN CAPITAL LETTER U WITH MACRON 0x00AF 0x014A # LATIN CAPITAL LETTER ENG 0x00B1 0x0105 # LATIN SMALL LETTER A WITH OGONEK 0x00B2 0x0113 # LATIN SMALL LETTER E WITH MACRON 0x00B3 0x0123 # LATIN SMALL LETTER G WITH CEDILLA 0x00B4 0x012B # LATIN SMALL LETTER I WITH MACRON 0x00B5 0x0129 # LATIN SMALL LETTER I WITH TILDE 0x00B6 0x0137 # LATIN SMALL LETTER K WITH CEDILLA 0x00B8 0x013C # LATIN SMALL LETTER L WITH CEDILLA 0x00B9 0x0111 # LATIN SMALL LETTER D WITH STROKE 0x00BA 0x0161 # LATIN SMALL LETTER S WITH CARON 0x00BB 0x0167 # LATIN SMALL LETTER T WITH STROKE 0x00BC 0x017E # LATIN SMALL LETTER Z WITH CARON 0x00BD 0x2015 # HORIZONTAL BAR 0x00BE 0x016B # LATIN SMALL LETTER U WITH MACRON 0x00BF 0x014B # LATIN SMALL LETTER ENG 0x00C0 0x0100 # LATIN CAPITAL LETTER A WITH MACRON 0x00C7 0x012E # LATIN CAPITAL LETTER I WITH OGONEK 0x00C8 0x010C # LATIN CAPITAL LETTER C WITH CARON 0x00CA 0x0118 # LATIN CAPITAL LETTER E WITH OGONEK 0x00CC 0x0116 # LATIN CAPITAL LETTER E WITH DOT ABOVE 0x00D1 0x0145 # LATIN CAPITAL LETTER N WITH CEDILLA 0x00D2 0x014C # LATIN CAPITAL LETTER O WITH MACRON 0x00D7 0x0168 # LATIN CAPITAL LETTER U WITH TILDE 0x00D9 0x0172 # LATIN CAPITAL LETTER U WITH OGONEK 0x00E0 0x0101 # LATIN SMALL LETTER A WITH MACRON 0x00E7 0x012F # LATIN SMALL LETTER I WITH OGONEK 0x00E8 0x010D # LATIN SMALL LETTER C WITH CARON 0x00EA 0x0119 # LATIN SMALL LETTER E WITH OGONEK 0x00EC 0x0117 # LATIN SMALL LETTER E WITH DOT ABOVE 0x00F1 0x0146 # LATIN SMALL LETTER N WITH CEDILLA 0x00F2 0x014D # LATIN SMALL LETTER O WITH MACRON 0x00F7 0x0169 # LATIN SMALL LETTER U WITH TILDE 0x00F9 0x0173 # LATIN SMALL LETTER U WITH OGONEK 0x00FF 0x0138 # LATIN SMALL LETTER KRA ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-2.enc0000644000000000000000000000543314011767524015373 0ustar rootroot# iso8859-2 STARTENCODING iso8859-2 SIZE 256 STARTMAPPING unicode 0x00A1 0x0104 # LATIN CAPITAL LETTER A WITH OGONEK 0x00A2 0x02D8 # BREVE 0x00A3 0x0141 # LATIN CAPITAL LETTER L WITH STROKE 0x00A5 0x013D # LATIN CAPITAL LETTER L WITH CARON 0x00A6 0x015A # LATIN CAPITAL LETTER S WITH ACUTE 0x00A9 0x0160 # LATIN CAPITAL LETTER S WITH CARON 0x00AA 0x015E # LATIN CAPITAL LETTER S WITH CEDILLA 0x00AB 0x0164 # LATIN CAPITAL LETTER T WITH CARON 0x00AC 0x0179 # LATIN CAPITAL LETTER Z WITH ACUTE 0x00AE 0x017D # LATIN CAPITAL LETTER Z WITH CARON 0x00AF 0x017B # LATIN CAPITAL LETTER Z WITH DOT ABOVE 0x00B1 0x0105 # LATIN SMALL LETTER A WITH OGONEK 0x00B2 0x02DB # OGONEK 0x00B3 0x0142 # LATIN SMALL LETTER L WITH STROKE 0x00B5 0x013E # LATIN SMALL LETTER L WITH CARON 0x00B6 0x015B # LATIN SMALL LETTER S WITH ACUTE 0x00B7 0x02C7 # CARON 0x00B9 0x0161 # LATIN SMALL LETTER S WITH CARON 0x00BA 0x015F # LATIN SMALL LETTER S WITH CEDILLA 0x00BB 0x0165 # LATIN SMALL LETTER T WITH CARON 0x00BC 0x017A # LATIN SMALL LETTER Z WITH ACUTE 0x00BD 0x02DD # DOUBLE ACUTE ACCENT 0x00BE 0x017E # LATIN SMALL LETTER Z WITH CARON 0x00BF 0x017C # LATIN SMALL LETTER Z WITH DOT ABOVE 0x00C0 0x0154 # LATIN CAPITAL LETTER R WITH ACUTE 0x00C3 0x0102 # LATIN CAPITAL LETTER A WITH BREVE 0x00C5 0x0139 # LATIN CAPITAL LETTER L WITH ACUTE 0x00C6 0x0106 # LATIN CAPITAL LETTER C WITH ACUTE 0x00C8 0x010C # LATIN CAPITAL LETTER C WITH CARON 0x00CA 0x0118 # LATIN CAPITAL LETTER E WITH OGONEK 0x00CC 0x011A # LATIN CAPITAL LETTER E WITH CARON 0x00CF 0x010E # LATIN CAPITAL LETTER D WITH CARON 0x00D0 0x0110 # LATIN CAPITAL LETTER D WITH STROKE 0x00D1 0x0143 # LATIN CAPITAL LETTER N WITH ACUTE 0x00D2 0x0147 # LATIN CAPITAL LETTER N WITH CARON 0x00D5 0x0150 # LATIN CAPITAL LETTER O WITH DOUBLE ACUTE 0x00D8 0x0158 # LATIN CAPITAL LETTER R WITH CARON 0x00D9 0x016E # LATIN CAPITAL LETTER U WITH RING ABOVE 0x00DB 0x0170 # LATIN CAPITAL LETTER U WITH DOUBLE ACUTE 0x00DE 0x0162 # LATIN CAPITAL LETTER T WITH CEDILLA 0x00E0 0x0155 # LATIN SMALL LETTER R WITH ACUTE 0x00E3 0x0103 # LATIN SMALL LETTER A WITH BREVE 0x00E5 0x013A # LATIN SMALL LETTER L WITH ACUTE 0x00E6 0x0107 # LATIN SMALL LETTER C WITH ACUTE 0x00E8 0x010D # LATIN SMALL LETTER C WITH CARON 0x00EA 0x0119 # LATIN SMALL LETTER E WITH OGONEK 0x00EC 0x011B # LATIN SMALL LETTER E WITH CARON 0x00EF 0x010F # LATIN SMALL LETTER D WITH CARON 0x00F0 0x0111 # LATIN SMALL LETTER D WITH STROKE 0x00F1 0x0144 # LATIN SMALL LETTER N WITH ACUTE 0x00F2 0x0148 # LATIN SMALL LETTER N WITH CARON 0x00F5 0x0151 # LATIN SMALL LETTER O WITH DOUBLE ACUTE 0x00F8 0x0159 # LATIN SMALL LETTER R WITH CARON 0x00F9 0x016F # LATIN SMALL LETTER U WITH RING ABOVE 0x00FB 0x0171 # LATIN SMALL LETTER U WITH DOUBLE ACUTE 0x00FE 0x0163 # LATIN SMALL LETTER T WITH CEDILLA 0x00FF 0x02D9 # DOT ABOVE ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/dec-special.enc0000644000000000000000000000261214011770074016243 0ustar rootrootSTARTENCODING dec-special # This file is derived from the file data.c in the XTerm sources SIZE 0x80 STARTMAPPING unicode 0x5F 0x25AE # BLACK VERTICAL RECTANGLE 0x60 0x25C6 # BLACK DIAMOND 0x61 0x2592 # MEDIUM SHADE 0x62 0x2409 # SYMBOL FOR HORIZONTAL TABULATION 0x63 0x240C # SYMBOL FOR FORM FEED 0x64 0x240D # SYMBOL FOR CARRIAGE RETURN 0x65 0x240A # SYMBOL FOR LINE FEED 0x66 0x00B0 # DEGREE SIGN 0x67 0x00B1 # PLUS-MINUS SIGN 0x68 0x2424 # SYMBOL FOR NEWLINE 0x69 0x240B # SYMBOL FOR VERTICAL TABULATION 0x6A 0x2518 # BOX DRAWINGS LIGHT UP AND LEFT 0x6B 0x2510 # BOX DRAWINGS LIGHT DOWN AND LEFT 0x6C 0x250C # BOX DRAWINGS LIGHT DOWN AND RIGHT 0x6D 0x2514 # BOX DRAWINGS LIGHT UP AND RIGHT 0x6E 0x253C # BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL 0x6F 0x23BA # HORIZONTAL SCAN LINE-1 0x70 0x23BB # HORIZONTAL SCAN LINE-3 0x71 0x2500 # BOX DRAWINGS LIGHT HORIZONTAL 0x72 0x23BC # HORIZONTAL SCAN LINE-7 0x73 0x23BD # HORIZONTAL SCAN LINE-9 0x74 0x251C # BOX DRAWINGS LIGHT VERTICAL AND RIGHT 0x75 0x2524 # BOX DRAWINGS LIGHT VERTICAL AND LEFT 0x76 0x2534 # BOX DRAWINGS LIGHT UP AND HORIZONTAL 0x77 0x252C # BOX DRAWINGS LIGHT DOWN AND HORIZONTAL 0x78 0x2502 # BOX DRAWINGS LIGHT VERTICAL 0x79 0x2264 # LESS-THAN OR EQUAL TO 0x7A 0x2265 # GREATER-THAN OR EQUAL TO 0x7B 0x03C0 # GREEK SMALL LETTER PI 0x7C 0x2260 # NOT EQUAL TO 0x7D 0x00A3 # POUND SIGN 0x7E 0x00B7 # MIDDLE DOT ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-6.enc0000644000000000000000000000343414011767351015374 0ustar rootroot# iso8859-6 STARTENCODING iso8859-6 SIZE 256 STARTMAPPING unicode 0x00AC 0x060C # ARABIC COMMA 0x00BB 0x061B # ARABIC SEMICOLON 0x00BF 0x061F # ARABIC QUESTION MARK 0x00C1 0x0621 # ARABIC LETTER HAMZA 0x00C2 0x0622 # ARABIC LETTER ALEF WITH MADDA ABOVE 0x00C3 0x0623 # ARABIC LETTER ALEF WITH HAMZA ABOVE 0x00C4 0x0624 # ARABIC LETTER WAW WITH HAMZA ABOVE 0x00C5 0x0625 # ARABIC LETTER ALEF WITH HAMZA BELOW 0x00C6 0x0626 # ARABIC LETTER YEH WITH HAMZA ABOVE 0x00C7 0x0627 # ARABIC LETTER ALEF 0x00C8 0x0628 # ARABIC LETTER BEH 0x00C9 0x0629 # ARABIC LETTER TEH MARBUTA 0x00CA 0x062A # ARABIC LETTER TEH 0x00CB 0x062B # ARABIC LETTER THEH 0x00CC 0x062C # ARABIC LETTER JEEM 0x00CD 0x062D # ARABIC LETTER HAH 0x00CE 0x062E # ARABIC LETTER KHAH 0x00CF 0x062F # ARABIC LETTER DAL 0x00D0 0x0630 # ARABIC LETTER THAL 0x00D1 0x0631 # ARABIC LETTER REH 0x00D2 0x0632 # ARABIC LETTER ZAIN 0x00D3 0x0633 # ARABIC LETTER SEEN 0x00D4 0x0634 # ARABIC LETTER SHEEN 0x00D5 0x0635 # ARABIC LETTER SAD 0x00D6 0x0636 # ARABIC LETTER DAD 0x00D7 0x0637 # ARABIC LETTER TAH 0x00D8 0x0638 # ARABIC LETTER ZAH 0x00D9 0x0639 # ARABIC LETTER AIN 0x00DA 0x063A # ARABIC LETTER GHAIN 0x00E0 0x0640 # ARABIC TATWEEL 0x00E1 0x0641 # ARABIC LETTER FEH 0x00E2 0x0642 # ARABIC LETTER QAF 0x00E3 0x0643 # ARABIC LETTER KAF 0x00E4 0x0644 # ARABIC LETTER LAM 0x00E5 0x0645 # ARABIC LETTER MEEM 0x00E6 0x0646 # ARABIC LETTER NOON 0x00E7 0x0647 # ARABIC LETTER HEH 0x00E8 0x0648 # ARABIC LETTER WAW 0x00E9 0x0649 # ARABIC LETTER ALEF MAKSURA 0x00EA 0x064A # ARABIC LETTER YEH 0x00EB 0x064B # ARABIC FATHATAN 0x00EC 0x064C # ARABIC DAMMATAN 0x00ED 0x064D # ARABIC KASRATAN 0x00EE 0x064E # ARABIC FATHA 0x00EF 0x064F # ARABIC DAMMA 0x00F0 0x0650 # ARABIC KASRA 0x00F1 0x0651 # ARABIC SHADDA 0x00F2 0x0652 # ARABIC SUKUN ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/encodings/iso8859-8.enc0000644000000000000000000000232414011765313015367 0ustar rootroot# iso8859-8 STARTENCODING iso8859-8 SIZE 256 STARTMAPPING unicode 0x00AA 0x00D7 # MULTIPLICATION SIGN 0x00BA 0x00F7 # DIVISION SIGN 0x00DF 0x2017 # DOUBLE LOW LINE 0x00E0 0x05D0 # HEBREW LETTER ALEF 0x00E1 0x05D1 # HEBREW LETTER BET 0x00E2 0x05D2 # HEBREW LETTER GIMEL 0x00E3 0x05D3 # HEBREW LETTER DALET 0x00E4 0x05D4 # HEBREW LETTER HE 0x00E5 0x05D5 # HEBREW LETTER VAV 0x00E6 0x05D6 # HEBREW LETTER ZAYIN 0x00E7 0x05D7 # HEBREW LETTER HET 0x00E8 0x05D8 # HEBREW LETTER TET 0x00E9 0x05D9 # HEBREW LETTER YOD 0x00EA 0x05DA # HEBREW LETTER FINAL KAF 0x00EB 0x05DB # HEBREW LETTER KAF 0x00EC 0x05DC # HEBREW LETTER LAMED 0x00ED 0x05DD # HEBREW LETTER FINAL MEM 0x00EE 0x05DE # HEBREW LETTER MEM 0x00EF 0x05DF # HEBREW LETTER FINAL NUN 0x00F0 0x05E0 # HEBREW LETTER NUN 0x00F1 0x05E1 # HEBREW LETTER SAMEKH 0x00F2 0x05E2 # HEBREW LETTER AYIN 0x00F3 0x05E3 # HEBREW LETTER FINAL PE 0x00F4 0x05E4 # HEBREW LETTER PE 0x00F5 0x05E5 # HEBREW LETTER FINAL TSADI 0x00F6 0x05E6 # HEBREW LETTER TSADI 0x00F7 0x05E7 # HEBREW LETTER QOF 0x00F8 0x05E8 # HEBREW LETTER RESH 0x00F9 0x05E9 # HEBREW LETTER SHIN 0x00FA 0x05EA # HEBREW LETTER TAV 0x00FD 0x200E # LEFT-TO-RIGHT MARK 0x00FE 0x200F # RIGHT-TO-LEFT MARK ENDMAPPING # vile:tblmode ENDENCODING luit-20240910/config.guess0000755000000000000000000014306714651355010013763 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2024-07-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # # Originally written by Per Bothner; maintained since 2000 by Ben Elliston. # # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.guess # # Please send patches to . # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] Output the configuration name of the system '$me' is run on. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.guess ($timestamp) Originally written by Per Bothner. Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; * ) break ;; esac done if test $# != 0; then echo "$me: too many arguments$help" >&2 exit 1 fi # Just in case it came from the environment. GUESS= # CC_FOR_BUILD -- compiler used by this script. Note that the use of a # compiler to aid in system detection is discouraged as it requires # temporary files to be created and, as you can see below, it is a # headache to deal with in a portable fashion. # Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still # use 'HOST_CC' if defined, but it is deprecated. # Portable tmp directory creation inspired by the Autoconf team. tmp= # shellcheck disable=SC2172 trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15 set_cc_for_build() { # prevent multiple calls if $tmp is already set test "$tmp" && return 0 : "${TMPDIR=/tmp}" # shellcheck disable=SC2039,SC3028 { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } || { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } || { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } || { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } dummy=$tmp/dummy case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in ,,) echo "int x;" > "$dummy.c" for driver in cc gcc c17 c99 c89 ; do if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then CC_FOR_BUILD=$driver break fi done if test x"$CC_FOR_BUILD" = x ; then CC_FOR_BUILD=no_compiler_found fi ;; ,,*) CC_FOR_BUILD=$CC ;; ,*,*) CC_FOR_BUILD=$HOST_CC ;; esac } # This is needed to find uname on a Pyramid OSx when run in the BSD universe. # (ghazi@noc.rutgers.edu 1994-08-24) if test -f /.attbin/uname ; then PATH=$PATH:/.attbin ; export PATH fi UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown case $UNAME_SYSTEM in Linux|GNU|GNU/*) LIBC=unknown set_cc_for_build cat <<-EOF > "$dummy.c" #if defined(__ANDROID__) LIBC=android #else #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #elif defined(__LLVM_LIBC__) LIBC=llvm #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #endif #endif #endif EOF cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'` eval "$cc_set_libc" # Second heuristic to detect musl libc. if [ "$LIBC" = unknown ] && command -v ldd >/dev/null && ldd --version 2>&1 | grep -q ^musl; then LIBC=musl fi # If the system lacks a compiler, then just pick glibc. # We could probably try harder. if [ "$LIBC" = unknown ]; then LIBC=gnu fi ;; esac # Note: order is significant - the case branches are not exclusive. case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in *:NetBSD:*:*) # NetBSD (nbsd) targets should (where applicable) match one or # more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*, # *-*-netbsdecoff* and *-*-netbsd*. For targets that recently # switched to ELF, *-*-netbsd* would select the old # object file format. This provides both forward # compatibility and a consistent mechanism for selecting the # object file format. # # Note: NetBSD doesn't particularly care about the vendor # portion of the name. We always set it to "unknown". UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \ echo unknown)` case $UNAME_MACHINE_ARCH in aarch64eb) machine=aarch64_be-unknown ;; armeb) machine=armeb-unknown ;; arm*) machine=arm-unknown ;; sh3el) machine=shl-unknown ;; sh3eb) machine=sh-unknown ;; sh5el) machine=sh5le-unknown ;; earmv*) arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'` endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'` machine=${arch}${endian}-unknown ;; *) machine=$UNAME_MACHINE_ARCH-unknown ;; esac # The Operating System including object format, if it has switched # to ELF recently (or will in the future) and ABI. case $UNAME_MACHINE_ARCH in earm*) os=netbsdelf ;; arm*|i386|m68k|ns32k|sh3*|sparc|vax) set_cc_for_build if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ELF__ then # Once all utilities can be ECOFF (netbsdecoff) or a.out (netbsdaout). # Return netbsd for either. FIX? os=netbsd else os=netbsdelf fi ;; *) os=netbsd ;; esac # Determine ABI tags. case $UNAME_MACHINE_ARCH in earm*) expr='s/^earmv[0-9]/-eabi/;s/eb$//' abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"` ;; esac # The OS release # Debian GNU/NetBSD machines have a different userland, and # thus, need a distinct triplet. However, they do not need # kernel version information, so it can be replaced with a # suitable tag, in the style of linux-gnu. case $UNAME_VERSION in Debian*) release='-gnu' ;; *) release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2` ;; esac # Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM: # contains redundant information, the shorter form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used. GUESS=$machine-${os}${release}${abi-} ;; *:Bitrig:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE ;; *:OpenBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE ;; *:SecBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE ;; *:LibertyBSD:*:*) UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'` GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE ;; *:MidnightBSD:*:*) GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE ;; *:ekkoBSD:*:*) GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE ;; *:SolidBSD:*:*) GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE ;; *:OS108:*:*) GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE ;; macppc:MirBSD:*:*) GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE ;; *:MirBSD:*:*) GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE ;; *:Sortix:*:*) GUESS=$UNAME_MACHINE-unknown-sortix ;; *:Twizzler:*:*) GUESS=$UNAME_MACHINE-unknown-twizzler ;; *:Redox:*:*) GUESS=$UNAME_MACHINE-unknown-redox ;; mips:OSF1:*.*) GUESS=mips-dec-osf1 ;; alpha:OSF1:*:*) # Reset EXIT trap before exiting to avoid spurious non-zero exit code. trap '' 0 case $UNAME_RELEASE in *4.0) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'` ;; *5.*) UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $4}'` ;; esac # According to Compaq, /usr/sbin/psrinfo has been available on # OSF/1 and Tru64 systems produced since 1995. I hope that # covers most systems running today. This code pipes the CPU # types through head -n 1, so we only detect the type of CPU 0. ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1` case $ALPHA_CPU_TYPE in "EV4 (21064)") UNAME_MACHINE=alpha ;; "EV4.5 (21064)") UNAME_MACHINE=alpha ;; "LCA4 (21066/21068)") UNAME_MACHINE=alpha ;; "EV5 (21164)") UNAME_MACHINE=alphaev5 ;; "EV5.6 (21164A)") UNAME_MACHINE=alphaev56 ;; "EV5.6 (21164PC)") UNAME_MACHINE=alphapca56 ;; "EV5.7 (21164PC)") UNAME_MACHINE=alphapca57 ;; "EV6 (21264)") UNAME_MACHINE=alphaev6 ;; "EV6.7 (21264A)") UNAME_MACHINE=alphaev67 ;; "EV6.8CB (21264C)") UNAME_MACHINE=alphaev68 ;; "EV6.8AL (21264B)") UNAME_MACHINE=alphaev68 ;; "EV6.8CX (21264D)") UNAME_MACHINE=alphaev68 ;; "EV6.9A (21264/EV69A)") UNAME_MACHINE=alphaev69 ;; "EV7 (21364)") UNAME_MACHINE=alphaev7 ;; "EV7.9 (21364A)") UNAME_MACHINE=alphaev79 ;; esac # A Pn.n version is a patched version. # A Vn.n version is a released version. # A Tn.n version is a released field test version. # A Xn.n version is an unreleased experimental baselevel. # 1.2 uses "1.2" for uname -r. OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` GUESS=$UNAME_MACHINE-dec-osf$OSF_REL ;; Amiga*:UNIX_System_V:4.0:*) GUESS=m68k-unknown-sysv4 ;; *:[Aa]miga[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-amigaos ;; *:[Mm]orph[Oo][Ss]:*:*) GUESS=$UNAME_MACHINE-unknown-morphos ;; *:OS/390:*:*) GUESS=i370-ibm-openedition ;; *:z/VM:*:*) GUESS=s390-ibm-zvmoe ;; *:OS400:*:*) GUESS=powerpc-ibm-os400 ;; arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*) GUESS=arm-acorn-riscix$UNAME_RELEASE ;; arm*:riscos:*:*|arm*:RISCOS:*:*) GUESS=arm-unknown-riscos ;; SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*) GUESS=hppa1.1-hitachi-hiuxmpp ;; Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*) # akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE. case `(/bin/universe) 2>/dev/null` in att) GUESS=pyramid-pyramid-sysv3 ;; *) GUESS=pyramid-pyramid-bsd ;; esac ;; NILE*:*:*:dcosx) GUESS=pyramid-pyramid-svr4 ;; DRS?6000:unix:4.0:6*) GUESS=sparc-icl-nx6 ;; DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*) case `/usr/bin/uname -p` in sparc) GUESS=sparc-icl-nx7 ;; esac ;; s390x:SunOS:*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL ;; sun4H:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-hal-solaris2$SUN_REL ;; sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris2$SUN_REL ;; i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*) GUESS=i386-pc-auroraux$UNAME_RELEASE ;; i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*) set_cc_for_build SUN_ARCH=i386 # If there is a compiler, see if it is configured for 64-bit objects. # Note that the Sun cc does not turn __LP64__ into 1 like gcc does. # This test works for both compilers. if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then SUN_ARCH=x86_64 fi fi SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=$SUN_ARCH-pc-solaris2$SUN_REL ;; sun4*:SunOS:6*:*) # According to config.sub, this is the proper way to canonicalize # SunOS6. Hard to guess exactly what SunOS6 will be like, but # it's likely to be more like Solaris than SunOS4. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=sparc-sun-solaris3$SUN_REL ;; sun4*:SunOS:*:*) case `/usr/bin/arch -k` in Series*|S4*) UNAME_RELEASE=`uname -v` ;; esac # Japanese Language versions have a version number like '4.1.3-JL'. SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'` GUESS=sparc-sun-sunos$SUN_REL ;; sun3*:SunOS:*:*) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun*:*:4.2BSD:*) UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null` test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3 case `/bin/arch` in sun3) GUESS=m68k-sun-sunos$UNAME_RELEASE ;; sun4) GUESS=sparc-sun-sunos$UNAME_RELEASE ;; esac ;; aushp:SunOS:*:*) GUESS=sparc-auspex-sunos$UNAME_RELEASE ;; # The situation for MiNT is a little confusing. The machine name # can be virtually everything (everything which is not # "atarist" or "atariste" at least should have a processor # > m68000). The system name ranges from "MiNT" over "FreeMiNT" # to the lowercase version "mint" (or "freemint"). Finally # the system name "TOS" denotes a system which is actually not # MiNT. But MiNT is downward compatible to TOS, so this should # be no problem. atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; *falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*) GUESS=m68k-atari-mint$UNAME_RELEASE ;; milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*) GUESS=m68k-milan-mint$UNAME_RELEASE ;; hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*) GUESS=m68k-hades-mint$UNAME_RELEASE ;; *:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*) GUESS=m68k-unknown-mint$UNAME_RELEASE ;; m68k:machten:*:*) GUESS=m68k-apple-machten$UNAME_RELEASE ;; powerpc:machten:*:*) GUESS=powerpc-apple-machten$UNAME_RELEASE ;; RISC*:Mach:*:*) GUESS=mips-dec-mach_bsd4.3 ;; RISC*:ULTRIX:*:*) GUESS=mips-dec-ultrix$UNAME_RELEASE ;; VAX*:ULTRIX*:*:*) GUESS=vax-dec-ultrix$UNAME_RELEASE ;; 2020:CLIX:*:* | 2430:CLIX:*:*) GUESS=clipper-intergraph-clix$UNAME_RELEASE ;; mips:*:*:UMIPS | mips:*:*:RISCos) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #ifdef __cplusplus #include /* for printf() prototype */ int main (int argc, char *argv[]) { #else int main (argc, argv) int argc; char *argv[]; { #endif #if defined (host_mips) && defined (MIPSEB) #if defined (SYSTYPE_SYSV) printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_SVR4) printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0); #endif #if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD) printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0); #endif #endif exit (-1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` && SYSTEM_NAME=`"$dummy" "$dummyarg"` && { echo "$SYSTEM_NAME"; exit; } GUESS=mips-mips-riscos$UNAME_RELEASE ;; Motorola:PowerMAX_OS:*:*) GUESS=powerpc-motorola-powermax ;; Motorola:*:4.3:PL8-*) GUESS=powerpc-harris-powermax ;; Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*) GUESS=powerpc-harris-powermax ;; Night_Hawk:Power_UNIX:*:*) GUESS=powerpc-harris-powerunix ;; m88k:CX/UX:7*:*) GUESS=m88k-harris-cxux7 ;; m88k:*:4*:R4*) GUESS=m88k-motorola-sysv4 ;; m88k:*:3*:R3*) GUESS=m88k-motorola-sysv3 ;; AViiON:dgux:*:*) # DG/UX returns AViiON for all architectures UNAME_PROCESSOR=`/usr/bin/uname -p` if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110 then if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \ test "$TARGET_BINARY_INTERFACE"x = x then GUESS=m88k-dg-dgux$UNAME_RELEASE else GUESS=m88k-dg-dguxbcs$UNAME_RELEASE fi else GUESS=i586-dg-dgux$UNAME_RELEASE fi ;; M88*:DolphinOS:*:*) # DolphinOS (SVR3) GUESS=m88k-dolphin-sysv3 ;; M88*:*:R3*:*) # Delta 88k system running SVR3 GUESS=m88k-motorola-sysv3 ;; XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3) GUESS=m88k-tektronix-sysv3 ;; Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD) GUESS=m68k-tektronix-bsd ;; *:IRIX*:*:*) IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'` GUESS=mips-sgi-irix$IRIX_REL ;; ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX. GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id ;; # Note that: echo "'`uname -s`'" gives 'AIX ' i*86:AIX:*:*) GUESS=i386-ibm-aix ;; ia64:AIX:*:*) if test -x /usr/bin/oslevel ; then IBM_REV=`/usr/bin/oslevel` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV ;; *:AIX:2:3) if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { if (!__power_pc()) exit(1); puts("powerpc-ibm-aix3.2.5"); exit(0); } EOF if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` then GUESS=$SYSTEM_NAME else GUESS=rs6000-ibm-aix3.2.5 fi elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then GUESS=rs6000-ibm-aix3.2.4 else GUESS=rs6000-ibm-aix3.2 fi ;; *:AIX:*:[4567]) IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'` if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then IBM_ARCH=rs6000 else IBM_ARCH=powerpc fi if test -x /usr/bin/lslpp ; then IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/` else IBM_REV=$UNAME_VERSION.$UNAME_RELEASE fi GUESS=$IBM_ARCH-ibm-aix$IBM_REV ;; *:AIX:*:*) GUESS=rs6000-ibm-aix ;; ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*) GUESS=romp-ibm-bsd4.4 ;; ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to ;; # report: romp-ibm BSD 4.3 *:BOSX:*:*) GUESS=rs6000-bull-bosx ;; DPX/2?00:B.O.S.:*:*) GUESS=m68k-bull-sysv3 ;; 9000/[34]??:4.3bsd:1.*:*) GUESS=m68k-hp-bsd ;; hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*) GUESS=m68k-hp-bsd4.4 ;; 9000/[34678]??:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` case $UNAME_MACHINE in 9000/31?) HP_ARCH=m68000 ;; 9000/[34]??) HP_ARCH=m68k ;; 9000/[678][0-9][0-9]) if test -x /usr/bin/getconf; then sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null` sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null` case $sc_cpu_version in 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1 532) # CPU_PA_RISC2_0 case $sc_kernel_bits in 32) HP_ARCH=hppa2.0n ;; 64) HP_ARCH=hppa2.0w ;; '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20 esac ;; esac fi if test "$HP_ARCH" = ""; then set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #define _HPUX_SOURCE #include #include int main () { #if defined(_SC_KERNEL_BITS) long bits = sysconf(_SC_KERNEL_BITS); #endif long cpu = sysconf (_SC_CPU_VERSION); switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0"); break; case CPU_PA_RISC1_1: puts ("hppa1.1"); break; case CPU_PA_RISC2_0: #if defined(_SC_KERNEL_BITS) switch (bits) { case 64: puts ("hppa2.0w"); break; case 32: puts ("hppa2.0n"); break; default: puts ("hppa2.0"); break; } break; #else /* !defined(_SC_KERNEL_BITS) */ puts ("hppa2.0"); break; #endif default: puts ("hppa1.0"); break; } exit (0); } EOF (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"` test -z "$HP_ARCH" && HP_ARCH=hppa fi ;; esac if test "$HP_ARCH" = hppa2.0w then set_cc_for_build # hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating # 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler # generating 64-bit code. GNU and HP use different nomenclature: # # $ CC_FOR_BUILD=cc ./config.guess # => hppa2.0w-hp-hpux11.23 # $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess # => hppa64-hp-hpux11.23 if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | grep -q __LP64__ then HP_ARCH=hppa2.0w else HP_ARCH=hppa64 fi fi GUESS=$HP_ARCH-hp-hpux$HPUX_REV ;; ia64:HP-UX:*:*) HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'` GUESS=ia64-hp-hpux$HPUX_REV ;; 3050*:HI-UX:*:*) set_cc_for_build sed 's/^ //' << EOF > "$dummy.c" #include int main () { long cpu = sysconf (_SC_CPU_VERSION); /* The order matters, because CPU_IS_HP_MC68K erroneously returns true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct results, however. */ if (CPU_IS_PA_RISC (cpu)) { switch (cpu) { case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break; case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break; case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break; default: puts ("hppa-hitachi-hiuxwe2"); break; } } else if (CPU_IS_HP_MC68K (cpu)) puts ("m68k-hitachi-hiuxwe2"); else puts ("unknown-hitachi-hiuxwe2"); exit (0); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } GUESS=unknown-hitachi-hiuxwe2 ;; 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*) GUESS=hppa1.1-hp-bsd ;; 9000/8??:4.3bsd:*:*) GUESS=hppa1.0-hp-bsd ;; *9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*) GUESS=hppa1.0-hp-mpeix ;; hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*) GUESS=hppa1.1-hp-osf ;; hp8??:OSF1:*:*) GUESS=hppa1.0-hp-osf ;; i*86:OSF1:*:*) if test -x /usr/sbin/sysversion ; then GUESS=$UNAME_MACHINE-unknown-osf1mk else GUESS=$UNAME_MACHINE-unknown-osf1 fi ;; parisc*:Lites*:*:*) GUESS=hppa1.1-hp-lites ;; C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*) GUESS=c1-convex-bsd ;; C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*) if getsysinfo -f scalar_acc then echo c32-convex-bsd else echo c2-convex-bsd fi exit ;; C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*) GUESS=c34-convex-bsd ;; C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*) GUESS=c38-convex-bsd ;; C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*) GUESS=c4-convex-bsd ;; CRAY*Y-MP:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=ymp-cray-unicos$CRAY_REL ;; CRAY*[A-Z]90:*:*:*) echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \ | sed -e 's/CRAY.*\([A-Z]90\)/\1/' \ -e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \ -e 's/\.[^.]*$/.X/' exit ;; CRAY*TS:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=t90-cray-unicos$CRAY_REL ;; CRAY*T3E:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=alphaev5-cray-unicosmk$CRAY_REL ;; CRAY*SV1:*:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=sv1-cray-unicos$CRAY_REL ;; *:UNICOS/mp:*:*) CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'` GUESS=craynv-cray-unicosmp$CRAY_REL ;; F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*) FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz` FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'` GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; 5000:UNIX_System_V:4.*:*) FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'` FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'` GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL} ;; i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*) GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE ;; sparc*:BSD/OS:*:*) GUESS=sparc-unknown-bsdi$UNAME_RELEASE ;; *:BSD/OS:*:*) GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE ;; arm:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` set_cc_for_build if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi else FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf fi ;; *:FreeBSD:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in amd64) UNAME_PROCESSOR=x86_64 ;; i386) UNAME_PROCESSOR=i586 ;; esac FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL ;; i*:CYGWIN*:*) GUESS=$UNAME_MACHINE-pc-cygwin ;; *:MINGW64*:*) GUESS=$UNAME_MACHINE-pc-mingw64 ;; *:MINGW*:*) GUESS=$UNAME_MACHINE-pc-mingw32 ;; *:MSYS*:*) GUESS=$UNAME_MACHINE-pc-msys ;; i*:PW*:*) GUESS=$UNAME_MACHINE-pc-pw32 ;; *:SerenityOS:*:*) GUESS=$UNAME_MACHINE-pc-serenity ;; *:Interix*:*) case $UNAME_MACHINE in x86) GUESS=i586-pc-interix$UNAME_RELEASE ;; authenticamd | genuineintel | EM64T) GUESS=x86_64-unknown-interix$UNAME_RELEASE ;; IA64) GUESS=ia64-unknown-interix$UNAME_RELEASE ;; esac ;; i*:UWIN*:*) GUESS=$UNAME_MACHINE-pc-uwin ;; amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*) GUESS=x86_64-pc-cygwin ;; prep*:SunOS:5.*:*) SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'` GUESS=powerpcle-unknown-solaris2$SUN_REL ;; *:GNU:*:*) # the GNU system GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'` GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL ;; *:GNU/*:*:*) # other systems with GNU libc and userland GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"` GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC ;; x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-pc-managarm-mlibc" ;; *:[Mm]anagarm:*:*) GUESS="$UNAME_MACHINE-unknown-managarm-mlibc" ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __ARM_EABI__ #ifdef __ARM_PCS_VFP ABI=eabihf #else ABI=eabi #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;; esac fi GUESS=$CPU-unknown-linux-$LIBCABI ;; aarch64_be:Linux:*:*) UNAME_MACHINE=aarch64_be GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; alpha:Linux:*:*) case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in EV5) UNAME_MACHINE=alphaev5 ;; EV56) UNAME_MACHINE=alphaev56 ;; PCA56) UNAME_MACHINE=alphapca56 ;; PCA57) UNAME_MACHINE=alphapca56 ;; EV6) UNAME_MACHINE=alphaev6 ;; EV67) UNAME_MACHINE=alphaev67 ;; EV68*) UNAME_MACHINE=alphaev68 ;; esac objdump --private-headers /bin/sh | grep -q ld.so.1 if test "$?" = 0 ; then LIBC=gnulibc1 ; fi GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; arm*:Linux:*:*) set_cc_for_build if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_EABI__ then GUESS=$UNAME_MACHINE-unknown-linux-$LIBC else if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \ | grep -q __ARM_PCS_VFP then GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi else GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf fi fi ;; avr32*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; cris:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; crisv32:Linux:*:*) GUESS=$UNAME_MACHINE-axis-linux-$LIBC ;; e2k:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; frv:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; hexagon:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:Linux:*:*) GUESS=$UNAME_MACHINE-pc-linux-$LIBC ;; ia64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; k1om:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; kvx:cos:*:*) GUESS=$UNAME_MACHINE-unknown-cos ;; kvx:mbr:*:*) GUESS=$UNAME_MACHINE-unknown-mbr ;; loongarch32:Linux:*:* | loongarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m32r*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; m68*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; mips:Linux:*:* | mips64:Linux:*:*) set_cc_for_build IS_GLIBC=0 test x"${LIBC}" = xgnu && IS_GLIBC=1 sed 's/^ //' << EOF > "$dummy.c" #undef CPU #undef mips #undef mipsel #undef mips64 #undef mips64el #if ${IS_GLIBC} && defined(_ABI64) LIBCABI=gnuabi64 #else #if ${IS_GLIBC} && defined(_ABIN32) LIBCABI=gnuabin32 #else LIBCABI=${LIBC} #endif #endif #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa64r6 #else #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6 CPU=mipsisa32r6 #else #if defined(__mips64) CPU=mips64 #else CPU=mips #endif #endif #endif #if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL) MIPS_ENDIAN=el #else #if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB) MIPS_ENDIAN= #else MIPS_ENDIAN= #endif #endif EOF cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'` eval "$cc_set_vars" test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; } ;; mips64el:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; openrisc*:Linux:*:*) GUESS=or1k-unknown-linux-$LIBC ;; or32:Linux:*:* | or1k*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; padre:Linux:*:*) GUESS=sparc-unknown-linux-$LIBC ;; parisc64:Linux:*:* | hppa64:Linux:*:*) GUESS=hppa64-unknown-linux-$LIBC ;; parisc:Linux:*:* | hppa:Linux:*:*) # Look for CPU level case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;; PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;; *) GUESS=hppa-unknown-linux-$LIBC ;; esac ;; ppc64:Linux:*:*) GUESS=powerpc64-unknown-linux-$LIBC ;; ppc:Linux:*:*) GUESS=powerpc-unknown-linux-$LIBC ;; ppc64le:Linux:*:*) GUESS=powerpc64le-unknown-linux-$LIBC ;; ppcle:Linux:*:*) GUESS=powerpcle-unknown-linux-$LIBC ;; riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; s390:Linux:*:* | s390x:Linux:*:*) GUESS=$UNAME_MACHINE-ibm-linux-$LIBC ;; sh64*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sh*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; sparc:Linux:*:* | sparc64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; tile*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; vax:Linux:*:*) GUESS=$UNAME_MACHINE-dec-linux-$LIBC ;; x86_64:Linux:*:*) set_cc_for_build CPU=$UNAME_MACHINE LIBCABI=$LIBC if test "$CC_FOR_BUILD" != no_compiler_found; then ABI=64 sed 's/^ //' << EOF > "$dummy.c" #ifdef __i386__ ABI=x86 #else #ifdef __ILP32__ ABI=x32 #endif #endif EOF cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'` eval "$cc_set_abi" case $ABI in x86) CPU=i686 ;; x32) LIBCABI=${LIBC}x32 ;; esac fi GUESS=$CPU-pc-linux-$LIBCABI ;; xtensa*:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; i*86:DYNIX/ptx:4*:*) # ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. # earlier versions are messed up and put the nodename in both # sysname and nodename. GUESS=i386-sequent-sysv4 ;; i*86:UNIX_SV:4.2MP:2.*) # Unixware is an offshoot of SVR4, but it has its own version # number series starting with 2... # I am not positive that other SVR4 systems won't match this, # I just have to hope. -- rms. # Use sysv4.2uw... so that sysv4* matches it. GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION ;; i*86:OS/2:*:*) # If we were able to find 'uname', then EMX Unix compatibility # is probably installed. GUESS=$UNAME_MACHINE-pc-os2-emx ;; i*86:XTS-300:*:STOP) GUESS=$UNAME_MACHINE-unknown-stop ;; i*86:atheos:*:*) GUESS=$UNAME_MACHINE-unknown-atheos ;; i*86:syllable:*:*) GUESS=$UNAME_MACHINE-pc-syllable ;; i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*) GUESS=i386-unknown-lynxos$UNAME_RELEASE ;; i*86:*DOS:*:*) GUESS=$UNAME_MACHINE-pc-msdosdjgpp ;; i*86:*:4.*:*) UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'` if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL fi ;; i*86:*:5:[678]*) # UnixWare 7.x, OpenUNIX and OpenServer 6. case `/bin/uname -X | grep "^Machine"` in *486*) UNAME_MACHINE=i486 ;; *Pentium) UNAME_MACHINE=i586 ;; *Pent*|*Celeron) UNAME_MACHINE=i686 ;; esac GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION} ;; i*86:*:3.2:*) if test -f /usr/options/cb.name; then UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')` (/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486 (/bin/uname -X|grep '^Machine.*Pentium' >/dev/null) \ && UNAME_MACHINE=i586 (/bin/uname -X|grep '^Machine.*Pent *II' >/dev/null) \ && UNAME_MACHINE=i686 (/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \ && UNAME_MACHINE=i686 GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL else GUESS=$UNAME_MACHINE-pc-sysv32 fi ;; pc:*:*:*) # Left here for compatibility: # uname -m prints for DJGPP always 'pc', but it prints nothing about # the processor, so we play safe by assuming i586. # Note: whatever this is, it MUST be the same as what config.sub # prints for the "djgpp" host, or else GDB configure will decide that # this is a cross-build. GUESS=i586-pc-msdosdjgpp ;; Intel:Mach:3*:*) GUESS=i386-pc-mach3 ;; paragon:*:*:*) GUESS=i860-intel-osf1 ;; i860:*:4.*:*) # i860-SVR4 if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4 else # Add other i860-SVR4 vendors below as they are discovered. GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4 fi ;; mini*:CTIX:SYS*5:*) # "miniframe" GUESS=m68010-convergent-sysv ;; mc68k:UNIX:SYSTEM5:3.51m) GUESS=m68k-convergent-sysv ;; M680?0:D-NIX:5.3:*) GUESS=m68k-diab-dnix ;; M68*:*:R3V[5678]*:*) test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;; 3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0) OS_REL='' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*) /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4; exit; } ;; NCR*:*:4.2:* | MPRAS*:*:4.2:*) OS_REL='.3' test -r /etc/.relid \ && OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid` /bin/uname -p 2>/dev/null | grep 86 >/dev/null \ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } /bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;; m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*) GUESS=m68k-unknown-lynxos$UNAME_RELEASE ;; mc68030:UNIX_System_V:4.*:*) GUESS=m68k-atari-sysv4 ;; TSUNAMI:LynxOS:2.*:*) GUESS=sparc-unknown-lynxos$UNAME_RELEASE ;; rs6000:LynxOS:2.*:*) GUESS=rs6000-unknown-lynxos$UNAME_RELEASE ;; PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*) GUESS=powerpc-unknown-lynxos$UNAME_RELEASE ;; SM[BE]S:UNIX_SV:*:*) GUESS=mips-dde-sysv$UNAME_RELEASE ;; RM*:ReliantUNIX-*:*:*) GUESS=mips-sni-sysv4 ;; RM*:SINIX-*:*:*) GUESS=mips-sni-sysv4 ;; *:SINIX-*:*:*) if uname -p 2>/dev/null >/dev/null ; then UNAME_MACHINE=`(uname -p) 2>/dev/null` GUESS=$UNAME_MACHINE-sni-sysv4 else GUESS=ns32k-sni-sysv fi ;; PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort # says GUESS=i586-unisys-sysv4 ;; *:UNIX_System_V:4*:FTX*) # From Gerald Hewes . # How about differentiating between stratus architectures? -djm GUESS=hppa1.1-stratus-sysv4 ;; *:*:*:FTX*) # From seanf@swdc.stratus.com. GUESS=i860-stratus-sysv4 ;; i*86:VOS:*:*) # From Paul.Green@stratus.com. GUESS=$UNAME_MACHINE-stratus-vos ;; *:VOS:*:*) # From Paul.Green@stratus.com. GUESS=hppa1.1-stratus-vos ;; mc68*:A/UX:*:*) GUESS=m68k-apple-aux$UNAME_RELEASE ;; news*:NEWS-OS:6*:*) GUESS=mips-sony-newsos6 ;; R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*) if test -d /usr/nec; then GUESS=mips-nec-sysv$UNAME_RELEASE else GUESS=mips-unknown-sysv$UNAME_RELEASE fi ;; BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only. GUESS=powerpc-be-beos ;; BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only. GUESS=powerpc-apple-beos ;; BePC:BeOS:*:*) # BeOS running on Intel PC compatible. GUESS=i586-pc-beos ;; BePC:Haiku:*:*) # Haiku running on Intel PC compatible. GUESS=i586-pc-haiku ;; ppc:Haiku:*:*) # Haiku running on Apple PowerPC GUESS=powerpc-apple-haiku ;; *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat) GUESS=$UNAME_MACHINE-unknown-haiku ;; SX-4:SUPER-UX:*:*) GUESS=sx4-nec-superux$UNAME_RELEASE ;; SX-5:SUPER-UX:*:*) GUESS=sx5-nec-superux$UNAME_RELEASE ;; SX-6:SUPER-UX:*:*) GUESS=sx6-nec-superux$UNAME_RELEASE ;; SX-7:SUPER-UX:*:*) GUESS=sx7-nec-superux$UNAME_RELEASE ;; SX-8:SUPER-UX:*:*) GUESS=sx8-nec-superux$UNAME_RELEASE ;; SX-8R:SUPER-UX:*:*) GUESS=sx8r-nec-superux$UNAME_RELEASE ;; SX-ACE:SUPER-UX:*:*) GUESS=sxace-nec-superux$UNAME_RELEASE ;; Power*:Rhapsody:*:*) GUESS=powerpc-apple-rhapsody$UNAME_RELEASE ;; *:Rhapsody:*:*) GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE ;; arm64:Darwin:*:*) GUESS=aarch64-apple-darwin$UNAME_RELEASE ;; *:Darwin:*:*) UNAME_PROCESSOR=`uname -p` case $UNAME_PROCESSOR in unknown) UNAME_PROCESSOR=powerpc ;; esac if command -v xcode-select > /dev/null 2> /dev/null && \ ! xcode-select --print-path > /dev/null 2> /dev/null ; then # Avoid executing cc if there is no toolchain installed as # cc will be a stub that puts up a graphical alert # prompting the user to install developer tools. CC_FOR_BUILD=no_compiler_found else set_cc_for_build fi if test "$CC_FOR_BUILD" != no_compiler_found; then if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_64BIT_ARCH >/dev/null then case $UNAME_PROCESSOR in i386) UNAME_PROCESSOR=x86_64 ;; powerpc) UNAME_PROCESSOR=powerpc64 ;; esac fi # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \ grep IS_PPC >/dev/null then UNAME_PROCESSOR=powerpc fi elif test "$UNAME_PROCESSOR" = i386 ; then # uname -m returns i386 or x86_64 UNAME_PROCESSOR=$UNAME_MACHINE fi GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE ;; *:procnto*:*:* | *:QNX:[0123456789]*:*) UNAME_PROCESSOR=`uname -p` if test "$UNAME_PROCESSOR" = x86; then UNAME_PROCESSOR=i386 UNAME_MACHINE=pc fi GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE ;; *:QNX:*:4*) GUESS=i386-pc-qnx ;; NEO-*:NONSTOP_KERNEL:*:*) GUESS=neo-tandem-nsk$UNAME_RELEASE ;; NSE-*:NONSTOP_KERNEL:*:*) GUESS=nse-tandem-nsk$UNAME_RELEASE ;; NSR-*:NONSTOP_KERNEL:*:*) GUESS=nsr-tandem-nsk$UNAME_RELEASE ;; NSV-*:NONSTOP_KERNEL:*:*) GUESS=nsv-tandem-nsk$UNAME_RELEASE ;; NSX-*:NONSTOP_KERNEL:*:*) GUESS=nsx-tandem-nsk$UNAME_RELEASE ;; *:NonStop-UX:*:*) GUESS=mips-compaq-nonstopux ;; BS2000:POSIX*:*:*) GUESS=bs2000-siemens-sysv ;; DS/*:UNIX_System_V:*:*) GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE ;; *:Plan9:*:*) # "uname -m" is not consistent, so use $cputype instead. 386 # is converted to i386 for consistency with other x86 # operating systems. if test "${cputype-}" = 386; then UNAME_MACHINE=i386 elif test "x${cputype-}" != x; then UNAME_MACHINE=$cputype fi GUESS=$UNAME_MACHINE-unknown-plan9 ;; *:TOPS-10:*:*) GUESS=pdp10-unknown-tops10 ;; *:TENEX:*:*) GUESS=pdp10-unknown-tenex ;; KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*) GUESS=pdp10-dec-tops20 ;; XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*) GUESS=pdp10-xkl-tops20 ;; *:TOPS-20:*:*) GUESS=pdp10-unknown-tops20 ;; *:ITS:*:*) GUESS=pdp10-unknown-its ;; SEI:*:*:SEIUX) GUESS=mips-sei-seiux$UNAME_RELEASE ;; *:DragonFly:*:*) DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'` GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL ;; *:*VMS:*:*) UNAME_MACHINE=`(uname -p) 2>/dev/null` case $UNAME_MACHINE in A*) GUESS=alpha-dec-vms ;; I*) GUESS=ia64-dec-vms ;; V*) GUESS=vax-dec-vms ;; esac ;; *:XENIX:*:SysV) GUESS=i386-pc-xenix ;; i*86:skyos:*:*) SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'` GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL ;; i*86:rdos:*:*) GUESS=$UNAME_MACHINE-pc-rdos ;; i*86:Fiwix:*:*) GUESS=$UNAME_MACHINE-pc-fiwix ;; *:AROS:*:*) GUESS=$UNAME_MACHINE-unknown-aros ;; x86_64:VMkernel:*:*) GUESS=$UNAME_MACHINE-unknown-esx ;; amd64:Isilon\ OneFS:*:*) GUESS=x86_64-unknown-onefs ;; *:Unleashed:*:*) GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE ;; *:Ironclad:*:*) GUESS=$UNAME_MACHINE-unknown-ironclad ;; esac # Do we have a guess based on uname results? if test "x$GUESS" != x; then echo "$GUESS" exit fi # No uname command or uname output not recognized. set_cc_for_build cat > "$dummy.c" < #include #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #include #if defined(_SIZE_T_) || defined(SIGLOST) #include #endif #endif #endif int main () { #if defined (sony) #if defined (MIPSEB) /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed, I don't know.... */ printf ("mips-sony-bsd\n"); exit (0); #else #include printf ("m68k-sony-newsos%s\n", #ifdef NEWSOS4 "4" #else "" #endif ); exit (0); #endif #endif #if defined (NeXT) #if !defined (__ARCHITECTURE__) #define __ARCHITECTURE__ "m68k" #endif int version; version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`; if (version < 4) printf ("%s-next-nextstep%d\n", __ARCHITECTURE__, version); else printf ("%s-next-openstep%d\n", __ARCHITECTURE__, version); exit (0); #endif #if defined (MULTIMAX) || defined (n16) #if defined (UMAXV) printf ("ns32k-encore-sysv\n"); exit (0); #else #if defined (CMU) printf ("ns32k-encore-mach\n"); exit (0); #else printf ("ns32k-encore-bsd\n"); exit (0); #endif #endif #endif #if defined (__386BSD__) printf ("i386-pc-bsd\n"); exit (0); #endif #if defined (sequent) #if defined (i386) printf ("i386-sequent-dynix\n"); exit (0); #endif #if defined (ns32000) printf ("ns32k-sequent-dynix\n"); exit (0); #endif #endif #if defined (_SEQUENT_) struct utsname un; uname(&un); if (strncmp(un.version, "V2", 2) == 0) { printf ("i386-sequent-ptx2\n"); exit (0); } if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */ printf ("i386-sequent-ptx1\n"); exit (0); } printf ("i386-sequent-ptx\n"); exit (0); #endif #if defined (vax) #if !defined (ultrix) #include #if defined (BSD) #if BSD == 43 printf ("vax-dec-bsd4.3\n"); exit (0); #else #if BSD == 199006 printf ("vax-dec-bsd4.3reno\n"); exit (0); #else printf ("vax-dec-bsd\n"); exit (0); #endif #endif #else printf ("vax-dec-bsd\n"); exit (0); #endif #else #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname un; uname (&un); printf ("vax-dec-ultrix%s\n", un.release); exit (0); #else printf ("vax-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__) #if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__) #if defined(_SIZE_T_) || defined(SIGLOST) struct utsname *un; uname (&un); printf ("mips-dec-ultrix%s\n", un.release); exit (0); #else printf ("mips-dec-ultrix\n"); exit (0); #endif #endif #endif #if defined (alliant) && defined (i860) printf ("i860-alliant-bsd\n"); exit (0); #endif exit (1); } EOF $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` && { echo "$SYSTEM_NAME"; exit; } # Apollos put the system type in the environment. test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; } echo "$0: unable to guess system type" >&2 case $UNAME_MACHINE:$UNAME_SYSTEM in mips:Linux | mips64:Linux) # If we got here on MIPS GNU/Linux, output extra information. cat >&2 <&2 <&2 </dev/null || echo unknown` uname -r = `(uname -r) 2>/dev/null || echo unknown` uname -s = `(uname -s) 2>/dev/null || echo unknown` uname -v = `(uname -v) 2>/dev/null || echo unknown` /usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null` /bin/uname -X = `(/bin/uname -X) 2>/dev/null` hostinfo = `(hostinfo) 2>/dev/null` /bin/universe = `(/bin/universe) 2>/dev/null` /usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null` /bin/arch = `(/bin/arch) 2>/dev/null` /usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null` /usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null` UNAME_MACHINE = "$UNAME_MACHINE" UNAME_RELEASE = "$UNAME_RELEASE" UNAME_SYSTEM = "$UNAME_SYSTEM" UNAME_VERSION = "$UNAME_VERSION" EOF fi exit 1 # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: luit-20240910/other.c0000644000000000000000000002555114366574771012751 0ustar rootroot/* $XTermId: other.c,v 1.17 2023/02/01 23:47:05 tom Exp $ */ /* Copyright 2006-2013,2023 by Thomas E. Dickey Copyright (c) 2002 by Tomohiro KUBOTA Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #define EURO_10646 0x20AC int init_gbk(OtherStatePtr s) { s->gbk.mapping = LookupMapping("gbk-0", us16BIT); if (!s->gbk.mapping) return 0; s->gbk.reverse = LookupReverse(s->gbk.mapping); if (!s->gbk.reverse) return 0; s->gbk.buf = -1; return 1; } unsigned int mapping_gbk(unsigned int n, OtherStatePtr s) { unsigned int r; if (n < 128) return n; if (n == 128) return EURO_10646; r = MapCodeValue(n, s->gbk.mapping); return r; } unsigned int reverse_gbk(unsigned int n, OtherStatePtr s) { if (n < 128) return n; if (n == EURO_10646) return 128; return s->gbk.reverse->reverse(n, s->gbk.reverse->data); } int stack_gbk(unsigned c, OtherStatePtr s) { if (s->gbk.buf < 0) { if (c < 129) return (int) c; s->gbk.buf = (int) c; return -1; } else { int b; if (c < 0x40 || c == 0x7F) { s->gbk.buf = -1; return (int) c; } if (s->gbk.buf < 0xFF && c < 0xFF) b = (int) ((unsigned) (s->gbk.buf << 8) + c); else b = -1; s->gbk.buf = -1; return b; } } int init_utf8(OtherStatePtr s) { s->utf8.buf_ptr = 0; return 1; } unsigned int mapping_utf8(unsigned int n, OtherStatePtr s GCC_UNUSED) { return n; } unsigned int reverse_utf8(unsigned int n, OtherStatePtr s GCC_UNUSED) { if (n < 0x80) return n; if (n < 0x800) return 0xC080 + ((n & 0x7C0) << 2) + (n & 0x3F); if (n < 0x10000) return 0xE08080 + ((n & 0xF000) << 4) + ((n & 0xFC0) << 2) + (n & 0x3F); return 0xF0808080 + ((n & 0x1C0000) << 6) + ((n & 0x3F000) << 4) + ((n & 0xFC0) << 2) + (n & 0x3F); } int stack_utf8(unsigned c, OtherStatePtr s) { int u; if (c < 0x80) { s->utf8.buf_ptr = 0; return (int) c; } if (s->utf8.buf_ptr == 0) { if ((c & 0x40) == 0) /* Skip continuation bytes 10xx xxxx */ return -1; s->utf8.buf[s->utf8.buf_ptr++] = UChar(c); if ((c & 0x60) == 0x40) /* Starts with 110x xxxx */ s->utf8.len = 2; else if ((c & 0x70) == 0x60) /* Starts with 1110 xxxx */ s->utf8.len = 3; else if ((c & 0x78) == 0x70) /* Starts with 1111 0xxx */ s->utf8.len = 4; else s->utf8.buf_ptr = 0; return -1; } if ((c & 0x40) != 0) { /* Resync if not a continuation 10xx xxxx */ s->utf8.buf_ptr = 0; return -1; } s->utf8.buf[s->utf8.buf_ptr++] = UChar(c); if (s->utf8.buf_ptr < s->utf8.len) return -1; /* Get the next continuation byte */ switch (s->utf8.len) { case 2: u = ((s->utf8.buf[0] & 0x1F) << 6) | (s->utf8.buf[1] & 0x3F); s->utf8.buf_ptr = 0; if (u < 0x80) return -1; else return u; case 3: u = ((s->utf8.buf[0] & 0x0F) << 12) | ((s->utf8.buf[1] & 0x3F) << 6) | (s->utf8.buf[2] & 0x3F); s->utf8.buf_ptr = 0; if (u < 0x800) return -1; else return u; case 4: u = ((s->utf8.buf[0] & 0x07) << 18) | ((s->utf8.buf[1] & 0x3F) << 12) | ((s->utf8.buf[2] & 0x3F) << 6) | ((s->utf8.buf[3] & 0x3F)); s->utf8.buf_ptr = 0; if (u < 0x10000) return -1; else return u; } s->utf8.buf_ptr = 0; return -1; } #define HALFWIDTH_10646 0xFF61 #define YEN_SJIS 0x5C #define YEN_10646 0x00A5 #define OVERLINE_SJIS 0x7E #define OVERLINE_10646 0x203E int init_sjis(OtherStatePtr s) { s->sjis.x0208mapping = LookupMapping("jisx0208.1990-0", us16BIT); if (!s->sjis.x0208mapping) return 0; s->sjis.x0208reverse = LookupReverse(s->sjis.x0208mapping); if (!s->sjis.x0208reverse) return 0; s->sjis.x0201mapping = LookupMapping("jisx0201.1976-0", us16BIT); if (!s->sjis.x0201mapping) return 0; s->sjis.x0201reverse = LookupReverse(s->sjis.x0201mapping); if (!s->sjis.x0201reverse) return 0; s->sjis.buf = -1; return 1; } unsigned int mapping_sjis(unsigned int n, OtherStatePtr s) { unsigned int j1, j2, s1, s2; if (n == YEN_SJIS) return YEN_10646; if (n == OVERLINE_SJIS) return OVERLINE_10646; if (n < 0x80) return n; if (n >= 0xA0 && n <= 0xDF) return MapCodeValue(n, s->sjis.x0201mapping); s1 = ((n >> 8) & 0xFF); s2 = (n & 0xFF); j1 = (s1 << 1) - (unsigned) (s1 <= 0x9F ? 0xE0 : 0x160) - (unsigned) (s2 < 0x9F ? 1 : 0); j2 = s2 - 0x1F - (unsigned) (s2 >= 0x7F ? 1 : 0) - (unsigned) (s2 >= 0x9F ? 0x5E : 0); return MapCodeValue((j1 << 8) + j2, s->sjis.x0208mapping); } unsigned int reverse_sjis(unsigned int n, OtherStatePtr s) { unsigned int j, j1, j2, s1, s2; if (n == YEN_10646) return YEN_SJIS; if (n == OVERLINE_10646) return OVERLINE_SJIS; if (n < 0x80) return n; if (n >= HALFWIDTH_10646) return s->sjis.x0201reverse->reverse(n, s->sjis.x0201reverse->data); j = s->sjis.x0208reverse->reverse(n, s->sjis.x0208reverse->data); j1 = ((j >> 8) & 0xFF); j2 = (j & 0xFF); s1 = ((j1 - 1) >> 1) + (unsigned) ((j1 <= 0x5E) ? 0x71 : 0xB1); s2 = j2 + (unsigned) ((j1 & 1) ? ((j2 < 0x60) ? 0x1F : 0x20) : 0x7E); return (s1 << 8) + s2; } int stack_sjis(unsigned c, OtherStatePtr s) { if (s->sjis.buf < 0) { if (c < 128 || (c >= 0xA0 && c <= 0xDF)) return (int) c; s->sjis.buf = (int) c; return -1; } else { int b; if (c < 0x40 || c == 0x7F) { s->sjis.buf = -1; return (int) c; } if (s->sjis.buf < 0xFF && c < 0xFF) b = (int) ((unsigned) (s->sjis.buf << 8) + c); else b = -1; s->sjis.buf = -1; return b; } } int init_hkscs(OtherStatePtr s) { s->hkscs.mapping = LookupMapping("big5hkscs-0", us16BIT); if (!s->hkscs.mapping) return 0; s->hkscs.reverse = LookupReverse(s->hkscs.mapping); if (!s->hkscs.reverse) return 0; s->hkscs.buf = -1; return 1; } unsigned int mapping_hkscs(unsigned int n, OtherStatePtr s) { unsigned int r; if (n < 128) return n; if (n == 128) return EURO_10646; r = MapCodeValue(n, s->hkscs.mapping); return r; } unsigned int reverse_hkscs(unsigned int n, OtherStatePtr s) { if (n < 128) return n; if (n == EURO_10646) return 128; return s->hkscs.reverse->reverse(n, s->hkscs.reverse->data); } int stack_hkscs(unsigned c, OtherStatePtr s) { if (s->hkscs.buf < 0) { if (c < 129) return (int) c; s->hkscs.buf = (int) c; return -1; } else { int b; if (c < 0x40 || c == 0x7F) { s->hkscs.buf = -1; return (int) c; } if (s->hkscs.buf < 0xFF && c < 0xFF) b = (int) ((unsigned) (s->hkscs.buf << 8) + c); else b = -1; s->hkscs.buf = -1; return b; } } /* * Because of the 1 ~ 4 multi-bytes nature of GB18030. * CharSet encoding is split to 2 subset (besides latin) * The 2Bytes MB char is defined in gb18030.2000-0 * The 4Bytes MB char is defined in gb18030.2000-1 * Please note that the mapping in 2000-1 is not a 4Bytes seq => 2Bytes value * mapping. * To use the 2000-1 we need to 'linear' the 4Bytes sequence and 'lookup' the * unicode value after that. * * For more info on GB18030 standard pls check: * http://oss.software.ibm.com/icu/docs/papers/gb18030.html * * For more info on GB18030 implementation issues in XFree86 pls check: * http://www.ibm.com/developerWorks/cn/linux/i18n/gb18030/xfree86/part1 */ int init_gb18030(OtherStatePtr s) { s->gb18030.cs0_mapping = LookupMapping("gb18030.2000-0", us16BIT); if (!s->gb18030.cs0_mapping) return 0; s->gb18030.cs0_reverse = LookupReverse(s->gb18030.cs0_mapping); if (!s->gb18030.cs0_reverse) return 0; s->gb18030.cs1_mapping = LookupMapping("gb18030.2000-1", us16BIT); if (!s->gb18030.cs1_mapping) return 0; s->gb18030.cs1_reverse = LookupReverse(s->gb18030.cs1_mapping); if (!s->gb18030.cs1_reverse) return 0; s->gb18030.linear = 0; s->gb18030.buf_ptr = 0; return 1; } unsigned int mapping_gb18030(unsigned int n, OtherStatePtr s) { if (n <= 0x80) return n; /* 0x80 is valid but unassigned codepoint */ if (n >= 0xFFFF) return '?'; return MapCodeValue(n, ((s->gb18030.linear) ? s->gb18030.cs1_mapping : s->gb18030.cs0_mapping)); } unsigned int reverse_gb18030(unsigned int n, OtherStatePtr s) { /* when lookup in 2000-0 failed. */ /* lookup in 2000-1 and then try to unlinear'd */ unsigned int r; if (n <= 0x80) return n; r = s->gb18030.cs0_reverse->reverse(n, s->gb18030.cs0_reverse->data); if (r != 0) return r; r = s->gb18030.cs1_reverse->reverse(n, s->gb18030.cs1_reverse->data); if (r != 0) { unsigned char bytes[4]; bytes[3] = UChar(0x30 + r % 10); r /= 10; bytes[2] = UChar(0x81 + r % 126); r /= 126; bytes[1] = UChar(0x30 + r % 10); r /= 10; bytes[0] = UChar(0x81 + r); r = (unsigned int) bytes[0] << 24; r |= (unsigned int) bytes[1] << 16; r |= (unsigned int) bytes[2] << 8; r |= (unsigned int) bytes[3]; } return r; } int stack_gb18030(unsigned c, OtherStatePtr s) { /* if set gb18030.linear => True. the return value is "linear'd" */ if (s->gb18030.buf_ptr == 0) { if (c <= 0x80) return (int) c; if (c == 0xFF) return -1; s->gb18030.linear = 0; s->gb18030.buf[s->gb18030.buf_ptr++] = (int) c; return -1; } else if (s->gb18030.buf_ptr == 1) { if (c >= 0x40) { s->gb18030.buf_ptr = 0; if ((c == 0x80) || (c == 0xFF)) return -1; else return (int) ((unsigned) (s->gb18030.buf[0] << 8) + c); } else if (c >= 30) { /* 2Byte is (0x30 -> 0x39) */ s->gb18030.buf[s->gb18030.buf_ptr++] = (int) c; return -1; } else { s->gb18030.buf_ptr = 0; return (int) c; } } else if (s->gb18030.buf_ptr == 2) { if ((c >= 0x81) && (c <= 0xFE)) { s->gb18030.buf[s->gb18030.buf_ptr++] = (int) c; return -1; } else { s->gb18030.buf_ptr = 0; return (int) c; } } else { int r = 0; s->gb18030.buf_ptr = 0; if ((c >= 0x30) && (c <= 0x39)) { s->gb18030.linear = 1; r = (((s->gb18030.buf[0] - 0x81) * 10 + (s->gb18030.buf[1] - 0x30)) * 126 + (s->gb18030.buf[2] - 0x81)) * 10 + ((int) c - 0x30); return r; } return -1; } } luit-20240910/version.h0000644000000000000000000000022014667662460013301 0ustar rootroot/* * $XTermId: version.h,v 1.68 2024/09/09 21:14:24 tom Exp $ * * https://invisible-island.net/luit/ */ #define LUIT_VERSION "2.0-20240910" luit-20240910/parser.c0000644000000000000000000001275514326614744013115 0ustar rootroot/* $XTermId: parser.c,v 1.27 2022/10/27 23:53:08 tom Exp $ */ /* Copyright 2011-2021,2022 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #ifdef HAVE_LANGINFO_CODESET #include #endif static char keyword[MAX_KEYWORD_LENGTH]; static void skipEndOfLine(FILE *f, int c) { if (c == 0) c = getc(f); for (;;) if (c <= 0 || c == '\n') return; else c = getc(f); } static int drainWhitespace(FILE *f, int c) { if (c == 0) c = getc(f); while (c > 0 && (c == '#' || c == ' ' || c == '\t')) { if (c == '#') { skipEndOfLine(f, c); c = '\n'; break; } c = getc(f); } return (c > 0) ? c : 0; } static int getString(FILE *f, int string_end, int *c_return) { int i = 0; int c; c = getc(f); while (c > 0) { if (c == string_end) break; if (c == '\\') { c = getc(f); if (c == '\n') continue; } keyword[i++] = (char) c; if (i >= MAX_KEYWORD_LENGTH) return TOK_ERROR; c = getc(f); } if (c <= 0) return TOK_ERROR; keyword[i] = '\0'; *c_return = c; return TOK_KEYWORD; } static int getToken(FILE *f, int c, int parse_assignments, int *c_return) { int i; c = drainWhitespace(f, c); if (c < 0) return TOK_EOF; if (c == '\n') { *c_return = 0; return TOK_EOL; } if (parse_assignments && c == '=') { *c_return = 0; return TOK_EQUALS; } if (c == '\'' || c == '"') return getString(f, c, c_return); i = 0; while (c > 0 && c != ' ' && c != '\t' && c != '\n') { if (c == '\\') { c = getc(f); if (c == '\n') continue; } keyword[i++] = (char) c; if (i >= MAX_KEYWORD_LENGTH) return TOK_ERROR; c = getc(f); if (parse_assignments && c == '=') break; } *c_return = c < 0 ? 0 : c; keyword[i] = '\0'; return TOK_KEYWORD; } /* Can parse both the old and new formats for locale.alias */ static int parseTwoTokenLine(FILE *f, char *first, char *second) { int rc = 0; int c = 0; int tok; size_t len; do { tok = getToken(f, c, 0, &c); if (tok == TOK_EOF) return -1; } while (tok == TOK_EOL); if (tok != TOK_KEYWORD) { rc = -2; } else { if ((len = strlen(keyword)) != 0 && keyword[len - 1] == ':') keyword[len - 1] = '\0'; strcpy(first, keyword); tok = getToken(f, c, 0, &c); if (tok != TOK_KEYWORD) { rc = -2; } else { strcpy(second, keyword); tok = getToken(f, c, 0, &c); if (tok != TOK_EOL) { rc = -2; } } } return rc; } /* * Check if the result from locale.alias has the encoding specified. */ static int has_encoding(const char *locale) { int result = 0; if (locale != 0 && *locale != 0) { char *dot = strchr(locale, '.'); result = (dot != 0 && dot != locale && dot[1] != 0 && strchr(dot + 1, '.') == 0); } return result; } char * resolveLocale(const char *locale) { FILE *f; char first[MAX_KEYWORD_LENGTH]; char second[MAX_KEYWORD_LENGTH]; char *resolved = NULL; int rc; int found = 0; TRACE(("resolveLocale(%s)\n", NonNull(locale))); if (locale == NULL) ExitFailure(); TRACE(("...looking in %s\n", NonNull(locale_alias))); if (locale_alias == NULL) ExitFailure(); f = fopen(locale_alias, "r"); if (f != NULL) { do { rc = parseTwoTokenLine(f, first, second); if (rc < -1) break; if (!strcmp(first, locale)) { resolved = strmalloc(second); found = 1; break; } } while (rc >= 0); if (!found) { if (resolved == NULL) { TRACE(("...not found in %s\n", NonNull(locale_alias))); resolved = strmalloc(locale); } } fclose(f); } /* * If we did not find the data in the locale.alias file (or as happens with * some, the right column does not appear to specify a valid locale), see * if we can get a better result from the system's locale tables. */ if (!found || !has_encoding(resolved)) { #ifdef HAVE_LANGINFO_CODESET char *improved; if (!ignore_locale && strcmp(locale, "C") && strcmp(locale, "POSIX") && strcmp(locale, "US-ASCII") && (improved = nl_langinfo(CODESET)) != 0) { TRACE(("...nl_langinfo ->%s\n", NonNull(improved))); free(resolved); resolved = strmalloc(improved); } else #endif if (f == 0) { if ((f = fopen(locale_alias, "r")) == 0) { perror(locale_alias); } else { fclose(f); } } } TRACE(("...resolveLocale ->%s\n", NonNull(resolved))); return resolved; } luit-20240910/sys.c0000644000000000000000000003121514545120463012420 0ustar rootroot/* $XTermId: sys.c,v 1.59 2024/01/02 23:50:11 tom Exp $ */ /* Copyright 2010-2021,2024 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #ifdef HAVE_SETGROUPS #include #endif #ifdef HAVE_WORKING_POLL #ifdef HAVE_POLL_H #include #else #include #endif #undef HAVE_SELECT #endif #ifdef HAVE_SELECT #if !(defined(_MINIX) || defined(__BEOS__)) #define HAVE_WORKING_SELECT 1 #endif #endif #ifdef HAVE_WORKING_SELECT #if defined(HAVE_SYS_SELECT_H) && defined(HAVE_SYS_TIME_SELECT) #include #endif #endif #ifdef HAVE_PTY_H #include #endif #ifdef HAVE_STROPTS_H #include #endif #ifdef HAVE_SYS_PARAM_H #include #endif #ifdef HAVE_OPENPTY #if defined(HAVE_UTIL_H) #include #elif defined(HAVE_LIBUTIL_H) #include #elif defined(HAVE_PTY_H) #include #endif #endif /* HAVE_OPENPTY */ #include #include #ifdef USE_IGNORE_RC int ignore_unused; #endif #if defined(HAVE_OPENPTY) static int opened_tty = -1; #endif #if defined(I_FIND) && defined(I_PUSH) #define PUSH_FAILS(fd,name) ioctl(fd, I_FIND, name) == 0 \ && ioctl(fd, I_PUSH, name) < 0 #else #define PUSH_FAILS(fd,name) ioctl(fd, I_PUSH, name) < 0 #endif static int saved_tio_valid = 0; static struct termios saved_tio; int waitForOutput(int fd) { int ret = 0; #if defined(HAVE_WORKING_POLL) struct pollfd pfd[1]; int rc; pfd[0].fd = fd; pfd[0].events = POLLOUT; pfd[0].revents = 0; rc = poll(pfd, (nfds_t) 1, -1); if (rc < 0) { ret = -1; } else if (pfd[0].revents & (POLLOUT | POLLERR | POLLHUP)) { ret = IO_CanWrite; } else if (pfd[0].revents & (POLLNVAL)) { ret = IO_Closed; } #elif defined(HAVE_WORKING_SELECT) fd_set fds; int rc; FD_ZERO(&fds); FD_SET(fd, &fds); rc = select(FD_SETSIZE, NULL, &fds, NULL, NULL); if (rc < 0) { ret = -1; if (errno == EBADF) ret = IO_Closed; } else if (FD_ISSET(fd, &fds)) { ret = IO_CanWrite; } #else ret = IO_CanWrite; #endif return ret; } int waitForInput(int fd1, int fd2) { int ret = 0; #if defined(HAVE_WORKING_POLL) struct pollfd pfd[2]; int rc; pfd[0].fd = fd1; pfd[1].fd = fd2; pfd[0].events = pfd[1].events = POLLIN; pfd[0].revents = pfd[1].revents = 0; rc = poll(pfd, (nfds_t) 2, -1); if (rc < 0) { ret = -1; } else { if (pfd[0].revents & (POLLIN | POLLERR | POLLHUP)) ret |= IO_CanRead; if (pfd[1].revents & (POLLIN | POLLERR | POLLHUP)) ret |= IO_CanWrite; if (pfd[0].revents & (POLLNVAL)) ret |= IO_Closed; if (pfd[1].revents & (POLLNVAL)) ret |= IO_Closed; } #elif defined(HAVE_WORKING_SELECT) fd_set fds; int rc; FD_ZERO(&fds); FD_SET(fd1, &fds); FD_SET(fd2, &fds); rc = select(FD_SETSIZE, &fds, NULL, NULL, NULL); if (rc < 0) { ret = -1; if (errno == EBADF) ret = IO_Closed; } else { if (FD_ISSET(fd1, &fds)) ret |= IO_CanRead; if (FD_ISSET(fd2, &fds)) ret |= IO_CanWrite; } #else ret = (IO_CanRead | IO_CanWrite); #endif return ret; } int setWindowSize(int sfd, int dfd) { #ifdef TIOCGWINSZ int rc; struct winsize ws; TRACE(("setWindowSize sfd %d, dfd %d\n", sfd, dfd)); rc = ioctl(sfd, TIOCGWINSZ, (char *) &ws); if (rc < 0) return -1; TRACE(("...got %dx%d\n", ws.ws_row, ws.ws_col)); rc = ioctl(dfd, TIOCSWINSZ, (char *) &ws); if (rc < 0) return -1; #endif return 0; } int installHandler(int signum, void (*handler) (int)) { struct sigaction sa; sigset_t ss; int rc; sigemptyset(&ss); sa.sa_handler = handler; sa.sa_mask = ss; sa.sa_flags = 0; rc = sigaction(signum, &sa, NULL); return rc; } int copyTermios(int sfd, int dfd) { struct termios tio; int rc; #if !defined(HAVE_GRANTPT) || defined(HAVE_GRANTPT_TCSETATTR) TRACE(("copyTermios(sfd %d, dfd %d)\n", sfd, dfd)); rc = tcgetattr(sfd, &tio); if (rc < 0) { TRACE_ERR("copyTermios - tcgetattr"); } else { rc = tcsetattr(dfd, TCSAFLUSH, &tio); if (rc < 0) { TRACE_ERR("copyTermios - tcsetattr"); } } #else (void) sfd; (void) dfd; (void) tio; rc = 0; #endif return rc; } static int saveTermios(int sfd) { int rc; rc = tcgetattr(sfd, &saved_tio); if (rc >= 0) saved_tio_valid = 1; return rc; } int restoreTermios(int sfd) { if (!saved_tio_valid) return -1; return tcsetattr(sfd, TCSAFLUSH, &saved_tio); } int setRawTermios(int sfd) { struct termios tio; int rc; if (!saved_tio_valid) saveTermios(sfd); rc = tcgetattr(sfd, &tio); if (rc < 0) return rc; tio.c_lflag &= (unsigned) ~(ECHO | ICANON | IEXTEN | ISIG); tio.c_iflag &= (unsigned) ~(ICRNL | IXOFF | IXON | ISTRIP); #ifdef ONLCR tio.c_oflag &= (unsigned) ~ONLCR; #endif #ifdef OCRNL tio.c_oflag &= (unsigned) ~OCRNL; #endif #ifdef ONOCR tio.c_oflag &= (unsigned) ~ONOCR; #endif #ifdef VMIN tio.c_cc[VMIN] = 0; tio.c_cc[VTIME] = 0; #endif rc = tcsetattr(sfd, TCSAFLUSH, &tio); if (rc < 0) return rc; return 0; } char * my_basename(char *path) { char *p; p = strrchr(path, '/'); if (!p) p = path; else p++; return p; } static int fix_pty_perms(char *line) { int rc; struct stat s; rc = stat(line, &s); if (rc < 0) return -1; TRACE(("fix_pty_perms sees %s\n", NonNull(line))); TRACE(("..pty owned by %ld/%ld\n", (long) s.st_uid, (long) s.st_gid)); TRACE(("...but you are %ld/%ld\n", (long) getuid(), (long) getgid())); if (s.st_uid != getuid() || s.st_gid != getgid()) { rc = chown(line, getuid(), getgid()); if (rc < 0) { Warning("could not change ownership of tty -- " "pty is insecure!\n"); return 0; } } if ((s.st_mode & 0777) != (S_IRUSR | S_IWUSR | S_IWGRP)) { rc = chmod(line, S_IRUSR | S_IWUSR | S_IWGRP); if (rc < 0) { Warning("could not change permissions of tty -- " "pty is insecure!\n"); return 0; } } return 1; } /* * APUE2 notes that some systems lack posix_openpt(), which should be provided * when grantpt() is available. */ #ifndef HAVE_POSIX_OPENPT #undef posix_openpt #define posix_openpt(mode) open("/dev/ptmx", mode) #endif int allocatePty(int *pty_return, char **line_return) { char name[12], *line = NULL; int pty = -1; const char *name1 = "pqrstuvwxyzPQRST"; char buffer[80]; char *name2 = strcpy(buffer, "0123456789abcdefghijklmnopqrstuv"); const char *p1; char *p2; #if defined(HAVE_GRANTPT) && defined(HAVE_WORKING_GRANTPT) int rc; TRACE(("allocatePty (posix)\n")); /* * hmm - xterm does open(/dev/ptmx), grant, unlock, open(ptsname) * The second open is in child(). * xterm puts the streams setup after the second open(). */ pty = posix_openpt(O_RDWR); if (pty < 0) { TRACE_ERR("allocatePty - posix_openpt"); goto bsd; } rc = grantpt(pty); if (rc < 0) { TRACE_ERR("allocatePty - grantpt"); close(pty); goto bsd; } rc = unlockpt(pty); if (rc < 0) { TRACE_ERR("allocatePty - unlockpt"); close(pty); goto bsd; } /* if ptsname follows the streams setup, it returns null */ line = strmalloc(ptsname(pty)); if (!line) { TRACE_ERR("allocatePty - ptsname"); close(pty); goto bsd; } TRACE(("ptsname '%s'\n", NonNull(line))); fix_pty_perms(line); *pty_return = pty; *line_return = line; return 0; bsd: #elif defined(HAVE_OPENPTY) int rc; char ttydev[80]; /* OpenBSD says at least 16 bytes */ TRACE(("allocatePty (openpty)\n")); rc = openpty(&pty, &opened_tty, ttydev, NULL, NULL); if (rc < 0) { close(pty); goto bsd; } line = strmalloc(ttydev); if (!line) { close(pty); goto bsd; } fix_pty_perms(line); *pty_return = pty; *line_return = line; return 0; bsd: #endif /* HAVE_GRANTPT, etc */ TRACE(("allocatePty (bsd)\n")); strcpy(name, "/dev/pty??"); for (p1 = name1; *p1; p1++) { name[8] = *p1; for (p2 = name2; *p2; p2++) { name[9] = *p2; pty = open(name, O_RDWR); if (pty >= 0) goto found; /* Systems derived from 4.4BSD differ in their pty names, so ENOENT doesn't necessarily imply we're done. */ continue; } } goto bail; found: if ((line = strmalloc(name)) != 0) { line[5] = 't'; fix_pty_perms(line); *pty_return = pty; *line_return = line; return 0; } close(pty); bail: return -1; } int openTty(char *line) { int tty = -1; TRACE(("openTty(%s)\n", NonNull(line))); if (line == NULL) ExitFailure(); tty = open(line, O_RDWR #if defined(TIOCSCTTY) && defined(O_NOCTTY) /* * Do not make this our controlling terminal, yet just in case it fails * in some intermediate state. But do not add this flag if we haven't * the corresponding ioctl. */ | O_NOCTTY #endif ); if (tty < 0) goto bail; #if defined(HAVE_OPENPTY) if (opened_tty >= 0) { close(opened_tty); opened_tty = -1; } #endif #ifdef TIOCSCTTY /* * Now that we've successfully opened the terminal, make it the controlling * terminal. This call works only if the process does not already have a * controlling terminal. * * Cygwin as of 2009/10/12 lacks this call, but has O_NOCTTY. */ if (ioctl(tty, TIOCSCTTY, (char *) 0) < 0) { TRACE_ERR("openTty - ioctl(TIOCSCTTY)"); goto bail; } #endif /* HPUX and Solaris */ #ifdef HAVE_GRANTPT_PTEM TRACE(("...setup stream\n")); if (PUSH_FAILS(tty, "ptem")) { TRACE_ERR("openTty - push ptem"); goto bail; } #endif #ifdef HAVE_GRANTPT_LDTERM if (PUSH_FAILS(tty, "ldterm")) { TRACE_ERR("openTty - push ldterm"); goto bail; } #endif /* Solaris */ #ifdef HAVE_GRANTPT_TTCOMPAT if (PUSH_FAILS(tty, "ttcompat")) { TRACE_ERR("openTty - push ttcompat"); goto bail; } #endif return tty; bail: if (tty >= 0) close(tty); return -1; } /* Post-4.4 BSD systems have POSIX semantics (_POSIX_SAVED_IDS or not, depending on the version). 4.3BSD and Minix do not have saved IDs at all, so there's no issue. */ int droppriv(void) { int rc; #if (defined(BSD) && !defined(_POSIX_SAVED_IDS)) || defined(_MINIX) rc = setuid(getuid()); if (rc >= 0) { rc = setgid(getgid()); } #elif defined(_POSIX_SAVED_IDS) uid_t uid = getuid(); uid_t euid = geteuid(); gid_t gid = getgid(); gid_t egid = getegid(); if ((uid != euid || gid != egid) && euid != 0) { errno = ENOSYS; rc = -1; } else { #ifdef HAVE_SETGROUPS setgroups(0, NULL); #endif rc = setgid(gid); if (rc >= 0) rc = setuid(uid); } #else uid_t uid = getuid(); uid_t euid = geteuid(); gid_t gid = getgid(); gid_t egid = getegid(); if (uid != euid || gid != egid) { errno = ENOSYS; rc = -1; } else { rc = 0; } #endif return rc; } #ifndef HAVE_STRCASECMP int my_strcasecmp(const char *a, const char *b) { while (*a != '\0' && *b != '\0') { int p = toupper(*a++); int q = toupper(*b++); int r; if ((r = p - q) != 0) return r; } return *a - *b; } #endif char * strmalloc(const char *value) { char *result = 0; if (value != 0) { #ifdef HAVE_STRDUP result = strdup(value); #else result = malloc(strlen(value) + 1); if (result != 0) strcpy(result, value); #endif } return result; } #ifdef NO_LEAKS void ExitProgram(int code) { TRACE(("ExitProgram %d\n", code)); luit_leaks(); iso2022_leaks(); charset_leaks(); fontenc_leaks(); #ifdef USE_ICONV luitconv_leaks(); #endif exit(code); } #endif luit-20240910/package/0000755000000000000000000000000014670147101013024 5ustar rootrootluit-20240910/package/luit.spec0000644000000000000000000000340614667527645014705 0ustar rootrootSummary: Locale and ISO 2022 support for Unicode terminals %define AppProgram luit %define AppVersion 20240910 %define UseProgram b%{AppProgram} # $XTermId: luit.spec,v 1.73 2024/09/09 08:19:49 tom Exp $ Name: %{UseProgram} Version: %{AppVersion} Release: 1 License: MIT Group: Applications/System URL: https://invisible-island.net/%{name}/ Source0: %{AppProgram}-%{AppVersion}.tgz %description Luit is a filter that can be run between an arbitrary application and a UTF-8 terminal emulator. It will convert application output from the locale's encoding into UTF-8, and convert terminal input from UTF-8 into the locale's encoding. This package installs an alternative binary "bluit", and adds a symbolic link for "xterm-filter". %prep %define debug_package %{nil} %setup -q -n %{AppProgram}-%{AppVersion} %build INSTALL_PROGRAM='${INSTALL}' \ %configure \ --program-prefix=b \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT ( cd $RPM_BUILD_ROOT%{_bindir} && ln -s %{UseProgram} xterm-filter ) ( cd $RPM_BUILD_ROOT%{_mandir}/man1 && ln -s %{UseProgram}.1 xterm-filter.1 ) strip $RPM_BUILD_ROOT%{_bindir}/%{UseProgram} %files %defattr(-,root,root) %doc %{AppProgram}.log.html %{_prefix}/bin/%{UseProgram} %{_prefix}/bin/xterm-filter %{_mandir}/man1/* %changelog # each patch should add its ChangeLog entries here * Tue Jan 11 2022 Thomas Dickey - update URL, install package as "bluit" * Sat Jun 05 2010 Thomas Dickey - Fixes/improvements for FreeBSD and Solaris * Mon May 31 2010 Thomas Dickey - initial version luit-20240910/package/detest/0000755000000000000000000000000014670147101014314 5ustar rootrootluit-20240910/package/detest/copyright0000644000000000000000000001102214544752011016245 0ustar rootrootFormat: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: luit Upstream-Contact: Thomas Dickey Source: https://invisible-island.net/luit/ Files: * Copyright: 2006-2023,2024 by Thomas E. Dickey License: X11 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Files: luit.c Copyright: 2001 by Juliusz Chroboczek 2002 by Tomohiro KUBOTA License: X11 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Files: install-sh Copyright: 1994 X Consortium License: X11 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. . Except as contained in this notice, the name of the X Consortium shall not be used in advertising or otherwise to promote the sale, use or other deal- ings in this Software without prior written authorization from the X Consor- tium. . FSF changes to this file are in the public domain. . Calling this script install-sh is preferred over install.sh, to prevent `make' implicit rules from creating a file called install from it when there is no Makefile. . This script is compatible with the BSD install script, but was written from scratch. It can only install one file at a time, a restriction shared with many OS's install programs. Files: config.guess config.sub Copyright: 1992-2020 Free Software Foundation, Inc. License: GPL-3 On Debian systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-3' luit-20240910/package/detest/postinst0000644000000000000000000000110314670147101016115 0ustar rootroot#!/bin/sh # $XTermId: postinst,v 1.5 2024/09/10 22:54:57 tom Exp $ set -e if [ "$1" = "configure" ] ; then PRI=50 ALT=xterm-filter # add this package, and related packages (which should "own" this) # (cocot needs a wrapper script, too, for compatibility with luit). for PKG in bluit luit cocot do if test -f /usr/bin/$PKG then update-alternatives \ --verbose \ --install /usr/bin/$ALT $ALT \ /usr/bin/$PKG $PRI \ --slave /usr/share/man/man1/$ALT.1.gz $ALT.1.gz \ /usr/share/man/man1/$PKG.1.gz PRI=`expr $PRI - 10` fi done fi #DEBHELPER# luit-20240910/package/detest/prerm0000644000000000000000000000023714167415017015373 0ustar rootroot#!/bin/sh set -e ALT=xterm-filter PKG=bluit case "$1" in remove|deconfigure) update-alternatives --quiet --remove $ALT /usr/bin/$PKG ;; esac #DEBHELPER# luit-20240910/package/detest/rules0000755000000000000000000000246114545114172015402 0ustar rootroot#!/usr/bin/make -f # $XTermId: rules,v 1.7 2024/01/02 23:12:58 tom Exp $ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 SHELL = /bin/bash DPKG_EXPORT_BUILDFLAGS = 1 export DEB_BUILD_MAINT_OPTIONS := hardening=+all qa=+bug reproducible=+all include /usr/share/dpkg/buildflags.mk DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) config.status: configure dh_testdir ./configure \ --program-prefix=b \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man build: build-stamp build-stamp: config.status dh_testdir $(MAKE) touch $@ clean: dh_testdir dh_testroot rm -f build-stamp [ ! -f Makefile ] || $(MAKE) clean rm -f config.log config.h Makefile config.status dh_clean install: build dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) prefix=$(CURDIR)/debian/bluit/usr install binary-indep: build install binary-arch: build install dh_testdir dh_testroot dh_installchangelogs luit.log.html dh_installdocs dh_installman dh_strip dh_compress dh_fixperms dh_installdeb dh_shlibdeps dh_gencontrol dh_md5sums dh_builddeb binary: binary-indep binary-arch .PHONY: build clean binary-indep binary-arch binary install luit-20240910/package/detest/control0000644000000000000000000000170114667662475015744 0ustar rootrootSource: bluit Section: utils Priority: optional Standards-Version: 4.6.0.1 Maintainer: Thomas E. Dickey Homepage: https://invisible-island.net/luit/ Build-Depends: debhelper-compat (= 13), libfontenc-dev, pkg-config, xutils-dev, zlib1g Package: bluit Provides: luit Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: locale and ISO 2022 support for Unicode terminals Luit is a filter that can be run between an arbitrary application and a UTF-8 terminal emulator. It will convert application output from the locale's encoding into UTF-8, and convert terminal input from UTF-8 into the locale's encoding. . This package installs an alternative binary "bluit", and adds it to the Debian alternatives via "xterm-filter". . This is version 2.0 of luit, which can use encoding information from either the font-encoding library, or the standard locale support in the C runtime library. luit-20240910/package/detest/source/0000755000000000000000000000000011410226414015606 5ustar rootrootluit-20240910/package/detest/source/format0000644000000000000000000000001511410226414017015 0ustar rootroot3.0 (native) luit-20240910/package/detest/source/options0000644000000000000000000000002611306042373017226 0ustar rootrootcompression-level = 9 luit-20240910/package/detest/watch0000644000000000000000000000021714167365211015352 0ustar rootrootversion=4 opts=pgpsigurlmangle=s/.*/$0.asc/,\ dversionmangle=s/^2\.0\+(\d+)/$1/ \ https://invisible-mirror.net/archives/luit/luit-(\d+)\.tgz luit-20240910/package/detest/changelog0000644000000000000000000000750114667527645016216 0ustar rootrootbluit (2.0+20240910) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 09 Sep 2024 04:19:49 -0400 bluit (2.0+20240102) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 02 Jan 2024 03:57:20 -0500 bluit (2.0+20230201) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 01 Feb 2023 18:19:21 -0500 bluit (2.0+20221028) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 26 Oct 2022 19:01:39 -0400 bluit (2.0+20220111) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 11 Jan 2022 17:58:31 -0500 bluit (20210218) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Thu, 18 Feb 2021 09:51:57 -0500 bluit (20210214) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 14 Feb 2021 10:05:46 -0500 bluit (20210120) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 19 Jan 2021 17:32:15 -0500 bluit (20210114) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 13 Jan 2021 04:18:44 -0500 bluit (20201003) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 03 Oct 2020 08:31:20 -0400 bluit (20191231) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 31 Dec 2019 16:30:54 -0500 bluit (20190106) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 06 Jan 2019 15:13:47 -0500 bluit (20181211) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 11 Dec 2018 04:25:31 -0500 bluit (20180628) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 26 Jun 2018 05:17:17 -0400 bluit (20160508) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 04 May 2016 18:54:17 -0400 bluit (20150706) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 06 Jul 2015 17:48:21 -0400 bluit (20141204) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 03 Dec 2014 05:24:09 -0500 bluit (20130217) unstable; urgency=low * deprecate fontenc library in favor of iconv * other improvements/new features * fix window-size for pty-losing platforms * code cleanup with Coverity and Clang -- Thomas E. Dickey Wed, 09 Jan 2013 20:02:46 -0500 bluit (20121014) unstable; urgency=low * fix reported regression in -encoding option -- Thomas E. Dickey Mon, 01 Oct 2012 05:10:34 -0400 bluit (20120129) unstable; urgency=low * portability fixes -- Thomas E. Dickey Tue, 24 Jan 2012 20:09:41 -0500 bluit (20111030) unstable; urgency=low * improve ability to use custom-defined locales * portability fixes -- Thomas E. Dickey Fri, 21 Oct 2011 07:47:33 -0400 bluit (20101128) unstable; urgency=low * add support for iconv, as a configure alternative to fontenc. -- Thomas E. Dickey Tue, 23 Nov 2010 09:25:48 -0500 bluit (20100605) unstable; urgency=low * Fixes/improvements for FreeBSD and Solaris -- Thomas E. Dickey Sat, 05 Jun 2010 08:26:43 -0400 bluit (20100601) unstable; urgency=high * Initial package release -- Thomas E. Dickey Mon, 31 May 2010 09:43:57 -0400 luit-20240910/parser.h0000644000000000000000000000272311053370446013104 0ustar rootroot/* $XTermId: parser.h,v 1.3 2008/08/21 22:50:14 tom Exp $ */ /* Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUIT_PARSER_H #define LUIT_PARSER_H 1 #ifndef LOCALE_ALIAS_FILE #define LOCALE_ALIAS_FILE "/usr/X11R6/lib/X11/locale/locale.alias" #endif #define MAX_KEYWORD_LENGTH 1024 #define TOK_ERROR (-2) #define TOK_EOF (-1) #define TOK_EOL 0 #define TOK_EQUALS 1 #define TOK_KEYWORD 2 char *resolveLocale(const char *locale); #endif /* LUIT_PARSER_H */ luit-20240910/trace.c0000644000000000000000000000300213414465254012675 0ustar rootroot/* $XTermId: trace.c,v 1.7 2019/01/06 20:53:00 tom Exp $ */ /* Copyright 2010-2011,2019 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include void Trace(const char *fmt, ...) { static pid_t first_pid; static FILE *fp = 0; va_list ap; if (first_pid == 0) first_pid = getpid(); if (fp == 0) fp = fopen("Trace.out", "w"); va_start(ap, fmt); if (getpid() != first_pid) fprintf(fp, "child:"); vfprintf(fp, fmt, ap); fflush(fp); va_end(ap); } luit-20240910/luit.c0000644000000000000000000005301714327021616012561 0ustar rootroot/* $XTermId: luit.c,v 1.75 2022/10/28 18:46:38 tom Exp $ */ /* Copyright 2010-2021,2022 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #include #include #include #include #include #include #include #include #include static int pipe_option = 0; static int p2c_waitpipe[2]; static int c2p_waitpipe[2]; static Iso2022Ptr inputState = NULL, outputState = NULL; static char *child_argv0 = NULL; static const char *locale_name = NULL; static int exitOnChild = 0; static int converter = 0; static int testonly = 0; static int warnings = 0; const char *locale_alias = LOCALE_ALIAS_FILE; int ilog = -1; int olog = -1; int verbose = 0; int ignore_locale = 0; int fill_fontenc = 0; #ifdef USE_ICONV UM_MODE lookup_order[] = { umFONTENC, umBUILTIN, umICONV, umPOSIX, umNONE }; #endif static volatile int sigwinch_queued = 0; static volatile int sigchld_queued = 0; static int convert(int, int); static int condom(int, char **); static void child(int sfd, char *, char *, char *const *); void Message(const char *f, ...) { va_list args; va_start(args, f); vfprintf(stderr, f, args); va_end(args); } void Warning(const char *f, ...) { va_list args; va_start(args, f); fputs("Warning: ", stderr); vfprintf(stderr, f, args); va_end(args); ++warnings; } void FatalError(const char *f, ...) { va_list args; va_start(args, f); vfprintf(stderr, f, args); va_end(args); ExitFailure(); } static void help(const char *program, int fatal) { #define DATA(name,mark,what) { #mark name, what } /* *INDENT-OFF* */ static const struct { const char *name; const char *value; } options[] = { /* sorted per POSIX */ DATA("V", -, "show version"), DATA("alias filename", -, "location of the locale alias file"), DATA("argv0 name", -, "set child's name"), DATA("c", -, "simple converter stdin/stdout"), DATA("encoding encoding", -, "use this encoding rather than current locale's encoding"), DATA("fill-fontenc", -, "fill in one-one mapping in -show-fontenc report"), DATA("g0 set", -, "set output G0 charset (default ASCII)"), DATA("g1 set", -, "set output G1 charset"), DATA("g2 set", -, "set output G2 charset"), DATA("g3 set", -, "set output G3 charset"), DATA("gl gn", -, "set output GL charset"), DATA("gr gk", -, "set output GR charset"), DATA("h", -, "show this message"), DATA("ilog filename", -, "log all input to this file"), DATA("k7", -, "generate 7-bit characters for input"), DATA("kg0 set", -, "set input G0 charset"), DATA("kg1 set", -, "set input G1 charset"), DATA("kg2 set", -, "set input G2 charset"), DATA("kg3 set", -, "set input G3 charset"), DATA("kgl gn", -, "set input GL charset"), DATA("kgr gk", -, "set input GR charset"), DATA("kls", -, "generate locking shifts SI/SO"), DATA("kss", +, "disable generation of single-shifts for input"), DATA("kssgr", +, "use GL after single-shift"), DATA("list", -, "list encodings recognized by this program"), DATA("list-builtin", -, "list built-in encodings"), DATA("list-fontenc", -, "list available \".enc\" encoding files"), DATA("list-iconv", -, "list iconv-supported encodings"), DATA("olog filename", -, "log all output to this file"), DATA("ols", +, "disable locking-shifts in output"), DATA("osl", +, "disable charset-selection sequences in output"), DATA("oss", +, "disable single-shifts in output"), DATA("ot", +, "disable interpretation of all sequences in output"), DATA("p", -, "do parent/child handshake"), DATA("prefer list", -, "override preference between fontenc/iconv lookups"), DATA("show-builtin enc", -, "show details of a given built-in encoding"), DATA("show-fontenc enc", -, "show details of an \".enc\" encoding file"), DATA("show-iconv enc", -, "show iconv encoding in \".enc\" format"), DATA("t", -, "testing (initialize locale but no terminal)"), DATA("v", -, "verbose (repeat to increase level)"), DATA("x", -, "exit as soon as child dies"), DATA("-", -, "end of options"), }; /* *INDENT-ON* */ size_t n; size_t col, now; FILE *fp = fatal ? stderr : stdout; if (fatal) { col = 0; fprintf(fp, "%s\n", program); for (n = 0; n < SizeOf(options); ++n) { if (col == 0) { fprintf(fp, " "); col = 1; } now = strlen(options[n].name) + 5; col += now; if (col > MAXCOLS) { fprintf(fp, "\n "); col = now + 1; } fprintf(fp, " [ %s ]", options[n].name); } if (col) fprintf(fp, "\n"); fprintf(fp, " [ program [ args ] ]\n"); } else { fprintf(fp, "Usage: %s [options] [ program [ args ] ]\n", program); fprintf(fp, "\n"); fprintf(fp, "Options:\n"); col = 0; for (n = 0; n < SizeOf(options); ++n) { now = strlen(options[n].name); if (now > col) col = now; } for (n = 0; n < SizeOf(options); ++n) { fprintf(fp, " %-*s %s\n", (int) col, options[n].name, options[n].value); } } fflush(fp); if (fatal) ExitFailure(); } #ifdef USE_ICONV static void setLookupOrder(const char *name) { /* *INDENT-OFF* */ static const struct { UM_MODE order; const char *name; } table[] = { { umBUILTIN, "builtin" }, { umFONTENC, "fontenc" }, { umICONV, "iconv" }, { umPOSIX, "posix" }, }; /* *INDENT-ON* */ size_t j, k; char *toparse = strmalloc(name); char *tomatch = toparse; char *token; UM_MODE new_list[SizeOf(lookup_order)]; size_t limit = SizeOf(lookup_order) - 1; size_t used = 0; TRACE(("setLookupOrder(%s)\n", NonNull(name))); while ((token = strtok(tomatch, ",")) != 0) { UM_MODE order = umNONE; size_t length = strlen(token); tomatch = 0; for (j = 0; j < SizeOf(table); ++j) { if (length <= strlen(table[j].name) && !strncmp(token, table[j].name, length)) { order = table[j].order; break; } } if (order == umNONE) { FatalError("invalid item in -prefer option: %s\n", token); } if (used >= limit) { FatalError("too many items in -prefer option: %s\n", name); } new_list[used++] = order; } while (used < limit) { for (j = 0; j < limit; ++j) { int found = 0; for (k = 0; k < used; ++k) { if (lookup_order[j] == new_list[k]) { ++found; } } if (!found) { new_list[used++] = lookup_order[j]; } else if (found > 1) { FatalError("repeated keyword in -prefer option: %s\n", name); } } } VERBOSE(1, ("Lookup order: ")); for (j = 0; j < limit; ++j) { lookup_order[j] = new_list[j]; if (verbose) { for (k = 0; k < SizeOf(table); ++k) { if (table[k].order == lookup_order[j]) { if (j) VERBOSE(1, (",")); VERBOSE(1, ("%s", table[k].name)); break; } } } } VERBOSE(1, ("\n")); free(toparse); } #else static int needIconvCfg(void) { Message("You need the iconv configuration for this option\n"); return EXIT_FAILURE; } #define reportBuiltinCharsets() needIconvCfg() #define reportIconvCharsets() needIconvCfg() #define setLookupOrder(name) needIconvCfg() #define showBuiltinCharset(name) needIconvCfg() #define showIconvCharset(name) needIconvCfg() #endif static char * needParam(int argc, char **argv, int now) { if (now + 1 >= argc) FatalError("%s requires an argument\n", argv[now]); return (argv[now + 1]); } #define getParam(now) needParam(argc, argv, now) static int parseOptions(int argc, char **argv) { int i = 1; while (i < argc) { if (argv[i][0] != '-' && argv[i][0] != '+') { break; } else if (!strcmp(argv[i], "--")) { i++; break; } else if (!strcmp(argv[i], "-v")) { verbose++; i++; } else if (!strcmp(argv[i], "-V")) { printf("%s - %s\n", argv[0], LUIT_VERSION); ExitSuccess(); } else if (!strcmp(argv[i], "-h")) { help(argv[0], 0); ExitSuccess(); } else if (!strcmp(argv[i], "-list")) { reportCharsets(); ExitSuccess(); } else if (!strcmp(argv[i], "-fill-fontenc")) { fill_fontenc = 1; i++; } else if (!strcmp(argv[i], "-prefer")) { setLookupOrder(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-show-builtin")) { ExitProgram(showBuiltinCharset(getParam(i))); } else if (!strcmp(argv[i], "-show-fontenc")) { ExitProgram(showFontencCharset(getParam(i))); } else if (!strcmp(argv[i], "-show-iconv")) { ExitProgram(showIconvCharset(getParam(i))); } else if (!strcmp(argv[i], "-list-builtin")) { ExitProgram(reportBuiltinCharsets()); } else if (!strcmp(argv[i], "-list-fontenc")) { ExitProgram(reportFontencCharsets()); } else if (!strcmp(argv[i], "-list-iconv")) { ExitProgram(reportIconvCharsets()); } else if (!strcmp(argv[i], "+oss")) { outputState->outputFlags &= ~OF_SS; i++; } else if (!strcmp(argv[i], "+ols")) { outputState->outputFlags &= ~OF_LS; i++; } else if (!strcmp(argv[i], "+osl")) { outputState->outputFlags &= ~OF_SELECT; i++; } else if (!strcmp(argv[i], "+ot")) { outputState->outputFlags = OF_PASSTHRU; i++; } else if (!strcmp(argv[i], "-k7")) { inputState->inputFlags &= ~IF_EIGHTBIT; i++; } else if (!strcmp(argv[i], "+kss")) { inputState->inputFlags &= ~IF_SS; i++; } else if (!strcmp(argv[1], "+kssgr")) { inputState->inputFlags &= ~IF_SSGR; i++; } else if (!strcmp(argv[i], "-kls")) { inputState->inputFlags |= IF_LS; i++; } else if (!strcmp(argv[i], "-g0")) { G0(outputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-g1")) { G1(outputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-g2")) { G2(outputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-g3")) { G3(outputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-gl")) { int j; if (strlen(getParam(i)) != 2 || argv[i + 1][0] != 'g') j = -1; else j = argv[i + 1][1] - '0'; if (j < 0 || j > 3) FatalError("The argument of -gl " "should be one of g0 through g3,\n" "not %s\n", argv[i + 1]); else outputState->glp = &outputState->g[j]; i += 2; } else if (!strcmp(argv[i], "-gr")) { int j; if (strlen(getParam(i)) != 2 || argv[i + 1][0] != 'g') j = -1; else j = argv[i + 1][1] - '0'; if (j < 0 || j > 3) FatalError("The argument of -gl " "should be one of g0 through g3,\n" "not %s\n", argv[i + 1]); else outputState->grp = &outputState->g[j]; i += 2; } else if (!strcmp(argv[i], "-kg0")) { G0(inputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-kg1")) { G1(inputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-kg2")) { G2(inputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-kg3")) { G3(inputState) = getCharsetByName(getParam(i)); i += 2; } else if (!strcmp(argv[i], "-kgl")) { int j; if (strlen(getParam(i)) != 2 || argv[i + 1][0] != 'g') j = -1; else j = argv[i + 1][1] - '0'; if (j < 0 || j > 3) FatalError("The argument of -kgl " "should be one of g0 through g3,\n" "not %s\n", argv[i + 1]); else inputState->glp = &inputState->g[j]; i += 2; } else if (!strcmp(argv[i], "-kgr")) { int j; if (strlen(getParam(i)) != 2 || argv[i + 1][0] != 'g') j = -1; else j = argv[i + 1][1] - '0'; if (j < 0 || j > 3) FatalError("The argument of -kgl " "should be one of g0 through g3,\n" "not %s\n", argv[i + 1]); else inputState->grp = &inputState->g[j]; i += 2; } else if (!strcmp(argv[i], "-argv0")) { child_argv0 = getParam(i); i += 2; } else if (!strcmp(argv[i], "-x")) { exitOnChild = 1; i++; } else if (!strcmp(argv[i], "-c")) { converter = 1; i++; } else if (!strcmp(argv[i], "-ilog")) { if (ilog >= 0) close(ilog); ilog = open(getParam(i), O_WRONLY | O_CREAT | O_TRUNC, 0777); if (ilog < 0) { perror("Couldn't open input log"); ExitFailure(); } i += 2; } else if (!strcmp(argv[i], "-olog")) { if (olog >= 0) close(olog); olog = open(getParam(i), O_WRONLY | O_CREAT | O_TRUNC, 0777); if (olog < 0) { perror("Couldn't open output log"); ExitFailure(); } i += 2; } else if (!strcmp(argv[i], "-alias")) { locale_alias = getParam(i); i += 2; } else if (!strcmp(argv[i], "-encoding")) { locale_name = getParam(i); ignore_locale = 1; i += 2; } else if (!strcmp(argv[i], "-p")) { pipe_option = 1; i += 1; } else if (!strcmp(argv[i], "-t")) { ++testonly; i += 1; } else { Message("Unknown option %s\n", argv[i]); help(argv[0], 1); } } return i; } static char * getShell(void) { const char *shell; if ((shell = getenv("SHELL")) == 0) shell = "/bin/sh"; return strmalloc(shell); } static int isSpecialCommand(int argc, char **argv) { int result = 0; if (argc == 1) { size_t len = strlen(argv[0]); size_t chk = strcspn(argv[0], "~`!$^&*(){}|\\<>?\"' \t"); if (len != chk) { result = 1; } } return result; } static int parseArgs(int argc, char **argv, char *argv0, char **path_return, char ***argv_return) { char *path = NULL; char **child_argv = NULL; if (argc <= 0) { if ((path = getShell()) == NULL) { goto bail; } child_argv = malloc(2 * sizeof(char *)); if (!child_argv) goto bail; if (argv0) child_argv[0] = argv0; else child_argv[0] = my_basename(path); child_argv[1] = NULL; } else if (isSpecialCommand(argc, argv)) { path = strmalloc("sh"); child_argv = malloc(4 * sizeof(char *)); child_argv[0] = argv0 ? argv0 : path; child_argv[1] = strmalloc("-c"); child_argv[2] = argv[0]; child_argv[3] = NULL; } else { path = strmalloc(argv[0]); if (!path) goto bail; child_argv = malloc((unsigned) (argc + 1) * sizeof(char *)); if (!child_argv) { goto bail; } if (child_argv0) child_argv[0] = argv0; else child_argv[0] = my_basename(argv[0]); memcpy(child_argv + 1, argv + 1, (unsigned) (argc - 1) * sizeof(char *)); child_argv[argc] = NULL; } *path_return = path; *argv_return = child_argv; return 0; bail: free(path); return -1; } int main(int argc, char **argv) { int rc; int i; char *l; #ifdef HAVE_PUTENV if ((l = strmalloc("NCURSES_NO_UTF8_ACS=1")) != 0) putenv(l); #endif l = setlocale(LC_ALL, ""); if (!l) Warning("couldn't set locale.\n"); TRACE(("setlocale ->%s\n", NonNull(l))); inputState = allocIso2022(); if (!inputState) FatalError("Couldn't create input state\n"); outputState = allocIso2022(); if (!outputState) FatalError("Couldn't create output state\n"); if (l) { locale_name = setlocale(LC_CTYPE, NULL); } else { locale_name = getenv("LC_ALL"); if (locale_name == NULL) { locale_name = getenv("LC_CTYPE"); if (locale_name == NULL) { locale_name = getenv("LANG"); } } } if (locale_name == NULL) { Message("Couldn't get locale name -- using C\n"); locale_name = "C"; } i = parseOptions(argc, argv); if (i < 0) FatalError("Couldn't parse options\n"); rc = initIso2022(locale_name, NULL, outputState); if (rc < 0) FatalError("Couldn't init output state\n"); rc = mergeIso2022(inputState, outputState); if (verbose) { reportIso2022("Input", inputState); } if (rc < 0) FatalError("Couldn't init input state\n"); if (testonly) { if (testonly > 1) { rc += warnings; } } else { if (converter) rc = convert(STDIN_FILENO, STDOUT_FILENO); else rc = condom(argc - i, argv + i); } #ifdef NO_LEAKS ExitProgram(rc); #endif return rc; } static int convert(int ifd, int ofd) { int rc, i; unsigned char buf[BUFFER_SIZE]; rc = droppriv(); if (rc < 0) { perror("Couldn't drop privileges"); ExitFailure(); } while (1) { i = (int) read(ifd, buf, (size_t) BUFFER_SIZE); if (i <= 0) { if (i < 0) { perror("Read error"); ExitFailure(); } break; } copyOut(outputState, ofd, buf, (unsigned) i); } return 0; } #ifdef SIGWINCH static void sigwinchHandler(int sig GCC_UNUSED) { sigwinch_queued = 1; } #endif static void sigchldHandler(int sig GCC_UNUSED) { sigchld_queued = 1; } static int setup_io(int sfd, int pty) { int rc; int val; TRACE(("setup_io pty %d (isatty:%d)\n", pty, isatty(pty))); #ifdef SIGWINCH installHandler(SIGWINCH, sigwinchHandler); #endif installHandler(SIGCHLD, sigchldHandler); rc = copyTermios(sfd, pty); if (rc < 0) FatalError("Couldn't copy terminal settings\n"); rc = setRawTermios(sfd); if (rc < 0) FatalError("Couldn't set terminal to raw\n"); val = fcntl(sfd, F_GETFL, 0); if (val >= 0) { (void) fcntl(sfd, F_SETFL, val | O_NONBLOCK); } val = fcntl(pty, F_GETFL, 0); if (val >= 0) { (void) fcntl(pty, F_SETFL, val | O_NONBLOCK); } setWindowSize(sfd, pty); return rc; } static void cleanup_io(int sfd, int pty) { int val; #ifdef SIGWINCH installHandler(SIGWINCH, SIG_DFL); #endif installHandler(SIGCHLD, SIG_DFL); val = fcntl(sfd, F_GETFL, 0); if (val >= 0) { (void) fcntl(sfd, F_SETFL, val & ~O_NONBLOCK); } val = fcntl(pty, F_GETFL, 0); if (val >= 0) { (void) fcntl(pty, F_SETFL, val & ~O_NONBLOCK); } } static void close_waitpipe(int which) { close(p2c_waitpipe[which]); close(c2p_waitpipe[!which]); } static void write_waitpipe(int fds[2]) { IGNORE_RC(write(fds[1], "1", (size_t) 1)); } static void read_waitpipe(int fds[2]) { char tmp[10]; IGNORE_RC(read(fds[0], tmp, (size_t) 1)); } static void child(int sfd, char *line, char *path, char *const argv[]) { int tty; int pgrp; TRACE(("child %s\n", NonNull(path))); if (path == NULL) ExitFailure(); pgrp = setsid(); if (pgrp < 0) { kill(getppid(), SIGABRT); ExitFailure(); } tty = openTty(line); if (tty < 0) { kill(getppid(), SIGABRT); ExitFailure(); } if (pipe_option) { write_waitpipe(c2p_waitpipe); } setWindowSize(sfd, tty); close(STDIN_FILENO); if (tty != STDIN_FILENO) dup2(tty, STDIN_FILENO); close(STDOUT_FILENO); if (tty != STDOUT_FILENO) dup2(tty, STDOUT_FILENO); close(STDERR_FILENO); if (tty != STDERR_FILENO) dup2(tty, STDERR_FILENO); if (tty > 2) close(tty); if (pipe_option) { read_waitpipe(p2c_waitpipe); close_waitpipe(0); } execvp(path, argv); perror(path); ExitFailure(); } static void parent(int sfd, int pty) { unsigned char buf[BUFFER_SIZE]; int i; int rc; if (pipe_option) { read_waitpipe(c2p_waitpipe); } if (verbose) { reportIso2022("Output", outputState); } setup_io(sfd, pty); if (pipe_option) { write_waitpipe(p2c_waitpipe); close_waitpipe(1); } for (;;) { rc = waitForInput(sfd, pty); if (sigwinch_queued) { sigwinch_queued = 0; setWindowSize(sfd, pty); } if (sigchld_queued && exitOnChild) break; if (rc > 0) { if (rc & IO_Closed) { break; } if (rc & IO_CanWrite) { i = (int) read(pty, buf, (size_t) BUFFER_SIZE); if ((i == 0) || ((i < 0) && (errno != EAGAIN))) break; if (i > 0) copyOut(outputState, sfd, buf, (unsigned) i); } if (rc & IO_CanRead) { i = (int) read(sfd, buf, (size_t) BUFFER_SIZE); if ((i == 0) || ((i < 0) && (errno != EAGAIN))) break; if (i > 0) copyIn(inputState, pty, buf, i); } } } restoreTermios(sfd); cleanup_io(sfd, pty); } static int condom(int argc, char **argv) { int pty; int pid; char *line; char *path = 0; char **child_argv = 0; int rc; int sfd = STDIN_FILENO; rc = parseArgs(argc, argv, child_argv0, &path, &child_argv); if (rc < 0) FatalError("Couldn't parse arguments\n"); rc = allocatePty(&pty, &line); if (rc < 0) { perror("Couldn't allocate pty"); ExitFailure(); } rc = droppriv(); if (rc < 0) { perror("Couldn't drop privileges"); ExitFailure(); } if (pipe_option) { IGNORE_RC(pipe(p2c_waitpipe)); IGNORE_RC(pipe(c2p_waitpipe)); } TRACE(("...forking to run %s(%s)\n", NonNull(path), NonNull(child_argv[0]))); pid = fork(); if (pid < 0) { perror("Couldn't fork"); ExitFailure(); } if (pid == 0) { close(pty); if (pipe_option) { close_waitpipe(1); } child(sfd, line, path, child_argv); } else { if (pipe_option) { close_waitpipe(0); } free(child_argv); free(path); free(line); parent(sfd, pty); } return 0; } #ifdef NO_LEAKS void luit_leaks(void) { destroyIso2022(inputState); destroyIso2022(outputState); } #endif luit-20240910/luit.log.html0000644000000000000000000006447314670144650014100 0ustar rootroot LUIT - Change Log
Copyright 2006-2023,2024 by Thomas E. Dickey

This file contains a list of the changes that I have made for luit.

2024/09/10 -

  • fix a memory-leak in initialize16bitTable
  • updated configure script, to improve pathname checks
  • update config.guess, config.sub

2024/01/02 -

  • minor fixes for compiler-warnings and manpage format.
  • updated configure script, to reduce compiler warnings in configure-checks.
  • update config.guess, config.sub

2023/02/01 -

  • correct conversion to/from codes past BMP (patch by Ben Wong, Debian #1027414)
  • fix a few compiler-warnings in configure-checks

2022/10/28 -

  • fix a few compiler-warnings
  • updated plink.sh, from xterm.
  • updated configure script, to work around regression in grep 3.8
  • updated configure macros for compiler-warning fixes.
  • update config.guess, config.sub, install-sh

2022/01/11 -

  • rename package/debian to avoid misuse by Debian build-system.
  • updated plink.sh, from xterm, to work around poor performance of gcc on Fedora.
  • updated configure macros for compiler-warning fixes.
  • update config.guess, config.sub

2021/02/18 -

  • repair/improve the check for X manpage's section, using a fix from xterm patch #302.
  • if a “.enc” file is found, but no built-in character set description is found, add that to the internal font-encoding table to allow it to be used, like the built-in character sets.
  • modify annotate-enc to handle the external “.enc” which were used with the older luit.

2021/02/14 -

  • add annotate-enc script, use that to annotate the ".enc" files.
  • add built-in encoding apl2 (prompted by patch by Jerome Ibanes).

2021/01/14 -

  • minor cleanup of file-descriptors, for readability.
  • updated configure macros for quoting/escaping fixes.
  • update config.guess, config.sub

2020/10/03 -

  • updated configure macros:
    • compiler-warning fixes
    • build-fixes for OpenBSD and macOS
  • update config.guess, config.sub

2019/12/31 -

  • updated configure macros.
  • update config.guess, config.sub

2019/01/06 -

  • updated configure macros to work around a non-POSIX feature of BSDs.
  • add a dummy "check" rule to makefile for Arch packages.
  • add COPYING file for Arch packages.
  • use consistent wording for copyright notice in source-files.
  • update config.guess, config.sub

2018/12/11 -

  • build-fixes/updates for cygwin to accommodate configure-macro changes.
  • updated configure macros:
    • CF_CC_ENV_FLAGS, add check for preprocessor-options in $CFLAGS.
    • CF_FUNC_GRANTPT, amend the posix_openpt vs grantpt change to work with BSDs
    • CF_GNU_SOURCE, fixes a regression for Cygwin. The check for _DEFAULT_SOURCE should apply to "recent" Cygwin (since early 2016), and except for "NEWLIB" vs "GLIBC" in the test, acts the same if I pretend that "newlib" is the GNU C library. Without this, the check falls through to the _XOPEN_SOURCE test, which breaks the pseudoterminal checks for xterm.
    • CF_LD_RPATH_OPT, suppress check if --disable-rpath is given.
    • CF_XOPEN_SOURCE, add midnightbsd to special cases with freebsd
  • update config.guess, config.sub

2018/06/28 -

  • modify configure script to avoid using OpenBSD's nonfunctional POSIX pseudoterminal interface.
  • add null-pointer checks for all strings printed in trace calls.
  • updated configure macros, deprecating use of _GNU_SOURCE symbol for DEFAULT_SOURCE, and preferring man2html over groff's html conversion.
  • update config.guess, config.sub

2016/05/08 -

  • adapt Solaris fix for C11 changes from xterm #325.
  • modify parseArgs to check for a special case, e.g., from xterm, where a shell command that cannot be exec'd is passed as a single parameter. For that case, run the command via the shell.
  • reset IEXTEN when turning off canonical mode, needed to make lnext control/V work consistently on BSD platforms (report/patch by Christian Weisgerber).
  • updated configure macros:
    CF_FUNC_POLL
    add a fallback to checking with posix_openpt(), in case someone's running the configure script in batch mode.
    CF_LD_RPATH_OPT
    change FreeBSD to use -Wl,-rpath rather than -rpath option. According to FreeBSD #178732, either works since FreeBSD 4.x; however scons does not accept anything except the -Wl,-rpath form.
    CF_WITH_MAN2HTML
    use configured shell rather than /bin/sh
    CF_XOPEN_SOURCE
    add a case for OS/2
  • update config.guess, config.sub

2015/07/06 -

  • add configure option --with-man2html
  • updated configure macros, mostly formatting changes from xterm, etc.
  • update config.guess, config.sub

2014/12/04 -

  • add table entries for luit to work as expected with CP865 — MS-DOS with Nordic letters. This code page was commonly used on BBSes in Norway, Denmark and Sweden running the MBBS and compatible systems in the 90s (patch by Hans Petter Jansson).
  • add to search-list for encodings.dir file to accommodate Fedora.
  • updated configure macros:
    • add /usr/pkg and /opt/local to help configuring with pkgsrc and macports.
    • fixes for Clang and MinGW, Solaris and Unixware.
    • improve "docs" rule in makefile.
    • CF_RPATH_HACK: use sort and uniq rather than sort -u, to work with HPUX 11.11, etc.
    • CF_ADD_LIBS: filter duplicate library names
  • update config.guess, config.sub

2013/02/17 -

  • bump to 2.0, reflecting changes
  • add character-set entries for CP1255 and CNS-11643 planes 1-3 to allow use of some of the remaining ".enc" files.
  • modify -list option to show character set sizes.
  • add -prefer option to control the lookup order between iconv, fontenc, builtin and posix character set data.
  • add -show-builtin option to show details of a particular built-in encoding.
  • add -list-builtin option to show built-in encodings embedded. This is available only for the iconv configuration; the fontenc library has no API for retrieving the information.
  • change defaults for configure script options --enable-iconv and --enable-fontenc to deprecate the fontenc library.
  • replaced existing built-in encoding tables with augmented set generated from iconv to obviate need for fontenc's tables as a fallback.
  • add prefix translations from IBM-CP to CP ), etc., to make fontenc's encoding name "ibm-cp866" work with luit.
  • add koi8-e to locale-charsets table, to make that encoding work.
  • add -show-iconv to show a given encoding from iconv using the ".enc" format.
  • add -fill-fontenc option to control output format of -show-fontenc.
  • add -show-fontenc option to show a given encoding, e.g., from a ".enc" file using the ".enc" format.
  • add -list-fontenc option to show available encodings using the ".enc" files which should be distributed with the fontencoding library.
  • add -list-iconv option to show encodings and corresponding locales supported in the iconv configuration.
  • document -kg0, etc., in manpage.
  • revise the help option -h, providing a summary of each option rather than the abbreviated listing. The abbreviated listing is still provided when an unrecognized option is encountered.
  • improve error recovery in the iconv configuration by falling back to POSIX encoding if no encoding can be found in the system's tables.
  • apply workaround from xterm patch #279 to make window size set for pty implementation such as Mac OS X which lose this when opening the other side of the connection.
  • fix issues from Coverity scan; all were minor.
  • update config.guess, config.sub

2012/10/14 -

  • review/improve no-leaks checking with valgrind.
  • add null-pointer checks in copyOut in case a non-8bit encoding was used with the iconv configuration.
  • document environment variables used by luit in its manpage.
  • amend the check using nl_langinfo(CODESET) in 2011/10/30 changes, ignoring that section if the -encoding option was given (report by Alexios Zavras).
  • support --datarootdir option in configure script.
  • updated configure macros:
    CF_FUNC_GRANTPT
    add another step to the test-program.
    CF_FUNC_POLL
    fix the case where stdin is redirected, e.g., in rpm/dpkg builds (reported in Debian #676461). Also correct return-check, which could have been confused by typing on the keyboard while the check was running.
    CF_GCC_ATTRIBUTES
    use AC_DEFINE_UNQUOTED() rather than appending to confdefs.h, since long-ago concern about the ability to pass-through parameterized macros appears to be not a problem, testing with 2.13 and 2.52
    CF_GCC_VERSION
    add workaround for Debian's modification of the version message
    CF_GCC_WARNINGS
    add check for clang
    CF_PATHSEP
    add message to show the actual value used.
    CF_PATH_SYNTAX
    also match (for substitution) variables such as ${includedir}
    CF_WITH_PATH
    fix after changes in ncurses to use --datarootdir
    CF__GRANTPT_BODY
    add an ifdef'd chunk #5 for testing the 'tty' (rather than 'pty') and moved the important 'pty' chunk before opening the slave device as a simple way of making the test program lose any possible race between parent/child processes in initializing both sides of the pseudoterminal (report by Christian Weisgerber).
    miscellaneous
    cleanup based on byacc 20121003.
  • update config.guess, config.sub

2012/1/29 -

  • improve portability of the iconv configuration by checking alternate forms for the encoding name passed to iconv_open.
  • add configure check for working posix_openpt, which may be broken in Mac OS X's current release 10.7 Lion (report by Kirby Zhou).
  • add some error checking for the poll and select logic to avoid looping when a file descriptor is no longer valid.
  • improve configure check for working poll function to avoid using Mac OS X's broken implementation (tested with Darwin 10.8.0).
  • updated configure script macros:
    CF_FUNC_GRANTPT
    modify check to exclude Darwin 9.x and lower from using posix_openpt. Bug report for xterm by Christian Ebert for 9.8.0 says screensize does not work for the pty.
    CF_XOPEN_SOURCE
    fixes for redefinition of _XOPEN_SOURCE on a few platforms: Mac OS X, IRIX64. Also workarounds for header inconsistencies with OpenBSD and MirBSD.

2011/10/30 -

  • modify configure script to add X_LIBS symbol after resolving fontenc library, to use the associated -L option in subsequent configure-checks.
  • add -t to simplify testing available locales versus luit's tables and the locale.alias file.
  • add "US-ASCII" for C/POSIX to the locale-charset table.
  • add entries to the locale-charset table to correspond with the font-encoding table, making it possible to use locales defined with each named charset (reported by Andrey Ivanov, also reported in Freedesktop #41857).
  • modify the lookup by locale charset to help match results from nl_langinfo(CODESET) by mapping commonly used prefixes into the prefixes used by luit.
  • check for, and use nl_langinfo(CODESET) to augment X's locale.aliases file for determining the encoding to use.
  • workaround limitation in copying terminal settings on Solaris from original tty to pty.
  • add /usr/openwin/lib/locale to search-list of locale.alias for Solaris 10.
  • improve configure script so that it does not error-out if fontenc is unavailable, using iconv instead.
  • bump version to 1.2, noting xorg hackers having marked (with only cosmetic changes) the 2010/6/1 snapshot as "1.1.0".
  • add/use configure check for posix_openpt, prompted by FreeBSD ports/161480.
  • updated configure script macros: CF_ANSI_CC_CHECK CF_DISABLE_RPATH_HACK CF_LD_RPATH_OPT CF_PKG_CONFIG CF_RPATH_HACK CF_SVR4 CF_WITH_ZLIB CF_XOPEN_SOURCE
  • update config.guess, config.sub

2010/11/28 -

  • use plink.sh script from xterm to reduce unneeded library dependencies, e.g., from fontenc's buggy package script.
  • eliminate quoted- and duplicate-includes.
  • make -g0 and similar options actually work, by adding checks in initIso2022.
  • add messages for the repeated -v option, to show which parts of the font-encoding configuration fail, for troubleshooting.
  • add configure option --disable-leaks, etc.
  • add configure option --enable-trace.
  • add configure option --enable-iconv, to use GNU iconv, which is far more portable than fontenc.
    • Initially, this supports single-byte encodings such as ISO-8859-x.
    • DEC special and technical character sets are supported via custom tables.
  • use static variables and functions consistently, where external linkage is not required.
  • updated configure script macros, e.g., to deprecate shell syntax no longer supported by bash.
  • modify manpage to use "misc" category for the miscellaneous Linux manpages cited in the "SEE ALSO" section, prompted by xorg change for 1.1.0 version.

    Aside from that (and some cosmetic changes to C source, as well as providing a different configure script), and omitting this change-log, the xorg 1.1.0 is the same as the 2010/6/1 version. Its release notes state:

    This release includes these changes from Thomas Dickey's luit-20100601:
    • add -alias option to allow override of locale.alias pathname.
    • improve fix waitForInput as suggested in Freedesktop #26383.
    • fix warnings from clang --analyze

2010/6/5 -

  • fix a typo in ifdef for <sys/param.h> which made setuid feature not work properly for FreeBSD.
  • improve configure check for locale.alias file for OpenSolaris.
  • add configure option --disable-rpath-hack, modified configure script to normally supply an rpath option if possible to simplify linkage to libraries in unusual places.

2010/6/1 -

  • add makefile rules for generating pdf, etc., for manpage.
  • modify minstall.sh to update program name if the configure script options such as --program-prefix were used to rename the program.
  • add Debian package scripts (requires some assembly...).
  • add rpm spec-file (see my ftp area for binaries).
  • add -alias option to allow override of locale.alias pathname.
  • improve configure check for locale.alias file for NetBSD.
  • improve fix waitForInput as suggested in Freedesktop #26383.
  • drop mkdirs.sh, use mkdir -p.
  • improve configure script for ctags/etags, e.g., to work with pkgsrc.
  • drop Imakefile
  • fix warnings from clang --analyze
  • updated configure script macros, mostly for quoting- and variable initialization fixes.
  • update config.guess, config.sub

2009/10/14 -

  • add -V version option.
  • work around defective implementation of gcc attribute warn_unused_return.
  • add configure check for openpty, use that on systems such as OpenBSD rather than requiring setuid operation.
  • ifdef open to work with incomplete definitions for O_NOCTTY and TIOCSCTTY (adapted from patch by Yaakov Selkowitz).

2009/8/16 -

  • reset connection to blocking mode on exit.
  • modify poll-flavor of waitForInput to also check if the connection has hung up.
  • improve initialization for -p command-line option to work with more BSD-flavors.
  • improve configure script checks for font encoding library using AC_PATH_XTRA, and noting that font encoding library may depend upon z library.
  • replace #ifdef to define HAVE_GRANTPT with configure script.
  • improve use of const more consistently in sources.
  • clean up include-dependencies by including config.h before other includes.
  • add change from xorg git:
    • luit: Convert platform #ifdefs to configure tests for functions & headers
      (adds configure checks for functions and headers used to open pty's, uses that to replace a derived #define for HAVE_POLL, #ifdef's the corresponding headers and modifies #ifdef for I_PUSH ioctl to add __SVR4).
  • updated configure script macros: CF_ADD_CFLAGS CF_ADD_INCDIR CF_ADD_LIBDIR CF_ADD_SEARCHPATH CF_FIND_LINKAGE CF_GCC_ATTRIBUTES CF_GCC_WARNINGS CF_HEADER_PATH CF_LIBRARY_PATH CF_PATH_PROG CF_PKG_CONFIG CF_XOPEN_SOURCE CF_X_FONTENC
  • update configure utility scripts (config.guess, config.sub, install-sh, mkdirs.sh).

2008/8/29 -

  • add -p option, to make the wait-pipe workaround from XFree86 optional. The default behavior is the older one.

2008/8/24 -

  • add ifdef for NO_LEAKS, to check for memory leaks. Found none in luit; font encoding library does have leaks.

2008/8/23 -

  • update minstall.sh from xterm to fix possible scripting dependency upon locale.
  • set ncurses' NCURSES_NO_UTF8_ACS environment variable to simplify use of line-drawing characters in luit.
  • improve default value for locale.alias pathname by checking in the more common X11 locations.

2008/8/21 -

  • use codepage change from luit 1.0.2
  • modify configure script so --with-fontenc-cflags and --with-fontenc-libs options with when pkg-config is not available.
  • fixes for configuring fontenc library without pkg-config.
  • fixes for gcc -Wwrite-strings warnings.
  • fixes for gcc -Wconversion warnings.
  • updated configure script macros CF_ANSI_CC_REQD, CF_CHECK_CACHE, CF_FIND_LIBRARY, CF_GCC_ATTRIBUTES, CF_GCC_WARNINGS, CF_IMAKE_CFLAGS, CF_MSG_LOG, CF_PATH_SYNTAX, CF_POSIX_SAVED_IDS, CF_SUBDIR_PATH, CF_TYPE_FD_SET, CF_VERBOSE, CF_WITH_PATH, CF_WITH_ZLIB, CF_XOPEN_SOURCE.
  • update configure utility scripts (config.guess, config.sub, install-sh, mkdirs.sh).

2006/8/20 -

  • import snapshot from XFree86 (last change 2005/2/9).
  • inspected Xorg sources, found no newer changes of note.
  • wrote a configure script.
  • minor code cleanup (fix compiler warnings, add ifdef's to prevent repeated inclusion of header files, remove redundant #include's, indented code).
luit-20240910/builtin.c0000644000000000000000000020557614012263637013265 0ustar rootroot/* * $XTermId: builtin.c,v 1.7 2021/02/14 18:10:39 tom Exp $ * This file was generated by ./make-tables */ #include #include #include static const BuiltInMapping apl2[] = { /* Character set details are from "APL2 Programming: Language Reference", */ /* Appendix A "The APL2 Character Set": */ /* Figure 68 "ASCII Character Set (Workstations)", and */ /* Figure 71 "ASCII, EBCDIC, Unicode, and Symbol Equivalents" */ {0x80, 0x00C7}, /* LATIN CAPITAL LETTER C WITH CEDILLA */ {0x81, 0x00FC}, /* LATIN SMALL LETTER U WITH DIAERESIS */ {0x82, 0x00E9}, /* LATIN SMALL LETTER E WITH ACUTE */ {0x83, 0x00E2}, /* LATIN SMALL LETTER A WITH CIRCUMFLEX */ {0x84, 0x00E4}, /* LATIN SMALL LETTER A WITH DIAERESIS */ {0x85, 0x00E0}, /* LATIN SMALL LETTER A WITH GRAVE */ {0x86, 0x00E5}, /* LATIN SMALL LETTER A WITH RING ABOVE */ {0x87, 0x00E7}, /* LATIN SMALL LETTER C WITH CEDILLA */ {0x88, 0x00EA}, /* LATIN SMALL LETTER E WITH CIRCUMFLEX */ {0x89, 0x00EB}, /* LATIN SMALL LETTER E WITH DIAERESIS */ {0x8A, 0x00E8}, /* LATIN SMALL LETTER E WITH GRAVE */ {0x8B, 0x00EF}, /* LATIN SMALL LETTER I WITH DIAERESIS */ {0x8C, 0x00EE}, /* LATIN SMALL LETTER I WITH CIRCUMFLEX */ {0x8D, 0x00EC}, /* LATIN SMALL LETTER I WITH GRAVE */ {0x8E, 0x00C4}, /* LATIN CAPITAL LETTER A WITH DIAERESIS */ {0x8F, 0x00C5}, /* LATIN CAPITAL LETTER A WITH RING ABOVE */ {0x90, 0x25AF}, /* WHITE VERTICAL RECTANGLE */ {0x91, 0x235E}, /* APL FUNCTIONAL SYMBOL QUOTE QUAD */ {0x92, 0x2339}, /* APL FUNCTIONAL SYMBOL QUAD DIVIDE */ {0x93, 0x00F4}, /* LATIN SMALL LETTER O WITH CIRCUMFLEX */ {0x94, 0x00F6}, /* LATIN SMALL LETTER O WITH DIAERESIS */ {0x95, 0x00F2}, /* LATIN SMALL LETTER O WITH GRAVE */ {0x96, 0x00FB}, /* LATIN SMALL LETTER U WITH CIRCUMFLEX */ {0x97, 0x00F9}, /* LATIN SMALL LETTER U WITH GRAVE */ {0x98, 0x22A4}, /* DOWN TACK */ {0x99, 0x00D6}, /* LATIN CAPITAL LETTER O WITH DIAERESIS */ {0x9A, 0x00DC}, /* LATIN CAPITAL LETTER U WITH DIAERESIS */ {0x9B, 0x00F8}, /* LATIN SMALL LETTER O WITH STROKE */ {0x9C, 0x00A3}, /* POUND SIGN */ {0x9D, 0x22A5}, /* UP TACK */ {0x9E, 0x2376}, /* APL FUNCTIONAL SYMBOL ALPHA UNDERBAR */ {0x9F, 0x2336}, /* APL FUNCTIONAL SYMBOL I-BEAM */ {0xA0, 0x00E1}, /* LATIN SMALL LETTER A WITH ACUTE */ {0xA1, 0x00ED}, /* LATIN SMALL LETTER I WITH ACUTE */ {0xA2, 0x00F3}, /* LATIN SMALL LETTER O WITH ACUTE */ {0xA3, 0x00FA}, /* LATIN SMALL LETTER U WITH ACUTE */ {0xA4, 0x00F1}, /* LATIN SMALL LETTER N WITH TILDE */ {0xA5, 0x00D1}, /* LATIN CAPITAL LETTER N WITH TILDE */ {0xA6, 0x00AA}, /* FEMININE ORDINAL INDICATOR */ {0xA7, 0x00BA}, /* MASCULINE ORDINAL INDICATOR */ {0xA8, 0x00BF}, /* INVERTED QUESTION MARK */ {0xA9, 0x2308}, /* LEFT CEILING */ {0xAA, 0x00AC}, /* NOT SIGN */ {0xAB, 0x00BD}, /* VULGAR FRACTION ONE HALF */ {0xAC, 0x222A}, /* UNION */ {0xAD, 0x00A1}, /* INVERTED EXCLAMATION MARK */ {0xAE, 0x2355}, /* APL FUNCTIONAL SYMBOL UP TACK JOT */ {0xAF, 0x234E}, /* APL FUNCTIONAL SYMBOL DOWN TACK JOT */ {0xB0, 0x2591}, /* LIGHT SHADE */ {0xB1, 0x2592}, /* MEDIUM SHADE */ {0xB2, 0x2593}, /* DARK SHADE */ {0xB3, 0x2502}, /* BOX DRAWINGS LIGHT VERTICAL */ {0xB4, 0x2524}, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ {0xB5, 0x235F}, /* APL FUNCTIONAL SYMBOL CIRCLE STAR */ {0xB6, 0x2206}, /* INCREMENT */ {0xB7, 0x2207}, /* NABLA */ {0xB8, 0x2192}, /* RIGHTWARDS ARROW */ {0xB9, 0x2563}, /* BOX DRAWINGS DOUBLE VERTICAL AND LEFT */ {0xBA, 0x2551}, /* BOX DRAWINGS DOUBLE VERTICAL */ {0xBB, 0x2557}, /* BOX DRAWINGS DOUBLE DOWN AND LEFT */ {0xBC, 0x255D}, /* BOX DRAWINGS DOUBLE UP AND LEFT */ {0xBD, 0x2190}, /* LEFTWARDS ARROW */ {0xBE, 0x230A}, /* LEFT FLOOR */ {0xBF, 0x2510}, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ {0xC0, 0x2514}, /* BOX DRAWINGS LIGHT UP AND RIGHT */ {0xC1, 0x2534}, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ {0xC2, 0x252C}, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ {0xC3, 0x251C}, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ {0xC4, 0x2500}, /* BOX DRAWINGS LIGHT HORIZONTAL */ {0xC5, 0x253C}, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ {0xC6, 0x2191}, /* UPWARDS ARROW */ {0xC7, 0x2193}, /* DOWNWARDS ARROW */ {0xC8, 0x255A}, /* BOX DRAWINGS DOUBLE UP AND RIGHT */ {0xC9, 0x2554}, /* BOX DRAWINGS DOUBLE DOWN AND RIGHT */ {0xCA, 0x2569}, /* BOX DRAWINGS DOUBLE UP AND HORIZONTAL */ {0xCB, 0x2566}, /* BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL */ {0xCC, 0x2560}, /* BOX DRAWINGS DOUBLE VERTICAL AND RIGHT */ {0xCD, 0x2550}, /* BOX DRAWINGS DOUBLE HORIZONTAL */ {0xCE, 0x256C}, /* BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL */ {0xCF, 0x2261}, /* IDENTICAL TO */ {0xD0, 0x2378}, /* APL FUNCTIONAL SYMBOL IOTA UNDERBAR */ {0xD1, 0x2377}, /* APL FUNCTIONAL SYMBOL EPSILON UNDERBAR */ {0xD2, 0x2235}, /* BECAUSE */ {0xD3, 0x2337}, /* APL FUNCTIONAL SYMBOL SQUISH QUAD */ {0xD4, 0x2342}, /* APL FUNCTIONAL SYMBOL QUAD BACKSLASH */ {0xD5, 0x233B}, /* APL FUNCTIONAL SYMBOL QUAD JOT */ {0xD6, 0x22A2}, /* RIGHT TACK */ {0xD7, 0x22A3}, /* LEFT TACK */ {0xD8, 0x25CA}, /* LOZENGE */ {0xD9, 0x2518}, /* BOX DRAWINGS LIGHT UP AND LEFT */ {0xDA, 0x250C}, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ {0xDB, 0x2588}, /* FULL BLOCK */ {0xDC, 0x2584}, /* LOWER HALF BLOCK */ {0xDD, 0x00A6}, /* BROKEN BAR */ {0xDE, 0x00CC}, /* LATIN CAPITAL LETTER I WITH GRAVE */ {0xDF, 0x2580}, /* UPPER HALF BLOCK */ {0xE0, 0x237A}, /* APL FUNCTIONAL SYMBOL ALPHA */ {0xE1, 0x2379}, /* APL FUNCTIONAL SYMBOL OMEGA UNDERBAR */ {0xE2, 0x2282}, /* SUBSET OF */ {0xE3, 0x2283}, /* SUPERSET OF */ {0xE4, 0x235D}, /* APL FUNCTIONAL SYMBOL UP SHOE JOT */ {0xE5, 0x2372}, /* APL FUNCTIONAL SYMBOL UP CARET TILDE */ {0xE6, 0x2374}, /* APL FUNCTIONAL SYMBOL RHO */ {0xE7, 0x2371}, /* APL FUNCTIONAL SYMBOL DOWN CARET TILDE */ {0xE8, 0x233D}, /* APL FUNCTIONAL SYMBOL CIRCLE STILE */ {0xE9, 0x2296}, /* CIRCLED MINUS */ {0xEA, 0x25CB}, /* WHITE CIRCLE */ {0xEB, 0x2228}, /* LOGICAL OR */ {0xEC, 0x2373}, /* APL FUNCTIONAL SYMBOL IOTA */ {0xED, 0x2349}, /* APL FUNCTIONAL SYMBOL CIRCLE BACKSLASH */ {0xEE, 0x220A}, /* SMALL ELEMENT OF */ {0xEF, 0x2229}, /* INTERSECTION */ {0xF0, 0x233F}, /* APL FUNCTIONAL SYMBOL SLASH BAR */ {0xF1, 0x2340}, /* APL FUNCTIONAL SYMBOL BACKSLASH BAR */ {0xF2, 0x2265}, /* GREATER-THAN OR EQUAL TO */ {0xF3, 0x2264}, /* LESS-THAN OR EQUAL TO */ {0xF4, 0x2260}, /* NOT EQUAL TO */ {0xF5, 0x00D7}, /* MULTIPLICATION SIGN */ {0xF6, 0x00F7}, /* DIVISION SIGN */ {0xF7, 0x2359}, /* APL FUNCTIONAL SYMBOL DELTA UNDERBAR */ {0xF8, 0x2218}, /* RING OPERATOR */ {0xF9, 0x2375}, /* APL FUNCTIONAL SYMBOL OMEGA */ {0xFA, 0x236B}, /* APL FUNCTIONAL SYMBOL DEL TILDE */ {0xFB, 0x234B}, /* APL FUNCTIONAL SYMBOL DELTA STILE */ {0xFC, 0x2352}, /* APL FUNCTIONAL SYMBOL DEL STILE */ {0xFD, 0x00AF}, /* MACRON */ {0xFE, 0x00A8}, /* DIAERESIS */ {0xFF, 0x00A0}, /* NO-BREAK SPACE */ }; static const BuiltInMapping dec_special[] = { /* This file is derived from the file data.c in the XTerm sources */ {0x5F, 0x25AE}, /* BLACK VERTICAL RECTANGLE */ {0x60, 0x25C6}, /* BLACK DIAMOND */ {0x61, 0x2592}, /* MEDIUM SHADE */ {0x62, 0x2409}, /* SYMBOL FOR HORIZONTAL TABULATION */ {0x63, 0x240C}, /* SYMBOL FOR FORM FEED */ {0x64, 0x240D}, /* SYMBOL FOR CARRIAGE RETURN */ {0x65, 0x240A}, /* SYMBOL FOR LINE FEED */ {0x66, 0x00B0}, /* DEGREE SIGN */ {0x67, 0x00B1}, /* PLUS-MINUS SIGN */ {0x68, 0x2424}, /* SYMBOL FOR NEWLINE */ {0x69, 0x240B}, /* SYMBOL FOR VERTICAL TABULATION */ {0x6A, 0x2518}, /* BOX DRAWINGS LIGHT UP AND LEFT */ {0x6B, 0x2510}, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ {0x6C, 0x250C}, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ {0x6D, 0x2514}, /* BOX DRAWINGS LIGHT UP AND RIGHT */ {0x6E, 0x253C}, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ {0x6F, 0x23BA}, /* HORIZONTAL SCAN LINE-1 */ {0x70, 0x23BB}, /* HORIZONTAL SCAN LINE-3 */ {0x71, 0x2500}, /* BOX DRAWINGS LIGHT HORIZONTAL */ {0x72, 0x23BC}, /* HORIZONTAL SCAN LINE-7 */ {0x73, 0x23BD}, /* HORIZONTAL SCAN LINE-9 */ {0x74, 0x251C}, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ {0x75, 0x2524}, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ {0x76, 0x2534}, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ {0x77, 0x252C}, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ {0x78, 0x2502}, /* BOX DRAWINGS LIGHT VERTICAL */ {0x79, 0x2264}, /* LESS-THAN OR EQUAL TO */ {0x7A, 0x2265}, /* GREATER-THAN OR EQUAL TO */ {0x7B, 0x03C0}, /* GREEK SMALL LETTER PI */ {0x7C, 0x2260}, /* NOT EQUAL TO */ {0x7D, 0x00A3}, /* POUND SIGN */ {0x7E, 0x00B7}, /* MIDDLE DOT */ }; static const BuiltInMapping dec_technical[] = { /* derived from http://www.vt100.net/charsets/technical.html */ {0x21, 0x23b7}, /* RADICAL SYMBOL BOTTOM Centred left to right, so that it joins up with 02/02 */ {0x22, 0x250c}, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ {0x23, 0x2500}, /* BOX DRAWINGS LIGHT HORIZONTAL */ {0x24, 0x2320}, /* TOP HALF INTEGRAL with the proviso that the stem is vertical, to join with 02/06 */ {0x25, 0x2321}, /* BOTTOM HALF INTEGRAL with the proviso above. */ {0x26, 0x2502}, /* BOX DRAWINGS LIGHT VERTICAL */ {0x27, 0x23a1}, /* LEFT SQUARE BRACKET UPPER CORNER Joins vertically to 02/06, 02/08. Doesn't join to its right. */ {0x28, 0x23a3}, /* LEFT SQUARE BRACKET LOWER CORNER Joins vertically to 02/06, 02/07. Doesn't join to its right. */ {0x29, 0x23a4}, /* RIGHT SQUARE BRACKET UPPER CORNER Joins vertically to 026, 02a. Doesn't join to its left. */ {0x2a, 0x23a6}, /* RIGHT SQUARE BRACKET LOWER CORNER Joins vertically to 026, 029. Doesn't join to its left. */ {0x2b, 0x239b}, /* LEFT PARENTHESIS UPPER HOOK Joins vertically to 026, 02c, 02/15. Doesn't join to its right. */ {0x2c, 0x239d}, /* LEFT PARENTHESIS LOWER HOOK Joins vertically to 026, 02b, 02/15. Doesn't join to its right. */ {0x2d, 0x239e}, /* RIGHT PARENTHESIS UPPER HOOK Joins vertically to 026, 02e, 03/00. Doesn't join to its left. */ {0x2e, 0x23a0}, /* RIGHT PARENTHESIS LOWER HOOK Joins vertically to 026, 02d, 03/00. Doesn't join to its left. */ {0x2f, 0x23a8}, /* LEFT CURLY BRACKET MIDDLE PIECE Joins vertically to 026, 02b, 02c. */ {0x30, 0x23ac}, /* RIGHT CURLY BRACKET MIDDLE PIECE Joins vertically to 02/06, 02d, 02e. */ {0x31, 0x2426}, /* Top Left Sigma. Joins to right with 02/03, 03/05. Joins diagonally below right with 03/03, 03/07. */ {0x32, 0x2426}, /* Bottom Left Sigma. Joins to right with 02/03, 03/06. Joins diagonally above right with 03/04, 03/07. */ {0x33, 0x2426}, /* Top Diagonal Sigma. Line for joining 03/01 to 03/04 or 03/07. */ {0x34, 0x2426}, /* Bottom Diagonal Sigma. Line for joining 03/02 to 03/03 or 03/07. */ {0x35, 0x2426}, /* Top Right Sigma. Joins to left with 02/03, 03/01. */ {0x36, 0x2426}, /* Bottom Right Sigma. Joins to left with 02/03, 03/02. */ {0x37, 0x2426}, /* Middle Sigma. Joins diagonally with 03/01, 03/02, 03/03, 03/04. */ {0x38, 0x2426}, /* undefined */ {0x39, 0x2426}, /* undefined */ {0x3a, 0x2426}, /* undefined */ {0x3b, 0x2426}, /* undefined */ {0x3c, 0x2264}, /* LESS-THAN OR EQUAL TO */ {0x3d, 0x2260}, /* NOT EQUAL TO */ {0x3e, 0x2265}, /* GREATER-THAN OR EQUAL TO */ {0x3f, 0x222B}, /* INTEGRAL */ {0x40, 0x2234}, /* THEREFORE */ {0x41, 0x221d}, /* PROPORTIONAL TO */ {0x42, 0x221e}, /* INFINITY */ {0x43, 0x00f7}, /* DIVISION SIGN */ {0x44, 0x039a}, /* GREEK CAPITAL DELTA */ {0x45, 0x2207}, /* NABLA */ {0x46, 0x03a6}, /* GREEK CAPITAL LETTER PHI */ {0x47, 0x0393}, /* GREEK CAPITAL LETTER GAMMA */ {0x48, 0x223c}, /* TILDE OPERATOR */ {0x49, 0x2243}, /* ASYMPTOTICALLY EQUAL TO */ {0x4a, 0x0398}, /* GREEK CAPITAL LETTER THETA */ {0x4b, 0x00d7}, /* MULTIPLICATION SIGN */ {0x4c, 0x039b}, /* GREEK CAPITAL LETTER LAMDA */ {0x4d, 0x21d4}, /* LEFT RIGHT DOUBLE ARROW */ {0x4e, 0x21d2}, /* RIGHTWARDS DOUBLE ARROW */ {0x4f, 0x2261}, /* IDENTICAL TO */ {0x50, 0x03a0}, /* GREEK CAPITAL LETTER PI */ {0x51, 0x03a8}, /* GREEK CAPITAL LETTER PSI */ {0x52, 0x2426}, /* undefined */ {0x53, 0x03a3}, /* GREEK CAPITAL LETTER SIGMA */ {0x54, 0x2426}, /* undefined */ {0x55, 0x2426}, /* undefined */ {0x56, 0x221a}, /* SQUARE ROOT */ {0x57, 0x03a9}, /* GREEK CAPITAL LETTER OMEGA */ {0x58, 0x039e}, /* GREEK CAPITAL LETTER XI */ {0x59, 0x03a5}, /* GREEK CAPITAL LETTER UPSILON */ {0x5a, 0x2282}, /* SUBSET OF */ {0x5b, 0x2283}, /* SUPERSET OF */ {0x5c, 0x2229}, /* INTERSECTION */ {0x5d, 0x222a}, /* UNION */ {0x5e, 0x2227}, /* LOGICAL AND */ {0x5f, 0x2228}, /* LOGICAL OR */ {0x60, 0x00ac}, /* NOT SIGN */ {0x61, 0x03b1}, /* GREEK SMALL LETTER ALPHA */ {0x62, 0x03b2}, /* GREEK SMALL LETTER BETA */ {0x63, 0x03c7}, /* GREEK SMALL LETTER CHI */ {0x64, 0x03b4}, /* GREEK SMALL LETTER DELTA */ {0x65, 0x03b5}, /* GREEK SMALL LETTER EPSILON */ {0x66, 0x03c6}, /* GREEK SMALL LETTER PHI */ {0x67, 0x03b3}, /* GREEK SMALL LETTER GAMMA */ {0x68, 0x03b7}, /* GREEK SMALL LETTER ETA */ {0x69, 0x03b9}, /* GREEK SMALL LETTER IOTA */ {0x6a, 0x03b8}, /* GREEK SMALL LETTER THETA */ {0x6b, 0x03ba}, /* GREEK SMALL LETTER KAPPA */ {0x6c, 0x03bb}, /* GREEK SMALL LETTER LAMDA */ {0x6d, 0x2426}, /* undefined */ {0x6e, 0x03bd}, /* GREEK SMALL LETTER NU */ {0x6f, 0x2202}, /* PARTIAL DIFFERENTIAL */ {0x70, 0x03c0}, /* GREEK SMALL LETTER PI */ {0x71, 0x03c8}, /* GREEK SMALL LETTER PSI */ {0x72, 0x03c1}, /* GREEK SMALL LETTER RHO */ {0x73, 0x03c3}, /* GREEK SMALL LETTER SIGMA */ {0x74, 0x03c4}, /* GREEK SMALL LETTER TAU */ {0x75, 0x2426}, /* undefined */ {0x76, 0x0192}, /* LATIN SMALL LETTER F WITH HOOK Probably chosen for its meaning of "function" */ {0x77, 0x03c9}, /* GREEK SMALL LETTER OMEGA */ {0x78, 0x03bE}, /* GREEK SMALL LETTER XI */ {0x79, 0x03c5}, /* GREEK SMALL LETTER UPSILON */ {0x7a, 0x03b6}, /* GREEK SMALL LETTER ZETA */ {0x7b, 0x2190}, /* LEFTWARDS ARROW */ {0x7c, 0x2191}, /* UPWARDS ARROW */ {0x7d, 0x2192}, /* RIGHTWARDS ARROW */ {0x7e, 0x2193}, /* DOWNWARDS ARROW */ }; static const BuiltInMapping iso8859_1[] = { /* iso8859-1 */ {0, 0}, /* empty table is illegal syntax */ }; static const BuiltInMapping iso8859_10[] = { /* iso8859-10 */ {0x00A1, 0x0104}, /* LATIN CAPITAL LETTER A WITH OGONEK */ {0x00A2, 0x0112}, /* LATIN CAPITAL LETTER E WITH MACRON */ {0x00A3, 0x0122}, /* LATIN CAPITAL LETTER G WITH CEDILLA */ {0x00A4, 0x012A}, /* LATIN CAPITAL LETTER I WITH MACRON */ {0x00A5, 0x0128}, /* LATIN CAPITAL LETTER I WITH TILDE */ {0x00A6, 0x0136}, /* LATIN CAPITAL LETTER K WITH CEDILLA */ {0x00A8, 0x013B}, /* LATIN CAPITAL LETTER L WITH CEDILLA */ {0x00A9, 0x0110}, /* LATIN CAPITAL LETTER D WITH STROKE */ {0x00AA, 0x0160}, /* LATIN CAPITAL LETTER S WITH CARON */ {0x00AB, 0x0166}, /* LATIN CAPITAL LETTER T WITH STROKE */ {0x00AC, 0x017D}, /* LATIN CAPITAL LETTER Z WITH CARON */ {0x00AE, 0x016A}, /* LATIN CAPITAL LETTER U WITH MACRON */ {0x00AF, 0x014A}, /* LATIN CAPITAL LETTER ENG */ {0x00B1, 0x0105}, /* LATIN SMALL LETTER A WITH OGONEK */ {0x00B2, 0x0113}, /* LATIN SMALL LETTER E WITH MACRON */ {0x00B3, 0x0123}, /* LATIN SMALL LETTER G WITH CEDILLA */ {0x00B4, 0x012B}, /* LATIN SMALL LETTER I WITH MACRON */ {0x00B5, 0x0129}, /* LATIN SMALL LETTER I WITH TILDE */ {0x00B6, 0x0137}, /* LATIN SMALL LETTER K WITH CEDILLA */ {0x00B8, 0x013C}, /* LATIN SMALL LETTER L WITH CEDILLA */ {0x00B9, 0x0111}, /* LATIN SMALL LETTER D WITH STROKE */ {0x00BA, 0x0161}, /* LATIN SMALL LETTER S WITH CARON */ {0x00BB, 0x0167}, /* LATIN SMALL LETTER T WITH STROKE */ {0x00BC, 0x017E}, /* LATIN SMALL LETTER Z WITH CARON */ {0x00BD, 0x2015}, /* HORIZONTAL BAR */ {0x00BE, 0x016B}, /* LATIN SMALL LETTER U WITH MACRON */ {0x00BF, 0x014B}, /* LATIN SMALL LETTER ENG */ {0x00C0, 0x0100}, /* LATIN CAPITAL LETTER A WITH MACRON */ {0x00C7, 0x012E}, /* LATIN CAPITAL LETTER I WITH OGONEK */ {0x00C8, 0x010C}, /* LATIN CAPITAL LETTER C WITH CARON */ {0x00CA, 0x0118}, /* LATIN CAPITAL LETTER E WITH OGONEK */ {0x00CC, 0x0116}, /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ {0x00D1, 0x0145}, /* LATIN CAPITAL LETTER N WITH CEDILLA */ {0x00D2, 0x014C}, /* LATIN CAPITAL LETTER O WITH MACRON */ {0x00D7, 0x0168}, /* LATIN CAPITAL LETTER U WITH TILDE */ {0x00D9, 0x0172}, /* LATIN CAPITAL LETTER U WITH OGONEK */ {0x00E0, 0x0101}, /* LATIN SMALL LETTER A WITH MACRON */ {0x00E7, 0x012F}, /* LATIN SMALL LETTER I WITH OGONEK */ {0x00E8, 0x010D}, /* LATIN SMALL LETTER C WITH CARON */ {0x00EA, 0x0119}, /* LATIN SMALL LETTER E WITH OGONEK */ {0x00EC, 0x0117}, /* LATIN SMALL LETTER E WITH DOT ABOVE */ {0x00F1, 0x0146}, /* LATIN SMALL LETTER N WITH CEDILLA */ {0x00F2, 0x014D}, /* LATIN SMALL LETTER O WITH MACRON */ {0x00F7, 0x0169}, /* LATIN SMALL LETTER U WITH TILDE */ {0x00F9, 0x0173}, /* LATIN SMALL LETTER U WITH OGONEK */ {0x00FF, 0x0138}, /* LATIN SMALL LETTER KRA */ }; static const BuiltInMapping iso8859_15[] = { /* iso8859-15 */ {0x00A4, 0x20AC}, /* EURO SIGN */ {0x00A6, 0x0160}, /* LATIN CAPITAL LETTER S WITH CARON */ {0x00A8, 0x0161}, /* LATIN SMALL LETTER S WITH CARON */ {0x00B4, 0x017D}, /* LATIN CAPITAL LETTER Z WITH CARON */ {0x00B8, 0x017E}, /* LATIN SMALL LETTER Z WITH CARON */ {0x00BC, 0x0152}, /* LATIN CAPITAL LIGATURE OE */ {0x00BD, 0x0153}, /* LATIN SMALL LIGATURE OE */ {0x00BE, 0x0178}, /* LATIN CAPITAL LETTER Y WITH DIAERESIS */ }; static const BuiltInMapping iso8859_2[] = { /* iso8859-2 */ {0x00A1, 0x0104}, /* LATIN CAPITAL LETTER A WITH OGONEK */ {0x00A2, 0x02D8}, /* BREVE */ {0x00A3, 0x0141}, /* LATIN CAPITAL LETTER L WITH STROKE */ {0x00A5, 0x013D}, /* LATIN CAPITAL LETTER L WITH CARON */ {0x00A6, 0x015A}, /* LATIN CAPITAL LETTER S WITH ACUTE */ {0x00A9, 0x0160}, /* LATIN CAPITAL LETTER S WITH CARON */ {0x00AA, 0x015E}, /* LATIN CAPITAL LETTER S WITH CEDILLA */ {0x00AB, 0x0164}, /* LATIN CAPITAL LETTER T WITH CARON */ {0x00AC, 0x0179}, /* LATIN CAPITAL LETTER Z WITH ACUTE */ {0x00AE, 0x017D}, /* LATIN CAPITAL LETTER Z WITH CARON */ {0x00AF, 0x017B}, /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ {0x00B1, 0x0105}, /* LATIN SMALL LETTER A WITH OGONEK */ {0x00B2, 0x02DB}, /* OGONEK */ {0x00B3, 0x0142}, /* LATIN SMALL LETTER L WITH STROKE */ {0x00B5, 0x013E}, /* LATIN SMALL LETTER L WITH CARON */ {0x00B6, 0x015B}, /* LATIN SMALL LETTER S WITH ACUTE */ {0x00B7, 0x02C7}, /* CARON */ {0x00B9, 0x0161}, /* LATIN SMALL LETTER S WITH CARON */ {0x00BA, 0x015F}, /* LATIN SMALL LETTER S WITH CEDILLA */ {0x00BB, 0x0165}, /* LATIN SMALL LETTER T WITH CARON */ {0x00BC, 0x017A}, /* LATIN SMALL LETTER Z WITH ACUTE */ {0x00BD, 0x02DD}, /* DOUBLE ACUTE ACCENT */ {0x00BE, 0x017E}, /* LATIN SMALL LETTER Z WITH CARON */ {0x00BF, 0x017C}, /* LATIN SMALL LETTER Z WITH DOT ABOVE */ {0x00C0, 0x0154}, /* LATIN CAPITAL LETTER R WITH ACUTE */ {0x00C3, 0x0102}, /* LATIN CAPITAL LETTER A WITH BREVE */ {0x00C5, 0x0139}, /* LATIN CAPITAL LETTER L WITH ACUTE */ {0x00C6, 0x0106}, /* LATIN CAPITAL LETTER C WITH ACUTE */ {0x00C8, 0x010C}, /* LATIN CAPITAL LETTER C WITH CARON */ {0x00CA, 0x0118}, /* LATIN CAPITAL LETTER E WITH OGONEK */ {0x00CC, 0x011A}, /* LATIN CAPITAL LETTER E WITH CARON */ {0x00CF, 0x010E}, /* LATIN CAPITAL LETTER D WITH CARON */ {0x00D0, 0x0110}, /* LATIN CAPITAL LETTER D WITH STROKE */ {0x00D1, 0x0143}, /* LATIN CAPITAL LETTER N WITH ACUTE */ {0x00D2, 0x0147}, /* LATIN CAPITAL LETTER N WITH CARON */ {0x00D5, 0x0150}, /* LATIN CAPITAL LETTER O WITH DOUBLE ACUTE */ {0x00D8, 0x0158}, /* LATIN CAPITAL LETTER R WITH CARON */ {0x00D9, 0x016E}, /* LATIN CAPITAL LETTER U WITH RING ABOVE */ {0x00DB, 0x0170}, /* LATIN CAPITAL LETTER U WITH DOUBLE ACUTE */ {0x00DE, 0x0162}, /* LATIN CAPITAL LETTER T WITH CEDILLA */ {0x00E0, 0x0155}, /* LATIN SMALL LETTER R WITH ACUTE */ {0x00E3, 0x0103}, /* LATIN SMALL LETTER A WITH BREVE */ {0x00E5, 0x013A}, /* LATIN SMALL LETTER L WITH ACUTE */ {0x00E6, 0x0107}, /* LATIN SMALL LETTER C WITH ACUTE */ {0x00E8, 0x010D}, /* LATIN SMALL LETTER C WITH CARON */ {0x00EA, 0x0119}, /* LATIN SMALL LETTER E WITH OGONEK */ {0x00EC, 0x011B}, /* LATIN SMALL LETTER E WITH CARON */ {0x00EF, 0x010F}, /* LATIN SMALL LETTER D WITH CARON */ {0x00F0, 0x0111}, /* LATIN SMALL LETTER D WITH STROKE */ {0x00F1, 0x0144}, /* LATIN SMALL LETTER N WITH ACUTE */ {0x00F2, 0x0148}, /* LATIN SMALL LETTER N WITH CARON */ {0x00F5, 0x0151}, /* LATIN SMALL LETTER O WITH DOUBLE ACUTE */ {0x00F8, 0x0159}, /* LATIN SMALL LETTER R WITH CARON */ {0x00F9, 0x016F}, /* LATIN SMALL LETTER U WITH RING ABOVE */ {0x00FB, 0x0171}, /* LATIN SMALL LETTER U WITH DOUBLE ACUTE */ {0x00FE, 0x0163}, /* LATIN SMALL LETTER T WITH CEDILLA */ {0x00FF, 0x02D9}, /* DOT ABOVE */ }; static const BuiltInMapping iso8859_3[] = { /* iso8859-3 */ {0x00A1, 0x0126}, /* LATIN CAPITAL LETTER H WITH STROKE */ {0x00A2, 0x02D8}, /* BREVE */ {0x00A6, 0x0124}, /* LATIN CAPITAL LETTER H WITH CIRCUMFLEX */ {0x00A9, 0x0130}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ {0x00AA, 0x015E}, /* LATIN CAPITAL LETTER S WITH CEDILLA */ {0x00AB, 0x011E}, /* LATIN CAPITAL LETTER G WITH BREVE */ {0x00AC, 0x0134}, /* LATIN CAPITAL LETTER J WITH CIRCUMFLEX */ {0x00AF, 0x017B}, /* LATIN CAPITAL LETTER Z WITH DOT ABOVE */ {0x00B1, 0x0127}, /* LATIN SMALL LETTER H WITH STROKE */ {0x00B6, 0x0125}, /* LATIN SMALL LETTER H WITH CIRCUMFLEX */ {0x00B9, 0x0131}, /* LATIN SMALL LETTER DOTLESS I */ {0x00BA, 0x015F}, /* LATIN SMALL LETTER S WITH CEDILLA */ {0x00BB, 0x011F}, /* LATIN SMALL LETTER G WITH BREVE */ {0x00BC, 0x0135}, /* LATIN SMALL LETTER J WITH CIRCUMFLEX */ {0x00BF, 0x017C}, /* LATIN SMALL LETTER Z WITH DOT ABOVE */ {0x00C5, 0x010A}, /* LATIN CAPITAL LETTER C WITH DOT ABOVE */ {0x00C6, 0x0108}, /* LATIN CAPITAL LETTER C WITH CIRCUMFLEX */ {0x00D5, 0x0120}, /* LATIN CAPITAL LETTER G WITH DOT ABOVE */ {0x00D8, 0x011C}, /* LATIN CAPITAL LETTER G WITH CIRCUMFLEX */ {0x00DD, 0x016C}, /* LATIN CAPITAL LETTER U WITH BREVE */ {0x00DE, 0x015C}, /* LATIN CAPITAL LETTER S WITH CIRCUMFLEX */ {0x00E5, 0x010B}, /* LATIN SMALL LETTER C WITH DOT ABOVE */ {0x00E6, 0x0109}, /* LATIN SMALL LETTER C WITH CIRCUMFLEX */ {0x00F5, 0x0121}, /* LATIN SMALL LETTER G WITH DOT ABOVE */ {0x00F8, 0x011D}, /* LATIN SMALL LETTER G WITH CIRCUMFLEX */ {0x00FD, 0x016D}, /* LATIN SMALL LETTER U WITH BREVE */ {0x00FE, 0x015D}, /* LATIN SMALL LETTER S WITH CIRCUMFLEX */ {0x00FF, 0x02D9}, /* DOT ABOVE */ }; static const BuiltInMapping iso8859_4[] = { /* iso8859-4 */ {0x00A1, 0x0104}, /* LATIN CAPITAL LETTER A WITH OGONEK */ {0x00A2, 0x0138}, /* LATIN SMALL LETTER KRA */ {0x00A3, 0x0156}, /* LATIN CAPITAL LETTER R WITH CEDILLA */ {0x00A5, 0x0128}, /* LATIN CAPITAL LETTER I WITH TILDE */ {0x00A6, 0x013B}, /* LATIN CAPITAL LETTER L WITH CEDILLA */ {0x00A9, 0x0160}, /* LATIN CAPITAL LETTER S WITH CARON */ {0x00AA, 0x0112}, /* LATIN CAPITAL LETTER E WITH MACRON */ {0x00AB, 0x0122}, /* LATIN CAPITAL LETTER G WITH CEDILLA */ {0x00AC, 0x0166}, /* LATIN CAPITAL LETTER T WITH STROKE */ {0x00AE, 0x017D}, /* LATIN CAPITAL LETTER Z WITH CARON */ {0x00B1, 0x0105}, /* LATIN SMALL LETTER A WITH OGONEK */ {0x00B2, 0x02DB}, /* OGONEK */ {0x00B3, 0x0157}, /* LATIN SMALL LETTER R WITH CEDILLA */ {0x00B5, 0x0129}, /* LATIN SMALL LETTER I WITH TILDE */ {0x00B6, 0x013C}, /* LATIN SMALL LETTER L WITH CEDILLA */ {0x00B7, 0x02C7}, /* CARON */ {0x00B9, 0x0161}, /* LATIN SMALL LETTER S WITH CARON */ {0x00BA, 0x0113}, /* LATIN SMALL LETTER E WITH MACRON */ {0x00BB, 0x0123}, /* LATIN SMALL LETTER G WITH CEDILLA */ {0x00BC, 0x0167}, /* LATIN SMALL LETTER T WITH STROKE */ {0x00BD, 0x014A}, /* LATIN CAPITAL LETTER ENG */ {0x00BE, 0x017E}, /* LATIN SMALL LETTER Z WITH CARON */ {0x00BF, 0x014B}, /* LATIN SMALL LETTER ENG */ {0x00C0, 0x0100}, /* LATIN CAPITAL LETTER A WITH MACRON */ {0x00C7, 0x012E}, /* LATIN CAPITAL LETTER I WITH OGONEK */ {0x00C8, 0x010C}, /* LATIN CAPITAL LETTER C WITH CARON */ {0x00CA, 0x0118}, /* LATIN CAPITAL LETTER E WITH OGONEK */ {0x00CC, 0x0116}, /* LATIN CAPITAL LETTER E WITH DOT ABOVE */ {0x00CF, 0x012A}, /* LATIN CAPITAL LETTER I WITH MACRON */ {0x00D0, 0x0110}, /* LATIN CAPITAL LETTER D WITH STROKE */ {0x00D1, 0x0145}, /* LATIN CAPITAL LETTER N WITH CEDILLA */ {0x00D2, 0x014C}, /* LATIN CAPITAL LETTER O WITH MACRON */ {0x00D3, 0x0136}, /* LATIN CAPITAL LETTER K WITH CEDILLA */ {0x00D9, 0x0172}, /* LATIN CAPITAL LETTER U WITH OGONEK */ {0x00DD, 0x0168}, /* LATIN CAPITAL LETTER U WITH TILDE */ {0x00DE, 0x016A}, /* LATIN CAPITAL LETTER U WITH MACRON */ {0x00E0, 0x0101}, /* LATIN SMALL LETTER A WITH MACRON */ {0x00E7, 0x012F}, /* LATIN SMALL LETTER I WITH OGONEK */ {0x00E8, 0x010D}, /* LATIN SMALL LETTER C WITH CARON */ {0x00EA, 0x0119}, /* LATIN SMALL LETTER E WITH OGONEK */ {0x00EC, 0x0117}, /* LATIN SMALL LETTER E WITH DOT ABOVE */ {0x00EF, 0x012B}, /* LATIN SMALL LETTER I WITH MACRON */ {0x00F0, 0x0111}, /* LATIN SMALL LETTER D WITH STROKE */ {0x00F1, 0x0146}, /* LATIN SMALL LETTER N WITH CEDILLA */ {0x00F2, 0x014D}, /* LATIN SMALL LETTER O WITH MACRON */ {0x00F3, 0x0137}, /* LATIN SMALL LETTER K WITH CEDILLA */ {0x00F9, 0x0173}, /* LATIN SMALL LETTER U WITH OGONEK */ {0x00FD, 0x0169}, /* LATIN SMALL LETTER U WITH TILDE */ {0x00FE, 0x016B}, /* LATIN SMALL LETTER U WITH MACRON */ {0x00FF, 0x02D9}, /* DOT ABOVE */ }; static const BuiltInMapping iso8859_5[] = { /* iso8859-5 */ {0x00A1, 0x0401}, /* CYRILLIC CAPITAL LETTER IO */ {0x00A2, 0x0402}, /* CYRILLIC CAPITAL LETTER DJE */ {0x00A3, 0x0403}, /* CYRILLIC CAPITAL LETTER GJE */ {0x00A4, 0x0404}, /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ {0x00A5, 0x0405}, /* CYRILLIC CAPITAL LETTER DZE */ {0x00A6, 0x0406}, /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00A7, 0x0407}, /* CYRILLIC CAPITAL LETTER YI */ {0x00A8, 0x0408}, /* CYRILLIC CAPITAL LETTER JE */ {0x00A9, 0x0409}, /* CYRILLIC CAPITAL LETTER LJE */ {0x00AA, 0x040A}, /* CYRILLIC CAPITAL LETTER NJE */ {0x00AB, 0x040B}, /* CYRILLIC CAPITAL LETTER TSHE */ {0x00AC, 0x040C}, /* CYRILLIC CAPITAL LETTER KJE */ {0x00AE, 0x040E}, /* CYRILLIC CAPITAL LETTER SHORT U */ {0x00AF, 0x040F}, /* CYRILLIC CAPITAL LETTER DZHE */ {0x00B0, 0x0410}, /* CYRILLIC CAPITAL LETTER A */ {0x00B1, 0x0411}, /* CYRILLIC CAPITAL LETTER BE */ {0x00B2, 0x0412}, /* CYRILLIC CAPITAL LETTER VE */ {0x00B3, 0x0413}, /* CYRILLIC CAPITAL LETTER GHE */ {0x00B4, 0x0414}, /* CYRILLIC CAPITAL LETTER DE */ {0x00B5, 0x0415}, /* CYRILLIC CAPITAL LETTER IE */ {0x00B6, 0x0416}, /* CYRILLIC CAPITAL LETTER ZHE */ {0x00B7, 0x0417}, /* CYRILLIC CAPITAL LETTER ZE */ {0x00B8, 0x0418}, /* CYRILLIC CAPITAL LETTER I */ {0x00B9, 0x0419}, /* CYRILLIC CAPITAL LETTER SHORT I */ {0x00BA, 0x041A}, /* CYRILLIC CAPITAL LETTER KA */ {0x00BB, 0x041B}, /* CYRILLIC CAPITAL LETTER EL */ {0x00BC, 0x041C}, /* CYRILLIC CAPITAL LETTER EM */ {0x00BD, 0x041D}, /* CYRILLIC CAPITAL LETTER EN */ {0x00BE, 0x041E}, /* CYRILLIC CAPITAL LETTER O */ {0x00BF, 0x041F}, /* CYRILLIC CAPITAL LETTER PE */ {0x00C0, 0x0420}, /* CYRILLIC CAPITAL LETTER ER */ {0x00C1, 0x0421}, /* CYRILLIC CAPITAL LETTER ES */ {0x00C2, 0x0422}, /* CYRILLIC CAPITAL LETTER TE */ {0x00C3, 0x0423}, /* CYRILLIC CAPITAL LETTER U */ {0x00C4, 0x0424}, /* CYRILLIC CAPITAL LETTER EF */ {0x00C5, 0x0425}, /* CYRILLIC CAPITAL LETTER HA */ {0x00C6, 0x0426}, /* CYRILLIC CAPITAL LETTER TSE */ {0x00C7, 0x0427}, /* CYRILLIC CAPITAL LETTER CHE */ {0x00C8, 0x0428}, /* CYRILLIC CAPITAL LETTER SHA */ {0x00C9, 0x0429}, /* CYRILLIC CAPITAL LETTER SHCHA */ {0x00CA, 0x042A}, /* CYRILLIC CAPITAL LETTER HARD SIGN */ {0x00CB, 0x042B}, /* CYRILLIC CAPITAL LETTER YERU */ {0x00CC, 0x042C}, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ {0x00CD, 0x042D}, /* CYRILLIC CAPITAL LETTER E */ {0x00CE, 0x042E}, /* CYRILLIC CAPITAL LETTER YU */ {0x00CF, 0x042F}, /* CYRILLIC CAPITAL LETTER YA */ {0x00D0, 0x0430}, /* CYRILLIC SMALL LETTER A */ {0x00D1, 0x0431}, /* CYRILLIC SMALL LETTER BE */ {0x00D2, 0x0432}, /* CYRILLIC SMALL LETTER VE */ {0x00D3, 0x0433}, /* CYRILLIC SMALL LETTER GHE */ {0x00D4, 0x0434}, /* CYRILLIC SMALL LETTER DE */ {0x00D5, 0x0435}, /* CYRILLIC SMALL LETTER IE */ {0x00D6, 0x0436}, /* CYRILLIC SMALL LETTER ZHE */ {0x00D7, 0x0437}, /* CYRILLIC SMALL LETTER ZE */ {0x00D8, 0x0438}, /* CYRILLIC SMALL LETTER I */ {0x00D9, 0x0439}, /* CYRILLIC SMALL LETTER SHORT I */ {0x00DA, 0x043A}, /* CYRILLIC SMALL LETTER KA */ {0x00DB, 0x043B}, /* CYRILLIC SMALL LETTER EL */ {0x00DC, 0x043C}, /* CYRILLIC SMALL LETTER EM */ {0x00DD, 0x043D}, /* CYRILLIC SMALL LETTER EN */ {0x00DE, 0x043E}, /* CYRILLIC SMALL LETTER O */ {0x00DF, 0x043F}, /* CYRILLIC SMALL LETTER PE */ {0x00E0, 0x0440}, /* CYRILLIC SMALL LETTER ER */ {0x00E1, 0x0441}, /* CYRILLIC SMALL LETTER ES */ {0x00E2, 0x0442}, /* CYRILLIC SMALL LETTER TE */ {0x00E3, 0x0443}, /* CYRILLIC SMALL LETTER U */ {0x00E4, 0x0444}, /* CYRILLIC SMALL LETTER EF */ {0x00E5, 0x0445}, /* CYRILLIC SMALL LETTER HA */ {0x00E6, 0x0446}, /* CYRILLIC SMALL LETTER TSE */ {0x00E7, 0x0447}, /* CYRILLIC SMALL LETTER CHE */ {0x00E8, 0x0448}, /* CYRILLIC SMALL LETTER SHA */ {0x00E9, 0x0449}, /* CYRILLIC SMALL LETTER SHCHA */ {0x00EA, 0x044A}, /* CYRILLIC SMALL LETTER HARD SIGN */ {0x00EB, 0x044B}, /* CYRILLIC SMALL LETTER YERU */ {0x00EC, 0x044C}, /* CYRILLIC SMALL LETTER SOFT SIGN */ {0x00ED, 0x044D}, /* CYRILLIC SMALL LETTER E */ {0x00EE, 0x044E}, /* CYRILLIC SMALL LETTER YU */ {0x00EF, 0x044F}, /* CYRILLIC SMALL LETTER YA */ {0x00F0, 0x2116}, /* NUMERO SIGN */ {0x00F1, 0x0451}, /* CYRILLIC SMALL LETTER IO */ {0x00F2, 0x0452}, /* CYRILLIC SMALL LETTER DJE */ {0x00F3, 0x0453}, /* CYRILLIC SMALL LETTER GJE */ {0x00F4, 0x0454}, /* CYRILLIC SMALL LETTER UKRAINIAN IE */ {0x00F5, 0x0455}, /* CYRILLIC SMALL LETTER DZE */ {0x00F6, 0x0456}, /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00F7, 0x0457}, /* CYRILLIC SMALL LETTER YI */ {0x00F8, 0x0458}, /* CYRILLIC SMALL LETTER JE */ {0x00F9, 0x0459}, /* CYRILLIC SMALL LETTER LJE */ {0x00FA, 0x045A}, /* CYRILLIC SMALL LETTER NJE */ {0x00FB, 0x045B}, /* CYRILLIC SMALL LETTER TSHE */ {0x00FC, 0x045C}, /* CYRILLIC SMALL LETTER KJE */ {0x00FD, 0x00A7}, /* SECTION SIGN */ {0x00FE, 0x045E}, /* CYRILLIC SMALL LETTER SHORT U */ {0x00FF, 0x045F}, /* CYRILLIC SMALL LETTER DZHE */ }; static const BuiltInMapping iso8859_6[] = { /* iso8859-6 */ {0x00AC, 0x060C}, /* ARABIC COMMA */ {0x00BB, 0x061B}, /* ARABIC SEMICOLON */ {0x00BF, 0x061F}, /* ARABIC QUESTION MARK */ {0x00C1, 0x0621}, /* ARABIC LETTER HAMZA */ {0x00C2, 0x0622}, /* ARABIC LETTER ALEF WITH MADDA ABOVE */ {0x00C3, 0x0623}, /* ARABIC LETTER ALEF WITH HAMZA ABOVE */ {0x00C4, 0x0624}, /* ARABIC LETTER WAW WITH HAMZA ABOVE */ {0x00C5, 0x0625}, /* ARABIC LETTER ALEF WITH HAMZA BELOW */ {0x00C6, 0x0626}, /* ARABIC LETTER YEH WITH HAMZA ABOVE */ {0x00C7, 0x0627}, /* ARABIC LETTER ALEF */ {0x00C8, 0x0628}, /* ARABIC LETTER BEH */ {0x00C9, 0x0629}, /* ARABIC LETTER TEH MARBUTA */ {0x00CA, 0x062A}, /* ARABIC LETTER TEH */ {0x00CB, 0x062B}, /* ARABIC LETTER THEH */ {0x00CC, 0x062C}, /* ARABIC LETTER JEEM */ {0x00CD, 0x062D}, /* ARABIC LETTER HAH */ {0x00CE, 0x062E}, /* ARABIC LETTER KHAH */ {0x00CF, 0x062F}, /* ARABIC LETTER DAL */ {0x00D0, 0x0630}, /* ARABIC LETTER THAL */ {0x00D1, 0x0631}, /* ARABIC LETTER REH */ {0x00D2, 0x0632}, /* ARABIC LETTER ZAIN */ {0x00D3, 0x0633}, /* ARABIC LETTER SEEN */ {0x00D4, 0x0634}, /* ARABIC LETTER SHEEN */ {0x00D5, 0x0635}, /* ARABIC LETTER SAD */ {0x00D6, 0x0636}, /* ARABIC LETTER DAD */ {0x00D7, 0x0637}, /* ARABIC LETTER TAH */ {0x00D8, 0x0638}, /* ARABIC LETTER ZAH */ {0x00D9, 0x0639}, /* ARABIC LETTER AIN */ {0x00DA, 0x063A}, /* ARABIC LETTER GHAIN */ {0x00E0, 0x0640}, /* ARABIC TATWEEL */ {0x00E1, 0x0641}, /* ARABIC LETTER FEH */ {0x00E2, 0x0642}, /* ARABIC LETTER QAF */ {0x00E3, 0x0643}, /* ARABIC LETTER KAF */ {0x00E4, 0x0644}, /* ARABIC LETTER LAM */ {0x00E5, 0x0645}, /* ARABIC LETTER MEEM */ {0x00E6, 0x0646}, /* ARABIC LETTER NOON */ {0x00E7, 0x0647}, /* ARABIC LETTER HEH */ {0x00E8, 0x0648}, /* ARABIC LETTER WAW */ {0x00E9, 0x0649}, /* ARABIC LETTER ALEF MAKSURA */ {0x00EA, 0x064A}, /* ARABIC LETTER YEH */ {0x00EB, 0x064B}, /* ARABIC FATHATAN */ {0x00EC, 0x064C}, /* ARABIC DAMMATAN */ {0x00ED, 0x064D}, /* ARABIC KASRATAN */ {0x00EE, 0x064E}, /* ARABIC FATHA */ {0x00EF, 0x064F}, /* ARABIC DAMMA */ {0x00F0, 0x0650}, /* ARABIC KASRA */ {0x00F1, 0x0651}, /* ARABIC SHADDA */ {0x00F2, 0x0652}, /* ARABIC SUKUN */ }; static const BuiltInMapping iso8859_7[] = { /* iso8859-7 */ {0x00A1, 0x2018}, /* LEFT SINGLE QUOTATION MARK */ {0x00A2, 0x2019}, /* RIGHT SINGLE QUOTATION MARK */ {0x00A4, 0x20AC}, /* EURO SIGN */ {0x00A5, 0x20AF}, /* DRACHMA SIGN */ {0x00AA, 0x037A}, /* GREEK YPOGEGRAMMENI */ {0x00AF, 0x2015}, /* HORIZONTAL BAR */ {0x00B4, 0x0384}, /* GREEK TONOS */ {0x00B5, 0x0385}, /* GREEK DIALYTIKA TONOS */ {0x00B6, 0x0386}, /* GREEK CAPITAL LETTER ALPHA WITH TONOS */ {0x00B8, 0x0388}, /* GREEK CAPITAL LETTER EPSILON WITH TONOS */ {0x00B9, 0x0389}, /* GREEK CAPITAL LETTER ETA WITH TONOS */ {0x00BA, 0x038A}, /* GREEK CAPITAL LETTER IOTA WITH TONOS */ {0x00BC, 0x038C}, /* GREEK CAPITAL LETTER OMICRON WITH TONOS */ {0x00BE, 0x038E}, /* GREEK CAPITAL LETTER UPSILON WITH TONOS */ {0x00BF, 0x038F}, /* GREEK CAPITAL LETTER OMEGA WITH TONOS */ {0x00C0, 0x0390}, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA AND TONOS */ {0x00C1, 0x0391}, /* GREEK CAPITAL LETTER ALPHA */ {0x00C2, 0x0392}, /* GREEK CAPITAL LETTER BETA */ {0x00C3, 0x0393}, /* GREEK CAPITAL LETTER GAMMA */ {0x00C4, 0x0394}, /* GREEK CAPITAL LETTER DELTA */ {0x00C5, 0x0395}, /* GREEK CAPITAL LETTER EPSILON */ {0x00C6, 0x0396}, /* GREEK CAPITAL LETTER ZETA */ {0x00C7, 0x0397}, /* GREEK CAPITAL LETTER ETA */ {0x00C8, 0x0398}, /* GREEK CAPITAL LETTER THETA */ {0x00C9, 0x0399}, /* GREEK CAPITAL LETTER IOTA */ {0x00CA, 0x039A}, /* GREEK CAPITAL LETTER KAPPA */ {0x00CB, 0x039B}, /* GREEK CAPITAL LETTER LAMDA */ {0x00CC, 0x039C}, /* GREEK CAPITAL LETTER MU */ {0x00CD, 0x039D}, /* GREEK CAPITAL LETTER NU */ {0x00CE, 0x039E}, /* GREEK CAPITAL LETTER XI */ {0x00CF, 0x039F}, /* GREEK CAPITAL LETTER OMICRON */ {0x00D0, 0x03A0}, /* GREEK CAPITAL LETTER PI */ {0x00D1, 0x03A1}, /* GREEK CAPITAL LETTER RHO */ {0x00D3, 0x03A3}, /* GREEK CAPITAL LETTER SIGMA */ {0x00D4, 0x03A4}, /* GREEK CAPITAL LETTER TAU */ {0x00D5, 0x03A5}, /* GREEK CAPITAL LETTER UPSILON */ {0x00D6, 0x03A6}, /* GREEK CAPITAL LETTER PHI */ {0x00D7, 0x03A7}, /* GREEK CAPITAL LETTER CHI */ {0x00D8, 0x03A8}, /* GREEK CAPITAL LETTER PSI */ {0x00D9, 0x03A9}, /* GREEK CAPITAL LETTER OMEGA */ {0x00DA, 0x03AA}, /* GREEK CAPITAL LETTER IOTA WITH DIALYTIKA */ {0x00DB, 0x03AB}, /* GREEK CAPITAL LETTER UPSILON WITH DIALYTIKA */ {0x00DC, 0x03AC}, /* GREEK SMALL LETTER ALPHA WITH TONOS */ {0x00DD, 0x03AD}, /* GREEK SMALL LETTER EPSILON WITH TONOS */ {0x00DE, 0x03AE}, /* GREEK SMALL LETTER ETA WITH TONOS */ {0x00DF, 0x03AF}, /* GREEK SMALL LETTER IOTA WITH TONOS */ {0x00E0, 0x03B0}, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA AND TONOS */ {0x00E1, 0x03B1}, /* GREEK SMALL LETTER ALPHA */ {0x00E2, 0x03B2}, /* GREEK SMALL LETTER BETA */ {0x00E3, 0x03B3}, /* GREEK SMALL LETTER GAMMA */ {0x00E4, 0x03B4}, /* GREEK SMALL LETTER DELTA */ {0x00E5, 0x03B5}, /* GREEK SMALL LETTER EPSILON */ {0x00E6, 0x03B6}, /* GREEK SMALL LETTER ZETA */ {0x00E7, 0x03B7}, /* GREEK SMALL LETTER ETA */ {0x00E8, 0x03B8}, /* GREEK SMALL LETTER THETA */ {0x00E9, 0x03B9}, /* GREEK SMALL LETTER IOTA */ {0x00EA, 0x03BA}, /* GREEK SMALL LETTER KAPPA */ {0x00EB, 0x03BB}, /* GREEK SMALL LETTER LAMDA */ {0x00EC, 0x03BC}, /* GREEK SMALL LETTER MU */ {0x00ED, 0x03BD}, /* GREEK SMALL LETTER NU */ {0x00EE, 0x03BE}, /* GREEK SMALL LETTER XI */ {0x00EF, 0x03BF}, /* GREEK SMALL LETTER OMICRON */ {0x00F0, 0x03C0}, /* GREEK SMALL LETTER PI */ {0x00F1, 0x03C1}, /* GREEK SMALL LETTER RHO */ {0x00F2, 0x03C2}, /* GREEK SMALL LETTER FINAL SIGMA */ {0x00F3, 0x03C3}, /* GREEK SMALL LETTER SIGMA */ {0x00F4, 0x03C4}, /* GREEK SMALL LETTER TAU */ {0x00F5, 0x03C5}, /* GREEK SMALL LETTER UPSILON */ {0x00F6, 0x03C6}, /* GREEK SMALL LETTER PHI */ {0x00F7, 0x03C7}, /* GREEK SMALL LETTER CHI */ {0x00F8, 0x03C8}, /* GREEK SMALL LETTER PSI */ {0x00F9, 0x03C9}, /* GREEK SMALL LETTER OMEGA */ {0x00FA, 0x03CA}, /* GREEK SMALL LETTER IOTA WITH DIALYTIKA */ {0x00FB, 0x03CB}, /* GREEK SMALL LETTER UPSILON WITH DIALYTIKA */ {0x00FC, 0x03CC}, /* GREEK SMALL LETTER OMICRON WITH TONOS */ {0x00FD, 0x03CD}, /* GREEK SMALL LETTER UPSILON WITH TONOS */ {0x00FE, 0x03CE}, /* GREEK SMALL LETTER OMEGA WITH TONOS */ }; static const BuiltInMapping iso8859_8[] = { /* iso8859-8 */ {0x00AA, 0x00D7}, /* MULTIPLICATION SIGN */ {0x00BA, 0x00F7}, /* DIVISION SIGN */ {0x00DF, 0x2017}, /* DOUBLE LOW LINE */ {0x00E0, 0x05D0}, /* HEBREW LETTER ALEF */ {0x00E1, 0x05D1}, /* HEBREW LETTER BET */ {0x00E2, 0x05D2}, /* HEBREW LETTER GIMEL */ {0x00E3, 0x05D3}, /* HEBREW LETTER DALET */ {0x00E4, 0x05D4}, /* HEBREW LETTER HE */ {0x00E5, 0x05D5}, /* HEBREW LETTER VAV */ {0x00E6, 0x05D6}, /* HEBREW LETTER ZAYIN */ {0x00E7, 0x05D7}, /* HEBREW LETTER HET */ {0x00E8, 0x05D8}, /* HEBREW LETTER TET */ {0x00E9, 0x05D9}, /* HEBREW LETTER YOD */ {0x00EA, 0x05DA}, /* HEBREW LETTER FINAL KAF */ {0x00EB, 0x05DB}, /* HEBREW LETTER KAF */ {0x00EC, 0x05DC}, /* HEBREW LETTER LAMED */ {0x00ED, 0x05DD}, /* HEBREW LETTER FINAL MEM */ {0x00EE, 0x05DE}, /* HEBREW LETTER MEM */ {0x00EF, 0x05DF}, /* HEBREW LETTER FINAL NUN */ {0x00F0, 0x05E0}, /* HEBREW LETTER NUN */ {0x00F1, 0x05E1}, /* HEBREW LETTER SAMEKH */ {0x00F2, 0x05E2}, /* HEBREW LETTER AYIN */ {0x00F3, 0x05E3}, /* HEBREW LETTER FINAL PE */ {0x00F4, 0x05E4}, /* HEBREW LETTER PE */ {0x00F5, 0x05E5}, /* HEBREW LETTER FINAL TSADI */ {0x00F6, 0x05E6}, /* HEBREW LETTER TSADI */ {0x00F7, 0x05E7}, /* HEBREW LETTER QOF */ {0x00F8, 0x05E8}, /* HEBREW LETTER RESH */ {0x00F9, 0x05E9}, /* HEBREW LETTER SHIN */ {0x00FA, 0x05EA}, /* HEBREW LETTER TAV */ {0x00FD, 0x200E}, /* LEFT-TO-RIGHT MARK */ {0x00FE, 0x200F}, /* RIGHT-TO-LEFT MARK */ }; static const BuiltInMapping iso8859_9[] = { /* iso8859-9 */ {0x00D0, 0x011E}, /* LATIN CAPITAL LETTER G WITH BREVE */ {0x00DD, 0x0130}, /* LATIN CAPITAL LETTER I WITH DOT ABOVE */ {0x00DE, 0x015E}, /* LATIN CAPITAL LETTER S WITH CEDILLA */ {0x00F0, 0x011F}, /* LATIN SMALL LETTER G WITH BREVE */ {0x00FD, 0x0131}, /* LATIN SMALL LETTER DOTLESS I */ {0x00FE, 0x015F}, /* LATIN SMALL LETTER S WITH CEDILLA */ }; static const BuiltInMapping koi8_e[] = { /* koi8-e */ {0x00A1, 0x0452}, /* CYRILLIC SMALL LETTER DJE */ {0x00A2, 0x0453}, /* CYRILLIC SMALL LETTER GJE */ {0x00A3, 0x0451}, /* CYRILLIC SMALL LETTER IO */ {0x00A4, 0x0454}, /* CYRILLIC SMALL LETTER UKRAINIAN IE */ {0x00A5, 0x0455}, /* CYRILLIC SMALL LETTER DZE */ {0x00A6, 0x0456}, /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00A7, 0x0457}, /* CYRILLIC SMALL LETTER YI */ {0x00A8, 0x0458}, /* CYRILLIC SMALL LETTER JE */ {0x00A9, 0x0459}, /* CYRILLIC SMALL LETTER LJE */ {0x00AA, 0x045A}, /* CYRILLIC SMALL LETTER NJE */ {0x00AB, 0x045B}, /* CYRILLIC SMALL LETTER TSHE */ {0x00AC, 0x045C}, /* CYRILLIC SMALL LETTER KJE */ {0x00AE, 0x045E}, /* CYRILLIC SMALL LETTER SHORT U */ {0x00AF, 0x045F}, /* CYRILLIC SMALL LETTER DZHE */ {0x00B0, 0x2116}, /* NUMERO SIGN */ {0x00B1, 0x0402}, /* CYRILLIC CAPITAL LETTER DJE */ {0x00B2, 0x0403}, /* CYRILLIC CAPITAL LETTER GJE */ {0x00B3, 0x0401}, /* CYRILLIC CAPITAL LETTER IO */ {0x00B4, 0x0404}, /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ {0x00B5, 0x0405}, /* CYRILLIC CAPITAL LETTER DZE */ {0x00B6, 0x0406}, /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00B7, 0x0407}, /* CYRILLIC CAPITAL LETTER YI */ {0x00B8, 0x0408}, /* CYRILLIC CAPITAL LETTER JE */ {0x00B9, 0x0409}, /* CYRILLIC CAPITAL LETTER LJE */ {0x00BA, 0x040A}, /* CYRILLIC CAPITAL LETTER NJE */ {0x00BB, 0x040B}, /* CYRILLIC CAPITAL LETTER TSHE */ {0x00BC, 0x040C}, /* CYRILLIC CAPITAL LETTER KJE */ {0x00BD, 0x00A4}, /* CURRENCY SIGN */ {0x00BE, 0x040E}, /* CYRILLIC CAPITAL LETTER SHORT U */ {0x00BF, 0x040F}, /* CYRILLIC CAPITAL LETTER DZHE */ {0x00C0, 0x044E}, /* CYRILLIC SMALL LETTER YU */ {0x00C1, 0x0430}, /* CYRILLIC SMALL LETTER A */ {0x00C2, 0x0431}, /* CYRILLIC SMALL LETTER BE */ {0x00C3, 0x0446}, /* CYRILLIC SMALL LETTER TSE */ {0x00C4, 0x0434}, /* CYRILLIC SMALL LETTER DE */ {0x00C5, 0x0435}, /* CYRILLIC SMALL LETTER IE */ {0x00C6, 0x0444}, /* CYRILLIC SMALL LETTER EF */ {0x00C7, 0x0433}, /* CYRILLIC SMALL LETTER GHE */ {0x00C8, 0x0445}, /* CYRILLIC SMALL LETTER HA */ {0x00C9, 0x0438}, /* CYRILLIC SMALL LETTER I */ {0x00CA, 0x0439}, /* CYRILLIC SMALL LETTER SHORT I */ {0x00CB, 0x043A}, /* CYRILLIC SMALL LETTER KA */ {0x00CC, 0x043B}, /* CYRILLIC SMALL LETTER EL */ {0x00CD, 0x043C}, /* CYRILLIC SMALL LETTER EM */ {0x00CE, 0x043D}, /* CYRILLIC SMALL LETTER EN */ {0x00CF, 0x043E}, /* CYRILLIC SMALL LETTER O */ {0x00D0, 0x043F}, /* CYRILLIC SMALL LETTER PE */ {0x00D1, 0x044F}, /* CYRILLIC SMALL LETTER YA */ {0x00D2, 0x0440}, /* CYRILLIC SMALL LETTER ER */ {0x00D3, 0x0441}, /* CYRILLIC SMALL LETTER ES */ {0x00D4, 0x0442}, /* CYRILLIC SMALL LETTER TE */ {0x00D5, 0x0443}, /* CYRILLIC SMALL LETTER U */ {0x00D6, 0x0436}, /* CYRILLIC SMALL LETTER ZHE */ {0x00D7, 0x0432}, /* CYRILLIC SMALL LETTER VE */ {0x00D8, 0x044C}, /* CYRILLIC SMALL LETTER SOFT SIGN */ {0x00D9, 0x044B}, /* CYRILLIC SMALL LETTER YERU */ {0x00DA, 0x0437}, /* CYRILLIC SMALL LETTER ZE */ {0x00DB, 0x0448}, /* CYRILLIC SMALL LETTER SHA */ {0x00DC, 0x044D}, /* CYRILLIC SMALL LETTER E */ {0x00DD, 0x0449}, /* CYRILLIC SMALL LETTER SHCHA */ {0x00DE, 0x0447}, /* CYRILLIC SMALL LETTER CHE */ {0x00DF, 0x044A}, /* CYRILLIC SMALL LETTER HARD SIGN */ {0x00E0, 0x042E}, /* CYRILLIC CAPITAL LETTER YU */ {0x00E1, 0x0410}, /* CYRILLIC CAPITAL LETTER A */ {0x00E2, 0x0411}, /* CYRILLIC CAPITAL LETTER BE */ {0x00E3, 0x0426}, /* CYRILLIC CAPITAL LETTER TSE */ {0x00E4, 0x0414}, /* CYRILLIC CAPITAL LETTER DE */ {0x00E5, 0x0415}, /* CYRILLIC CAPITAL LETTER IE */ {0x00E6, 0x0424}, /* CYRILLIC CAPITAL LETTER EF */ {0x00E7, 0x0413}, /* CYRILLIC CAPITAL LETTER GHE */ {0x00E8, 0x0425}, /* CYRILLIC CAPITAL LETTER HA */ {0x00E9, 0x0418}, /* CYRILLIC CAPITAL LETTER I */ {0x00EA, 0x0419}, /* CYRILLIC CAPITAL LETTER SHORT I */ {0x00EB, 0x041A}, /* CYRILLIC CAPITAL LETTER KA */ {0x00EC, 0x041B}, /* CYRILLIC CAPITAL LETTER EL */ {0x00ED, 0x041C}, /* CYRILLIC CAPITAL LETTER EM */ {0x00EE, 0x041D}, /* CYRILLIC CAPITAL LETTER EN */ {0x00EF, 0x041E}, /* CYRILLIC CAPITAL LETTER O */ {0x00F0, 0x041F}, /* CYRILLIC CAPITAL LETTER PE */ {0x00F1, 0x042F}, /* CYRILLIC CAPITAL LETTER YA */ {0x00F2, 0x0420}, /* CYRILLIC CAPITAL LETTER ER */ {0x00F3, 0x0421}, /* CYRILLIC CAPITAL LETTER ES */ {0x00F4, 0x0422}, /* CYRILLIC CAPITAL LETTER TE */ {0x00F5, 0x0423}, /* CYRILLIC CAPITAL LETTER U */ {0x00F6, 0x0416}, /* CYRILLIC CAPITAL LETTER ZHE */ {0x00F7, 0x0412}, /* CYRILLIC CAPITAL LETTER VE */ {0x00F8, 0x042C}, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ {0x00F9, 0x042B}, /* CYRILLIC CAPITAL LETTER YERU */ {0x00FA, 0x0417}, /* CYRILLIC CAPITAL LETTER ZE */ {0x00FB, 0x0428}, /* CYRILLIC CAPITAL LETTER SHA */ {0x00FC, 0x042D}, /* CYRILLIC CAPITAL LETTER E */ {0x00FD, 0x0429}, /* CYRILLIC CAPITAL LETTER SHCHA */ {0x00FE, 0x0427}, /* CYRILLIC CAPITAL LETTER CHE */ {0x00FF, 0x042A}, /* CYRILLIC CAPITAL LETTER HARD SIGN */ }; static const BuiltInMapping koi8_r[] = { /* koi8-r */ {0x0080, 0x2500}, /* BOX DRAWINGS LIGHT HORIZONTAL */ {0x0081, 0x2502}, /* BOX DRAWINGS LIGHT VERTICAL */ {0x0082, 0x250C}, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ {0x0083, 0x2510}, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ {0x0084, 0x2514}, /* BOX DRAWINGS LIGHT UP AND RIGHT */ {0x0085, 0x2518}, /* BOX DRAWINGS LIGHT UP AND LEFT */ {0x0086, 0x251C}, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ {0x0087, 0x2524}, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ {0x0088, 0x252C}, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ {0x0089, 0x2534}, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ {0x008A, 0x253C}, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ {0x008B, 0x2580}, /* UPPER HALF BLOCK */ {0x008C, 0x2584}, /* LOWER HALF BLOCK */ {0x008D, 0x2588}, /* FULL BLOCK */ {0x008E, 0x258C}, /* LEFT HALF BLOCK */ {0x008F, 0x2590}, /* RIGHT HALF BLOCK */ {0x0090, 0x2591}, /* LIGHT SHADE */ {0x0091, 0x2592}, /* MEDIUM SHADE */ {0x0092, 0x2593}, /* DARK SHADE */ {0x0093, 0x2320}, /* TOP HALF INTEGRAL */ {0x0094, 0x25A0}, /* BLACK SQUARE */ {0x0095, 0x2219}, /* BULLET OPERATOR */ {0x0096, 0x221A}, /* SQUARE ROOT */ {0x0097, 0x2248}, /* ALMOST EQUAL TO */ {0x0098, 0x2264}, /* LESS-THAN OR EQUAL TO */ {0x0099, 0x2265}, /* GREATER-THAN OR EQUAL TO */ {0x009A, 0x00A0}, /* NO-BREAK SPACE */ {0x009B, 0x2321}, /* BOTTOM HALF INTEGRAL */ {0x009C, 0x00B0}, /* DEGREE SIGN */ {0x009D, 0x00B2}, /* SUPERSCRIPT TWO */ {0x009E, 0x00B7}, /* MIDDLE DOT */ {0x009F, 0x00F7}, /* DIVISION SIGN */ {0x00A0, 0x2550}, /* BOX DRAWINGS DOUBLE HORIZONTAL */ {0x00A1, 0x2551}, /* BOX DRAWINGS DOUBLE VERTICAL */ {0x00A2, 0x2552}, /* BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE */ {0x00A3, 0x0451}, /* CYRILLIC SMALL LETTER IO */ {0x00A4, 0x2553}, /* BOX DRAWINGS DOWN DOUBLE AND RIGHT SINGLE */ {0x00A5, 0x2554}, /* BOX DRAWINGS DOUBLE DOWN AND RIGHT */ {0x00A6, 0x2555}, /* BOX DRAWINGS DOWN SINGLE AND LEFT DOUBLE */ {0x00A7, 0x2556}, /* BOX DRAWINGS DOWN DOUBLE AND LEFT SINGLE */ {0x00A8, 0x2557}, /* BOX DRAWINGS DOUBLE DOWN AND LEFT */ {0x00A9, 0x2558}, /* BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE */ {0x00AA, 0x2559}, /* BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE */ {0x00AB, 0x255A}, /* BOX DRAWINGS DOUBLE UP AND RIGHT */ {0x00AC, 0x255B}, /* BOX DRAWINGS UP SINGLE AND LEFT DOUBLE */ {0x00AD, 0x255C}, /* BOX DRAWINGS UP DOUBLE AND LEFT SINGLE */ {0x00AE, 0x255D}, /* BOX DRAWINGS DOUBLE UP AND LEFT */ {0x00AF, 0x255E}, /* BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE */ {0x00B0, 0x255F}, /* BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE */ {0x00B1, 0x2560}, /* BOX DRAWINGS DOUBLE VERTICAL AND RIGHT */ {0x00B2, 0x2561}, /* BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE */ {0x00B3, 0x0401}, /* CYRILLIC CAPITAL LETTER IO */ {0x00B4, 0x2562}, /* BOX DRAWINGS VERTICAL DOUBLE AND LEFT SINGLE */ {0x00B5, 0x2563}, /* BOX DRAWINGS DOUBLE VERTICAL AND LEFT */ {0x00B6, 0x2564}, /* BOX DRAWINGS DOWN SINGLE AND HORIZONTAL DOUBLE */ {0x00B7, 0x2565}, /* BOX DRAWINGS DOWN DOUBLE AND HORIZONTAL SINGLE */ {0x00B8, 0x2566}, /* BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL */ {0x00B9, 0x2567}, /* BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE */ {0x00BA, 0x2568}, /* BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE */ {0x00BB, 0x2569}, /* BOX DRAWINGS DOUBLE UP AND HORIZONTAL */ {0x00BC, 0x256A}, /* BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE */ {0x00BD, 0x256B}, /* BOX DRAWINGS VERTICAL DOUBLE AND HORIZONTAL SINGLE */ {0x00BE, 0x256C}, /* BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL */ {0x00BF, 0x00A9}, /* COPYRIGHT SIGN */ {0x00C0, 0x044E}, /* CYRILLIC SMALL LETTER YU */ {0x00C1, 0x0430}, /* CYRILLIC SMALL LETTER A */ {0x00C2, 0x0431}, /* CYRILLIC SMALL LETTER BE */ {0x00C3, 0x0446}, /* CYRILLIC SMALL LETTER TSE */ {0x00C4, 0x0434}, /* CYRILLIC SMALL LETTER DE */ {0x00C5, 0x0435}, /* CYRILLIC SMALL LETTER IE */ {0x00C6, 0x0444}, /* CYRILLIC SMALL LETTER EF */ {0x00C7, 0x0433}, /* CYRILLIC SMALL LETTER GHE */ {0x00C8, 0x0445}, /* CYRILLIC SMALL LETTER HA */ {0x00C9, 0x0438}, /* CYRILLIC SMALL LETTER I */ {0x00CA, 0x0439}, /* CYRILLIC SMALL LETTER SHORT I */ {0x00CB, 0x043A}, /* CYRILLIC SMALL LETTER KA */ {0x00CC, 0x043B}, /* CYRILLIC SMALL LETTER EL */ {0x00CD, 0x043C}, /* CYRILLIC SMALL LETTER EM */ {0x00CE, 0x043D}, /* CYRILLIC SMALL LETTER EN */ {0x00CF, 0x043E}, /* CYRILLIC SMALL LETTER O */ {0x00D0, 0x043F}, /* CYRILLIC SMALL LETTER PE */ {0x00D1, 0x044F}, /* CYRILLIC SMALL LETTER YA */ {0x00D2, 0x0440}, /* CYRILLIC SMALL LETTER ER */ {0x00D3, 0x0441}, /* CYRILLIC SMALL LETTER ES */ {0x00D4, 0x0442}, /* CYRILLIC SMALL LETTER TE */ {0x00D5, 0x0443}, /* CYRILLIC SMALL LETTER U */ {0x00D6, 0x0436}, /* CYRILLIC SMALL LETTER ZHE */ {0x00D7, 0x0432}, /* CYRILLIC SMALL LETTER VE */ {0x00D8, 0x044C}, /* CYRILLIC SMALL LETTER SOFT SIGN */ {0x00D9, 0x044B}, /* CYRILLIC SMALL LETTER YERU */ {0x00DA, 0x0437}, /* CYRILLIC SMALL LETTER ZE */ {0x00DB, 0x0448}, /* CYRILLIC SMALL LETTER SHA */ {0x00DC, 0x044D}, /* CYRILLIC SMALL LETTER E */ {0x00DD, 0x0449}, /* CYRILLIC SMALL LETTER SHCHA */ {0x00DE, 0x0447}, /* CYRILLIC SMALL LETTER CHE */ {0x00DF, 0x044A}, /* CYRILLIC SMALL LETTER HARD SIGN */ {0x00E0, 0x042E}, /* CYRILLIC CAPITAL LETTER YU */ {0x00E1, 0x0410}, /* CYRILLIC CAPITAL LETTER A */ {0x00E2, 0x0411}, /* CYRILLIC CAPITAL LETTER BE */ {0x00E3, 0x0426}, /* CYRILLIC CAPITAL LETTER TSE */ {0x00E4, 0x0414}, /* CYRILLIC CAPITAL LETTER DE */ {0x00E5, 0x0415}, /* CYRILLIC CAPITAL LETTER IE */ {0x00E6, 0x0424}, /* CYRILLIC CAPITAL LETTER EF */ {0x00E7, 0x0413}, /* CYRILLIC CAPITAL LETTER GHE */ {0x00E8, 0x0425}, /* CYRILLIC CAPITAL LETTER HA */ {0x00E9, 0x0418}, /* CYRILLIC CAPITAL LETTER I */ {0x00EA, 0x0419}, /* CYRILLIC CAPITAL LETTER SHORT I */ {0x00EB, 0x041A}, /* CYRILLIC CAPITAL LETTER KA */ {0x00EC, 0x041B}, /* CYRILLIC CAPITAL LETTER EL */ {0x00ED, 0x041C}, /* CYRILLIC CAPITAL LETTER EM */ {0x00EE, 0x041D}, /* CYRILLIC CAPITAL LETTER EN */ {0x00EF, 0x041E}, /* CYRILLIC CAPITAL LETTER O */ {0x00F0, 0x041F}, /* CYRILLIC CAPITAL LETTER PE */ {0x00F1, 0x042F}, /* CYRILLIC CAPITAL LETTER YA */ {0x00F2, 0x0420}, /* CYRILLIC CAPITAL LETTER ER */ {0x00F3, 0x0421}, /* CYRILLIC CAPITAL LETTER ES */ {0x00F4, 0x0422}, /* CYRILLIC CAPITAL LETTER TE */ {0x00F5, 0x0423}, /* CYRILLIC CAPITAL LETTER U */ {0x00F6, 0x0416}, /* CYRILLIC CAPITAL LETTER ZHE */ {0x00F7, 0x0412}, /* CYRILLIC CAPITAL LETTER VE */ {0x00F8, 0x042C}, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ {0x00F9, 0x042B}, /* CYRILLIC CAPITAL LETTER YERU */ {0x00FA, 0x0417}, /* CYRILLIC CAPITAL LETTER ZE */ {0x00FB, 0x0428}, /* CYRILLIC CAPITAL LETTER SHA */ {0x00FC, 0x042D}, /* CYRILLIC CAPITAL LETTER E */ {0x00FD, 0x0429}, /* CYRILLIC CAPITAL LETTER SHCHA */ {0x00FE, 0x0427}, /* CYRILLIC CAPITAL LETTER CHE */ {0x00FF, 0x042A}, /* CYRILLIC CAPITAL LETTER HARD SIGN */ }; static const BuiltInMapping koi8_ru[] = { /* koi8-ru */ {0x0080, 0x2500}, /* BOX DRAWINGS LIGHT HORIZONTAL */ {0x0081, 0x2502}, /* BOX DRAWINGS LIGHT VERTICAL */ {0x0082, 0x250C}, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ {0x0083, 0x2510}, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ {0x0084, 0x2514}, /* BOX DRAWINGS LIGHT UP AND RIGHT */ {0x0085, 0x2518}, /* BOX DRAWINGS LIGHT UP AND LEFT */ {0x0086, 0x251C}, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ {0x0087, 0x2524}, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ {0x0088, 0x252C}, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ {0x0089, 0x2534}, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ {0x008A, 0x253C}, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ {0x008B, 0x2580}, /* UPPER HALF BLOCK */ {0x008C, 0x2584}, /* LOWER HALF BLOCK */ {0x008D, 0x2588}, /* FULL BLOCK */ {0x008E, 0x258C}, /* LEFT HALF BLOCK */ {0x008F, 0x2590}, /* RIGHT HALF BLOCK */ {0x0090, 0x2591}, /* LIGHT SHADE */ {0x0091, 0x2592}, /* MEDIUM SHADE */ {0x0092, 0x2593}, /* DARK SHADE */ {0x0093, 0x201C}, /* LEFT DOUBLE QUOTATION MARK */ {0x0094, 0x25A0}, /* BLACK SQUARE */ {0x0095, 0x2219}, /* BULLET OPERATOR */ {0x0096, 0x201D}, /* RIGHT DOUBLE QUOTATION MARK */ {0x0097, 0x2014}, /* EM DASH */ {0x0098, 0x2116}, /* NUMERO SIGN */ {0x0099, 0x2122}, /* TRADE MARK SIGN */ {0x009A, 0x00A0}, /* NO-BREAK SPACE */ {0x009B, 0x00BB}, /* RIGHT-POINTING DOUBLE ANGLE QUOTATION MARK */ {0x009C, 0x00AE}, /* REGISTERED SIGN */ {0x009D, 0x00AB}, /* LEFT-POINTING DOUBLE ANGLE QUOTATION MARK */ {0x009E, 0x00B7}, /* MIDDLE DOT */ {0x009F, 0x00A4}, /* CURRENCY SIGN */ {0x00A0, 0x2550}, /* BOX DRAWINGS DOUBLE HORIZONTAL */ {0x00A1, 0x2551}, /* BOX DRAWINGS DOUBLE VERTICAL */ {0x00A2, 0x2552}, /* BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE */ {0x00A3, 0x0451}, /* CYRILLIC SMALL LETTER IO */ {0x00A4, 0x0454}, /* CYRILLIC SMALL LETTER UKRAINIAN IE */ {0x00A5, 0x2554}, /* BOX DRAWINGS DOUBLE DOWN AND RIGHT */ {0x00A6, 0x0456}, /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00A7, 0x0457}, /* CYRILLIC SMALL LETTER YI */ {0x00A8, 0x2557}, /* BOX DRAWINGS DOUBLE DOWN AND LEFT */ {0x00A9, 0x2558}, /* BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE */ {0x00AA, 0x2559}, /* BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE */ {0x00AB, 0x255A}, /* BOX DRAWINGS DOUBLE UP AND RIGHT */ {0x00AC, 0x255B}, /* BOX DRAWINGS UP SINGLE AND LEFT DOUBLE */ {0x00AD, 0x0491}, /* CYRILLIC SMALL LETTER GHE WITH UPTURN */ {0x00AE, 0x045E}, /* CYRILLIC SMALL LETTER SHORT U */ {0x00AF, 0x255E}, /* BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE */ {0x00B0, 0x255F}, /* BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE */ {0x00B1, 0x2560}, /* BOX DRAWINGS DOUBLE VERTICAL AND RIGHT */ {0x00B2, 0x2561}, /* BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE */ {0x00B3, 0x0401}, /* CYRILLIC CAPITAL LETTER IO */ {0x00B4, 0x0404}, /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ {0x00B5, 0x2563}, /* BOX DRAWINGS DOUBLE VERTICAL AND LEFT */ {0x00B6, 0x0406}, /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00B7, 0x0407}, /* CYRILLIC CAPITAL LETTER YI */ {0x00B8, 0x2566}, /* BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL */ {0x00B9, 0x2567}, /* BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE */ {0x00BA, 0x2568}, /* BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE */ {0x00BB, 0x2569}, /* BOX DRAWINGS DOUBLE UP AND HORIZONTAL */ {0x00BC, 0x256A}, /* BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE */ {0x00BD, 0x0490}, /* CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ {0x00BE, 0x040E}, /* CYRILLIC CAPITAL LETTER SHORT U */ {0x00BF, 0x00A9}, /* COPYRIGHT SIGN */ {0x00C0, 0x044E}, /* CYRILLIC SMALL LETTER YU */ {0x00C1, 0x0430}, /* CYRILLIC SMALL LETTER A */ {0x00C2, 0x0431}, /* CYRILLIC SMALL LETTER BE */ {0x00C3, 0x0446}, /* CYRILLIC SMALL LETTER TSE */ {0x00C4, 0x0434}, /* CYRILLIC SMALL LETTER DE */ {0x00C5, 0x0435}, /* CYRILLIC SMALL LETTER IE */ {0x00C6, 0x0444}, /* CYRILLIC SMALL LETTER EF */ {0x00C7, 0x0433}, /* CYRILLIC SMALL LETTER GHE */ {0x00C8, 0x0445}, /* CYRILLIC SMALL LETTER HA */ {0x00C9, 0x0438}, /* CYRILLIC SMALL LETTER I */ {0x00CA, 0x0439}, /* CYRILLIC SMALL LETTER SHORT I */ {0x00CB, 0x043A}, /* CYRILLIC SMALL LETTER KA */ {0x00CC, 0x043B}, /* CYRILLIC SMALL LETTER EL */ {0x00CD, 0x043C}, /* CYRILLIC SMALL LETTER EM */ {0x00CE, 0x043D}, /* CYRILLIC SMALL LETTER EN */ {0x00CF, 0x043E}, /* CYRILLIC SMALL LETTER O */ {0x00D0, 0x043F}, /* CYRILLIC SMALL LETTER PE */ {0x00D1, 0x044F}, /* CYRILLIC SMALL LETTER YA */ {0x00D2, 0x0440}, /* CYRILLIC SMALL LETTER ER */ {0x00D3, 0x0441}, /* CYRILLIC SMALL LETTER ES */ {0x00D4, 0x0442}, /* CYRILLIC SMALL LETTER TE */ {0x00D5, 0x0443}, /* CYRILLIC SMALL LETTER U */ {0x00D6, 0x0436}, /* CYRILLIC SMALL LETTER ZHE */ {0x00D7, 0x0432}, /* CYRILLIC SMALL LETTER VE */ {0x00D8, 0x044C}, /* CYRILLIC SMALL LETTER SOFT SIGN */ {0x00D9, 0x044B}, /* CYRILLIC SMALL LETTER YERU */ {0x00DA, 0x0437}, /* CYRILLIC SMALL LETTER ZE */ {0x00DB, 0x0448}, /* CYRILLIC SMALL LETTER SHA */ {0x00DC, 0x044D}, /* CYRILLIC SMALL LETTER E */ {0x00DD, 0x0449}, /* CYRILLIC SMALL LETTER SHCHA */ {0x00DE, 0x0447}, /* CYRILLIC SMALL LETTER CHE */ {0x00DF, 0x044A}, /* CYRILLIC SMALL LETTER HARD SIGN */ {0x00E0, 0x042E}, /* CYRILLIC CAPITAL LETTER YU */ {0x00E1, 0x0410}, /* CYRILLIC CAPITAL LETTER A */ {0x00E2, 0x0411}, /* CYRILLIC CAPITAL LETTER BE */ {0x00E3, 0x0426}, /* CYRILLIC CAPITAL LETTER TSE */ {0x00E4, 0x0414}, /* CYRILLIC CAPITAL LETTER DE */ {0x00E5, 0x0415}, /* CYRILLIC CAPITAL LETTER IE */ {0x00E6, 0x0424}, /* CYRILLIC CAPITAL LETTER EF */ {0x00E7, 0x0413}, /* CYRILLIC CAPITAL LETTER GHE */ {0x00E8, 0x0425}, /* CYRILLIC CAPITAL LETTER HA */ {0x00E9, 0x0418}, /* CYRILLIC CAPITAL LETTER I */ {0x00EA, 0x0419}, /* CYRILLIC CAPITAL LETTER SHORT I */ {0x00EB, 0x041A}, /* CYRILLIC CAPITAL LETTER KA */ {0x00EC, 0x041B}, /* CYRILLIC CAPITAL LETTER EL */ {0x00ED, 0x041C}, /* CYRILLIC CAPITAL LETTER EM */ {0x00EE, 0x041D}, /* CYRILLIC CAPITAL LETTER EN */ {0x00EF, 0x041E}, /* CYRILLIC CAPITAL LETTER O */ {0x00F0, 0x041F}, /* CYRILLIC CAPITAL LETTER PE */ {0x00F1, 0x042F}, /* CYRILLIC CAPITAL LETTER YA */ {0x00F2, 0x0420}, /* CYRILLIC CAPITAL LETTER ER */ {0x00F3, 0x0421}, /* CYRILLIC CAPITAL LETTER ES */ {0x00F4, 0x0422}, /* CYRILLIC CAPITAL LETTER TE */ {0x00F5, 0x0423}, /* CYRILLIC CAPITAL LETTER U */ {0x00F6, 0x0416}, /* CYRILLIC CAPITAL LETTER ZHE */ {0x00F7, 0x0412}, /* CYRILLIC CAPITAL LETTER VE */ {0x00F8, 0x042C}, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ {0x00F9, 0x042B}, /* CYRILLIC CAPITAL LETTER YERU */ {0x00FA, 0x0417}, /* CYRILLIC CAPITAL LETTER ZE */ {0x00FB, 0x0428}, /* CYRILLIC CAPITAL LETTER SHA */ {0x00FC, 0x042D}, /* CYRILLIC CAPITAL LETTER E */ {0x00FD, 0x0429}, /* CYRILLIC CAPITAL LETTER SHCHA */ {0x00FE, 0x0427}, /* CYRILLIC CAPITAL LETTER CHE */ {0x00FF, 0x042A}, /* CYRILLIC CAPITAL LETTER HARD SIGN */ }; static const BuiltInMapping koi8_u[] = { /* koi8-u */ {0x0080, 0x2500}, /* BOX DRAWINGS LIGHT HORIZONTAL */ {0x0081, 0x2502}, /* BOX DRAWINGS LIGHT VERTICAL */ {0x0082, 0x250C}, /* BOX DRAWINGS LIGHT DOWN AND RIGHT */ {0x0083, 0x2510}, /* BOX DRAWINGS LIGHT DOWN AND LEFT */ {0x0084, 0x2514}, /* BOX DRAWINGS LIGHT UP AND RIGHT */ {0x0085, 0x2518}, /* BOX DRAWINGS LIGHT UP AND LEFT */ {0x0086, 0x251C}, /* BOX DRAWINGS LIGHT VERTICAL AND RIGHT */ {0x0087, 0x2524}, /* BOX DRAWINGS LIGHT VERTICAL AND LEFT */ {0x0088, 0x252C}, /* BOX DRAWINGS LIGHT DOWN AND HORIZONTAL */ {0x0089, 0x2534}, /* BOX DRAWINGS LIGHT UP AND HORIZONTAL */ {0x008A, 0x253C}, /* BOX DRAWINGS LIGHT VERTICAL AND HORIZONTAL */ {0x008B, 0x2580}, /* UPPER HALF BLOCK */ {0x008C, 0x2584}, /* LOWER HALF BLOCK */ {0x008D, 0x2588}, /* FULL BLOCK */ {0x008E, 0x258C}, /* LEFT HALF BLOCK */ {0x008F, 0x2590}, /* RIGHT HALF BLOCK */ {0x0090, 0x2591}, /* LIGHT SHADE */ {0x0091, 0x2592}, /* MEDIUM SHADE */ {0x0092, 0x2593}, /* DARK SHADE */ {0x0093, 0x2320}, /* TOP HALF INTEGRAL */ {0x0094, 0x25A0}, /* BLACK SQUARE */ {0x0095, 0x2219}, /* BULLET OPERATOR */ {0x0096, 0x221A}, /* SQUARE ROOT */ {0x0097, 0x2248}, /* ALMOST EQUAL TO */ {0x0098, 0x2264}, /* LESS-THAN OR EQUAL TO */ {0x0099, 0x2265}, /* GREATER-THAN OR EQUAL TO */ {0x009A, 0x00A0}, /* NO-BREAK SPACE */ {0x009B, 0x2321}, /* BOTTOM HALF INTEGRAL */ {0x009C, 0x00B0}, /* DEGREE SIGN */ {0x009D, 0x00B2}, /* SUPERSCRIPT TWO */ {0x009E, 0x00B7}, /* MIDDLE DOT */ {0x009F, 0x00F7}, /* DIVISION SIGN */ {0x00A0, 0x2550}, /* BOX DRAWINGS DOUBLE HORIZONTAL */ {0x00A1, 0x2551}, /* BOX DRAWINGS DOUBLE VERTICAL */ {0x00A2, 0x2552}, /* BOX DRAWINGS DOWN SINGLE AND RIGHT DOUBLE */ {0x00A3, 0x0451}, /* CYRILLIC SMALL LETTER IO */ {0x00A4, 0x0454}, /* CYRILLIC SMALL LETTER UKRAINIAN IE */ {0x00A5, 0x2554}, /* BOX DRAWINGS DOUBLE DOWN AND RIGHT */ {0x00A6, 0x0456}, /* CYRILLIC SMALL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00A7, 0x0457}, /* CYRILLIC SMALL LETTER YI */ {0x00A8, 0x2557}, /* BOX DRAWINGS DOUBLE DOWN AND LEFT */ {0x00A9, 0x2558}, /* BOX DRAWINGS UP SINGLE AND RIGHT DOUBLE */ {0x00AA, 0x2559}, /* BOX DRAWINGS UP DOUBLE AND RIGHT SINGLE */ {0x00AB, 0x255A}, /* BOX DRAWINGS DOUBLE UP AND RIGHT */ {0x00AC, 0x255B}, /* BOX DRAWINGS UP SINGLE AND LEFT DOUBLE */ {0x00AD, 0x0491}, /* CYRILLIC SMALL LETTER GHE WITH UPTURN */ {0x00AE, 0x255D}, /* BOX DRAWINGS DOUBLE UP AND LEFT */ {0x00AF, 0x255E}, /* BOX DRAWINGS VERTICAL SINGLE AND RIGHT DOUBLE */ {0x00B0, 0x255F}, /* BOX DRAWINGS VERTICAL DOUBLE AND RIGHT SINGLE */ {0x00B1, 0x2560}, /* BOX DRAWINGS DOUBLE VERTICAL AND RIGHT */ {0x00B2, 0x2561}, /* BOX DRAWINGS VERTICAL SINGLE AND LEFT DOUBLE */ {0x00B3, 0x0401}, /* CYRILLIC CAPITAL LETTER IO */ {0x00B4, 0x0404}, /* CYRILLIC CAPITAL LETTER UKRAINIAN IE */ {0x00B5, 0x2563}, /* BOX DRAWINGS DOUBLE VERTICAL AND LEFT */ {0x00B6, 0x0406}, /* CYRILLIC CAPITAL LETTER BYELORUSSIAN-UKRAINIAN I */ {0x00B7, 0x0407}, /* CYRILLIC CAPITAL LETTER YI */ {0x00B8, 0x2566}, /* BOX DRAWINGS DOUBLE DOWN AND HORIZONTAL */ {0x00B9, 0x2567}, /* BOX DRAWINGS UP SINGLE AND HORIZONTAL DOUBLE */ {0x00BA, 0x2568}, /* BOX DRAWINGS UP DOUBLE AND HORIZONTAL SINGLE */ {0x00BB, 0x2569}, /* BOX DRAWINGS DOUBLE UP AND HORIZONTAL */ {0x00BC, 0x256A}, /* BOX DRAWINGS VERTICAL SINGLE AND HORIZONTAL DOUBLE */ {0x00BD, 0x0490}, /* CYRILLIC CAPITAL LETTER GHE WITH UPTURN */ {0x00BE, 0x256C}, /* BOX DRAWINGS DOUBLE VERTICAL AND HORIZONTAL */ {0x00BF, 0x00A9}, /* COPYRIGHT SIGN */ {0x00C0, 0x044E}, /* CYRILLIC SMALL LETTER YU */ {0x00C1, 0x0430}, /* CYRILLIC SMALL LETTER A */ {0x00C2, 0x0431}, /* CYRILLIC SMALL LETTER BE */ {0x00C3, 0x0446}, /* CYRILLIC SMALL LETTER TSE */ {0x00C4, 0x0434}, /* CYRILLIC SMALL LETTER DE */ {0x00C5, 0x0435}, /* CYRILLIC SMALL LETTER IE */ {0x00C6, 0x0444}, /* CYRILLIC SMALL LETTER EF */ {0x00C7, 0x0433}, /* CYRILLIC SMALL LETTER GHE */ {0x00C8, 0x0445}, /* CYRILLIC SMALL LETTER HA */ {0x00C9, 0x0438}, /* CYRILLIC SMALL LETTER I */ {0x00CA, 0x0439}, /* CYRILLIC SMALL LETTER SHORT I */ {0x00CB, 0x043A}, /* CYRILLIC SMALL LETTER KA */ {0x00CC, 0x043B}, /* CYRILLIC SMALL LETTER EL */ {0x00CD, 0x043C}, /* CYRILLIC SMALL LETTER EM */ {0x00CE, 0x043D}, /* CYRILLIC SMALL LETTER EN */ {0x00CF, 0x043E}, /* CYRILLIC SMALL LETTER O */ {0x00D0, 0x043F}, /* CYRILLIC SMALL LETTER PE */ {0x00D1, 0x044F}, /* CYRILLIC SMALL LETTER YA */ {0x00D2, 0x0440}, /* CYRILLIC SMALL LETTER ER */ {0x00D3, 0x0441}, /* CYRILLIC SMALL LETTER ES */ {0x00D4, 0x0442}, /* CYRILLIC SMALL LETTER TE */ {0x00D5, 0x0443}, /* CYRILLIC SMALL LETTER U */ {0x00D6, 0x0436}, /* CYRILLIC SMALL LETTER ZHE */ {0x00D7, 0x0432}, /* CYRILLIC SMALL LETTER VE */ {0x00D8, 0x044C}, /* CYRILLIC SMALL LETTER SOFT SIGN */ {0x00D9, 0x044B}, /* CYRILLIC SMALL LETTER YERU */ {0x00DA, 0x0437}, /* CYRILLIC SMALL LETTER ZE */ {0x00DB, 0x0448}, /* CYRILLIC SMALL LETTER SHA */ {0x00DC, 0x044D}, /* CYRILLIC SMALL LETTER E */ {0x00DD, 0x0449}, /* CYRILLIC SMALL LETTER SHCHA */ {0x00DE, 0x0447}, /* CYRILLIC SMALL LETTER CHE */ {0x00DF, 0x044A}, /* CYRILLIC SMALL LETTER HARD SIGN */ {0x00E0, 0x042E}, /* CYRILLIC CAPITAL LETTER YU */ {0x00E1, 0x0410}, /* CYRILLIC CAPITAL LETTER A */ {0x00E2, 0x0411}, /* CYRILLIC CAPITAL LETTER BE */ {0x00E3, 0x0426}, /* CYRILLIC CAPITAL LETTER TSE */ {0x00E4, 0x0414}, /* CYRILLIC CAPITAL LETTER DE */ {0x00E5, 0x0415}, /* CYRILLIC CAPITAL LETTER IE */ {0x00E6, 0x0424}, /* CYRILLIC CAPITAL LETTER EF */ {0x00E7, 0x0413}, /* CYRILLIC CAPITAL LETTER GHE */ {0x00E8, 0x0425}, /* CYRILLIC CAPITAL LETTER HA */ {0x00E9, 0x0418}, /* CYRILLIC CAPITAL LETTER I */ {0x00EA, 0x0419}, /* CYRILLIC CAPITAL LETTER SHORT I */ {0x00EB, 0x041A}, /* CYRILLIC CAPITAL LETTER KA */ {0x00EC, 0x041B}, /* CYRILLIC CAPITAL LETTER EL */ {0x00ED, 0x041C}, /* CYRILLIC CAPITAL LETTER EM */ {0x00EE, 0x041D}, /* CYRILLIC CAPITAL LETTER EN */ {0x00EF, 0x041E}, /* CYRILLIC CAPITAL LETTER O */ {0x00F0, 0x041F}, /* CYRILLIC CAPITAL LETTER PE */ {0x00F1, 0x042F}, /* CYRILLIC CAPITAL LETTER YA */ {0x00F2, 0x0420}, /* CYRILLIC CAPITAL LETTER ER */ {0x00F3, 0x0421}, /* CYRILLIC CAPITAL LETTER ES */ {0x00F4, 0x0422}, /* CYRILLIC CAPITAL LETTER TE */ {0x00F5, 0x0423}, /* CYRILLIC CAPITAL LETTER U */ {0x00F6, 0x0416}, /* CYRILLIC CAPITAL LETTER ZHE */ {0x00F7, 0x0412}, /* CYRILLIC CAPITAL LETTER VE */ {0x00F8, 0x042C}, /* CYRILLIC CAPITAL LETTER SOFT SIGN */ {0x00F9, 0x042B}, /* CYRILLIC CAPITAL LETTER YERU */ {0x00FA, 0x0417}, /* CYRILLIC CAPITAL LETTER ZE */ {0x00FB, 0x0428}, /* CYRILLIC CAPITAL LETTER SHA */ {0x00FC, 0x042D}, /* CYRILLIC CAPITAL LETTER E */ {0x00FD, 0x0429}, /* CYRILLIC CAPITAL LETTER SHCHA */ {0x00FE, 0x0427}, /* CYRILLIC CAPITAL LETTER CHE */ {0x00FF, 0x042A}, /* CYRILLIC CAPITAL LETTER HARD SIGN */ }; #define DATA(name) name, SizeOf(name) const BuiltInCharsetRec builtin_encodings[] = { { "apl2", DATA(apl2) }, { "dec-special", DATA(dec_special) }, { "dec-technical", DATA(dec_technical) }, { "iso8859-1", DATA(iso8859_1) }, { "iso8859-10", DATA(iso8859_10) }, { "iso8859-15", DATA(iso8859_15) }, { "iso8859-2", DATA(iso8859_2) }, { "iso8859-3", DATA(iso8859_3) }, { "iso8859-4", DATA(iso8859_4) }, { "iso8859-5", DATA(iso8859_5) }, { "iso8859-6", DATA(iso8859_6) }, { "iso8859-7", DATA(iso8859_7) }, { "iso8859-8", DATA(iso8859_8) }, { "iso8859-9", DATA(iso8859_9) }, { "koi8-e", DATA(koi8_e) }, { "koi8-r", DATA(koi8_r) }, { "koi8-ru", DATA(koi8_ru) }, { "koi8-u", DATA(koi8_u) }, { 0, 0, 0 } }; luit-20240910/config_h.in0000644000000000000000000000050311473317262013540 0ustar rootroot/* * vile:cmode * config_h.in is a template file used by configure to produce config.h. * config_h is then transformed (by config.status) into the header file * config.h. * $XTermId: config_h.in,v 1.3 2010/11/24 23:24:34 tom Exp $ */ #ifndef CONFIG_H_incl #define CONFIG_H_incl 1 @DEFS@ #endif /* CONFIG_H_incl */ luit-20240910/fontenc.c0000644000000000000000000006436514670153005013247 0ustar rootroot/* $XTermId: fontenc.c,v 1.99 2024/09/10 23:28:05 tom Exp $ */ /* Copyright 2013-2022,2024 by Thomas E. Dickey Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #include #include #ifdef USE_ZLIB #include #endif #define flatUCode(row,col) (((row) << 8) + (col)) typedef enum { ftUnknown ,ftComment ,ftDefine ,ftStartEncoding ,ftStartMapping ,ftEndMapping ,ftEndEncoding ,ftFirstIndex ,ftSize ,ftUndefine ,ftAlias } FONTENC_TYPES; /* * The fontenc library is single-use (luit-only) and undocumented (read the * source code). Rather than incorporate it directly here, this module adapts * as needed, and replaces where fontenc is unsuitable for reuse. */ #ifdef USE_FONTENC extern FontEncPtr FontEncReallyLoad(const char *charset, const char *fontFileName); #endif /* * fontenc uses FontEncDirectory to find the "encodings.dir" file. It uses a * compiled-in default value which can be overridden by an environment * variable. */ #ifndef USE_FONTENC extern char *FontEncDirectory(void); char * FontEncDirectory(void) { static char default_dir[] = ENCODINGS_DIR_FILE; static char *dir = NULL; if (dir == NULL) { char *c = getenv("FONT_ENCODINGS_DIRECTORY"); if (c) { dir = strmalloc(c); if (!dir) return NULL; } else if (default_dir[0] != '\0') { dir = default_dir; } } return dir; } #endif /* !USE_FONTENC */ /* * fontenc uses an "encodings.dir" file which can appear in the X fonts tree in * more than one place (because the file is created as a side-effect of * mkfontdir). * * The "encodings.dir" file has a count of the number of records at the start. * Subsequent lines contain an alias and a pathname (for a ".enc" file). The * pathname can be either absolute or relative to the directory containing * "encodings.dir". * * The ".enc" files typically are gzip'd (fontenc is hardcoded to expect this, * and has been known to dump core when a stray uncompressed file is put into * the tree). The alias in "encodings.dir" is obtained from the first line * of the ".enc" file, and may be unrelated to the actual filename. */ typedef struct { int used; char *alias; char *path; FontEncPtr data; } ENCODINGS_DIR; static ENCODINGS_DIR *encodings_dir; /* * Read a buffer, trimming trailing whitespace (unlike getline, which in turn * is not portable enough in any case). */ static char * getFileBuffer(char **bufferp, size_t *lengthp, FILE *fp) { size_t used = 0; char extra[BUFSIZ]; int finished = 1; if (*bufferp != 0) **bufferp = '\0'; while (fgets(extra, (int) sizeof(extra) - 1, fp)) { size_t have = strlen(extra); int found = 0; finished = 0; while (have != 0) { --have; if (extra[have] == '\n') { found = 1; } if (isspace(UChar(extra[have]))) { extra[have] = '\0'; } else { break; } } if (have) { size_t need = have + used + 2; if (*lengthp < need) { char *next = realloc(*bufferp, need); if (next == NULL) { free(*bufferp); *bufferp = NULL; return NULL; } *bufferp = next; *lengthp = need; } else if (*bufferp == NULL) { return NULL; } strcpy(*bufferp + used, extra); used += have; } if (found) { break; } } return !finished ? *bufferp : NULL; } #ifndef USE_FONTENC #ifdef USE_ZLIB /* * Read a buffer, trimming trailing whitespace (unlike getline, which in turn * is not portable enough in any case). */ static char * getGzipBuffer(char **bufferp, size_t *lengthp, gzFile fp) { size_t used = 0; char extra[BUFSIZ]; int finished = 1; if (*bufferp != 0) **bufferp = '\0'; while (gzgets(fp, extra, (int) sizeof(extra) - 1)) { size_t have = strlen(extra); int found = 0; finished = 0; while (have != 0) { --have; if (extra[have] == '\n') { found = 1; } if (isspace(UChar(extra[have]))) { extra[have] = '\0'; } else { break; } } if (have) { size_t need = have + used + 2; if (*lengthp < need) { *bufferp = realloc(*bufferp, need); *lengthp = need; } strcpy(*bufferp + used, extra); used += have; } if (found) { break; } } return !finished ? *bufferp : 0; } #endif /* USE_ZLIB */ #endif /* !USE_FONTENC */ static char * absolutePath(char *given, const char *refPath) { char *result; char *leaf; if (*given != '/') { if (!strncmp(given, "./", (size_t) 2)) { given += 2; } result = malloc(strlen(refPath) + strlen(given) + 2); if (result != 0) { strcpy(result, refPath); if ((leaf = strrchr(result, '/')) == 0) { leaf = result + strlen(result); *leaf++ = '/'; } strcpy(leaf + 1, given); } else { FatalError("cannot allocate absolute path for %s\n", given); } } else { result = strmalloc(given); } return result; } static int compare_aliases(const void *a, const void *b) { const ENCODINGS_DIR *p = a; const ENCODINGS_DIR *q = b; return strcmp(p->alias, q->alias); } static char * skipToWhite(char *value) { char *result = 0; while (*value != '\0') { if (isspace(UChar(*value))) { result = value; break; } ++value; } return result; } static void loadEncodingsDir(void) { if (encodings_dir == 0) { FILE *fp; const char *path = FontEncDirectory(); char *buffer = 0; size_t entry = 0; size_t length = 0; size_t entries = 0; char *value; int used = 0; int n, found; int row = 0; if (path == 0) { TRACE(("cannot find encodings.dir\n")); } else if ((fp = fopen(path, "r")) == 0) { FatalError("cannot open %s\n", path); } else { while (getFileBuffer(&buffer, &length, fp) != 0) { ++row; if (*buffer == '\0') continue; if (encodings_dir == 0) { char *next = 0; long count = strtol(buffer, &next, 10); if (count <= 0) { FatalError("found no count in %s\n", path); } entries = (size_t) count; encodings_dir = calloc(entries + 1, sizeof(*encodings_dir)); if (encodings_dir == 0) { FatalError("cannot allocate %ld encodings\n", count); } } else if ((value = skipToWhite(buffer)) != 0) { *value++ = '\0'; /* get rid of duplicates - they do occur */ for (n = found = 0; n < used; ++n) { if (!strcmp(buffer, encodings_dir[n].alias)) { found = 1; break; } } if (!found) { encodings_dir[used].alias = strmalloc(buffer); encodings_dir[used].path = absolutePath(value, path); ++used; } if (++entry >= entries) break; } else { FatalError("incorrect format of line %d:%s\n", row, buffer); } } fclose(fp); if (used > 1) { qsort(encodings_dir, (size_t) used, sizeof(encodings_dir[0]), compare_aliases); } } free(buffer); } } #ifndef USE_FONTENC /* * The fontenc library attempts to fill in the one-one mapping in the setCode * function, but it is inconsistently applied and the loaded map contains gaps. * This function sets one-one for any codes which map to NUL. */ static void fillCharMap(FontEncSimpleMapPtr mp, int size) { int n; if (mp != 0 && mp->map != 0) { for (n = 0; n < size; ++n) { if (mp->map[n] == 0) { mp->map[n] = (UCode) (n + mp->first); } } } } /* * This function does the opposite of fillCharMap(), replacing one-one mappings * with a NUL. */ static void trimCharMap(FontEncSimpleMapPtr mp, int size) { int n; if (mp != 0 && mp->map != 0) { for (n = 0; n < size; ++n) { if (mp->map[n] == (UCode) (n + mp->first)) { mp->map[n] = 0; } } } } static void trim_or_fill(FontEncSimpleMapPtr mp, int size) { if (fill_fontenc) { fillCharMap(mp, size); } else { trimCharMap(mp, size); } } #else /* USE_FONTENC */ #define fillCharMap(mp, size) /* nothing */ #define trimCharMap(mp, size) /* nothing */ #define trim_or_fill(mp, size) /* nothing */ #endif /* !USE_FONTENC */ static size_t fontencSize(FontEncPtr enc) { size_t result = (size_t) (enc->size ? enc->size : 256); if (enc->row_size) result = (result) * 256; return result; } #ifndef USE_FONTENC #ifdef USE_ZLIB static char * skipBlanks(char *value) { while (isspace(UChar(*value))) ++value; return value; } static char * skipNonblanks(char *value) { while (*value != '\0' && !isspace(UChar(*value))) ++value; return value; } static char * allocateToken(char *value) { char *result; char *next; char save; value = skipBlanks(value); next = skipNonblanks(value); save = *next; *next = '\0'; result = strmalloc(value); *next = save; return result; } static int compareKeyword(char *value, const char *expected) { int result; char save; char *next; next = skipNonblanks(value); save = *next; *next = '\0'; result = StrCaseCmp(value, expected); *next = save; return result; } static FONTENC_TYPES getLineType(char *line, char **nextp) { FONTENC_TYPES result = ftUnknown; char save; line = skipBlanks(line); *nextp = skipNonblanks(line); save = **nextp; **nextp = '\0'; if (*line == '\0' || *line == '#') { result = ftComment; } else if (isdigit(UChar(*line))) { result = ftDefine; } else if (!StrCaseCmp(line, "ALIAS")) { result = ftAlias; } else if (!StrCaseCmp(line, "STARTENCODING")) { result = ftStartEncoding; } else if (!StrCaseCmp(line, "STARTMAPPING")) { result = ftStartMapping; } else if (!StrCaseCmp(line, "ENDENCODING")) { result = ftEndEncoding; } else if (!StrCaseCmp(line, "ENDMAPPING")) { result = ftEndMapping; } else if (!StrCaseCmp(line, "SIZE")) { result = ftSize; } else if (!StrCaseCmp(line, "FIRSTINDEX")) { result = ftFirstIndex; } else if (!StrCaseCmp(line, "UNDEFINE")) { result = ftUndefine; } **nextp = save; return result; } #define MAX_NUMBERS 4 static int getNumbers(char *line, int *results) { int count = 0; char *next; long value; while (count + 1 < MAX_NUMBERS) { line = skipBlanks(line); value = strtol(line, &next, 0); if (next == line) break; results[count++] = (int) value; line = next; } return count; } static int fontencFirst(FontEncPtr enc) { int result; if (enc->row_size) { result = (enc->row_size * enc->first) + enc->first_col; } else { result = enc->first; } return result; } static int fontencIndex(FontEncPtr enc, unsigned from) { int result; if ((int) from < MIN_UCODE) { result = -1; } else if (from <= MAX_UCODE) { if (enc->row_size == 0) { result = (int) from; } else { int row = (int) rowOf(from); int col = (int) colOf(from); if (col >= enc->row_size) { result = -1; } else { result = (row * enc->row_size) + col; } } } else { result = -1; } return result; } static void defineCode(FontEncPtr enc, int from, int to) { int inx = fontencIndex(enc, (unsigned) from); if (inx >= 0 && enc->mappings != NULL) { int first = fontencFirst(enc); FontEncSimpleMapPtr data = enc->mappings->client_data; int limit = (int) fontencSize(enc); if (inx >= first && (unsigned) inx < data->len && inx < limit) { data->map[inx - first] = (UCode) to; } } } #endif /* USE_ZLIB */ #endif /* !USE_FONTENC */ /* * fontenc uses this indexing scheme to reduce tablesize. * The function returns a valid index into the forward map to Unicode; */ static int fontencUnmap(FontEncSimpleMapPtr map, int from) { int result; if (map != 0) { if (map->row_size) { from += map->first; if (map->row_size == 0) { result = from; } else { int row = (from / (int) map->row_size); int col = (from % (int) map->row_size); result = (row * 256) + col; } } else { result = from + map->first; } if (result < MIN_UCODE) { result = -1; } else if (result >= MAX_UCODE) { result = -1; } } else { result = -1; } return result; } unsigned luitRecode(unsigned code, void *client_data) { unsigned result; FontEncSimpleMapPtr map; unsigned inx; map = client_data; if (code >= MAX_UCODE) { result = 0; } else { unsigned col = (unsigned) (map->row_size ? colOf(code) : 0); if (map->row_size && col >= map->row_size) { result = 0; } else { if (map->row_size) { inx = col + (unsigned) rowOf(code) * map->row_size; } else { inx = code; } if (map->map && inx >= map->first && inx < map->first + map->len) { result = map->map[inx - map->first]; } else { result = code; } } } return result; } #define UpdateLoChar(value) \ if (lo_char < 0) { \ lo_char = value; \ } else if (lo_char > value) { \ lo_char = value; \ } #define UpdateHiChar(value) \ if (hi_char < 0) { \ hi_char = value; \ } else if (hi_char < value) { \ hi_char = value; \ } /* * Read an encoding file, report summary statistics. */ static FontEncPtr loadFontEncRec(const char *charset, const char *path) { FontEncPtr result; #if defined(USE_FONTENC) result = FontEncReallyLoad(charset, path); #elif defined(USE_ZLIB) gzFile fp; char *buffer = 0; size_t length = 0; size_t numAliases = 0; size_t result_size = 0; int numbers[MAX_NUMBERS]; FontMapPtr mapping = 0; int done = 0; (void) charset; if ((result = calloc((size_t) 1, sizeof(*result))) == 0) return 0; fp = gzopen(path, "r"); if (fp != 0) { int ignore = 0; while (!done && getGzipBuffer(&buffer, &length, fp)) { char *later; switch (getLineType(buffer, &later)) { case ftComment: break; case ftStartEncoding: /* * Parameter should agree with "charset", but sometimes * does not. */ result->name = allocateToken(later); result->size = 256; break; case ftAlias: result->aliases = realloc(result->aliases, (numAliases + 2) * sizeof(char *)); result->aliases[numAliases++] = allocateToken(later); result->aliases[numAliases] = 0; break; case ftSize: /* * A single parameter gives the highest value directly. * Two parameters give number of rows and row size. */ switch (getNumbers(later, numbers)) { default: result->row_size = numbers[1]; /* FALLTHRU */ case 1: result->size = numbers[0]; break; case 0: break; } break; case ftFirstIndex: /* * Referring to SIZE, this gives the first defined code in * the range. Use one or two parameters together with the * row size from the SIZE statement. */ switch (getNumbers(later, numbers)) { default: result->first_col = numbers[1]; /* FALLTHRU */ case 1: result->first = numbers[0]; break; case 0: break; } break; case ftUndefine: /* * Mark one or more codes within the overall range as * undefined. There is no mapping to unicode for those codes. * * One or two parameters are expected. Two parameters specify * a range of codes to undefine. */ if (!ignore) { int code; switch (getNumbers(later, numbers)) { default: /* ignore */ break; case 2: for (code = numbers[0]; code <= numbers[1]; ++code) { defineCode(result, code, 0); } break; case 1: defineCode(result, numbers[0], 0); break; } } break; case ftDefine: if (!ignore) { int from; int to; switch (getNumbers(buffer, numbers)) { case 1: /* ignore */ break; case 2: defineCode(result, numbers[0], numbers[1]); break; case 3: to = numbers[2]; for (from = numbers[0]; from <= numbers[1]; ++from) { defineCode(result, from, to++); } break; } } break; case ftStartMapping: /* * The encoding can have more than one mapping, but we care * only about the mapping to unicode. */ later = skipBlanks(later); if (!compareKeyword(later, "unicode")) { FontEncSimpleMapPtr mq; ignore = 0; result_size = fontencSize(result); mapping = TypeCalloc(FontMapRec); if (mapping == 0) FatalError("cannot allocate map record\n"); mapping->type = FONT_ENCODING_UNICODE; mapping->recode = luitRecode; if ((mq = TypeCalloc(FontEncSimpleMapRec)) == 0 || (mq->map = TypeCallocN(UCode, result_size)) == 0) { FatalError("cannot allocate map for %ld codes\n", (long) result_size); } if (result->row_size) { mq->first = (UCode) flatUCode(result->first, result->first_col); } else { mq->first = (UCode) result->first; } mq->len = (unsigned) fontencSize(result); mq->first = (UCode) fontencFirst(result); mq->row_size = (UCode) result->row_size; mapping->client_data = mq; result->mappings = mapping; } else { ignore = 1; } break; case ftEndMapping: ignore = 0; break; case ftEndEncoding: done = 1; /* should be end of file */ break; default: if (!ignore) printf("\t->%s\n", buffer); break; } } gzclose(fp); free(buffer); } if (result->name == 0) result->name = strmalloc(charset); #else /* !USE_FONTENC && !USE_ZLIB */ (void) charset; (void) path; result = 0; #endif /* USE_FONTENC/USE_ZLIB */ return result; } /* * Find an encoding, given its name. */ FontEncPtr lookupOneFontenc(const char *name) { int n; FontEncPtr result = 0; #ifdef USE_FONTENC result = FontEncFind(name, NULL); if (result == 0) #endif { loadEncodingsDir(); if (encodings_dir != 0) { for (n = 0; encodings_dir[n].alias != 0; ++n) { if (!StrCaseCmp(name, encodings_dir[n].alias)) { if ((result = encodings_dir[n].data) == 0 && encodings_dir[n].used == 0) { result = loadFontEncRec(encodings_dir[n].alias, encodings_dir[n].path); if (result == 0) { Warning("cannot load data for %s\n", encodings_dir[n].path); } else { VERBOSE(1, ("load alias \"%s\" from \"%s\"\n", encodings_dir[n].alias, encodings_dir[n].path)); } encodings_dir[n].used = 1; encodings_dir[n].data = result; } break; } } } } return result; } static const char * fontmapTypename(int type) { const char *result = "?"; switch (type) { #ifdef FONT_ENCODING_TRUETYPE case FONT_ENCODING_TRUETYPE: result = "cmap"; break; #endif case FONT_ENCODING_UNICODE: result = "unicode"; break; #ifdef FONT_ENCODING_POSTSCRIPT case FONT_ENCODING_POSTSCRIPT: result = "postscript"; break; #endif } return result; } static FontEncSimpleMapPtr findUnicodeMapping(FontEncPtr data) { FontEncSimpleMapPtr mq = 0; FontMapPtr mp; for (mp = data->mappings; mp != NULL; mp = mp->next) { if (mp->type == FONT_ENCODING_UNICODE) { mq = mp->client_data; if (mq->map == NULL) mq = NULL; break; } } return mq; } /* * Read an encoding file, report summary statistics. */ static FontEncPtr reportOneFontenc(const char *alias, const char *path) { FontEncPtr data = loadFontEncRec(alias, path); if (data != 0) { int n; int lo_char = -1; int hi_char = -1; int num_def = 0; int inx; FontEncSimpleMapPtr mq; printf("\tName: %s\n", data->name); if (data->aliases) { for (n = 0; data->aliases[n]; ++n) { printf("\t %s\n", data->aliases[n]); } } if (data->row_size) { printf("\tSize: %d %d (%d)\n", data->size, data->row_size, data->size * data->row_size); } else { printf("\tSize: %d\n", data->size); } if (data->first_col) { printf("\tBase: %04X\n", flatUCode(data->first, data->first_col)); } else { printf("\tBase: %04X\n", data->first); } mq = findUnicodeMapping(data); if (mq != 0) { trim_or_fill(mq, (int) fontencSize(data)); for (n = 0; n < (int) mq->len; ++n) { inx = fontencUnmap(mq, n); if (inx >= 0 && mq->map[n]) { UpdateLoChar(inx); UpdateHiChar(inx); if (mq->map[n] != inx) num_def++; } } if (lo_char < 0) { lo_char = mq->first; hi_char = data->size - 1; } printf("\tData: [%04x..%04x] defined %d\n", lo_char, hi_char, num_def); } } return data; } /* * Make a report of the encoding files which could be loaded using either * the fontenc library (using its hardcoded tables) or dynamically via luit. */ int reportFontencCharsets(void) { int rc = EXIT_FAILURE; int n; printf("Available encodings listed in:\n\t%s\n", FontEncDirectory()); loadEncodingsDir(); if (encodings_dir != 0) { for (n = 0; encodings_dir[n].alias != 0; ++n) { printf("%s\n\t%s\n", encodings_dir[n].alias, encodings_dir[n].path); encodings_dir[n].data = reportOneFontenc(encodings_dir[n].alias, encodings_dir[n].path); if (encodings_dir[n].data != 0) { rc = EXIT_SUCCESS; } } } if (rc != EXIT_SUCCESS) { Warning("no encodings found\n"); } return rc; } /* * Regurgitate an encoding from the in-memory copy. */ static int showOneCharset(const char *name, FontEncPtr data) { int rc = EXIT_FAILURE; if (data != 0) { FontMapPtr mp; int n; printf("# %s\n", name); printf("STARTENCODING %s\n", data->name ? data->name : "unknown"); if (data->aliases) { for (n = 0; data->aliases[n]; ++n) { printf("ALIAS %s\n", data->aliases[n]); } } if (data->row_size) printf("SIZE %d %d\n", data->size, data->row_size); else if (data->size) printf("SIZE %d\n", data->size); if (data->first_col) printf("FIRSTINDEX %d %d\n", data->first, data->first_col); else if (data->first) printf("FIRSTINDEX %d\n", data->first); for (mp = data->mappings; mp != 0; mp = mp->next) { printf("STARTMAPPING %s\n", fontmapTypename(mp->type)); if (mp->type == FONT_ENCODING_UNICODE) { int limit = (int) fontencSize(data); unsigned ch; if (mp->client_data == 0) printf("# no client_data-array\n"); if (mp->recode == 0) { printf("# no recode-function\n"); } else { trim_or_fill(mp->client_data, (int) fontencSize(data)); for (n = 0; n < limit; ++n) { ch = mp->recode((unsigned) n, mp->client_data); if (ch || !n) { if (!fill_fontenc && ((unsigned) n == ch)) continue; printf("0x%04X 0x%04X\n", n, ch); } } } } printf("ENDMAPPING\n"); } printf("# vile:tblmode\n"); printf("ENDENCODING\n"); rc = EXIT_SUCCESS; } else { Warning("no encoding data found for %s\n", name); } return rc; } int showFontencCharset(const char *name) { return showOneCharset(name, lookupOneFontenc(name)); } /* * Returns 94, 96 or 128 for an 8-bit character-set, based on the mapping. */ int typeOfFontenc(FontEncPtr enc) { FontEncSimpleMapPtr mp = findUnicodeMapping(enc); int result = 0; if (mp != NULL) { int limit = (int) fontencSize(enc); int n; int hi = 0; int lo = limit; for (n = 0; n < limit; ++n) { UCode target = mp->map[n - mp->first]; if (target != 0 && target != n) { if (n > hi) hi = n; if (n < lo) lo = n; } } if (lo >= 128 && lo < 160) { result = 128; } else if (lo >= 160 && hi < 256) { result = 96; } else { result = hi - lo + 1; } VERBOSE(2, ("character-set size %d\n", result)); } return result; } /* * Returns 0x00 or 0x80 for an 8-bit character-set, according to where the * lowest mapping is done. */ unsigned shiftOfFontenc(FontEncPtr enc) { FontEncSimpleMapPtr mp = findUnicodeMapping(enc); unsigned result = 0x80; if (mp != NULL) { int limit = (int) fontencSize(enc); int n; for (n = 0; n < limit; ++n) { UCode target = mp->map[n - mp->first]; if (n >= 128) { break; } else if (target != 0 && target != n) { result = 0; break; } } VERBOSE(2, ("character-set offset %u\n", result)); } return result; } #ifdef USE_ICONV /* * Display built-in encoding as ".enc" format. */ int showBuiltinCharset(const char *name) { FontEncPtr data = luitGetFontEnc(name, umBUILTIN); int rc = showOneCharset(name, data); luitFreeFontEnc(data); return rc; } /* * Display iconv encoding as ".enc" format. */ int showIconvCharset(const char *name) { FontEncPtr data = luitGetFontEnc(name, umICONV); int rc = showOneCharset(name, data); luitFreeFontEnc(data); return rc; } #endif /* USE_ICONV */ #ifdef NO_LEAKS static void freeFontMapRec(FontMapPtr data) { switch (data->type) { #ifdef FONT_ENCODING_TRUETYPE case FONT_ENCODING_TRUETYPE: /* FALLTHRU */ #endif case FONT_ENCODING_UNICODE: { FontEncSimpleMapPtr mapHead = data->client_data; free((void *) mapHead->map); free(mapHead); } break; #ifdef FONT_ENCODING_POSTSCRIPT case FONT_ENCODING_POSTSCRIPT: { FontEncSimpleNamePtr mapHead = data->client_data; if (mapHead->map) { int n; for (n = 0; mapHead->map[n]; ++n) { free(mapHead->map[n]); } free(mapHead->map); } free(mapHead); } break; #endif /* FONT_ENCODING_POSTSCRIPT */ default: free(data->client_data); break; } free(data); } static void freeFontEncRec(FontEncPtr data) { if (data != 0) { while (data->mappings != 0) { FontMapPtr next = data->mappings->next; freeFontMapRec(data->mappings); data->mappings = next; } if (data->aliases) { int n; for (n = 0; data->aliases[n]; ++n) { free(data->aliases[n]); } free(data->aliases); } free(data->name); free(data); } } void fontenc_leaks(void) { if (encodings_dir != 0) { int enc; for (enc = 0; encodings_dir[enc].alias != 0; ++enc) { freeFontEncRec(encodings_dir[enc].data); free(encodings_dir[enc].alias); free(encodings_dir[enc].path); } free(encodings_dir); } } #endif /* NOLEAKS */ luit-20240910/plink.sh0000755000000000000000000000533414213433621013110 0ustar rootroot#!/bin/sh # $XTermId: plink.sh,v 1.17 2022/03/13 18:27:29 Ryan.Schmidt Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # # Copyright 2001-2021,2022 by Thomas E. Dickey # # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name(s) of the above copyright # holders shall not be used in advertising or otherwise to promote the # sale, use or other dealings in this Software without prior written # authorization. # ----------------------------------------------------------------------------- # # Reduce the number of dynamic libraries used to link an executable. LINKIT= ASNEED=no NO_LTO= # gcc's link-time optimization is very slow - reduce usage of that. case "$*" in *-flto=*|-flto\ ) NO_LTO=-fno-lto ;; esac : "${TMPDIR=/tmp}" while [ $# != 0 ] do if [ $ASNEED = no ] && [ -n "$LINKIT" ] then ASNEED=yes OPT=-Wl,-as-needed warned=`mktemp "$TMPDIR/xterm.XXXXXXXX"` trap "rm -f $warned; exit 1" 1 2 3 15 trap "rm -f $warned" 0 if ( eval $LINKIT $OPT $NO_LTO "$@" >"$warned" 2>&1 ) then WARNED=`cat "$warned"` rm -f "$warned" case ".$WARNED" in *Warning*|*nsupported*|*nrecognized*|*nknown*) ;; *) LINKIT="$LINKIT $OPT $*" break ;; esac else rm -f "$warned" fi fi OPT="$1" shift case $OPT in -k*) OPT=`echo "$OPT" | sed -e 's/^-k/-l/'` echo "always use $OPT (cannot test if needed)" LINKIT="$LINKIT $OPT" ;; -l*) echo "testing if $OPT is needed" if ( eval $LINKIT $NO_LTO "$@" >/dev/null 2>&1 ) then : echo ...no else echo ...yes LINKIT="$LINKIT $OPT" fi ;; *) LINKIT="$LINKIT $OPT" ;; esac done eval $LINKIT luit-20240910/Makefile.in0000644000000000000000000001061413414461476013511 0ustar rootroot## $XTermId: Makefile.in,v 1.26 2019/01/06 20:21:18 tom Exp $ ## ## Copyright 2006-2015,2019 by Thomas E. Dickey ## ## All Rights Reserved ## ## Permission to use, copy, modify, and distribute this software and its ## documentation for any purpose and without fee is hereby granted, ## provided that the above copyright notice appear in all copies and that ## both that copyright notice and this permission notice appear in ## supporting documentation, and that the name of the above listed ## copyright holder(s) not be used in advertising or publicity pertaining ## to distribution of the software without specific, written prior ## permission. ## ## THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD ## TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY ## AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE ## LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES ## WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ## ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF ## OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. SHELL = /bin/sh #### Start of system configuration section. #### srcdir = @srcdir@ VPATH = @srcdir@ x = @EXEEXT@ o = .@OBJEXT@ CC = @CC@ CPP = @CPP@ LINK = $(CC) $(CFLAGS) RM = rm -f LINT = @LINT@ CTAGS = @CTAGS@ ETAGS = @ETAGS@ INSTALL = @INSTALL@ INSTALL_PROGRAM = @INSTALL_PROGRAM@ INSTALL_SCRIPT = @INSTALL_SCRIPT@ INSTALL_DATA = @INSTALL_DATA@ transform = @program_transform_name@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ manext = 1 bindir = @bindir@ libdir = @libdir@ mandir = @mandir@/man$(manext) LOCALE_ALIAS = @LOCALE_ALIAS_FILE@ EXTRA_CFLAGS = @EXTRA_CFLAGS@ EXTRA_CPPFLAGS = @EXTRA_CPPFLAGS@ CPPFLAGS = -I. -I$(srcdir) -DHAVE_CONFIG_H -DLOCALE_ALIAS_FILE=\"$(LOCALE_ALIAS)\" @CPPFLAGS@ $(EXTRA_CPPFLAGS) CFLAGS = @X_CFLAGS@ @CFLAGS@ $(EXTRA_CFLAGS) LDFLAGS = @EXTRA_LDFLAGS@ @LDFLAGS@ LIBS = @X_LIBS@ @LIBS@ #### End of system configuration section. #### DESTDIR = BINDIR = $(DESTDIR)$(bindir) MANDIR = $(DESTDIR)$(mandir) INSTALL_DIRS = $(BINDIR) $(MANDIR) SRCS = luit.c iso2022.c charset.c parser.c sys.c other.c fontenc.c @EXTRASRCS@ OBJS = luit$o iso2022$o charset$o parser$o sys$o other$o fontenc$o @EXTRAOBJS@ HDRS = charset.h config.h iso2022.h luit.h luitconv.h other.h parser.h sys.h PROGRAMS = luit$x all : $(PROGRAMS) ################################################################################ .SUFFIXES : .i .html .$(manext) .c$o : @RULE_CC@ @ECHO_CC@$(CC) $(CPPFLAGS) $(CFLAGS) -c $(srcdir)/$*.c .c.i : @RULE_CC@ @ECHO_CC@$(CPP) -C $(CPPFLAGS) $*.c >$@ .man.$(manext) : $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $< $@ $(appsdir) ################################################################################ $(OBJS) : $(HDRS) luit$x : $(OBJS) @ECHO_LD@$(SHELL) $(srcdir)/plink.sh $(LINK) $(LDFLAGS) -o $@ $(OBJS) $(LIBS) actual_luit = `echo luit| sed '$(transform)'` binary_luit = $(actual_luit)$x install \ install-bin \ install-full :: luit$x $(BINDIR) $(INSTALL_PROGRAM) luit$x $(BINDIR)/$(binary_luit) install \ install-man \ install-full :: $(MANDIR) $(SHELL) $(srcdir)/minstall.sh "$(INSTALL_DATA)" $(srcdir)/luit.man $(MANDIR)/$(actual_luit).$(manext) $(prefix) $(LOCALE_ALIAS) install :: @echo 'Completed installation of executables and documentation.' installdirs : $(INSTALL_DIRS) uninstall \ uninstall-bin \ uninstall-full :: -$(RM) $(BINDIR)/$(binary_luit) uninstall \ uninstall-man \ uninstall-full :: -$(RM) $(MANDIR)/$(actual_luit).$(manext) mostlyclean :: -$(RM) *$o *.[is] .pure core *~ *.bak *.BAK *.out *.tmp clean :: mostlyclean -$(RM) $(PROGRAMS) distclean :: clean -$(RM) Makefile config.status config.cache config.log config.h man2html.tmp -$(RM) luit.html *.pdf *.ps *.txt *.$(manext) realclean :: distclean -$(RM) tags TAGS maintainer-clean : realclean check : @ echo "There are no batch-tests for this program" lint : $(LINT) $(CPPFLAGS) $(SRCS) tags : $(CTAGS) $(SRCS) $(HDRS) @MAKE_UPPER_TAGS@TAGS : @MAKE_UPPER_TAGS@ $(ETAGS) $(SRCS) $(HDRS) ALWAYS : depend : $(TABLES) makedepend -- $(CPPFLAGS) -- $(SRCS) $(BINDIR) \ $(MANDIR) : mkdir -p $@ ################################################################################ # DO NOT DELETE THIS LINE -- make depend depends on it. luit-20240910/config.sub0000755000000000000000000011544114627414553013434 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2024 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268,SC2162 # see below for rationale timestamp='2024-05-27' # This file is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, see . # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that # program. This Exception is an additional permission under section 7 # of the GNU General Public License, version 3 ("GPLv3"). # Please send patches to . # # Configuration subroutine to validate and canonicalize a configuration type. # Supply the specified configuration type as an argument. # If it is invalid, we print an error message on stderr and exit with code 1. # Otherwise, we print the canonical config type on stdout and succeed. # You can get the latest version of this script from: # https://git.savannah.gnu.org/cgit/config.git/plain/config.sub # This file is supposed to be the same for all GNU packages # and recognize all the CPU types, system types and aliases # that are meaningful with *any* GNU software. # Each package is responsible for reporting which valid configurations # it does not support. The user should be able to distinguish # a failure to support a valid configuration from a meaningless # configuration. # The goal of this file is to map all the various variations of a given # machine specification into a single specification in the form: # CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM # or in some cases, the newer four-part form: # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # It is wrong to echo any other type of specification. # The "shellcheck disable" line above the timestamp inhibits complaints # about features and limitations of the classic Bourne shell that were # superseded or lifted in POSIX. However, this script identifies a wide # variety of pre-POSIX systems that do not have POSIX shells at all, and # even some reasonably current systems (Solaris 10 as case-in-point) still # have a pre-POSIX /bin/sh. me=`echo "$0" | sed -e 's,.*/,,'` usage="\ Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS Canonicalize a configuration name. Options: -h, --help print this help, then exit -t, --time-stamp print date of last modification, then exit -v, --version print version number, then exit Report bugs and patches to ." version="\ GNU config.sub ($timestamp) Copyright 1992-2024 Free Software Foundation, Inc. This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." help=" Try '$me --help' for more information." # Parse command line while test $# -gt 0 ; do case $1 in --time-stamp | --time* | -t ) echo "$timestamp" ; exit ;; --version | -v ) echo "$version" ; exit ;; --help | --h* | -h ) echo "$usage"; exit ;; -- ) # Stop option processing shift; break ;; - ) # Use stdin as input. break ;; -* ) echo "$me: invalid option $1$help" >&2 exit 1 ;; *local*) # First pass through any local machine types. echo "$1" exit ;; * ) break ;; esac done case $# in 0) echo "$me: missing argument$help" >&2 exit 1;; 1) ;; *) echo "$me: too many arguments$help" >&2 exit 1;; esac # Split fields of configuration type saved_IFS=$IFS IFS="-" read field1 field2 field3 field4 <&2 exit 1 ;; *-*-*-*) basic_machine=$field1-$field2 basic_os=$field3-$field4 ;; *-*-*) # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two # parts maybe_os=$field2-$field3 case $maybe_os in cloudabi*-eabi* \ | kfreebsd*-gnu* \ | knetbsd*-gnu* \ | kopensolaris*-gnu* \ | linux-* \ | managarm-* \ | netbsd*-eabi* \ | netbsd*-gnu* \ | nto-qnx* \ | os2-emx* \ | rtmk-nova* \ | storm-chaos* \ | uclinux-gnu* \ | uclinux-uclibc* \ | windows-* ) basic_machine=$field1 basic_os=$maybe_os ;; android-linux) basic_machine=$field1-unknown basic_os=linux-android ;; *) basic_machine=$field1-$field2 basic_os=$field3 ;; esac ;; *-*) case $field1-$field2 in # Shorthands that happen to contain a single dash convex-c[12] | convex-c3[248]) basic_machine=$field2-convex basic_os= ;; decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Do not treat sunos as a manufacturer sun*os*) basic_machine=$field1 basic_os=$field2 ;; # Manufacturers 3100* \ | 32* \ | 3300* \ | 3600* \ | 7300* \ | acorn \ | altos* \ | apollo \ | apple \ | atari \ | att* \ | axis \ | be \ | bull \ | cbm \ | ccur \ | cisco \ | commodore \ | convergent* \ | convex* \ | cray \ | crds \ | dec* \ | delta* \ | dg \ | digital \ | dolphin \ | encore* \ | gould \ | harris \ | highlevel \ | hitachi* \ | hp \ | ibm* \ | intergraph \ | isi* \ | knuth \ | masscomp \ | microblaze* \ | mips* \ | motorola* \ | ncr* \ | news \ | next \ | ns \ | oki \ | omron* \ | pc533* \ | rebel \ | rom68k \ | rombug \ | semi \ | sequent* \ | siemens \ | sgi* \ | siemens \ | sim \ | sni \ | sony* \ | stratus \ | sun \ | sun[234]* \ | tektronix \ | tti* \ | ultra \ | unicom* \ | wec \ | winbond \ | wrs) basic_machine=$field1-$field2 basic_os= ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; *) basic_machine=$field1 basic_os=$field2 ;; esac ;; esac ;; *) # Convert single-component short-hands not valid as part of # multi-component configurations. case $field1 in 386bsd) basic_machine=i386-pc basic_os=bsd ;; a29khif) basic_machine=a29k-amd basic_os=udi ;; adobe68k) basic_machine=m68010-adobe basic_os=scout ;; alliant) basic_machine=fx80-alliant basic_os= ;; altos | altos3068) basic_machine=m68k-altos basic_os= ;; am29k) basic_machine=a29k-none basic_os=bsd ;; amdahl) basic_machine=580-amdahl basic_os=sysv ;; amiga) basic_machine=m68k-unknown basic_os= ;; amigaos | amigados) basic_machine=m68k-unknown basic_os=amigaos ;; amigaunix | amix) basic_machine=m68k-unknown basic_os=sysv4 ;; apollo68) basic_machine=m68k-apollo basic_os=sysv ;; apollo68bsd) basic_machine=m68k-apollo basic_os=bsd ;; aros) basic_machine=i386-pc basic_os=aros ;; aux) basic_machine=m68k-apple basic_os=aux ;; balance) basic_machine=ns32k-sequent basic_os=dynix ;; blackfin) basic_machine=bfin-unknown basic_os=linux ;; cegcc) basic_machine=arm-unknown basic_os=cegcc ;; cray) basic_machine=j90-cray basic_os=unicos ;; crds | unos) basic_machine=m68k-crds basic_os= ;; da30) basic_machine=m68k-da30 basic_os= ;; decstation | pmax | pmin | dec3100 | decstatn) basic_machine=mips-dec basic_os= ;; delta88) basic_machine=m88k-motorola basic_os=sysv3 ;; dicos) basic_machine=i686-pc basic_os=dicos ;; djgpp) basic_machine=i586-pc basic_os=msdosdjgpp ;; ebmon29k) basic_machine=a29k-amd basic_os=ebmon ;; es1800 | OSE68k | ose68k | ose | OSE) basic_machine=m68k-ericsson basic_os=ose ;; gmicro) basic_machine=tron-gmicro basic_os=sysv ;; go32) basic_machine=i386-pc basic_os=go32 ;; h8300hms) basic_machine=h8300-hitachi basic_os=hms ;; h8300xray) basic_machine=h8300-hitachi basic_os=xray ;; h8500hms) basic_machine=h8500-hitachi basic_os=hms ;; harris) basic_machine=m88k-harris basic_os=sysv3 ;; hp300 | hp300hpux) basic_machine=m68k-hp basic_os=hpux ;; hp300bsd) basic_machine=m68k-hp basic_os=bsd ;; hppaosf) basic_machine=hppa1.1-hp basic_os=osf ;; hppro) basic_machine=hppa1.1-hp basic_os=proelf ;; i386mach) basic_machine=i386-mach basic_os=mach ;; isi68 | isi) basic_machine=m68k-isi basic_os=sysv ;; m68knommu) basic_machine=m68k-unknown basic_os=linux ;; magnum | m3230) basic_machine=mips-mips basic_os=sysv ;; merlin) basic_machine=ns32k-utek basic_os=sysv ;; mingw64) basic_machine=x86_64-pc basic_os=mingw64 ;; mingw32) basic_machine=i686-pc basic_os=mingw32 ;; mingw32ce) basic_machine=arm-unknown basic_os=mingw32ce ;; monitor) basic_machine=m68k-rom68k basic_os=coff ;; morphos) basic_machine=powerpc-unknown basic_os=morphos ;; moxiebox) basic_machine=moxie-unknown basic_os=moxiebox ;; msdos) basic_machine=i386-pc basic_os=msdos ;; msys) basic_machine=i686-pc basic_os=msys ;; mvs) basic_machine=i370-ibm basic_os=mvs ;; nacl) basic_machine=le32-unknown basic_os=nacl ;; ncr3000) basic_machine=i486-ncr basic_os=sysv4 ;; netbsd386) basic_machine=i386-pc basic_os=netbsd ;; netwinder) basic_machine=armv4l-rebel basic_os=linux ;; news | news700 | news800 | news900) basic_machine=m68k-sony basic_os=newsos ;; news1000) basic_machine=m68030-sony basic_os=newsos ;; necv70) basic_machine=v70-nec basic_os=sysv ;; nh3000) basic_machine=m68k-harris basic_os=cxux ;; nh[45]000) basic_machine=m88k-harris basic_os=cxux ;; nindy960) basic_machine=i960-intel basic_os=nindy ;; mon960) basic_machine=i960-intel basic_os=mon960 ;; nonstopux) basic_machine=mips-compaq basic_os=nonstopux ;; os400) basic_machine=powerpc-ibm basic_os=os400 ;; OSE68000 | ose68000) basic_machine=m68000-ericsson basic_os=ose ;; os68k) basic_machine=m68k-none basic_os=os68k ;; paragon) basic_machine=i860-intel basic_os=osf ;; parisc) basic_machine=hppa-unknown basic_os=linux ;; psp) basic_machine=mipsallegrexel-sony basic_os=psp ;; pw32) basic_machine=i586-unknown basic_os=pw32 ;; rdos | rdos64) basic_machine=x86_64-pc basic_os=rdos ;; rdos32) basic_machine=i386-pc basic_os=rdos ;; rom68k) basic_machine=m68k-rom68k basic_os=coff ;; sa29200) basic_machine=a29k-amd basic_os=udi ;; sei) basic_machine=mips-sei basic_os=seiux ;; sequent) basic_machine=i386-sequent basic_os= ;; sps7) basic_machine=m68k-bull basic_os=sysv2 ;; st2000) basic_machine=m68k-tandem basic_os= ;; stratus) basic_machine=i860-stratus basic_os=sysv4 ;; sun2) basic_machine=m68000-sun basic_os= ;; sun2os3) basic_machine=m68000-sun basic_os=sunos3 ;; sun2os4) basic_machine=m68000-sun basic_os=sunos4 ;; sun3) basic_machine=m68k-sun basic_os= ;; sun3os3) basic_machine=m68k-sun basic_os=sunos3 ;; sun3os4) basic_machine=m68k-sun basic_os=sunos4 ;; sun4) basic_machine=sparc-sun basic_os= ;; sun4os3) basic_machine=sparc-sun basic_os=sunos3 ;; sun4os4) basic_machine=sparc-sun basic_os=sunos4 ;; sun4sol2) basic_machine=sparc-sun basic_os=solaris2 ;; sun386 | sun386i | roadrunner) basic_machine=i386-sun basic_os= ;; sv1) basic_machine=sv1-cray basic_os=unicos ;; symmetry) basic_machine=i386-sequent basic_os=dynix ;; t3e) basic_machine=alphaev5-cray basic_os=unicos ;; t90) basic_machine=t90-cray basic_os=unicos ;; toad1) basic_machine=pdp10-xkl basic_os=tops20 ;; tpf) basic_machine=s390x-ibm basic_os=tpf ;; udi29k) basic_machine=a29k-amd basic_os=udi ;; ultra3) basic_machine=a29k-nyu basic_os=sym1 ;; v810 | necv810) basic_machine=v810-nec basic_os=none ;; vaxv) basic_machine=vax-dec basic_os=sysv ;; vms) basic_machine=vax-dec basic_os=vms ;; vsta) basic_machine=i386-pc basic_os=vsta ;; vxworks960) basic_machine=i960-wrs basic_os=vxworks ;; vxworks68) basic_machine=m68k-wrs basic_os=vxworks ;; vxworks29k) basic_machine=a29k-wrs basic_os=vxworks ;; xbox) basic_machine=i686-pc basic_os=mingw32 ;; ymp) basic_machine=ymp-cray basic_os=unicos ;; *) basic_machine=$1 basic_os= ;; esac ;; esac # Decode 1-component or ad-hoc basic machines case $basic_machine in # Here we handle the default manufacturer of certain CPU types. It is in # some cases the only manufacturer, in others, it is the most popular. w89k) cpu=hppa1.1 vendor=winbond ;; op50n) cpu=hppa1.1 vendor=oki ;; op60c) cpu=hppa1.1 vendor=oki ;; ibm*) cpu=i370 vendor=ibm ;; orion105) cpu=clipper vendor=highlevel ;; mac | mpw | mac-mpw) cpu=m68k vendor=apple ;; pmac | pmac-mpw) cpu=powerpc vendor=apple ;; # Recognize the various machine names and aliases which stand # for a CPU type and a company and sometimes even an OS. 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) cpu=m68000 vendor=att ;; 3b*) cpu=we32k vendor=att ;; bluegene*) cpu=powerpc vendor=ibm basic_os=cnk ;; decsystem10* | dec10*) cpu=pdp10 vendor=dec basic_os=tops10 ;; decsystem20* | dec20*) cpu=pdp10 vendor=dec basic_os=tops20 ;; delta | 3300 | delta-motorola | 3300-motorola | motorola-delta | motorola-3300) cpu=m68k vendor=motorola ;; # This used to be dpx2*, but that gets the RS6000-based # DPX/20 and the x86-based DPX/2-100 wrong. See # https://oldskool.silicium.org/stations/bull_dpx20.htm # https://www.feb-patrimoine.com/english/bull_dpx2.htm # https://www.feb-patrimoine.com/english/unix_and_bull.htm dpx2 | dpx2[23]00 | dpx2[23]xx) cpu=m68k vendor=bull ;; dpx2100 | dpx21xx) cpu=i386 vendor=bull ;; dpx20) cpu=rs6000 vendor=bull ;; encore | umax | mmax) cpu=ns32k vendor=encore ;; elxsi) cpu=elxsi vendor=elxsi basic_os=${basic_os:-bsd} ;; fx2800) cpu=i860 vendor=alliant ;; genix) cpu=ns32k vendor=ns ;; h3050r* | hiux*) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; hp3k9[0-9][0-9] | hp9[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k2[0-9][0-9] | hp9k31[0-9]) cpu=m68000 vendor=hp ;; hp9k3[2-9][0-9]) cpu=m68k vendor=hp ;; hp9k6[0-9][0-9] | hp6[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; hp9k7[0-79][0-9] | hp7[0-79][0-9]) cpu=hppa1.1 vendor=hp ;; hp9k78[0-9] | hp78[0-9]) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) # FIXME: really hppa2.0-hp cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][13679] | hp8[0-9][13679]) cpu=hppa1.1 vendor=hp ;; hp9k8[0-9][0-9] | hp8[0-9][0-9]) cpu=hppa1.0 vendor=hp ;; i*86v32) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv32 ;; i*86v4*) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv4 ;; i*86v) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=sysv ;; i*86sol2) cpu=`echo "$1" | sed -e 's/86.*/86/'` vendor=pc basic_os=solaris2 ;; j90 | j90-cray) cpu=j90 vendor=cray basic_os=${basic_os:-unicos} ;; iris | iris4d) cpu=mips vendor=sgi case $basic_os in irix*) ;; *) basic_os=irix4 ;; esac ;; miniframe) cpu=m68000 vendor=convergent ;; *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*) cpu=m68k vendor=atari basic_os=mint ;; news-3600 | risc-news) cpu=mips vendor=sony basic_os=newsos ;; next | m*-next) cpu=m68k vendor=next ;; np1) cpu=np1 vendor=gould ;; op50n-* | op60c-*) cpu=hppa1.1 vendor=oki basic_os=proelf ;; pa-hitachi) cpu=hppa1.1 vendor=hitachi basic_os=hiuxwe2 ;; pbd) cpu=sparc vendor=tti ;; pbb) cpu=m68k vendor=tti ;; pc532) cpu=ns32k vendor=pc532 ;; pn) cpu=pn vendor=gould ;; power) cpu=power vendor=ibm ;; ps2) cpu=i386 vendor=ibm ;; rm[46]00) cpu=mips vendor=siemens ;; rtpc | rtpc-*) cpu=romp vendor=ibm ;; sde) cpu=mipsisa32 vendor=sde basic_os=${basic_os:-elf} ;; simso-wrs) cpu=sparclite vendor=wrs basic_os=vxworks ;; tower | tower-32) cpu=m68k vendor=ncr ;; vpp*|vx|vx-*) cpu=f301 vendor=fujitsu ;; w65) cpu=w65 vendor=wdc ;; w89k-*) cpu=hppa1.1 vendor=winbond basic_os=proelf ;; none) cpu=none vendor=none ;; leon|leon[3-9]) cpu=sparc vendor=$basic_machine ;; leon-*|leon[3-9]-*) cpu=sparc vendor=`echo "$basic_machine" | sed 's/-.*//'` ;; *-*) saved_IFS=$IFS IFS="-" read cpu vendor <&2 exit 1 ;; esac ;; esac # Here we canonicalize certain aliases for manufacturers. case $vendor in digital*) vendor=dec ;; commodore*) vendor=cbm ;; *) ;; esac # Decode manufacturer-specific aliases for certain operating systems. if test x"$basic_os" != x then # First recognize some ad-hoc cases, or perhaps split kernel-os, or else just # set os. obj= case $basic_os in gnu/linux*) kernel=linux os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'` ;; os2-emx) kernel=os2 os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'` ;; nto-qnx*) kernel=nto os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'` ;; *-*) saved_IFS=$IFS IFS="-" read kernel os <&2 fi ;; *) echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2 exit 1 ;; esac case $obj in aout* | coff* | elf* | pe*) ;; '') # empty is fine ;; *) echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2 exit 1 ;; esac # Here we handle the constraint that a (synthetic) cpu and os are # valid only in combination with each other and nowhere else. case $cpu-$os in # The "javascript-unknown-ghcjs" triple is used by GHC; we # accept it here in order to tolerate that, but reject any # variations. javascript-ghcjs) ;; javascript-* | *-ghcjs) echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2 exit 1 ;; esac # As a final step for OS-related things, validate the OS-kernel combination # (given a valid OS), if there is a kernel. case $kernel-$os-$obj in linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \ | linux-mlibc*- | linux-musl*- | linux-newlib*- \ | linux-relibc*- | linux-uclibc*- | linux-ohos*- ) ;; uclinux-uclibc*- | uclinux-gnu*- ) ;; managarm-mlibc*- | managarm-kernel*- ) ;; windows*-msvc*-) ;; -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \ | -uclibc*- ) # These are just libc implementations, not actual OSes, and thus # require a kernel. echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2 exit 1 ;; -kernel*- ) echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2 exit 1 ;; *-kernel*- ) echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2 exit 1 ;; *-msvc*- ) echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2 exit 1 ;; kfreebsd*-gnu*- | knetbsd*-gnu*- | netbsd*-gnu*- | kopensolaris*-gnu*-) ;; vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-) ;; nto-qnx*-) ;; os2-emx-) ;; rtmk-nova-) ;; *-eabi*- | *-gnueabi*-) ;; none--*) # None (no kernel, i.e. freestanding / bare metal), # can be paired with an machine code file format ;; -*-) # Blank kernel with real OS is always fine. ;; --*) # Blank kernel and OS with real machine code file format is always fine. ;; *-*-*) echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2 exit 1 ;; esac # Here we handle the case where we know the os, and the CPU type, but not the # manufacturer. We pick the logical manufacturer. case $vendor in unknown) case $cpu-$os in *-riscix*) vendor=acorn ;; *-sunos* | *-solaris*) vendor=sun ;; *-cnk* | *-aix*) vendor=ibm ;; *-beos*) vendor=be ;; *-hpux*) vendor=hp ;; *-mpeix*) vendor=hp ;; *-hiux*) vendor=hitachi ;; *-unos*) vendor=crds ;; *-dgux*) vendor=dg ;; *-luna*) vendor=omron ;; *-genix*) vendor=ns ;; *-clix*) vendor=intergraph ;; *-mvs* | *-opened*) vendor=ibm ;; *-os400*) vendor=ibm ;; s390-* | s390x-*) vendor=ibm ;; *-ptx*) vendor=sequent ;; *-tpf*) vendor=ibm ;; *-vxsim* | *-vxworks* | *-windiss*) vendor=wrs ;; *-aux*) vendor=apple ;; *-hms*) vendor=hitachi ;; *-mpw* | *-macos*) vendor=apple ;; *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*) vendor=atari ;; *-vos*) vendor=stratus ;; esac ;; esac echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}" exit # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "timestamp='" # time-stamp-format: "%:y-%02m-%02d" # time-stamp-end: "'" # End: luit-20240910/iso2022.h0000644000000000000000000000563211474014371012711 0ustar rootroot/* $XTermId: iso2022.h,v 1.16 2010/11/26 20:30:49 tom Exp $ */ /* Copyright 2010 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUIT_ISO2022_H #define LUIT_ISO2022_H 1 #include #include #define ESC 0x1B #define CSI 0x9B #define CSI_7 '[' #define SS2 0x8E #define SS2_7 0x4E #define SS3 0x8F #define SS3_7 0x4F #define LS0 0x0F #define LS1 0x0E #define LS2_7 0x6E #define LS3_7 0x6F #define LS1R_7 0x7E #define LS2R_7 0x7D #define LS3R_7 0x7C #define IS_FINAL_ESC(x) (((x) & 0xF0 ) != 0x20) #define IS_FINAL_CSI(x) (((x) & 0xF0 ) != 0x20 && (((x) & 0xF0 ) != 0x30)) #define P_NORMAL 0 #define P_ESC 1 #define P_CSI 2 #define S_NORMAL 0 #define S_SS2 1 #define S_SS3 2 #define IF_SS 1 #define IF_LS 2 #define IF_EIGHTBIT 4 #define IF_SSGR 8 #define OF_SS 1 #define OF_LS 2 #define OF_SELECT 4 #define OF_PASSTHRU 8 typedef struct _Iso2022 { const CharsetRec **glp; const CharsetRec **grp; const CharsetRec *g[4]; const CharsetRec *other; int parserState; int shiftState; int inputFlags; int outputFlags; unsigned char *buffered; size_t buffered_len; size_t buffered_count; int buffered_ku; unsigned char *outbuf; size_t outbuf_count; } Iso2022Rec, *Iso2022Ptr; #define GL(i) (*(i)->glp) #define GR(i) (*(i)->grp) #define G0(i) ((i)->g[0]) #define G1(i) ((i)->g[1]) #define G2(i) ((i)->g[2]) #define G3(i) ((i)->g[3]) #define OTHER(i) ((i)->other) #define BUFFER_SIZE 512 Iso2022Ptr allocIso2022(void); int initIso2022(const char *, const char *, Iso2022Ptr); int mergeIso2022(Iso2022Ptr, Iso2022Ptr); void reportIso2022(const char *, Iso2022Ptr); void copyIn(Iso2022Ptr, int, unsigned char *, int); void copyOut(Iso2022Ptr, int, unsigned char *, unsigned); #ifdef NO_LEAKS void destroyIso2022(Iso2022Ptr); #endif #endif /* LUIT_ISO2022_H */ luit-20240910/install-sh0000755000000000000000000003577613761220263013460 0ustar rootroot#!/bin/sh # install - install a program, script, or datafile scriptversion=2020-11-14.01; # UTC # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # 'make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. tab=' ' nl=' ' IFS=" $tab$nl" # Set DOITPROG to "echo" to test this script. doit=${DOITPROG-} doit_exec=${doit:-exec} # Put in absolute file names if you don't have them in your path; # or use environment vars. chgrpprog=${CHGRPPROG-chgrp} chmodprog=${CHMODPROG-chmod} chownprog=${CHOWNPROG-chown} cmpprog=${CMPPROG-cmp} cpprog=${CPPROG-cp} mkdirprog=${MKDIRPROG-mkdir} mvprog=${MVPROG-mv} rmprog=${RMPROG-rm} stripprog=${STRIPPROG-strip} posix_mkdir= # Desired mode of installed file. mode=0755 # Create dirs (including intermediate dirs) using mode 755. # This is like GNU 'install' as of coreutils 8.32 (2020). mkdir_umask=22 backupsuffix= chgrpcmd= chmodcmd=$chmodprog chowncmd= mvcmd=$mvprog rmcmd="$rmprog -f" stripcmd= src= dst= dir_arg= dst_arg= copy_on_change=false is_target_a_directory=possibly usage="\ Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE or: $0 [OPTION]... SRCFILES... DIRECTORY or: $0 [OPTION]... -t DIRECTORY SRCFILES... or: $0 [OPTION]... -d DIRECTORIES... In the 1st form, copy SRCFILE to DSTFILE. In the 2nd and 3rd, copy all SRCFILES to DIRECTORY. In the 4th, create DIRECTORIES. Options: --help display this help and exit. --version display version info and exit. -c (ignored) -C install only if different (preserve data modification time) -d create directories instead of installing files. -g GROUP $chgrpprog installed files to GROUP. -m MODE $chmodprog installed files to MODE. -o USER $chownprog installed files to USER. -p pass -p to $cpprog. -s $stripprog installed files. -S SUFFIX attempt to back up existing files, with suffix SUFFIX. -t DIRECTORY install into DIRECTORY. -T report an error if DSTFILE is a directory. Environment variables override the default commands: CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG RMPROG STRIPPROG By default, rm is invoked with -f; when overridden with RMPROG, it's up to you to specify -f if you want it. If -S is not specified, no backups are attempted. Email bug reports to bug-automake@gnu.org. Automake home page: https://www.gnu.org/software/automake/ " while test $# -ne 0; do case $1 in -c) ;; -C) copy_on_change=true;; -d) dir_arg=true;; -g) chgrpcmd="$chgrpprog $2" shift;; --help) echo "$usage"; exit $?;; -m) mode=$2 case $mode in *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*) echo "$0: invalid mode: $mode" >&2 exit 1;; esac shift;; -o) chowncmd="$chownprog $2" shift;; -p) cpprog="$cpprog -p";; -s) stripcmd=$stripprog;; -S) backupsuffix="$2" shift;; -t) is_target_a_directory=always dst_arg=$2 # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac shift;; -T) is_target_a_directory=never;; --version) echo "$0 $scriptversion"; exit $?;; --) shift break;; -*) echo "$0: invalid option: $1" >&2 exit 1;; *) break;; esac shift done # We allow the use of options -d and -T together, by making -d # take the precedence; this is for compatibility with GNU install. if test -n "$dir_arg"; then if test -n "$dst_arg"; then echo "$0: target directory not allowed when installing a directory." >&2 exit 1 fi fi if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then # When -d is used, all remaining arguments are directories to create. # When -t is used, the destination is already specified. # Otherwise, the last argument is the destination. Remove it from $@. for arg do if test -n "$dst_arg"; then # $@ is not empty: it contains at least $arg. set fnord "$@" "$dst_arg" shift # fnord fi shift # arg dst_arg=$arg # Protect names problematic for 'test' and other utilities. case $dst_arg in -* | [=\(\)!]) dst_arg=./$dst_arg;; esac done fi if test $# -eq 0; then if test -z "$dir_arg"; then echo "$0: no input file specified." >&2 exit 1 fi # It's OK to call 'install-sh -d' without argument. # This can happen when creating conditional directories. exit 0 fi if test -z "$dir_arg"; then if test $# -gt 1 || test "$is_target_a_directory" = always; then if test ! -d "$dst_arg"; then echo "$0: $dst_arg: Is not a directory." >&2 exit 1 fi fi fi if test -z "$dir_arg"; then do_exit='(exit $ret); exit $ret' trap "ret=129; $do_exit" 1 trap "ret=130; $do_exit" 2 trap "ret=141; $do_exit" 13 trap "ret=143; $do_exit" 15 # Set umask so as not to create temps with too-generous modes. # However, 'strip' requires both read and write access to temps. case $mode in # Optimize common cases. *644) cp_umask=133;; *755) cp_umask=22;; *[0-7]) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw='% 200' fi cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;; *) if test -z "$stripcmd"; then u_plus_rw= else u_plus_rw=,u+rw fi cp_umask=$mode$u_plus_rw;; esac fi for src do # Protect names problematic for 'test' and other utilities. case $src in -* | [=\(\)!]) src=./$src;; esac if test -n "$dir_arg"; then dst=$src dstdir=$dst test -d "$dstdir" dstdir_status=$? # Don't chown directories that already exist. if test $dstdir_status = 0; then chowncmd="" fi else # Waiting for this to be detected by the "$cpprog $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if test ! -f "$src" && test ! -d "$src"; then echo "$0: $src does not exist." >&2 exit 1 fi if test -z "$dst_arg"; then echo "$0: no destination specified." >&2 exit 1 fi dst=$dst_arg # If destination is a directory, append the input filename. if test -d "$dst"; then if test "$is_target_a_directory" = never; then echo "$0: $dst_arg: Is a directory" >&2 exit 1 fi dstdir=$dst dstbase=`basename "$src"` case $dst in */) dst=$dst$dstbase;; *) dst=$dst/$dstbase;; esac dstdir_status=0 else dstdir=`dirname "$dst"` test -d "$dstdir" dstdir_status=$? fi fi case $dstdir in */) dstdirslash=$dstdir;; *) dstdirslash=$dstdir/;; esac obsolete_mkdir_used=false if test $dstdir_status != 0; then case $posix_mkdir in '') # With -d, create the new directory with the user-specified mode. # Otherwise, rely on $mkdir_umask. if test -n "$dir_arg"; then mkdir_mode=-m$mode else mkdir_mode= fi posix_mkdir=false # The $RANDOM variable is not portable (e.g., dash). Use it # here however when possible just to lower collision chance. tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$ trap ' ret=$? rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null exit $ret ' 0 # Because "mkdir -p" follows existing symlinks and we likely work # directly in world-writeable /tmp, make sure that the '$tmpdir' # directory is successfully created first before we actually test # 'mkdir -p'. if (umask $mkdir_umask && $mkdirprog $mkdir_mode "$tmpdir" && exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1 then if test -z "$dir_arg" || { # Check for POSIX incompatibilities with -m. # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or # other-writable bit of parent directory when it shouldn't. # FreeBSD 6.1 mkdir -m -p sets mode of existing directory. test_tmpdir="$tmpdir/a" ls_ld_tmpdir=`ls -ld "$test_tmpdir"` case $ls_ld_tmpdir in d????-?r-*) different_mode=700;; d????-?--*) different_mode=755;; *) false;; esac && $mkdirprog -m$different_mode -p -- "$test_tmpdir" && { ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"` test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1" } } then posix_mkdir=: fi rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" else # Remove any dirs left behind by ancient mkdir implementations. rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null fi trap '' 0;; esac if $posix_mkdir && ( umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir" ) then : else # mkdir does not conform to POSIX, # or it failed possibly due to a race condition. Create the # directory the slow way, step by step, checking for races as we go. case $dstdir in /*) prefix='/';; [-=\(\)!]*) prefix='./';; *) prefix='';; esac oIFS=$IFS IFS=/ set -f set fnord $dstdir shift set +f IFS=$oIFS prefixes= for d do test X"$d" = X && continue prefix=$prefix$d if test -d "$prefix"; then prefixes= else if $posix_mkdir; then (umask $mkdir_umask && $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break # Don't fail if two instances are running concurrently. test -d "$prefix" || exit 1 else case $prefix in *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;; *) qprefix=$prefix;; esac prefixes="$prefixes '$qprefix'" fi fi prefix=$prefix/ done if test -n "$prefixes"; then # Don't fail if two instances are running concurrently. (umask $mkdir_umask && eval "\$doit_exec \$mkdirprog $prefixes") || test -d "$dstdir" || exit 1 obsolete_mkdir_used=true fi fi fi if test -n "$dir_arg"; then { test -z "$chowncmd" || $doit $chowncmd "$dst"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dst"; } && { test "$obsolete_mkdir_used$chowncmd$chgrpcmd" = false || test -z "$chmodcmd" || $doit $chmodcmd $mode "$dst"; } || exit 1 else # Make a couple of temp file names in the proper directory. dsttmp=${dstdirslash}_inst.$$_ rmtmp=${dstdirslash}_rm.$$_ # Trap to clean up those temp files at exit. trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0 # Copy the file name to the temp name. (umask $cp_umask && { test -z "$stripcmd" || { # Create $dsttmp read-write so that cp doesn't create it read-only, # which would cause strip to fail. if test -z "$doit"; then : >"$dsttmp" # No need to fork-exec 'touch'. else $doit touch "$dsttmp" fi } } && $doit_exec $cpprog "$src" "$dsttmp") && # and set any options; do chmod last to preserve setuid bits. # # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $cpprog $src $dsttmp" command. # { test -z "$chowncmd" || $doit $chowncmd "$dsttmp"; } && { test -z "$chgrpcmd" || $doit $chgrpcmd "$dsttmp"; } && { test -z "$stripcmd" || $doit $stripcmd "$dsttmp"; } && { test -z "$chmodcmd" || $doit $chmodcmd $mode "$dsttmp"; } && # If -C, don't bother to copy if it wouldn't change the file. if $copy_on_change && old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` && new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` && set -f && set X $old && old=:$2:$4:$5:$6 && set X $new && new=:$2:$4:$5:$6 && set +f && test "$old" = "$new" && $cmpprog "$dst" "$dsttmp" >/dev/null 2>&1 then rm -f "$dsttmp" else # If $backupsuffix is set, and the file being installed # already exists, attempt a backup. Don't worry if it fails, # e.g., if mv doesn't support -f. if test -n "$backupsuffix" && test -f "$dst"; then $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null fi # Rename the file to the real destination. $doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null || # The rename failed, perhaps because mv can't rename something else # to itself, or perhaps because mv is so ancient that it does not # support -f. { # Now remove or move aside any old file at destination location. # We try this two ways since rm can't unlink itself on some # systems and the destination file might be busy for other # reasons. In this case, the final cleanup might fail but the new # file should still install successfully. { test ! -f "$dst" || $doit $rmcmd "$dst" 2>/dev/null || { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null && { $doit $rmcmd "$rmtmp" 2>/dev/null; :; } } || { echo "$0: cannot unlink or rename $dst" >&2 (exit 1); exit 1 } } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dst" } fi || exit 1 trap '' 0 fi done # Local variables: # eval: (add-hook 'before-save-hook 'time-stamp) # time-stamp-start: "scriptversion=" # time-stamp-format: "%:y-%02m-%02d.%02H" # time-stamp-time-zone: "UTC0" # time-stamp-end: "; # UTC" # End: luit-20240910/minstall.sh0000755000000000000000000000723214013553766013630 0ustar rootroot#!/bin/sh # $XTermId: minstall.sh,v 1.7 2021/02/18 21:11:18 tom Exp $ # ----------------------------------------------------------------------------- # this file is part of xterm # # Copyright 2006-2010,2021 by Thomas E. Dickey # # All Rights Reserved # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modify, merge, publish, # distribute, sublicense, and/or sell copies of the Software, and to # permit persons to whom the Software is furnished to do so, subject to # the following conditions: # # The above copyright notice and this permission notice shall be included # in all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS # OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF # MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. # IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE LIABLE FOR ANY # CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, # TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE # SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name(s) of the above copyright # holders shall not be used in advertising or otherwise to promote the # sale, use or other dealings in this Software without prior written # authorization. # ----------------------------------------------------------------------------- # Install manpages, substituting a reasonable section value since XFree86 4.x # and derived imakes do not use constants... # # Parameters: # $1 = program to invoke as "install" # $2 = manpage to install # $3 = final installed-path # $4 = top-level application directory # $5 = path of locale.alias # # override locale... LANG=C; export LANG LANGUAGE=C; export LANGUAGE LC_ALL=C; export LC_ALL LC_CTYPE=C; export LC_CTYPE XTERM_LOCALE=C export XTERM_LOCALE # these could interfere with the "man" command. unset MANPAGER unset PAGER # get parameters MINSTALL="$1" OLD_FILE="$2" END_FILE="$3" ROOT_DIR="$4" ALIAS_IS="$5" suffix=`echo "$END_FILE" | sed -e 's%^.*\.%%'` NEW_FILE=temp$$ MY_MANSECT=$suffix # provide for renaming via --program-prefix, etc. lower=abcdefghikjlmnopqrstuvwxyz upper=ABCDEFGHIKJLMNOPQRSTUVWXYZ OLD_LOWER=`basename "$OLD_FILE" | sed -e 's/\..*$//'` NEW_LOWER=`basename "$END_FILE" | sed -e 's/\..*$//'` OLD_UPPER=`echo "$OLD_LOWER" | tr $lower $upper` NEW_UPPER=`echo "$NEW_LOWER" | tr $lower $upper` OLD_CHAR0=`echo "$OLD_LOWER" | sed -e 's/^\(.\).*/\1/' | tr $lower $upper` NEW_CHAR0=`echo "$NEW_LOWER" | sed -e 's/^\(.\).*/\1/' | tr $lower $upper` OLD_CHARS=`echo "$OLD_LOWER" | sed -e 's/^.//'` NEW_CHARS=`echo "$NEW_LOWER" | sed -e 's/^.//'` OLD_FIRST=${OLD_CHAR0}${OLD_CHARS} NEW_FIRST=${NEW_CHAR0}${NEW_CHARS} # "X" is usually in the miscellaneous section, along with "undocumented". # Use that to guess an appropriate section. X_MANPAGE=X X_MANSECT=`man $X_MANPAGE 2>&1 | grep $X_MANPAGE'([^)]*)' | head -n 1 | tr '\012' '\040' | sed -e 's/^[^0123456789]*\([^) ][^) ]*\).*/\1/'` test -z "$X_MANSECT" && X_MANSECT=$suffix sed -e 's%__vendorversion__%"X Window System"%' \ -e "s%__projectroot__%$ROOT_DIR%" \ -e "s%__mansuffix__%$MY_MANSECT%g" \ -e "s%__miscmansuffix__%$X_MANSECT%g" \ -e "s%__locale_alias__%$ALIAS_IS%g" \ -e "s%$OLD_LOWER%$NEW_LOWER%g" \ -e "s%$OLD_UPPER%$NEW_UPPER%g" \ -e "s%$OLD_FIRST%$NEW_FIRST%g" \ "$OLD_FILE" >$NEW_FILE echo "$MINSTALL $OLD_FILE $END_FILE" eval "$MINSTALL $NEW_FILE $END_FILE" rm -f $NEW_FILE luit-20240910/COPYING.asc0000644000000000000000000000133114544750022013231 0ustar rootroot-----BEGIN PGP SIGNATURE----- Comment: See https://invisible-island.net/public/public.html for info iQGzBAABCgAdFiEEGYgtkt2kxADCLA1WzCr0RyFnvgMFAmWT0BIACgkQzCr0RyFn vgNkMAwAkWfw3uLlVhtHsVbZZwA2MIdijTV6GS1FheUA1vdBP1wEKlcytv6P1cjD MykYULFZ3f/q2g7t1GvriLaRze7wkk+sUKkdFj+WAq6sUpu7Oj2n1kAWY50Ox507 ChxbDQFFbN48SjgDU9oP4Kc24+dDkz1odg99oQJvElTjE2aFCZsyYjMCAFM+btr/ tiHzzZ2YUIsKHb872fejaUqqeTE6TVQryW3cmhjG6ExHYpYsXuDFY8XdwSOifNAr iVS3loWflgecZn7GvGfwB6zFjp97zx6R00VzaSonl0rXl+hL4vI5mXyrnIZZubjN 3kNCVrg9Mw5JQBcIum+z8hdXOZFTX3LaPYVBtHlp76OhINKARmARAB/QwGyCC6wh vZTO1JL2Biyo1jze9FO927Wh3qVs+zPYNHKKQdOeULknJVzVderC9rs1Ll3Eax+U bDyTaKguq4JWpJjajm+QLh0cVcROWiAzrGouiuYmZnvghMpb3bxTx3c2tqOhT5cU KUZwEKzi =qoz9 -----END PGP SIGNATURE----- luit-20240910/COPYING0000644000000000000000000000217514544750001012470 0ustar rootrootCopyright 2006-2023,2024 by Thomas E. Dickey Copyright (c) 2002 by Tomohiro KUBOTA Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. luit-20240910/luit.man0000644000000000000000000003322714545100072013107 0ustar rootroot.\" $XTermId: luit.man,v 1.41 2024/01/02 21:29:30 tom Exp $ .\" --------------------------------------------------------------------------- .\" Copyright 2006-2021,2024 by Thomas E. Dickey .\" Copyright (c) 2001 by Juliusz Chroboczek .\" .\" Permission is hereby granted, free of charge, to any person obtaining a .\" copy of this software and associated documentation files (the "Software"), .\" to deal in the Software without restriction, including without limitation .\" the rights to use, copy, modify, merge, publish, distribute, sublicense, .\" and/or sell copies of the Software, and to permit persons to whom the .\" Software is furnished to do so, subject to the following conditions: .\" .\" The above copyright notice and this permission notice shall be included in .\" all copies or substantial portions of the Software. .\" .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR .\" IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, .\" FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL .\" THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER .\" LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING .\" FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER .\" DEALINGS IN THE SOFTWARE. .\" --------------------------------------------------------------------------- .\" Escape single quotes in literal strings from groff's Unicode transform. .TH LUIT 1 __vendorversion__ .ie \n(.g \{\ .ds `` \(lq .ds '' \(rq .ds ' \(aq .\} .el \{\ .ie t .ds `` `` .el .ds `` "" .ie t .ds '' '' .el .ds '' "" .ie t .ds ' \(aq .el .ds ' ' .\} .de bP .ie n .IP \(bu 4 .el .IP \(bu 2 .. .SH NAME luit \- Locale and ISO\ 2022 support for Unicode terminals .SH SYNOPSIS .B luit [ .I options ] [ .B \-\- ] [ .I program [ .I args ] ] .\" *************************************************************************** .SH DESCRIPTION .B Luit is a filter that can be run between an arbitrary application and a UTF-8 terminal emulator. It will convert application output from the locale's encoding into UTF-8, and convert terminal input from UTF-8 into the locale's encoding. .PP \fBLuit\fP reads its input from the child process, i.e., an application running in the terminal. \fBLuit\fP writes its output to the terminal. The two (input and output) can have different encodings. .PP An application may also request switching to a different output encoding using ISO\ 2022 and ISO\ 6429 escape sequences. Use of this feature is discouraged: multilingual applications should be modified to directly generate UTF-8 instead. .PP .B Luit is usually invoked transparently by the terminal emulator. For information about running .B luit from the command line, see EXAMPLES below. .\" *************************************************************************** .SH OPTIONS .TP .B \-V Print \fBluit\fP's version and quit. .TP .BI \-alias " filename" the locale alias file .br (default: __locale_alias__). .TP .BI \-argv0 " name" Set the child's name (as passed in argv[0]). .TP .B \-c Function as a simple converter from standard input to standard output. .TP .BI \-encoding " encoding" Set up .B luit to use .I encoding rather than the current locale's encoding. .TP .BI \-g0 " charset" Set the output charset initially selected in G0. The default depends on the locale, but is usually .BR ASCII . .TP .BI \-g1 " charset" Set the output charset initially selected in G1. The default depends on the locale. .TP .BI \-g2 " charset" Set the output charset initially selected in G2. The default depends on the locale. .TP .BI \-g3 " charset" Set the output charset initially selected in G3. The default depends on the locale. .TP .BI \-gl " gn" Set the initial assignment of GL in the output. The argument should be one of .BR g0 , .BR g1 , .B g2 or .BR g3 . The default depends on the locale, but is usually .BR g0 . .TP .BI \-gr " gk" Set the initial assignment of GR in the output. The default depends on the locale, and is usually .B g2 except for EUC locales, where it is .BR g1 . .TP .B \-h Display a usage and options message on the standard output and quit. .TP .BI \-ilog " filename" Log into .I filename all the bytes received from the child. .TP .B \-k7 Generate seven-bit characters for keyboard input. .TP .BI \-kg0 " charset" Set the input charset initially selected in G0. The default depends on the locale, but is usually .BR ASCII . .TP .BI \-kg1 " charset" Set the input charset initially selected in G1. The default depends on the locale. .TP .BI \-kg2 " charset" Set the input charset initially selected in G2. The default depends on the locale. .TP .BI \-kg3 " charset" Set the input charset initially selected in G3. The default depends on the locale. .TP .BI \-kgl " gn" Set the initial assignment of GL in the input. The argument should be one of .BR g0 , .BR g1 , .B g2 or .BR g3 . The default depends on the locale, but is usually .BR g0 . .TP .BI \-kgr " gk" Set the initial assignment of GR in the input. The default depends on the locale, and is usually .B g2 except for EUC locales, where it is .BR g1 . .TP .B \-kls Generate locking shifts (SO/SI) for keyboard input. .TP .B +kss Disable generation of single-shifts for keyboard input. .TP .B +kssgr Use GL codes after a single shift for keyboard input. By default, GR codes are generated after a single shift when generating eight-bit keyboard input. .TP .B \-list List the supported charsets and encodings, then quit. \fBLuit\fP uses its internal tables for this, which are based on the \fIfontenc\fP library. .TP .B \-list\-builtin List the built-in encodings used as a fallback when data from \fIiconv\fP or \fIfontenc\fP is missing. .IP This option relies on \fBluit\fP being configured to use \fIiconv\fP, since the \fIfontenc\fP library does not supply a list of built-in encodings. .TP .B \-list\-fontenc List the encodings provided by \*(``.enc\*('' files originally distributed with the \fIfontenc\fP library. .TP .B \-list\-iconv List the encodings and locales supported by the \fIiconv\fP library. \fBLuit\fP adapts its internal tables of \fIfontenc\fP names to \fIiconv\fP encodings. .IP To make scripting simpler, .B luit ignores spaces, underscores and ASCII minus-signs (dash) embedded in the names. .B Luit also ignores case when matching charset and encoding names. .IP This option lists only the encodings which are associated with the locales supported on the current operating system. The portable \fIiconv\fP application provides a list of its supported encodings with the \fB\-l\fP option. Other implementations may provide similar functionality. There is no portable library call by which an application can obtain the same information. .TP .BI \-olog " filename" Log into .I filename all the bytes sent to the terminal emulator. .TP .B +ols Disable interpretation of locking shifts in application output. .TP .B +osl Disable interpretation of character set selection sequences in application output. .TP .B +oss Disable interpretation of single shifts in application output. .TP .B +ot Disable interpretation of all sequences and pass all sequences in application output to the terminal unchanged. This may lead to interesting results. .TP .B \-p In startup, establish a handshake between parent and child processes. This is needed for some older systems, e.g., to successfully copy the terminal settings to the pseudo-terminal. .TP .BI \-prefer " list" Set the lookup-order preference for character set information. The parameter is a comma-separated list of keywords. The default order (listing all keywords) is .RS .IP fontenc,builtin,iconv,posix .RE .IP The default order uses \fBfontenc\fP first because this allows \fBluit\fP to start more rapidly (about 0.1 seconds) than using \fBiconv\fP for complex encodings such as eucJP. However, you may find that the iconv implementation is more accurate or complete. In that case, you can use the \fB\-show-iconv\fP option to obtain a text file which can be used as an encoding with the \fBfontenc\fP configuration. .IP This option relies on \fBluit\fP being configured to use \fIiconv\fP, since the \fIfontenc\fP library does not provide this choice. .TP .BI \-show\-builtin " encoding" Show a built-in encoding, e.g., from a \*(``.enc\*('' file using the \*(``.enc\*('' format. .IP This option relies on \fBluit\fP being configured to use \fIiconv\fP, since the \fIfontenc\fP library does not supply a list of built-in encodings. .TP .BI \-show\-fontenc " encoding" Show a given encoding, e.g., from a \*(``.enc\*('' file using the \*(``.enc\*('' format. If \fBluit\fP is configured to use the \fIfontenc\fP library, it obtains the information using that library. Otherwise \fBluit\fP reads the file directly. .IP Some of \fIfontenc\fP's encodings are built into the library. The \fIfontenc\fP library uses those in preference to an external file. Use the \fB\-show\-builtin\fP option to provide similar information when \fBluit\fP is configured to use \fIiconv\fP. .TP .BI \-show\-iconv " encoding" Show a given encoding, using the \*(``.enc\*('' format. If \fBluit\fP is configured to use \fIiconv\fP, it obtains the information using that interface. If \fIiconv\fP cannot supply the information, \fBluit\fP may use a built-in table. .TP .B \-t Initialize \fBluit\fP using the locale and command-line options, but do not open a pty connection. This option is used for testing \fBluit\fP's configuration. It will exit with success if no errors were detected. Repeat the \fB\-t\fP option to cause warning messages to be treated as errors. .TP .B \-v Be verbose. Repeating the option, e.g., \*(``\fB\-v\ \-v\fP\*('' makes it more verbose. .B Luit does not use \fIgetopt\fP, so \*(``\fB\-vv\fP\*('' does not work. .TP .B \-x Exit as soon as the child dies. This may cause .B luit to lose data at the end of the child's output. .TP .B \-\- End of options. .\" *************************************************************************** .SH ENVIRONMENT \fBLuit\fP uses these environment variables: .TP FONT_ENCODINGS_DIRECTORY overrides the location of the \*(``encodings.dir\*('' file, which lists encodings in external \*(``.enc\*('' files. .TP LC_ALL .TP LC_CTYPE .TP LANG During initialization, \fBluit\fP calls \fBsetlocale\fP to check if the user's locale is supported by the operating system. If \fBsetlocale\fP returns a failure, \fBluit\fP looks instead at these variables in succession to obtain any clues from the user's environment for locale preference. .TP NCURSES_NO_UTF8_ACS \fBLuit\fP sets this to tell ncurses to not rely upon VT100 SI/SO controls for line-drawing. .TP SHELL This is normally set by shells other than the Bourne shell, as a convention. \fBLuit\fP will use this value (rather than the user's entry in /etc/passwd) to decide which shell to execute. If SHELL is not set, \fBluit\fP executes /bin/sh. .\" *************************************************************************** .SH FILES .TP .B __locale_alias__ The file mapping locales to locale encodings. .\" *************************************************************************** .SH BUGS .SS Limitations None of this complexity should be necessary. Stateless UTF-8 throughout the system is the way to go. .PP Charsets with a non-trivial intermediary byte are not yet supported. .PP Selecting alternate sets of control characters is not supported and will never be. .SS Security On systems with SVR4 (\*(``Unix-98\*('') ptys (Linux version 2.2 and later, SVR4), .B luit should be run as the invoking user. .PP On systems without SVR4 (\*(``Unix-98\*('') ptys (notably BSD variants), running .B luit as an ordinary user will leave the tty world-writable; this is a security hole, and \fBluit\fP will generate a warning (but still accept to run). A possible solution is to make .B luit suid root; .B luit should drop privileges sufficiently early to make this safe. However, the startup code has not been exhaustively audited, and the author takes no responsibility for any resulting security issues. .PP .B Luit will refuse to run if it is installed setuid and cannot safely drop privileges. .\" *************************************************************************** .SH EXAMPLES The most typical use of .B luit is to adapt an instance of .B XTerm to the locale's encoding. Current versions of .B XTerm invoke .B luit automatically when it is needed. If you are using an older release of .BR XTerm , or a different terminal emulator, you may invoke .B luit manually: .IP $ xterm \-u8 \-e luit .PP If you are running in a UTF-8 locale but need to access a remote machine that doesn't support UTF-8, .B luit can adapt the remote output to your terminal: .IP $ LC_ALL=fr_FR luit ssh legacy-machine .PP .B Luit is also useful with applications that hard-wire an encoding that is different from the one normally used on the system or want to use legacy escape sequences for multilingual output. In particular, versions of .B Emacs that do not speak UTF-8 well can use .B luit for multilingual output: .IP $ luit \-encoding 'ISO 8859\-1' emacs \-nw .PP And then, in .BR Emacs , .IP M\-x set\-terminal\-coding\-system RET iso\-2022\-8bit\-ss2 RET .\" *************************************************************************** .SH AUTHORS Luit was written by Juliusz Chroboczek for the XFree86 project. .PP Thomas E. Dickey has maintained \fBluit\fP for use by \fBxterm\fP since 2006. .\" *************************************************************************** .SH SEE ALSO These are portable: .bP xterm(__mansuffix__), .bP ncurses(3X). .PP These are Linux-specific: .bP unicode(__miscmansuffix__), .bP utf-8(__miscmansuffix__), .bP charsets(__miscmansuffix__). .PP These are particularly useful: .nf .bP \fICharacter Code Structure and Extension Techniques (ISO\ 2022, ECMA-35)\fP .bP \fIControl Functions for Coded Character Sets (ISO\ 6429, ECMA-48)\fP .bP http://czyborra.com/charsets/ .fi luit-20240910/luit.h0000644000000000000000000000414113314654033012560 0ustar rootroot/* $XTermId: luit.h,v 1.23 2018/06/27 09:25:47 tom Exp $ */ /* Copyright 2010-2013,2018 by Thomas E. Dickey Copyright (c) 2001 by Juliusz Chroboczek Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ #ifndef LUIT_LUIT_H #define LUIT_LUIT_H 1 #include #include #include #include #include #include #include #include #ifndef GCC_UNUSED #define GCC_UNUSED /* ARGSUSED */ #endif #ifndef GCC_NORETURN #define GCC_NORETURN /* nothing */ #endif #ifndef GCC_PRINTFLIKE #define GCC_PRINTFLIKE(a,b) /* nothing */ #endif extern const char *locale_alias; extern int fill_fontenc; extern int ignore_locale; extern int iso2022; extern int sevenbit; extern int ilog; extern int olog; extern int verbose; #define MAXCOLS 78 void Message(const char *f,...) GCC_PRINTFLIKE(1,2); void Warning(const char *f,...) GCC_PRINTFLIKE(1,2); void FatalError(const char *f,...) GCC_PRINTFLIKE(1,2) GCC_NORETURN; #define VERBOSE(level,params) if (verbose >= level) Message params #define IsEmpty(s) ((s) == 0 || (*(s)) == '\0') #define NonNull(s) ((s) ? (s) : "") #endif /* LUIT_LUIT_H */ luit-20240910/aclocal.m40000644000000000000000000032367114670152106013306 0ustar rootrootdnl $XTermId: aclocal.m4,v 1.107 2024/09/10 23:20:38 tom Exp $ dnl dnl --------------------------------------------------------------------------- dnl dnl Copyright 2006-2023,2024 by Thomas E. Dickey dnl dnl All Rights Reserved dnl dnl Permission to use, copy, modify, and distribute this software and its dnl documentation for any purpose and without fee is hereby granted, dnl provided that the above copyright notice appear in all copies and that dnl both that copyright notice and this permission notice appear in dnl supporting documentation, and that the name of the above listed dnl copyright holder(s) not be used in advertising or publicity pertaining dnl to distribution of the software without specific, written prior dnl permission. dnl dnl THE ABOVE LISTED COPYRIGHT HOLDER(S) DISCLAIM ALL WARRANTIES WITH REGARD dnl TO THIS SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY dnl AND FITNESS, IN NO EVENT SHALL THE ABOVE LISTED COPYRIGHT HOLDER(S) BE dnl LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES dnl WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN dnl ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF dnl OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. dnl dnl --------------------------------------------------------------------------- dnl See dnl https://invisible-island.net/autoconf/autoconf.html dnl https://invisible-island.net/autoconf/my-autoconf.html dnl --------------------------------------------------------------------------- dnl --------------------------------------------------------------------------- dnl AM_ICONV version: 12 updated: 2007/07/30 19:12:03 dnl -------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal dnl iconv.m4 dnl ==================== dnl serial AM2 dnl dnl From Bruno Haible. dnl dnl ==================== dnl Modified to use CF_FIND_LINKAGE and CF_ADD_SEARCHPATH, to broaden the dnl range of locations searched. Retain the same cache-variable naming to dnl allow reuse with the other gettext macros -Thomas E Dickey AC_DEFUN([AM_ICONV], [ dnl Some systems have iconv in libc, some have it in libiconv (OSF/1 and dnl those with the standalone portable GNU libiconv installed). AC_ARG_WITH([libiconv-prefix], [ --with-libiconv-prefix=DIR search for libiconv in DIR/include and DIR/lib], [ CF_ADD_OPTIONAL_PATH($withval, libiconv) ]) AC_CACHE_CHECK(for iconv, am_cv_func_iconv, [ CF_FIND_LINKAGE(CF__ICONV_HEAD, CF__ICONV_BODY, iconv, am_cv_func_iconv=yes, am_cv_func_iconv=["no, consider installing GNU libiconv"])]) if test "$am_cv_func_iconv" = yes; then AC_DEFINE(HAVE_ICONV, 1, [Define if you have the iconv() function.]) AC_CACHE_CHECK([if the declaration of iconv() needs const.], am_cv_proto_iconv_const,[ AC_TRY_COMPILE(CF__ICONV_HEAD [ extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif ],[], am_cv_proto_iconv_const=no, am_cv_proto_iconv_const=yes)]) if test "$am_cv_proto_iconv_const" = yes ; then am_cv_proto_iconv_arg1="const" else am_cv_proto_iconv_arg1="" fi AC_DEFINE_UNQUOTED(ICONV_CONST, $am_cv_proto_iconv_arg1, [Define as const if the declaration of iconv() needs const.]) fi LIBICONV= if test "$cf_cv_find_linkage_iconv" = yes; then CF_ADD_INCDIR($cf_cv_header_path_iconv) if test -n "$cf_cv_library_file_iconv" ; then LIBICONV="-liconv" CF_ADD_LIBDIR($cf_cv_library_path_iconv) fi fi AC_SUBST(LIBICONV) ])dnl dnl --------------------------------------------------------------------------- dnl AM_LANGINFO_CODESET version: 7 updated: 2023/01/11 04:05:23 dnl ------------------- dnl Inserted as requested by gettext 0.10.40 dnl File from /usr/share/aclocal dnl codeset.m4 dnl ==================== dnl serial AM1 dnl dnl From Bruno Haible. AC_DEFUN([AM_LANGINFO_CODESET], [ AC_CACHE_CHECK([for nl_langinfo and CODESET], am_cv_langinfo_codeset, [AC_TRY_LINK([ $ac_includes_default #include ], [char* cs = nl_langinfo(CODESET); (void)cs], am_cv_langinfo_codeset=yes, am_cv_langinfo_codeset=no) ]) if test "$am_cv_langinfo_codeset" = yes; then AC_DEFINE(HAVE_LANGINFO_CODESET, 1, [Define if you have and nl_langinfo(CODESET).]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_CHECK version: 5 updated: 2014/06/04 19:11:49 dnl ------------------ dnl Conditionally generate script according to whether we're using a given autoconf. dnl dnl $1 = version to compare against dnl $2 = code to use if AC_ACVERSION is at least as high as $1. dnl $3 = code to use if AC_ACVERSION is older than $1. define([CF_ACVERSION_CHECK], [ ifdef([AC_ACVERSION], ,[ifdef([AC_AUTOCONF_VERSION],[m4_copy([AC_AUTOCONF_VERSION],[AC_ACVERSION])],[m4_copy([m4_PACKAGE_VERSION],[AC_ACVERSION])])])dnl ifdef([m4_version_compare], [m4_if(m4_version_compare(m4_defn([AC_ACVERSION]), [$1]), -1, [$3], [$2])], [CF_ACVERSION_COMPARE( AC_PREREQ_CANON(AC_PREREQ_SPLIT([$1])), AC_PREREQ_CANON(AC_PREREQ_SPLIT(AC_ACVERSION)), AC_ACVERSION, [$2], [$3])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ACVERSION_COMPARE version: 3 updated: 2012/10/03 18:39:53 dnl -------------------- dnl CF_ACVERSION_COMPARE(MAJOR1, MINOR1, TERNARY1, dnl MAJOR2, MINOR2, TERNARY2, dnl PRINTABLE2, not FOUND, FOUND) define([CF_ACVERSION_COMPARE], [ifelse(builtin([eval], [$2 < $5]), 1, [ifelse([$8], , ,[$8])], [ifelse([$9], , ,[$9])])])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_CFLAGS version: 15 updated: 2020/12/31 10:54:15 dnl ------------- dnl Copy non-preprocessor flags to $CFLAGS, preprocessor flags to $CPPFLAGS dnl $1 = flags to add dnl $2 = if given makes this macro verbose. dnl dnl Put any preprocessor definitions that use quoted strings in $EXTRA_CPPFLAGS, dnl to simplify use of $CPPFLAGS in compiler checks, etc., that are easily dnl confused by the quotes (which require backslashes to keep them usable). AC_DEFUN([CF_ADD_CFLAGS], [ cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $1 do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[[^=]]*='\''\"[[^"]]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue elif test "${cf_tst_cflags}" = "\"'" ; then CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,$cf_tst_cppflags) ;; esac CF_APPEND_TEXT(cf_new_cppflags,$cf_add_cflags) ;; esac ;; (*) CF_APPEND_TEXT(cf_new_cflags,$cf_add_cflags) ;; esac ;; (yes) CF_APPEND_TEXT(cf_new_extra_cppflags,$cf_add_cflags) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[[^"]]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CFLAGS $cf_new_cflags)]) CF_APPEND_TEXT(CFLAGS,$cf_new_cflags) fi if test -n "$cf_new_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$CPPFLAGS $cf_new_cppflags)]) CF_APPEND_TEXT(CPPFLAGS,$cf_new_cppflags) fi if test -n "$cf_new_extra_cppflags" ; then ifelse([$2],,,[CF_VERBOSE(add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags)]) CF_APPEND_TEXT(EXTRA_CPPFLAGS,$cf_new_extra_cppflags) fi AC_SUBST(EXTRA_CPPFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_INCDIR version: 17 updated: 2021/09/04 06:35:04 dnl ------------- dnl Add an include-directory to $CPPFLAGS. Don't add /usr/include, since it is dnl redundant. We don't normally need to add -I/usr/local/include for gcc, dnl but old versions (and some misinstalled ones) need that. To make things dnl worse, gcc 3.x may give error messages if -I/usr/local/include is added to dnl the include-path). AC_DEFUN([CF_ADD_INCDIR], [ if test -n "$1" ; then for cf_add_incdir in $1 do while test "$cf_add_incdir" != /usr/include do if test -d "$cf_add_incdir" then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS CF_APPEND_TEXT(CPPFLAGS,-I$cf_add_incdir) AC_TRY_COMPILE([#include ], [printf("Hello")], [], [cf_have_incdir=yes]) CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then CF_VERBOSE(adding $cf_add_incdir to include-path) ifelse([$2],,CPPFLAGS,[$2])="$ifelse([$2],,CPPFLAGS,[$2]) -I$cf_add_incdir" cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIB version: 2 updated: 2010/06/02 05:03:05 dnl ---------- dnl Add a library, used to enforce consistency. dnl dnl $1 = library to add, without the "-l" dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIB],[CF_ADD_LIBS(-l$1,ifelse($2,,LIBS,[$2]))])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIBDIR version: 11 updated: 2020/12/31 20:19:42 dnl ------------- dnl Adds to the library-path dnl dnl Some machines have trouble with multiple -L options. dnl dnl $1 is the (list of) directory(s) to add dnl $2 is the optional name of the variable to update (default LDFLAGS) dnl AC_DEFUN([CF_ADD_LIBDIR], [ if test -n "$1" ; then for cf_add_libdir in $1 do if test "$cf_add_libdir" = /usr/lib ; then : elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then CF_VERBOSE(adding $cf_add_libdir to library-path) ifelse([$2],,LDFLAGS,[$2])="-L$cf_add_libdir $ifelse([$2],,LDFLAGS,[$2])" fi fi done fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_LIBS version: 3 updated: 2019/11/02 16:47:33 dnl ----------- dnl Add one or more libraries, used to enforce consistency. Libraries are dnl prepended to an existing list, since their dependencies are assumed to dnl already exist in the list. dnl dnl $1 = libraries to add, with the "-l", etc. dnl $2 = variable to update (default $LIBS) AC_DEFUN([CF_ADD_LIBS],[ cf_add_libs="[$]ifelse($2,,LIBS,[$2])" # reverse order cf_add_0lib= for cf_add_1lib in $1; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done ifelse($2,,LIBS,[$2])="$cf_add_libs" ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_OPTIONAL_PATH version: 6 updated: 2024/09/10 19:19:44 dnl -------------------- dnl Add an optional search-path to the compile/link variables. dnl See CF_WITH_PATH dnl dnl $1 = shell variable containing the result of --with-XXX=[DIR] dnl $2 = module to look for. AC_DEFUN([CF_ADD_OPTIONAL_PATH],[ case "x$1" in (xno|xyes|x) ;; (*) CF_ADD_SEARCHPATH([$1], [AC_MSG_ERROR(cannot find $2 under $1)]) CF_VERBOSE(setting path value for ifelse([$2],,variable,[$2]) to $1) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_ADD_SEARCHPATH version: 6 updated: 2020/12/31 20:19:42 dnl ----------------- dnl Set $CPPFLAGS and $LDFLAGS with the directories given via the parameter. dnl They can be either the common root of include- and lib-directories, or the dnl lib-directory (to allow for things like lib64 directories). dnl See also CF_FIND_LINKAGE. dnl dnl $1 is the list of colon-separated directory names to search. dnl $2 is the action to take if a parameter does not yield a directory. AC_DEFUN([CF_ADD_SEARCHPATH], [ AC_REQUIRE([CF_PATHSEP]) for cf_searchpath in `echo "$1" | tr $PATH_SEPARATOR ' '`; do if test -d "$cf_searchpath/include" ; then CF_ADD_INCDIR($cf_searchpath/include) elif test -d "$cf_searchpath/../include" ; then CF_ADD_INCDIR($cf_searchpath/../include) ifelse([$2],,,[else $2]) fi if test -d "$cf_searchpath/lib" ; then CF_ADD_LIBDIR($cf_searchpath/lib) elif test -d "$cf_searchpath" ; then CF_ADD_LIBDIR($cf_searchpath) ifelse([$2],,,[else $2]) fi done ]) dnl --------------------------------------------------------------------------- dnl CF_ADD_SUBDIR_PATH version: 5 updated: 2020/12/31 20:19:42 dnl ------------------ dnl Append to a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib dnl $4 = the directory under which we will test for subdirectories dnl $5 = a directory that we do not want $4 to match AC_DEFUN([CF_ADD_SUBDIR_PATH], [ test "x$4" != "x$5" && \ test -d "$4" && \ ifelse([$5],NONE,,[{ test -z "$5" || test "x$5" = xNONE || test "x$4" != "x$5"; } &&]) { test -n "$verbose" && echo " ... testing for $3-directories under $4" test -d "$4/$3" && $1="[$]$1 $4/$3" test -d "$4/$3/$2" && $1="[$]$1 $4/$3/$2" test -d "$4/$3/$2/$3" && $1="[$]$1 $4/$3/$2/$3" test -d "$4/$2/$3" && $1="[$]$1 $4/$2/$3" test -d "$4/$2/$3/$2" && $1="[$]$1 $4/$2/$3/$2" } ])dnl dnl --------------------------------------------------------------------------- dnl CF_ANSI_CC_CHECK version: 15 updated: 2024/05/01 15:00:19 dnl ---------------- dnl This was originally adapted from the macros 'fp_PROG_CC_STDC' and dnl 'fp_C_PROTOTYPES' in the sharutils 4.2 distribution. AC_DEFUN([CF_ANSI_CC_CHECK], [ CF_CC_ENV_FLAGS AC_CACHE_CHECK(for ${CC:-cc} option to accept ANSI C, cf_cv_ansi_cc,[ cf_cv_ansi_cc=no cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX -Aa -D_HPUX_SOURCE # SVR4 -Xc # UnixWare 1.2 (cannot use -Xc, since ANSI/POSIX clashes) for cf_arg in "-DCC_HAS_PROTOS" \ "" \ -qlanglvl=ansi \ -std1 \ -Ae \ "-Aa -D_HPUX_SOURCE" \ -Xc do CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" CF_ADD_CFLAGS($cf_arg) AC_TRY_COMPILE( [ #ifndef CC_HAS_PROTOS #if !defined(__STDC__) || (__STDC__ != 1) choke me #endif #endif extern int test (int i, double x); ],[ struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);};], [cf_cv_ansi_cc="$cf_arg"; break]) done CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then CF_ADD_CFLAGS($cf_cv_ansi_cc) else AC_DEFINE(CC_HAS_PROTOS,1,[Define to 1 if C compiler supports prototypes]) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ANSI_CC_REQD version: 4 updated: 2008/03/23 14:48:54 dnl --------------- dnl For programs that must use an ANSI compiler, obtain compiler options that dnl will make it recognize prototypes. We'll do preprocessor checks in other dnl macros, since tools such as unproto can fake prototypes, but only part of dnl the preprocessor. AC_DEFUN([CF_ANSI_CC_REQD], [AC_REQUIRE([CF_ANSI_CC_CHECK]) if test "$cf_cv_ansi_cc" = "no"; then AC_MSG_ERROR( [Your compiler does not appear to recognize prototypes. You have the following choices: a. adjust your compiler options b. get an up-to-date compiler c. use a wrapper such as unproto]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_APPEND_CFLAGS version: 3 updated: 2021/09/05 17:25:40 dnl ---------------- dnl Use CF_ADD_CFLAGS after first checking for potential redefinitions. dnl $1 = flags to add dnl $2 = if given makes this macro verbose. define([CF_APPEND_CFLAGS], [ for cf_add_cflags in $1 do case "x$cf_add_cflags" in (x-[[DU]]*) CF_REMOVE_CFLAGS($cf_add_cflags,CFLAGS,[$2]) CF_REMOVE_CFLAGS($cf_add_cflags,CPPFLAGS,[$2]) ;; esac CF_ADD_CFLAGS([$cf_add_cflags],[$2]) done ])dnl dnl --------------------------------------------------------------------------- dnl CF_APPEND_TEXT version: 1 updated: 2017/02/25 18:58:55 dnl -------------- dnl use this macro for appending text without introducing an extra blank at dnl the beginning define([CF_APPEND_TEXT], [ test -n "[$]$1" && $1="[$]$1 " $1="[$]{$1}$2" ])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_DISABLE version: 3 updated: 1999/03/30 17:24:31 dnl -------------- dnl Allow user to disable a normally-on option. AC_DEFUN([CF_ARG_DISABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],yes)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_ENABLE version: 3 updated: 1999/03/30 17:24:31 dnl ------------- dnl Allow user to enable a normally-off option. AC_DEFUN([CF_ARG_ENABLE], [CF_ARG_OPTION($1,[$2],[$3],[$4],no)])dnl dnl --------------------------------------------------------------------------- dnl CF_ARG_OPTION version: 5 updated: 2015/05/10 19:52:14 dnl ------------- dnl Restricted form of AC_ARG_ENABLE that ensures user doesn't give bogus dnl values. dnl dnl Parameters: dnl $1 = option name dnl $2 = help-string dnl $3 = action to perform if option is not default dnl $4 = action if perform if option is default dnl $5 = default option value (either 'yes' or 'no') AC_DEFUN([CF_ARG_OPTION], [AC_ARG_ENABLE([$1],[$2],[test "$enableval" != ifelse([$5],no,yes,no) && enableval=ifelse([$5],no,no,yes) if test "$enableval" != "$5" ; then ifelse([$3],,[ :]dnl ,[ $3]) ifelse([$4],,,[ else $4]) fi],[enableval=$5 ifelse([$4],,,[ $4 ])dnl ])])dnl dnl --------------------------------------------------------------------------- dnl CF_C11_NORETURN version: 4 updated: 2023/02/18 17:41:25 dnl --------------- AC_DEFUN([CF_C11_NORETURN], [ AC_MSG_CHECKING(if you want to use C11 _Noreturn feature) CF_ARG_ENABLE(stdnoreturn, [ --enable-stdnoreturn enable C11 _Noreturn feature for diagnostics], [enable_stdnoreturn=yes], [enable_stdnoreturn=no]) AC_MSG_RESULT($enable_stdnoreturn) if test $enable_stdnoreturn = yes; then AC_CACHE_CHECK([for C11 _Noreturn feature], cf_cv_c11_noreturn, [AC_TRY_COMPILE([ $ac_includes_default #include static _Noreturn void giveup(void) { exit(0); } ], [if (feof(stdin)) giveup()], cf_cv_c11_noreturn=yes, cf_cv_c11_noreturn=no) ]) else cf_cv_c11_noreturn=no, fi if test "$cf_cv_c11_noreturn" = yes; then AC_DEFINE(HAVE_STDNORETURN_H, 1,[Define if header is available and working]) AC_DEFINE_UNQUOTED(STDC_NORETURN,_Noreturn,[Define if C11 _Noreturn keyword is supported]) HAVE_STDNORETURN_H=1 else HAVE_STDNORETURN_H=0 fi AC_SUBST(HAVE_STDNORETURN_H) AC_SUBST(STDC_NORETURN) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CC_ENV_FLAGS version: 11 updated: 2023/02/20 11:15:46 dnl --------------- dnl Check for user's environment-breakage by stuffing CFLAGS/CPPFLAGS content dnl into CC. This will not help with broken scripts that wrap the compiler dnl with options, but eliminates a more common category of user confusion. dnl dnl In particular, it addresses the problem of being able to run the C dnl preprocessor in a consistent manner. dnl dnl Caveat: this also disallows blanks in the pathname for the compiler, but dnl the nuisance of having inconsistent settings for compiler and preprocessor dnl outweighs that limitation. AC_DEFUN([CF_CC_ENV_FLAGS], [ # This should have been defined by AC_PROG_CC : "${CC:=cc}" AC_MSG_CHECKING(\$CFLAGS variable) case "x$CFLAGS" in (*-[[IUD]]*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment uses the CFLAGS variable to hold CPPFLAGS options) cf_flags="$CFLAGS" CFLAGS= for cf_arg in $cf_flags do CF_ADD_CFLAGS($cf_arg) done ;; (*) AC_MSG_RESULT(ok) ;; esac AC_MSG_CHECKING(\$CC variable) case "$CC" in (*[[\ \ ]]-*) AC_MSG_RESULT(broken) AC_MSG_WARN(your environment uses the CC variable to hold CFLAGS/CPPFLAGS options) # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[[ ]]* / /g' -e 's/[[ ]]*[[ ]]-[[^ ]].*//'` cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"` CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[[IUDfgOW]]*) CF_ADD_CFLAGS($cf_arg) ;; (*) CC="$CC $cf_arg" ;; esac done CF_VERBOSE(resulting CC: '$CC') CF_VERBOSE(resulting CFLAGS: '$CFLAGS') CF_VERBOSE(resulting CPPFLAGS: '$CPPFLAGS') ;; (*) AC_MSG_RESULT(ok) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_CACHE version: 13 updated: 2020/12/31 10:54:15 dnl -------------- dnl Check if we're accidentally using a cache from a different machine. dnl Derive the system name, as a check for reusing the autoconf cache. dnl dnl If we've packaged config.guess and config.sub, run that (since it does a dnl better job than uname). Normally we'll use AC_CANONICAL_HOST, but allow dnl an extra parameter that we may override, e.g., for AC_CANONICAL_SYSTEM dnl which is useful in cross-compiles. dnl dnl Note: we would use $ac_config_sub, but that is one of the places where dnl autoconf 2.5x broke compatibility with autoconf 2.13 AC_DEFUN([CF_CHECK_CACHE], [ if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then ifelse([$1],,[AC_CANONICAL_HOST],[$1]) system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && AC_DEFINE_UNQUOTED(SYSTEM_NAME,"$system_name",[Define to the system name.]) AC_CACHE_VAL(cf_cv_system_name,[cf_cv_system_name="$system_name"]) test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && AC_MSG_RESULT(Configuring for $cf_cv_system_name) if test ".$system_name" != ".$cf_cv_system_name" ; then AC_MSG_RESULT(Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)) AC_MSG_ERROR("Please remove config.cache and try again.") fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_ERRNO version: 14 updated: 2023/02/18 17:41:25 dnl -------------- dnl Check for data that is usually declared in or , e.g., dnl the 'errno' variable. Define a DECL_xxx symbol if we must declare it dnl ourselves. dnl dnl $1 = the name to check dnl $2 = the assumed type AC_DEFUN([CF_CHECK_ERRNO], [ AC_CACHE_CHECK(if external $1 is declared, cf_cv_dcl_$1,[ AC_TRY_COMPILE([ $ac_includes_default #include ], ifelse([$2],,int,[$2]) x = (ifelse([$2],,int,[$2])) $1; (void)x, [cf_cv_dcl_$1=yes], [cf_cv_dcl_$1=no]) ]) if test "$cf_cv_dcl_$1" = no ; then CF_UPPER(cf_result,decl_$1) AC_DEFINE_UNQUOTED($cf_result) fi # It's possible (for near-UNIX clones) that the data doesn't exist CF_CHECK_EXTERN_DATA($1,ifelse([$2],,int,[$2])) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_EXTERN_DATA version: 5 updated: 2021/09/04 06:35:04 dnl -------------------- dnl Check for existence of external data in the current set of libraries. If dnl we can modify it, it is real enough. dnl $1 = the name to check dnl $2 = its type AC_DEFUN([CF_CHECK_EXTERN_DATA], [ AC_CACHE_CHECK(if external $1 exists, cf_cv_have_$1,[ AC_TRY_LINK([ #undef $1 extern $2 $1; ], [$1 = 2], [cf_cv_have_$1=yes], [cf_cv_have_$1=no]) ]) if test "$cf_cv_have_$1" = yes ; then CF_UPPER(cf_result,have_$1) AC_DEFINE_UNQUOTED($cf_result) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CHECK_TYPE version: 4 updated: 2021/01/02 09:31:20 dnl ------------- dnl Add a 3rd parameter to AC_CHECK_TYPE, working around autoconf 2.5x's dnl deliberate incompatibility. dnl $1 = name of type to check for dnl $2 = default type dnl $3 = additional #include's and related preprocessor lines. ifdef([m4_HAS_AC_CT_FOURARGS], [m4_undefine([m4_HAS_AC_CT_FOURARGS])])dnl ifelse(m4_PACKAGE_VERSION, [fnord_acsalt], [], [ifdef([m4_version_compare],[m4_define([m4_HAS_AC_CT_FOURARGS])])])dnl AC_DEFUN([CF_CHECK_TYPE], [ ifdef([m4_HAS_AC_CT_FOURARGS],[ AC_CHECK_TYPE([$1],ac_cv_type_$1=yes,ac_cv_type_$1=no,[$3]) ],[ AC_MSG_CHECKING(for $1) AC_TRY_COMPILE([ #if STDC_HEADERS #include #include #endif $3 ],[ static $1 dummy; if (sizeof(dummy)) return 0; else return 1;], ac_cv_type_$1=yes, ac_cv_type_$1=no) AC_MSG_RESULT($ac_cv_type_$1) ])dnl if test "$ac_cv_type_$1" = no; then AC_DEFINE($1, $2, Define to $2 if $1 is not declared) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CLANG_COMPILER version: 9 updated: 2023/02/18 17:41:25 dnl ----------------- dnl Check if the given compiler is really clang. clang's C driver defines dnl __GNUC__ (fooling the configure script into setting $GCC to yes) but does dnl not ignore some gcc options. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = CLANG_COMPILER (default) dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_CLANG_COMPILER],[ ifelse([$2],,CLANG_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then AC_MSG_CHECKING(if this is really Clang ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" AC_TRY_COMPILE([],[ #ifdef __clang__ #else #error __clang__ is not defined #endif ],[ifelse([$2],,CLANG_COMPILER,[$2])=yes ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,CLANG_COMPILER,[$2])) fi CLANG_VERSION=none if test "x$ifelse([$2],,CLANG_COMPILER,[$2])" = "xyes" ; then case "$CC" in (c[[1-9]][[0-9]]|*/c[[1-9]][[0-9]]) AC_MSG_WARN(replacing broken compiler alias $CC) CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`" CC=clang ;; esac AC_MSG_CHECKING(version of $CC) CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$CLANG_VERSION" && CLANG_VERSION=unknown AC_MSG_RESULT($CLANG_VERSION) for cf_clang_opt in \ -Qunused-arguments \ -Wno-error=implicit-function-declaration do AC_MSG_CHECKING(if option $cf_clang_opt works) cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $cf_clang_opt" AC_TRY_LINK([ #include ],[ printf("hello!\\n");],[ cf_clang_optok=yes],[ cf_clang_optok=no]) AC_MSG_RESULT($cf_clang_optok) CFLAGS="$cf_save_CFLAGS" if test "$cf_clang_optok" = yes; then CF_VERBOSE(adding option $cf_clang_opt) CF_APPEND_TEXT(CFLAGS,$cf_clang_opt) fi done fi ]) dnl --------------------------------------------------------------------------- dnl CF_DISABLE_ECHO version: 14 updated: 2021/09/04 06:35:04 dnl --------------- dnl You can always use "make -n" to see the actual options, but it is hard to dnl pick out/analyze warning messages when the compile-line is long. dnl dnl Sets: dnl ECHO_LT - symbol to control if libtool is verbose dnl ECHO_LD - symbol to prefix "cc -o" lines dnl RULE_CC - symbol to put before implicit "cc -c" lines (e.g., .c.o) dnl SHOW_CC - symbol to put before explicit "cc -c" lines dnl ECHO_CC - symbol to put before any "cc" line dnl AC_DEFUN([CF_DISABLE_ECHO],[ AC_MSG_CHECKING(if you want to see long compiling messages) CF_ARG_DISABLE(echo, [ --disable-echo do not display "compiling" commands], [ ECHO_LT='--silent' ECHO_LD='@echo linking [$]@;' RULE_CC='@echo compiling [$]<' SHOW_CC='@echo compiling [$]@' ECHO_CC='@' ],[ ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' ]) AC_MSG_RESULT($enableval) AC_SUBST(ECHO_LT) AC_SUBST(ECHO_LD) AC_SUBST(RULE_CC) AC_SUBST(SHOW_CC) AC_SUBST(ECHO_CC) ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_LEAKS version: 9 updated: 2021/04/03 16:41:50 dnl ---------------- dnl Combine no-leak checks with the libraries or tools that are used for the dnl checks. AC_DEFUN([CF_DISABLE_LEAKS],[ AC_REQUIRE([CF_WITH_DMALLOC]) AC_REQUIRE([CF_WITH_DBMALLOC]) AC_REQUIRE([CF_WITH_VALGRIND]) AC_MSG_CHECKING(if you want to perform memory-leak testing) AC_ARG_ENABLE(leaks, [ --disable-leaks test: free permanent memory, analyze leaks], [enable_leaks=$enableval], [enable_leaks=yes]) dnl with_no_leaks is more readable... if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi AC_MSG_RESULT($with_no_leaks) if test "$enable_leaks" = no ; then AC_DEFINE(NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) AC_DEFINE(YY_NO_LEAKS,1,[Define to 1 if you want to perform memory-leak testing.]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_DISABLE_RPATH_HACK version: 3 updated: 2021/01/05 20:14:44 dnl --------------------- dnl The rpath-hack makes it simpler to build programs, particularly with the dnl *BSD ports which may have essential libraries in unusual places. But it dnl can interfere with building an executable for the base system. Use this dnl option in that case. AC_DEFUN([CF_DISABLE_RPATH_HACK], [ AC_MSG_CHECKING(if rpath-hack should be disabled) CF_ARG_DISABLE(rpath-hack, [ --disable-rpath-hack don't add rpath options for additional libraries], [enable_rpath_hack=no], [enable_rpath_hack=yes]) dnl TODO - drop cf_disable_rpath_hack if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi AC_MSG_RESULT($cf_disable_rpath_hack) if test "$enable_rpath_hack" = yes ; then CF_RPATH_HACK fi ]) dnl --------------------------------------------------------------------------- dnl CF_ENABLE_TRACE version: 3 updated: 2012/10/04 05:24:07 dnl --------------- AC_DEFUN([CF_ENABLE_TRACE],[ AC_MSG_CHECKING(if you want to enable debugging trace) CF_ARG_ENABLE(trace, [ --enable-trace test: turn on debug-tracing], [with_trace=yes], [with_trace=no]) AC_MSG_RESULT($with_trace) if test "$with_trace" = "yes" then AC_DEFINE(OPT_TRACE,1,[Define to 1 if you want to enable debugging trace]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_ENABLE_WARNINGS version: 9 updated: 2021/01/05 19:40:50 dnl ------------------ dnl Configure-option to enable gcc warnings dnl dnl $1 = extra options to add, if supported dnl $2 = option for checking attributes. By default, this is done when dnl warnings are enabled. For other values: dnl yes: always do this, e.g., to use in generated library-headers dnl no: never do this AC_DEFUN([CF_ENABLE_WARNINGS],[ if test "$GCC" = yes || test "$GXX" = yes then CF_FIX_WARNINGS(CFLAGS) CF_FIX_WARNINGS(CPPFLAGS) CF_FIX_WARNINGS(LDFLAGS) AC_MSG_CHECKING(if you want to turn on gcc warnings) CF_ARG_ENABLE(warnings, [ --enable-warnings test: turn on gcc compiler warnings], [enable_warnings=yes], [enable_warnings=no]) AC_MSG_RESULT($enable_warnings) if test "$enable_warnings" = "yes" then ifelse($2,,[CF_GCC_ATTRIBUTES]) CF_GCC_WARNINGS($1) fi ifelse($2,yes,[CF_GCC_ATTRIBUTES]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIND_LINKAGE version: 22 updated: 2020/12/31 20:19:42 dnl --------------- dnl Find a library (specifically the linkage used in the code fragment), dnl searching for it if it is not already in the library path. dnl See also CF_ADD_SEARCHPATH. dnl dnl Parameters (4-on are optional): dnl $1 = headers for library entrypoint dnl $2 = code fragment for library entrypoint dnl $3 = the library name without the "-l" option or ".so" suffix. dnl $4 = action to perform if successful (default: update CPPFLAGS, etc) dnl $5 = action to perform if not successful dnl $6 = module name, if not the same as the library name dnl $7 = extra libraries dnl dnl Sets these variables: dnl $cf_cv_find_linkage_$3 - yes/no according to whether linkage is found dnl $cf_cv_header_path_$3 - include-directory if needed dnl $cf_cv_library_path_$3 - library-directory if needed dnl $cf_cv_library_file_$3 - library-file if needed, e.g., -l$3 AC_DEFUN([CF_FIND_LINKAGE],[ # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these # will be set on completion of the AC_TRY_LINK below. cf_cv_header_path_$3= cf_cv_library_path_$3= CF_MSG_LOG([Starting [FIND_LINKAGE]($3,$6)]) cf_save_LIBS="$LIBS" AC_TRY_LINK([$1],[$2],[ cf_cv_find_linkage_$3=yes cf_cv_header_path_$3=/usr/include cf_cv_library_path_$3=/usr/lib ],[ LIBS="-l$3 $7 $cf_save_LIBS" AC_TRY_LINK([$1],[$2],[ cf_cv_find_linkage_$3=yes cf_cv_header_path_$3=/usr/include cf_cv_library_path_$3=/usr/lib cf_cv_library_file_$3="-l$3" ],[ cf_cv_find_linkage_$3=no LIBS="$cf_save_LIBS" CF_VERBOSE(find linkage for $3 library) CF_MSG_LOG([Searching for headers in [FIND_LINKAGE]($3,$6)]) cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" CF_HEADER_PATH(cf_search,ifelse([$6],,[$3],[$6])) for cf_cv_header_path_$3 in $cf_search do if test -d "$cf_cv_header_path_$3" ; then CF_VERBOSE(... testing $cf_cv_header_path_$3) CPPFLAGS="$cf_save_CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-I$cf_cv_header_path_$3) AC_TRY_COMPILE([$1],[$2],[ CF_VERBOSE(... found $3 headers in $cf_cv_header_path_$3) cf_cv_find_linkage_$3=maybe cf_test_CPPFLAGS="$CPPFLAGS" break],[ CPPFLAGS="$cf_save_CPPFLAGS" ]) fi done if test "$cf_cv_find_linkage_$3" = maybe ; then CF_MSG_LOG([Searching for $3 library in [FIND_LINKAGE]($3,$6)]) cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" ifelse([$6],,,[ CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... found $3 library in system) cf_cv_find_linkage_$3=yes]) CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" ]) if test "$cf_cv_find_linkage_$3" != yes ; then CF_LIBRARY_PATH(cf_search,$3) for cf_cv_library_path_$3 in $cf_search do if test -d "$cf_cv_library_path_$3" ; then CF_VERBOSE(... testing $cf_cv_library_path_$3) CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-l$3 $7 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_$3" AC_TRY_LINK([$1],[$2],[ CF_VERBOSE(... found $3 library in $cf_cv_library_path_$3) cf_cv_find_linkage_$3=yes cf_cv_library_file_$3="-l$3" break],[ CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS" ]) fi done CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi else cf_cv_find_linkage_$3=no fi ],$7) ]) LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_$3" = yes ; then ifelse([$4],,[ CF_ADD_INCDIR($cf_cv_header_path_$3) CF_ADD_LIBDIR($cf_cv_library_path_$3) CF_ADD_LIB($3) ],[$4]) else ifelse([$5],,AC_MSG_WARN(Cannot find $3 library),[$5]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FIX_WARNINGS version: 4 updated: 2021/12/16 18:22:31 dnl --------------- dnl Warning flags do not belong in CFLAGS, CPPFLAGS, etc. Any of gcc's dnl "-Werror" flags can interfere with configure-checks. Those go into dnl EXTRA_CFLAGS. dnl dnl $1 = variable name to repair define([CF_FIX_WARNINGS],[ if test "$GCC" = yes || test "$GXX" = yes then case [$]$1 in (*-Werror=*) cf_temp_flags= for cf_temp_scan in [$]$1 do case "x$cf_temp_scan" in (x-Werror=format*) CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) ;; (x-Werror=*) CF_APPEND_TEXT(EXTRA_CFLAGS,$cf_temp_scan) ;; (*) CF_APPEND_TEXT(cf_temp_flags,$cf_temp_scan) ;; esac done if test "x[$]$1" != "x$cf_temp_flags" then CF_VERBOSE(repairing $1: [$]$1) $1="$cf_temp_flags" CF_VERBOSE(... fixed [$]$1) CF_VERBOSE(... extra $EXTRA_CFLAGS) fi ;; esac fi AC_SUBST(EXTRA_CFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_GRANTPT version: 15 updated: 2020/12/31 18:40:20 dnl --------------- dnl Check for grantpt versus openpty, as well as functions that "should" be dnl available if grantpt is available. AC_DEFUN([CF_FUNC_GRANTPT],[ AC_CHECK_HEADERS( \ stropts.h \ ) cf_func_grantpt="grantpt ptsname" cf_prefer_openpt=no case $host_os in (darwin[[0-9]].*) ;; (openbsd[[0-9]].*) # The POSIX entrypoints exist, but have never worked. ;; (linux*) cf_func_grantpt="$cf_func_grantpt posix_openpt" cf_prefer_openpt=yes ;; (*) cf_func_grantpt="$cf_func_grantpt posix_openpt" ;; esac AC_CHECK_FUNCS($cf_func_grantpt) cf_grantpt_opts= if test "x$ac_cv_func_grantpt" = "xyes" ; then AC_MSG_CHECKING(if grantpt really works) AC_TRY_LINK(CF__GRANTPT_HEAD,CF__GRANTPT_BODY,[ AC_TRY_RUN(CF__GRANTPT_HEAD int main(void) { CF__GRANTPT_BODY } , ,ac_cv_func_grantpt=no ,ac_cv_func_grantpt=maybe) ],ac_cv_func_grantpt=no) AC_MSG_RESULT($ac_cv_func_grantpt) if test "x$ac_cv_func_grantpt" != "xno" ; then if test "x$ac_cv_func_grantpt" = "xyes" ; then AC_MSG_CHECKING(for pty features) dnl if we have no stropts.h, skip the checks for streams modules if test "x$ac_cv_header_stropts_h" = xyes then cf_pty_this=0 else cf_pty_this=3 fi cf_pty_defines= while test $cf_pty_this != 6 do cf_pty_feature= cf_pty_next="`expr $cf_pty_this + 1`" CF_MSG_LOG(pty feature test $cf_pty_next:5) AC_TRY_RUN(#define CONFTEST $cf_pty_this $cf_pty_defines CF__GRANTPT_HEAD int main(void) { CF__GRANTPT_BODY } , [ case $cf_pty_next in (1) # - streams cf_pty_feature=ptem ;; (2) # - streams cf_pty_feature=ldterm ;; (3) # - streams cf_pty_feature=ttcompat ;; (4) cf_pty_feature=pty_isatty ;; (5) cf_pty_feature=pty_tcsetattr ;; (6) cf_pty_feature=tty_tcsetattr ;; esac ],[ case $cf_pty_next in (1|2|3) CF_MSG_LOG(skipping remaining streams features $cf_pty_this..2) cf_pty_next=3 ;; esac ]) if test -n "$cf_pty_feature" then cf_pty_defines="$cf_pty_defines #define CONFTEST_$cf_pty_feature 1 " cf_grantpt_opts="$cf_grantpt_opts $cf_pty_feature" fi cf_pty_this=$cf_pty_next done AC_MSG_RESULT($cf_grantpt_opts) cf_grantpt_opts=`echo "$cf_grantpt_opts" | sed -e 's/ isatty//'` fi fi fi dnl If we found grantpt, but no features, e.g., for streams or if we are not dnl able to use tcsetattr, then give openpty a try. In particular, Darwin 10.7 dnl has a more functional openpty than posix_openpt. dnl dnl There is no configure run-test for openpty, since older implementations do dnl not always run properly as a non-root user. For that reason, we also allow dnl the configure script to suppress this check entirely with $disable_openpty. if test "x$cf_prefer_posix_openpt" = "xyes" && test "x$ac_cv_func_posix_openpt" = "xyes" ; then CF_VERBOSE(prefer posix_openpt over openpty) elif test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then AC_CHECK_LIB(util, openpty, [cf_have_openpty=yes],[cf_have_openpty=no]) if test "$cf_have_openpty" = yes ; then ac_cv_func_grantpt=no LIBS="-lutil $LIBS" AC_DEFINE(HAVE_OPENPTY,1,[Define to 1 if you have the openpty function]) AC_CHECK_HEADERS( \ util.h \ libutil.h \ pty.h \ ) fi fi dnl If we did not settle on using openpty, fill in the definitions for grantpt. if test "x$ac_cv_func_grantpt" != xno then CF_VERBOSE(will rely upon grantpt) AC_DEFINE(HAVE_WORKING_GRANTPT,1,[Define to 1 if the grantpt function seems to work]) for cf_feature in $cf_grantpt_opts do cf_feature=`echo "$cf_feature" | sed -e 's/ //g'` CF_UPPER(cf_FEATURE,$cf_feature) AC_DEFINE_UNQUOTED(HAVE_GRANTPT_$cf_FEATURE) done elif test "x$cf_have_openpty" = xno then CF_VERBOSE(will rely upon BSD-pseudoterminals) else CF_VERBOSE(will rely upon openpty) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_POLL version: 11 updated: 2023/01/05 18:51:40 dnl ------------ dnl See if the poll function really works. Some platforms have poll(), but dnl it does not work for terminals or files. AC_DEFUN([CF_FUNC_POLL],[ tty >/dev/null 2>&1 || { AC_CHECK_FUNCS(posix_openpt) } AC_CACHE_CHECK(if poll really works,cf_cv_working_poll,[ AC_TRY_RUN([ $ac_includes_default #include #ifdef HAVE_POLL_H #include #else #include #endif int main(void) { struct pollfd myfds; int ret; /* check for Darwin bug with respect to "devices" */ myfds.fd = open("/dev/null", 1); /* O_WRONLY */ if (myfds.fd < 0) myfds.fd = 0; myfds.events = POLLIN; myfds.revents = 0; ret = poll(&myfds, 1, 100); if (ret < 0 || (myfds.revents & POLLNVAL)) { ret = -1; } else { int fd = 0; if (!isatty(fd)) { fd = open("/dev/tty", 2); /* O_RDWR */ } #ifdef HAVE_POSIX_OPENPT if (fd < 0) { fd = posix_openpt(O_RDWR); } #endif if (fd >= 0) { /* also check with standard input */ myfds.fd = fd; myfds.events = POLLIN; myfds.revents = 0; ret = poll(&myfds, 1, 100); } else { ret = -1; } } ${cf_cv_main_return:-return}(ret < 0); }], [cf_cv_working_poll=yes], [cf_cv_working_poll=no], [cf_cv_working_poll=unknown])]) test "$cf_cv_working_poll" = "yes" && AC_DEFINE(HAVE_WORKING_POLL,1,[Define to 1 if the poll function seems to work]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_FUNC_SETGROUPS version: 1 updated: 2024/01/02 19:01:22 dnl ----------------- dnl Check for getgroups() and setgroups() functions AC_DEFUN([CF_FUNC_SETGROUPS],[ AC_CACHE_CHECK(for getgroups/setgroups,cf_cv_func_setgroups,[ AC_TRY_LINK([ $ac_includes_default #include ],[ gid_t my_list[10]; if (getgroups(0, my_list)) setgroups(0, NULL); ],[cf_cv_func_setgroups=yes],[cf_cv_func_setgroups=no]) ]) test "$cf_cv_func_setgroups" = yes && AC_DEFINE(HAVE_SETGROUPS,1,[Define to 1 if setgroups function exists]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_ATTRIBUTES version: 24 updated: 2021/03/20 12:00:25 dnl ----------------- dnl Test for availability of useful gcc __attribute__ directives to quiet dnl compiler warnings. Though useful, not all are supported -- and contrary dnl to documentation, unrecognized directives cause older compilers to barf. AC_DEFUN([CF_GCC_ATTRIBUTES], [AC_REQUIRE([AC_PROG_FGREP])dnl AC_REQUIRE([CF_C11_NORETURN])dnl if test "$GCC" = yes || test "$GXX" = yes then cat > conftest.i < "conftest.$ac_ext" < #include "confdefs.h" #include "conftest.h" #include "conftest.i" #if GCC_PRINTF #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) #else #define GCC_PRINTFLIKE(fmt,var) /*nothing*/ #endif #if GCC_SCANF #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) #else #define GCC_SCANFLIKE(fmt,var) /*nothing*/ #endif extern void wow(char *,...) GCC_SCANFLIKE(1,2); extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2); extern GCC_NORETURN void foo(void); int main(int argc GCC_UNUSED, char *argv[[]] GCC_UNUSED) { (void)argc; (void)argv; return 0; } EOF cf_printf_attribute=no cf_scanf_attribute=no for cf_attribute in scanf printf unused noreturn do CF_UPPER(cf_ATTRIBUTE,$cf_attribute) cf_directive="__attribute__(($cf_attribute))" echo "checking for $CC $cf_directive" 1>&AC_FD_CC case "$cf_attribute" in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <>confdefs.h case "$cf_attribute" in (noreturn) AC_DEFINE_UNQUOTED(GCC_NORETURN,$cf_directive,[Define to noreturn-attribute for gcc]) ;; (printf) cf_value='/* nothing */' if test "$cf_printf_attribute" != no ; then cf_value='__attribute__((format(printf,fmt,var)))' AC_DEFINE(GCC_PRINTF,1,[Define to 1 if the compiler supports gcc-like printf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_PRINTFLIKE(fmt,var),$cf_value,[Define to printf-attribute for gcc]) ;; (scanf) cf_value='/* nothing */' if test "$cf_scanf_attribute" != no ; then cf_value='__attribute__((format(scanf,fmt,var)))' AC_DEFINE(GCC_SCANF,1,[Define to 1 if the compiler supports gcc-like scanf attribute.]) fi AC_DEFINE_UNQUOTED(GCC_SCANFLIKE(fmt,var),$cf_value,[Define to sscanf-attribute for gcc]) ;; (unused) AC_DEFINE_UNQUOTED(GCC_UNUSED,$cf_directive,[Define to unused-attribute for gcc]) ;; esac fi done else ${FGREP-fgrep} define conftest.i >>confdefs.h fi rm -rf ./conftest* fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_VERSION version: 9 updated: 2023/03/05 14:30:13 dnl -------------- dnl Find version of gcc, and (because icc/clang pretend to be gcc without being dnl compatible), attempt to determine if icc/clang is actually used. AC_DEFUN([CF_GCC_VERSION],[ AC_REQUIRE([AC_PROG_CC]) GCC_VERSION=none if test "$GCC" = yes ; then AC_MSG_CHECKING(version of $CC) GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[[^(]]*([[^)]][[^)]]*) //' -e 's/^[[^0-9.]]*//' -e 's/[[^0-9.]].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown AC_MSG_RESULT($GCC_VERSION) fi CF_INTEL_COMPILER(GCC,INTEL_COMPILER,CFLAGS) CF_CLANG_COMPILER(GCC,CLANG_COMPILER,CFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_GCC_WARNINGS version: 41 updated: 2021/01/01 16:53:59 dnl --------------- dnl Check if the compiler supports useful warning options. There's a few that dnl we don't use, simply because they're too noisy: dnl dnl -Wconversion (useful in older versions of gcc, but not in gcc 2.7.x) dnl -Winline (usually not worthwhile) dnl -Wredundant-decls (system headers make this too noisy) dnl -Wtraditional (combines too many unrelated messages, only a few useful) dnl -Wwrite-strings (too noisy, but should review occasionally). This dnl is enabled for ncurses using "--enable-const". dnl -pedantic dnl dnl Parameter: dnl $1 is an optional list of gcc warning flags that a particular dnl application might want to use, e.g., "no-unused" for dnl -Wno-unused dnl Special: dnl If $with_ext_const is "yes", add a check for -Wwrite-strings dnl AC_DEFUN([CF_GCC_WARNINGS], [ AC_REQUIRE([CF_GCC_VERSION]) if test "x$have_x" = xyes; then CF_CONST_X_STRING fi cat > "conftest.$ac_ext" <],[ #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 return 0; #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 return 0; #else # error not GNU C library #endif], [cf_cv_gnu_library=yes], [cf_cv_gnu_library=no]) ]) if test x$cf_cv_gnu_library = xyes; then # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE # was changed to help a little. newlib incorporated the change about 4 # years later. AC_CACHE_CHECK(if _DEFAULT_SOURCE can be used as a basis,cf_cv_gnu_library_219,[ cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) AC_TRY_COMPILE([#include ],[ #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) return 0; #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) return 0; #else # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old #endif], [cf_cv_gnu_library_219=yes], [cf_cv_gnu_library_219=no]) CPPFLAGS="$cf_save" ]) if test "x$cf_cv_gnu_library_219" = xyes; then cf_save="$CPPFLAGS" AC_CACHE_CHECK(if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE,cf_cv_gnu_dftsrc_219,[ CF_ADD_CFLAGS(-D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source) AC_TRY_COMPILE([ #include #include ],[ #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) return 0; #else # error GNU C library is too old #endif], [cf_cv_gnu_dftsrc_219=yes], [cf_cv_gnu_dftsrc_219=no]) ]) test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" else cf_cv_gnu_dftsrc_219=maybe fi if test "x$cf_cv_gnu_dftsrc_219" != xyes; then AC_CACHE_CHECK(if we must define _GNU_SOURCE,cf_cv_gnu_source,[ AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be defined #endif], [cf_cv_gnu_source=no], [cf_save="$CPPFLAGS" CF_ADD_CFLAGS(-D_GNU_SOURCE) AC_TRY_COMPILE([#include ],[ #ifdef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be undefined #endif], [cf_cv_gnu_source=no], [cf_cv_gnu_source=yes]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_gnu_source" = yes then AC_CACHE_CHECK(if we should also define _DEFAULT_SOURCE,cf_cv_default_source,[ CF_APPEND_TEXT(CPPFLAGS,-D_GNU_SOURCE) AC_TRY_COMPILE([#include ],[ #ifdef _DEFAULT_SOURCE #error expected _DEFAULT_SOURCE to be undefined #endif], [cf_cv_default_source=no], [cf_cv_default_source=yes]) ]) if test "$cf_cv_default_source" = yes then CF_APPEND_TEXT(CPPFLAGS,-D_DEFAULT_SOURCE) fi fi fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_HEADER_PATH version: 15 updated: 2021/01/01 13:31:04 dnl -------------- dnl Construct a search-list of directories for a nonstandard header-file dnl dnl Parameters dnl $1 = the variable to return as result dnl $2 = the package name AC_DEFUN([CF_HEADER_PATH], [ $1= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case "$cf_header_path" in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` CF_ADD_SUBDIR_PATH($1,$2,include,$cf_header_path,NONE) cf_header_path_list="$cf_header_path_list [$]$1" ;; esac done fi # add the variations for the package we are looking for CF_SUBDIR_PATH($1,$2,include) test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d "$includedir" && $1="[$]$1 $includedir" test -d "$includedir/$2" && $1="[$]$1 $includedir/$2" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d "$oldincludedir" && $1="[$]$1 $oldincludedir" test -d "$oldincludedir/$2" && $1="[$]$1 $oldincludedir/$2" } $1="[$]$1 $cf_header_path_list" ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 9 updated: 2023/02/18 17:41:25 dnl ----------------- dnl Check if the given compiler is really the Intel compiler for Linux. It dnl tries to imitate gcc, but does not return an error when it finds a mismatch dnl between prototypes, e.g., as exercised by CF_MISSING_CHECK. dnl dnl This macro should be run "soon" after AC_PROG_CC or AC_PROG_CPLUSPLUS, to dnl ensure that it is not mistaken for gcc/g++. It is normally invoked from dnl the wrappers for gcc and g++ warnings. dnl dnl $1 = GCC (default) or GXX dnl $2 = INTEL_COMPILER (default) or INTEL_CPLUSPLUS dnl $3 = CFLAGS (default) or CXXFLAGS AC_DEFUN([CF_INTEL_COMPILER],[ AC_REQUIRE([AC_CANONICAL_HOST]) ifelse([$2],,INTEL_COMPILER,[$2])=no if test "$ifelse([$1],,[$1],GCC)" = yes ; then case "$host_os" in (linux*|gnu*) AC_MSG_CHECKING(if this is really Intel ifelse([$1],GXX,C++,C) compiler) cf_save_CFLAGS="$ifelse([$3],,CFLAGS,[$3])" ifelse([$3],,CFLAGS,[$3])="$ifelse([$3],,CFLAGS,[$3]) -no-gcc" AC_TRY_COMPILE([],[ #ifdef __INTEL_COMPILER #else #error __INTEL_COMPILER is not defined #endif ],[ifelse([$2],,INTEL_COMPILER,[$2])=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" ],[]) ifelse([$3],,CFLAGS,[$3])="$cf_save_CFLAGS" AC_MSG_RESULT($ifelse([$2],,INTEL_COMPILER,[$2])) ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_LD_RPATH_OPT version: 9 updated: 2021/01/01 13:31:04 dnl --------------- dnl For the given system and compiler, find the compiler flags to pass to the dnl loader to use the "rpath" feature. AC_DEFUN([CF_LD_RPATH_OPT], [ AC_REQUIRE([CF_CHECK_CACHE]) LD_RPATH_OPT= if test "x$cf_cv_enable_rpath" != xno then AC_MSG_CHECKING(for an rpath option) case "$cf_cv_system_name" in (irix*) if test "$GCC" = yes; then LD_RPATH_OPT="-Wl,-rpath," else LD_RPATH_OPT="-rpath " fi ;; (linux*|gnu*|k*bsd*-gnu|freebsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (openbsd[[2-9]].*|mirbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (dragonfly*) LD_RPATH_OPT="-rpath " ;; (netbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (osf*|mls+*) LD_RPATH_OPT="-rpath " ;; (solaris2*) LD_RPATH_OPT="-R" ;; (*) ;; esac AC_MSG_RESULT($LD_RPATH_OPT) case "x$LD_RPATH_OPT" in (x-R*) AC_MSG_CHECKING(if we need a space after rpath option) cf_save_LIBS="$LIBS" CF_ADD_LIBS(${LD_RPATH_OPT}$libdir) AC_TRY_LINK(, , cf_rpath_space=no, cf_rpath_space=yes) LIBS="$cf_save_LIBS" AC_MSG_RESULT($cf_rpath_space) test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " ;; esac fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_LIBRARY_PATH version: 11 updated: 2021/01/01 13:31:04 dnl --------------- dnl Construct a search-list of directories for a nonstandard library-file dnl dnl Parameters dnl $1 = the variable to return as result dnl $2 = the package name AC_DEFUN([CF_LIBRARY_PATH], [ $1= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case "$cf_library_path" in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` CF_ADD_SUBDIR_PATH($1,$2,lib,$cf_library_path,NONE) cf_library_path_list="$cf_library_path_list [$]$1" ;; esac done fi CF_SUBDIR_PATH($1,$2,lib) $1="$cf_library_path_list [$]$1" ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKE_DOCS version: 5 updated: 2021/01/10 16:05:11 dnl ------------ dnl $1 = name(s) to generate rules for dnl $2 = suffix of corresponding manpages used as input. dnl dnl This works best if called at the end of configure.in, following CF_WITH_MAN2HTML define([CF_MAKE_DOCS],[ test -z "$cf_make_docs" && cf_make_docs=0 cf_output=makefile test -f "$cf_output" || cf_output=Makefile if test "$cf_make_docs" = 0 then cat >>$cf_output <[\$]@ ${GROFF_NOTE}.ps.pdf : ${GROFF_NOTE} ps2pdf [\$]*.ps ${GROFF_NOTE} ${GROFF_NOTE}.$2.ps : ${GROFF_NOTE} [\$](SHELL) -c "tbl [\$]*.$2 | groff -man" >[\$]@ ${GROFF_NOTE} ${GROFF_NOTE}.$2.txt : ${GROFF_NOTE} GROFF_NO_SGR=stupid [\$](SHELL) -c "tbl [\$]*.$2 | nroff -rHY=0 -Tascii -man | col -bx" >[\$]@ ${MAN2HTML_NOTE}.$2.html : ${MAN2HTML_NOTE} ./${MAN2HTML_TEMP} [\$]* $2 man >[\$]@ CF_EOF cf_make_docs=1 fi for cf_name in $1 do cat >>$cf_output <conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi ]) test "$cf_cv_mixedcase" = yes && AC_DEFINE(MIXEDCASE_FILENAMES,1,[Define to 1 if filesystem supports mixed-case filenames.]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MSG_LOG version: 5 updated: 2010/10/23 15:52:32 dnl ---------- dnl Write a debug message to config.log, along with the line number in the dnl configure script. AC_DEFUN([CF_MSG_LOG],[ echo "${as_me:-configure}:__oline__: testing $* ..." 1>&AC_FD_CC ])dnl dnl --------------------------------------------------------------------------- dnl CF_NO_LEAKS_OPTION version: 9 updated: 2021/06/13 19:45:41 dnl ------------------ dnl see CF_WITH_NO_LEAKS dnl dnl $1 = option/name dnl $2 = help-text dnl $3 = symbol to define if the option is set dnl $4 = additional actions to take if the option is set AC_DEFUN([CF_NO_LEAKS_OPTION],[ AC_MSG_CHECKING(if you want to use $1 for testing) AC_ARG_WITH($1, [$2], [case "x$withval" in (x|xno) ;; (*) : "${with_cflags:=-g}" : "${enable_leaks:=no}" with_$1=yes AC_DEFINE_UNQUOTED($3,1,"Define to 1 if you want to use $1 for testing.")ifelse([$4],,[ $4 ]) ;; esac], [with_$1=]) AC_MSG_RESULT(${with_$1:-no}) case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) CF_ADD_CFLAGS([-g]) ;; esac ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATHSEP version: 8 updated: 2021/01/01 13:31:04 dnl ---------- dnl Provide a value for the $PATH and similar separator (or amend the value dnl as provided in autoconf 2.5x). AC_DEFUN([CF_PATHSEP], [ AC_MSG_CHECKING(for PATH separator) case "$cf_cv_system_name" in (os2*) PATH_SEPARATOR=';' ;; (*) ${PATH_SEPARATOR:=':'} ;; esac ifelse([$1],,,[$1=$PATH_SEPARATOR]) AC_SUBST(PATH_SEPARATOR) AC_MSG_RESULT($PATH_SEPARATOR) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PATH_SYNTAX version: 19 updated: 2024/08/03 13:08:58 dnl -------------- dnl Check the argument to see that it looks like a pathname. Rewrite it if it dnl begins with one of the prefix/exec_prefix variables, and then again if the dnl result begins with 'NONE'. This is necessary to work around autoconf's dnl delayed evaluation of those symbols. AC_DEFUN([CF_PATH_SYNTAX],[ AC_REQUIRE([CF_GLOB_FULLPATH])dnl if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case "x[$]$1" in (x\[$]\(*\)*|x\'*\'*) ;; (x.|x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER) ;; (x\[$]\{*prefix\}*|x\[$]\{*dir\}*) eval $1="[$]$1" case "x[$]$1" in (xNONE/*) $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (xno|xNONE/*) $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` ;; (*) ifelse([$2],,[AC_MSG_ERROR([expected a pathname, not \"[$]$1\"])],$2) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_PKG_CONFIG version: 13 updated: 2023/10/28 11:59:01 dnl ------------- dnl Check for the package-config program, unless disabled by command-line. dnl dnl Sets $PKG_CONFIG to the pathname of the pkg-config program. AC_DEFUN([CF_PKG_CONFIG], [ AC_MSG_CHECKING(if you want to use pkg-config) AC_ARG_WITH(pkg-config, [[ --with-pkg-config[=CMD] enable/disable use of pkg-config and its name CMD]], [cf_pkg_config=$withval], [cf_pkg_config=yes]) AC_MSG_RESULT($cf_pkg_config) case "$cf_pkg_config" in (no) PKG_CONFIG=none ;; (yes) CF_ACVERSION_CHECK(2.52, [AC_PATH_TOOL(PKG_CONFIG, pkg-config, none)], [AC_PATH_PROG(PKG_CONFIG, pkg-config, none)]) ;; (*) PKG_CONFIG=$withval ;; esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then CF_PATH_SYNTAX(PKG_CONFIG) elif test "x$cf_pkg_config" != xno ; then AC_MSG_WARN(pkg-config is not installed) fi AC_SUBST(PKG_CONFIG) ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_C_SOURCE version: 12 updated: 2023/02/18 17:41:25 dnl ----------------- dnl Define _POSIX_C_SOURCE to the given level, and _POSIX_SOURCE if needed. dnl dnl POSIX.1-1990 _POSIX_SOURCE dnl POSIX.1-1990 and _POSIX_SOURCE and dnl POSIX.2-1992 C-Language _POSIX_C_SOURCE=2 dnl Bindings Option dnl POSIX.1b-1993 _POSIX_C_SOURCE=199309L dnl POSIX.1c-1996 _POSIX_C_SOURCE=199506L dnl X/Open 2000 _POSIX_C_SOURCE=200112L dnl dnl Parameters: dnl $1 is the nominal value for _POSIX_C_SOURCE AC_DEFUN([CF_POSIX_C_SOURCE], [AC_REQUIRE([CF_POSIX_VISIBLE])dnl if test "$cf_cv_posix_visible" = no; then cf_POSIX_C_SOURCE=ifelse([$1],,199506L,[$1]) cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" CF_REMOVE_DEFINE(cf_trim_CFLAGS,$cf_save_CFLAGS,_POSIX_C_SOURCE) CF_REMOVE_DEFINE(cf_trim_CPPFLAGS,$cf_save_CPPFLAGS,_POSIX_C_SOURCE) AC_CACHE_CHECK(if we should define _POSIX_C_SOURCE,cf_cv_posix_c_source,[ CF_MSG_LOG(if the symbol is already defined go no further) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined #endif], [cf_cv_posix_c_source=no], [cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[[12]]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then AC_TRY_COMPILE([#include ],[ #ifdef _POSIX_SOURCE #error _POSIX_SOURCE is defined #endif],[], cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE") fi CF_MSG_LOG(ifdef from value $cf_POSIX_C_SOURCE) CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,$cf_cv_posix_c_source) CF_MSG_LOG(if the second compile does not leave our definition intact error) AC_TRY_COMPILE([#include ],[ #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined #endif],, [cf_cv_posix_c_source=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" ]) ]) if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" CF_ADD_CFLAGS($cf_cv_posix_c_source) fi fi # cf_cv_posix_visible ])dnl dnl --------------------------------------------------------------------------- dnl CF_POSIX_VISIBLE version: 1 updated: 2018/12/31 20:46:17 dnl ---------------- dnl POSIX documents test-macros which an application may set before any system dnl headers are included to make features available. dnl dnl Some BSD platforms (originally FreeBSD, but copied by a few others) dnl diverged from POSIX in 2002 by setting symbols which make all of the most dnl recent features visible in the system header files unless the application dnl overrides the corresponding test-macros. Doing that introduces portability dnl problems. dnl dnl This macro makes a special check for the symbols used for this, to avoid a dnl conflicting definition. AC_DEFUN([CF_POSIX_VISIBLE], [ AC_CACHE_CHECK(if the POSIX test-macros are already defined,cf_cv_posix_visible,[ AC_TRY_COMPILE([#include ],[ #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) #error conflicting symbols found #endif ],[cf_cv_posix_visible=no],[cf_cv_posix_visible=yes]) ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_CC version: 5 updated: 2019/12/31 08:53:54 dnl ---------- dnl standard check for CC, plus followup sanity checks dnl $1 = optional parameter to pass to AC_PROG_CC to specify compiler name AC_DEFUN([CF_PROG_CC],[ CF_ACVERSION_CHECK(2.53, [AC_MSG_WARN(this will incorrectly handle gnatgcc choice) AC_REQUIRE([AC_PROG_CC])], []) ifelse($1,,[AC_PROG_CC],[AC_PROG_CC($1)]) CF_GCC_VERSION CF_ACVERSION_CHECK(2.52, [AC_PROG_CC_STDC], [CF_ANSI_CC_REQD]) CF_CC_ENV_FLAGS ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_GROFF version: 3 updated: 2018/01/07 13:16:19 dnl ------------- dnl Check if groff is available, for cases (such as html output) where nroff dnl is not enough. AC_DEFUN([CF_PROG_GROFF],[ AC_PATH_PROG(GROFF_PATH,groff,no) AC_PATH_PROGS(NROFF_PATH,nroff mandoc,no) AC_PATH_PROG(TBL_PATH,tbl,cat) if test "x$GROFF_PATH" = xno then NROFF_NOTE= GROFF_NOTE="#" else NROFF_NOTE="#" GROFF_NOTE= fi AC_SUBST(GROFF_NOTE) AC_SUBST(NROFF_NOTE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_PROG_LINT version: 5 updated: 2022/08/20 15:44:13 dnl ------------ AC_DEFUN([CF_PROG_LINT], [ AC_CHECK_PROGS(LINT, lint cppcheck splint) case "x$LINT" in (xcppcheck|x*/cppcheck) test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" ;; esac AC_SUBST(LINT_OPTS) AC_SUBST(LINT_LIBS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_CFLAGS version: 3 updated: 2021/09/05 17:25:40 dnl ---------------- dnl Remove a given option from CFLAGS/CPPFLAGS dnl $1 = option to remove dnl $2 = variable to update dnl $3 = nonempty to allow verbose message define([CF_REMOVE_CFLAGS], [ cf_tmp_cflag=`echo "x$1" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x[$]$2" | sed -e 's/^.//' -e 's/[[ ]][[ ]]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[[^ ]][[^ ]]*\\)\?%%" -e 's/^[[ ]]*//' -e 's%[[ ]][[ ]]*-D% -D%g' -e 's%[[ ]][[ ]]*-I% -I%g'` test "[$]$2" != "$cf_old_cflag" || break ifelse([$3],,,[CF_VERBOSE(removing old option $1 from $2)]) $2="$cf_old_cflag" done ])dnl dnl --------------------------------------------------------------------------- dnl CF_REMOVE_DEFINE version: 3 updated: 2010/01/09 11:05:50 dnl ---------------- dnl Remove all -U and -D options that refer to the given symbol from a list dnl of C compiler options. This works around the problem that not all dnl compilers process -U and -D options from left-to-right, so a -U option dnl cannot be used to cancel the effect of a preceding -D option. dnl dnl $1 = target (which could be the same as the source variable) dnl $2 = source (including '$') dnl $3 = symbol to remove define([CF_REMOVE_DEFINE], [ $1=`echo "$2" | \ sed -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[[ ]]/ /g' \ -e 's/-[[UD]]'"$3"'\(=[[^ ]]*\)\?[$]//g'` ])dnl dnl --------------------------------------------------------------------------- dnl CF_RESTORE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:47:45 dnl --------------------- dnl Restore flags saved in CF_SAVE_XTRA_FLAGS dnl $1 = name of current macro define([CF_RESTORE_XTRA_FLAGS], [ LIBS="$cf_save_LIBS_$1" CFLAGS="$cf_save_CFLAGS_$1" CPPFLAGS="$cf_save_CPPFLAGS_$1" ])dnl dnl --------------------------------------------------------------------------- dnl CF_RPATH_HACK version: 13 updated: 2021/01/03 18:30:50 dnl ------------- AC_DEFUN([CF_RPATH_HACK], [AC_REQUIRE([AC_PROG_FGREP])dnl AC_REQUIRE([CF_LD_RPATH_OPT])dnl AC_MSG_CHECKING(for updated LDFLAGS) if test -n "$LD_RPATH_OPT" ; then AC_MSG_RESULT(maybe) AC_CHECK_PROGS(cf_ldd_prog,ldd,no) cf_rpath_list="/usr/lib /lib" if test "$cf_ldd_prog" != no then cf_rpath_oops= AC_TRY_LINK([#include ], [printf("Hello");], [cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq` cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[[ ]]/%/%' -e 's%/[[^/]][[^/]]*$%%' |sort | uniq`]) # If we passed the link-test, but get a "not found" on a given library, # this could be due to inept reconfiguration of gcc to make it only # partly honor /usr/local/lib (or whatever). Sometimes this behavior # is intentional, e.g., installing gcc in /usr/bin and suppressing the # /usr/local libraries. if test -n "$cf_rpath_oops" then for cf_rpath_src in $cf_rpath_oops do for cf_rpath_dir in \ /usr/local \ /usr/pkg \ /opt/sfw do if test -f "$cf_rpath_dir/lib/$cf_rpath_src" then CF_VERBOSE(...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src) LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" break fi done done fi fi CF_VERBOSE(...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS) CF_RPATH_HACK_2(LDFLAGS) CF_RPATH_HACK_2(LIBS) CF_VERBOSE(...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS) else AC_MSG_RESULT(no) fi AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_RPATH_HACK_2 version: 8 updated: 2021/01/01 13:31:04 dnl --------------- dnl Do one set of substitutions for CF_RPATH_HACK, adding an rpath option to dnl EXTRA_LDFLAGS for each -L option found. dnl dnl $cf_rpath_list contains a list of directories to ignore. dnl dnl $1 = variable name to update. The LDFLAGS variable should be the only one, dnl but LIBS often has misplaced -L options. AC_DEFUN([CF_RPATH_HACK_2], [ CF_VERBOSE(...checking $1 [$]$1) cf_rpath_dst= for cf_rpath_src in [$]$1 do case "$cf_rpath_src" in (-L*) # check if this refers to a directory which we will ignore cf_rpath_skip=no if test -n "$cf_rpath_list" then for cf_rpath_item in $cf_rpath_list do if test "x$cf_rpath_src" = "x-L$cf_rpath_item" then cf_rpath_skip=yes break fi done fi if test "$cf_rpath_skip" = no then # transform the option if test "$LD_RPATH_OPT" = "-R " ; then cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` else cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` fi # if we have not already added this, add it now cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" then CF_VERBOSE(...Filter $cf_rpath_src ->$cf_rpath_tmp) EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi fi ;; esac cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" done $1=$cf_rpath_dst CF_VERBOSE(...checked $1 [$]$1) AC_SUBST(EXTRA_LDFLAGS) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SAVE_XTRA_FLAGS version: 1 updated: 2020/01/11 16:46:44 dnl ------------------ dnl Use this macro to save CFLAGS/CPPFLAGS/LIBS before checks against X headers dnl and libraries which do not update those variables. dnl dnl $1 = name of current macro define([CF_SAVE_XTRA_FLAGS], [ cf_save_LIBS_$1="$LIBS" cf_save_CFLAGS_$1="$CFLAGS" cf_save_CPPFLAGS_$1="$CPPFLAGS" LIBS="$LIBS ${X_PRE_LIBS} ${X_LIBS} ${X_EXTRA_LIBS}" for cf_X_CFLAGS in $X_CFLAGS do case "x$cf_X_CFLAGS" in x-[[IUD]]*) CPPFLAGS="$CPPFLAGS $cf_X_CFLAGS" ;; *) CFLAGS="$CFLAGS $cf_X_CFLAGS" ;; esac done ])dnl dnl --------------------------------------------------------------------------- dnl CF_SIGWINCH version: 7 updated: 2023/02/18 17:41:25 dnl ----------- dnl Use this macro after CF_XOPEN_SOURCE, but do not require it (not all dnl programs need this test). dnl dnl This is really a Mac OS X 10.4.3 workaround. Defining _POSIX_C_SOURCE dnl forces SIGWINCH to be undefined (breaks xterm, ncurses). Oddly, the struct dnl winsize declaration is left alone - we may revisit this if Apple choose to dnl break that part of the interface as well. AC_DEFUN([CF_SIGWINCH], [ AC_CACHE_CHECK(if SIGWINCH is defined,cf_cv_define_sigwinch,[ AC_TRY_COMPILE([ #include #include ],[int x = SIGWINCH; (void)x], [cf_cv_define_sigwinch=yes], [AC_TRY_COMPILE([ #undef _XOPEN_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #include #include ],[int x = SIGWINCH; (void)x], [cf_cv_define_sigwinch=maybe], [cf_cv_define_sigwinch=no]) ]) ]) if test "$cf_cv_define_sigwinch" = maybe ; then AC_CACHE_CHECK(for actual SIGWINCH definition,cf_cv_fixup_sigwinch,[ cf_cv_fixup_sigwinch=unknown cf_sigwinch=32 while test "$cf_sigwinch" != 1 do AC_TRY_COMPILE([ #undef _XOPEN_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #include #include ],[ #if SIGWINCH != $cf_sigwinch #error SIGWINCH is not $cf_sigwinch #endif int x = SIGWINCH; (void)x], [cf_cv_fixup_sigwinch=$cf_sigwinch break]) cf_sigwinch="`expr "$cf_sigwinch" - 1`" done ]) if test "$cf_cv_fixup_sigwinch" != unknown ; then CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch" fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_SUBDIR_PATH version: 7 updated: 2014/12/04 04:33:06 dnl -------------- dnl Construct a search-list for a nonstandard header/lib-file dnl $1 = the variable to return as result dnl $2 = the package name dnl $3 = the subdirectory, e.g., bin, include or lib AC_DEFUN([CF_SUBDIR_PATH], [ $1= CF_ADD_SUBDIR_PATH($1,$2,$3,$prefix,NONE) for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ [$]HOME do CF_ADD_SUBDIR_PATH($1,$2,$3,$cf_subdir_prefix,$prefix) done ])dnl dnl --------------------------------------------------------------------------- dnl CF_SVR4 version: 6 updated: 2023/12/01 17:22:50 dnl ------- dnl Check if this is an SVR4 system. We need the definition for xterm AC_DEFUN([CF_SVR4], [ AC_CHECK_LIB(elf, elf_begin,[ AC_CACHE_CHECK(if this is an SVR4 system, cf_cv_svr4,[ AC_TRY_COMPILE([ #if defined(__CYGWIN__) #error Cygwin is not SVr4 #endif #include #include ],[ static struct termio d_tio; d_tio.c_cc[VINTR] = 0; d_tio.c_cc[VQUIT] = 0; d_tio.c_cc[VERASE] = 0; d_tio.c_cc[VKILL] = 0; d_tio.c_cc[VEOF] = 0; d_tio.c_cc[VEOL] = 0; d_tio.c_cc[VMIN] = 0; d_tio.c_cc[VTIME] = 0; d_tio.c_cc[VLNEXT] = 0; ], [cf_cv_svr4=yes], [cf_cv_svr4=no]) ]) ]) test "$cf_cv_svr4" = yes && AC_DEFINE(SVR4,1,[Define to 1 if this is an SVR4 system]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYSV version: 16 updated: 2020/01/11 16:46:44 dnl ------- dnl Check if this is a SYSV platform, e.g., as used in , and whether dnl defining it will be helpful. The following features are used to check: dnl dnl a) bona-fide SVSV doesn't use const for sys_errlist[]. Since this is a dnl legacy (pre-ANSI) feature, const should not apply. Modern systems only dnl declare strerror(). Xos.h declares the legacy form of str_errlist[], and dnl a compile-time error will result from trying to assign to a const array. dnl dnl b) compile with headers that exist on SYSV hosts. dnl dnl c) compile with type definitions that differ on SYSV hosts from standard C. AC_DEFUN([CF_SYSV], [ AC_REQUIRE([AC_PATH_XTRA]) CF_SAVE_XTRA_FLAGS([CF_SYSV]) AC_CHECK_HEADERS( \ termios.h \ stdlib.h \ X11/Intrinsic.h \ ) AC_REQUIRE([CF_SYS_ERRLIST]) AC_CACHE_CHECK(if we should define SYSV,cf_cv_sysv,[ AC_TRY_COMPILE([ #undef SYSV #define SYSV 1 /* get Xos.h to declare sys_errlist[] */ #ifdef HAVE_STDLIB_H #include /* look for wchar_t */ #endif #ifdef HAVE_X11_INTRINSIC_H #include /* Intrinsic.h has other traps... */ #endif #ifdef HAVE_TERMIOS_H /* needed for HPUX 10.20 */ #include #define STRUCT_TERMIOS struct termios #else #define STRUCT_TERMIOS struct termio #endif #include #include /* eliminate most BSD hacks */ #include /* declare sys_errlist on older systems */ #include /* eliminate most of the remaining ones */ ],[ static STRUCT_TERMIOS d_tio; d_tio.c_cc[VINTR] = 0; d_tio.c_cc[VQUIT] = 0; d_tio.c_cc[VERASE] = 0; d_tio.c_cc[VKILL] = 0; d_tio.c_cc[VEOF] = 0; d_tio.c_cc[VEOL] = 0; d_tio.c_cc[VMIN] = 0; d_tio.c_cc[VTIME] = 0; #if defined(HAVE_SYS_ERRLIST) && !defined(DECL_SYS_ERRLIST) sys_errlist[0] = ""; /* Cygwin mis-declares this */ #endif ], [cf_cv_sysv=yes], [cf_cv_sysv=no]) ]) test "$cf_cv_sysv" = yes && AC_DEFINE(SYSV,1,[Define to 1 if this is an SYSV system]) CF_RESTORE_XTRA_FLAGS([CF_SYSV]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYS_ERRLIST version: 6 updated: 2001/12/30 13:03:23 dnl -------------- dnl Check for declaration of sys_nerr and sys_errlist in one of stdio.h and dnl errno.h. Declaration of sys_errlist on BSD4.4 interferes with our dnl declaration. Reported by Keith Bostic. AC_DEFUN([CF_SYS_ERRLIST], [ CF_CHECK_ERRNO(sys_nerr) CF_CHECK_ERRNO(sys_errlist) ])dnl dnl --------------------------------------------------------------------------- dnl CF_SYS_TIME_SELECT version: 6 updated: 2015/04/18 08:56:57 dnl ------------------ dnl Check if we can include with ; this breaks on dnl older SCO configurations. AC_DEFUN([CF_SYS_TIME_SELECT], [ AC_MSG_CHECKING(if sys/time.h works with sys/select.h) AC_CACHE_VAL(cf_cv_sys_time_select,[ AC_TRY_COMPILE([ #include #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif ],[],[cf_cv_sys_time_select=yes], [cf_cv_sys_time_select=no]) ]) AC_MSG_RESULT($cf_cv_sys_time_select) test "$cf_cv_sys_time_select" = yes && AC_DEFINE(HAVE_SYS_TIME_SELECT,1,[Define to 1 if we can include with ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TRY_XOPEN_SOURCE version: 4 updated: 2022/09/10 15:16:16 dnl ------------------- dnl If _XOPEN_SOURCE is not defined in the compile environment, check if we dnl can define it successfully. AC_DEFUN([CF_TRY_XOPEN_SOURCE],[ AC_CACHE_CHECK(if we should define _XOPEN_SOURCE,cf_cv_xopen_source,[ AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, [cf_cv_xopen_source=no], [cf_save="$CPPFLAGS" CF_APPEND_TEXT(CPPFLAGS,-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE) AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY, [cf_cv_xopen_source=no], [cf_cv_xopen_source=$cf_XOPEN_SOURCE]) CPPFLAGS="$cf_save" ]) ]) if test "$cf_cv_xopen_source" != no ; then CF_REMOVE_DEFINE(CFLAGS,$CFLAGS,_XOPEN_SOURCE) CF_REMOVE_DEFINE(CPPFLAGS,$CPPFLAGS,_XOPEN_SOURCE) cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" CF_APPEND_CFLAGS($cf_temp_xopen_source) fi ]) dnl --------------------------------------------------------------------------- dnl CF_UPPER version: 5 updated: 2001/01/29 23:40:59 dnl -------- dnl Make an uppercase version of a variable dnl $1=uppercase($2) AC_DEFUN([CF_UPPER], [ $1=`echo "$2" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` ])dnl dnl --------------------------------------------------------------------------- dnl CF_VERBOSE version: 3 updated: 2007/07/29 09:55:12 dnl ---------- dnl Use AC_VERBOSE w/o the warnings AC_DEFUN([CF_VERBOSE], [test -n "$verbose" && echo " $1" 1>&AC_FD_MSG CF_MSG_LOG([$1]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITHOUT_X version: 3 updated: 2021/01/13 16:51:52 dnl ------------ dnl Use this to cancel the check for X headers/libraries which would be pulled dnl in via CF_GCC_WARNINGS. define([CF_WITHOUT_X], AC_DEFUN([AC_PATH_XTRA],[]) AC_DEFUN([CF_SAVE_XTRA_FLAGS],[]) AC_DEFUN([CF_RESTORE_XTRA_FLAGS],[]) AC_DEFUN([CF_CONST_X_STRING],[echo "skipping X-const check";])dnl AC_SUBST(X_CFLAGS) AC_SUBST(X_LIBS) [])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DBMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl ---------------- dnl Configure-option for dbmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DBMALLOC],[ CF_NO_LEAKS_OPTION(dbmalloc, [ --with-dbmalloc test: use Conor Cahill's dbmalloc library], [USE_DBMALLOC]) if test "$with_dbmalloc" = yes ; then AC_CHECK_HEADER(dbmalloc.h, [AC_CHECK_LIB(dbmalloc,[debug_malloc]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_DMALLOC version: 7 updated: 2010/06/21 17:26:47 dnl --------------- dnl Configure-option for dmalloc. The optional parameter is used to override dnl the updating of $LIBS, e.g., to avoid conflict with subsequent tests. AC_DEFUN([CF_WITH_DMALLOC],[ CF_NO_LEAKS_OPTION(dmalloc, [ --with-dmalloc test: use Gray Watson's dmalloc library], [USE_DMALLOC]) if test "$with_dmalloc" = yes ; then AC_CHECK_HEADER(dmalloc.h, [AC_CHECK_LIB(dmalloc,[dmalloc_debug]ifelse([$1],,[],[,$1]))]) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_ENCODINGS_DIR version: 7 updated: 2023/11/22 19:48:06 dnl --------------------- dnl Configure option to specify the location of encodings.dir, for programs dnl that must read it directly. AC_DEFUN([CF_WITH_ENCODINGS_DIR], [ AC_MSG_CHECKING(for location of encodings.dir file) AC_ARG_WITH(encodings-dir, [[ --with-encodings-dir[=XXX] file used for encodings directory (default: auto)]], [ENCODINGS_DIR_FILE=$withval], [ENCODINGS_DIR_FILE=auto]) CF_VERBOSE() case "x$ENCODINGS_DIR_FILE" in (xauto|xyes|xno) ENCODINGS_DIR_FILE=unknown for cf_leaf in lib share do for cf_path in \ /usr/X11R7/$cf_leaf/X11/fonts \ /usr/X11R6/$cf_leaf/X11/fonts \ /usr/local/$cf_leaf/X11/fonts \ /opt/local/$cf_leaf/fonts/X11 \ /opt/X11/$cf_leaf/X11/fonts \ /usr/$cf_leaf/fonts/X11 \ /usr/$cf_leaf/X11/fonts do test -d "$cf_path" || continue cf_encodings_dir=$cf_path/encodings/encodings.dir CF_VERBOSE(...testing $cf_encodings_dir) if test -f $cf_encodings_dir ; then ENCODINGS_DIR_FILE=$cf_encodings_dir break fi done done ;; (*) if test ! -f "$ENCODINGS_DIR_FILE" ; then AC_MSG_WARN(Encodings file not found: $ENCODINGS_DIR_FILE) ENCODINGS_DIR_FILE=/usr/share/fonts/X11 fi ;; esac AC_MSG_RESULT($ENCODINGS_DIR_FILE) test $ENCODINGS_DIR_FILE = unknown && ENCODINGS_DIR_FILE= AC_SUBST(ENCODINGS_DIR_FILE) AC_DEFINE_UNQUOTED(ENCODINGS_DIR_FILE, "$ENCODINGS_DIR_FILE", [Define to pathname of file used for encodings directory]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_LOCALE_ALIAS version: 10 updated: 2023/11/22 19:50:11 dnl -------------------- dnl Configure option to specify the location of locale.alias, for programs that dnl must read it directly. AC_DEFUN([CF_WITH_LOCALE_ALIAS], [ AC_MSG_CHECKING(for location of locale alias file) AC_ARG_WITH(locale-alias, [[ --with-locale-alias[=XXX] file used for locale aliases (default: auto)]], [LOCALE_ALIAS_FILE=$withval], [LOCALE_ALIAS_FILE=auto]) CF_VERBOSE() case "x$LOCALE_ALIAS_FILE" in (xauto|xyes|xno) LOCALE_ALIAS_FILE=unknown for cf_leaf in lib share do for cf_path in \ /usr/openwin/$cf_leaf/locale \ /usr/$cf_leaf/X11/locale \ /usr/X11R7/$cf_leaf/X11/locale \ /usr/X11R6/$cf_leaf/X11/locale \ /opt/local/$cf_leaf/X11/locale \ /opt/X11/$cf_leaf/X11/locale \ /usr/X11/$cf_leaf/X11/locale do test -d $cf_path || continue cf_alias_file=$cf_path/locale.alias CF_VERBOSE(testing $cf_alias_file) if test -f $cf_alias_file ; then LOCALE_ALIAS_FILE=$cf_alias_file break fi done test "$LOCALE_ALIAS_FILE" = unknown || break done ;; (*) if test ! -f "$LOCALE_ALIAS_FILE" ; then AC_MSG_WARN(Alias file not found: $LOCALE_ALIAS_FILE) fi ;; esac AC_MSG_RESULT($LOCALE_ALIAS_FILE) AC_SUBST(LOCALE_ALIAS_FILE) ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_MAN2HTML version: 14 updated: 2024/09/09 17:17:46 dnl ---------------- dnl Check for man2html and groff. Prefer man2html over groff, but use groff dnl as a fallback. See dnl dnl https://invisible-island.net/scripts/man2html.html dnl dnl Generate a shell script which hides the differences between the two. dnl dnl We name that "man2html.tmp". dnl dnl The shell script can be removed later, e.g., using "make distclean". AC_DEFUN([CF_WITH_MAN2HTML],[ AC_REQUIRE([CF_PROG_GROFF])dnl AC_REQUIRE([AC_PROG_FGREP])dnl case "x${with_man2html}" in (xno) cf_man2html=no ;; (x|xyes) AC_PATH_PROG(cf_man2html,man2html,no) case "x$cf_man2html" in (x/*) AC_MSG_CHECKING(for the modified Earl Hood script) if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) then cf_man2html_ok=yes else cf_man2html=no cf_man2html_ok=no fi AC_MSG_RESULT($cf_man2html_ok) ;; (*) cf_man2html=no ;; esac esac AC_MSG_CHECKING(for program to convert manpage to html) AC_ARG_WITH(man2html, [[ --with-man2html[=XXX] use XXX rather than groff]], [cf_man2html=$withval], [cf_man2html=$cf_man2html]) cf_with_groff=no case $cf_man2html in (yes) AC_MSG_RESULT(man2html) AC_PATH_PROG(cf_man2html,man2html,no) ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH AC_MSG_RESULT($cf_man2html) ;; (*) AC_MSG_RESULT($cf_man2html) ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <conftest.in <conftest.out cf_man2html_1st="`${FGREP-fgrep} -n MARKER conftest.out |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`" cf_man2html_top=`expr "$cf_man2html_1st" - 2` cf_man2html_bot="`wc -l conftest.out |sed -e 's/[[^0-9]]//g'`" cf_man2html_bot=`expr "$cf_man2html_bot" - 2 - "$cf_man2html_top"` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" AC_MSG_RESULT($cf_man2html_top_bot) AC_MSG_CHECKING(for pagesize to use) for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do cat >>conftest.in <conftest.out cf_man2html_page="`${FGREP-fgrep} -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[[^0-9]]*://' -e 's/:.*//'`" test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* AC_MSG_RESULT($cf_man2html_page) cat >>$MAN2HTML_TEMP < ],[ gzopen("name","mode") ],z,,,zlib) AC_CHECK_FUNCS( \ zError \ ) ])dnl dnl --------------------------------------------------------------------------- dnl CF_XOPEN_SOURCE version: 67 updated: 2023/09/06 18:55:27 dnl --------------- dnl Try to get _XOPEN_SOURCE defined properly that we can use POSIX functions, dnl or adapt to the vendor's definitions to get equivalent functionality, dnl without losing the common non-POSIX features. dnl dnl Parameters: dnl $1 is the nominal value for _XOPEN_SOURCE dnl $2 is the nominal value for _POSIX_C_SOURCE dnl dnl The default case prefers _XOPEN_SOURCE over _POSIX_C_SOURCE if the dnl implementation predefines it, because X/Open and most implementations agree dnl that the latter is a legacy or "aligned" value. dnl dnl Because _XOPEN_SOURCE is preferred, if defining _POSIX_C_SOURCE turns dnl that off, then refrain from setting _POSIX_C_SOURCE explicitly. dnl dnl References: dnl https://pubs.opengroup.org/onlinepubs/007904975/functions/xsh_chap02_02.html dnl https://docs.oracle.com/cd/E19253-01/816-5175/standards-5/index.html dnl https://www.gnu.org/software/libc/manual/html_node/Feature-Test-Macros.html AC_DEFUN([CF_XOPEN_SOURCE],[ AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([CF_POSIX_VISIBLE]) if test "$cf_cv_posix_visible" = no; then cf_XOPEN_SOURCE=ifelse([$1],,500,[$1]) cf_POSIX_C_SOURCE=ifelse([$2],,199506L,[$2]) cf_xopen_source= case "$host_os" in (aix[[4-7]]*) cf_xopen_source="-D_ALL_SOURCE" ;; (darwin[[0-8]].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; (darwin*) cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; (freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; (hpux11*) cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; (hpux*) cf_xopen_source="-D_HPUX_SOURCE" ;; (irix[[56]].*) cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc) CF_GNU_SOURCE($cf_XOPEN_SOURCE) ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; (mirbsd*) # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[[6-9]]*) # OpenBSD 6.x has broken locale support, both compile-time and runtime. # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html # Abusing the conformance level is a workaround. AC_MSG_WARN(this system does not provide usable locale support) cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=700 ;; (openbsd[[4-5]]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[[45]]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) CF_TRY_XOPEN_SOURCE cf_save_xopen_cppflags="$CPPFLAGS" CF_POSIX_C_SOURCE($cf_POSIX_C_SOURCE) # Some of these niche implementations use copy/paste, double-check... if test "$cf_cv_xopen_source" = no ; then CF_VERBOSE(checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE) AC_TRY_COMPILE(CF__XOPEN_SOURCE_HEAD,CF__XOPEN_SOURCE_BODY,,[ AC_MSG_WARN(_POSIX_C_SOURCE definition is not usable) CPPFLAGS="$cf_save_xopen_cppflags"]) fi ;; esac if test -n "$cf_xopen_source" ; then CF_APPEND_CFLAGS($cf_xopen_source,true) fi dnl In anything but the default case, we may have system-specific setting dnl which is still not guaranteed to provide all of the entrypoints that dnl _XOPEN_SOURCE would yield. if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then AC_MSG_CHECKING(if _XOPEN_SOURCE really is set) AC_TRY_COMPILE([#include ],[ #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif], [cf_XOPEN_SOURCE_set=yes], [cf_XOPEN_SOURCE_set=no]) AC_MSG_RESULT($cf_XOPEN_SOURCE_set) if test "$cf_XOPEN_SOURCE_set" = yes then AC_TRY_COMPILE([#include ],[ #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE #endif], [cf_XOPEN_SOURCE_set_ok=yes], [cf_XOPEN_SOURCE_set_ok=no]) if test "$cf_XOPEN_SOURCE_set_ok" = no then AC_MSG_WARN(_XOPEN_SOURCE is lower than requested) fi else CF_TRY_XOPEN_SOURCE fi fi fi # cf_cv_posix_visible ]) dnl --------------------------------------------------------------------------- dnl CF_X_FONTENC version: 7 updated: 2011/10/28 18:48:08 dnl ------------ dnl dnl First check for the appropriate config program, since the developers for dnl these libraries change their configuration (and config program) more or dnl less randomly. If we cannot find the config program, do not bother trying dnl to guess the latest variation of include/lib directories. dnl dnl If the package-config program is not found, rely on the configure script's dnl options to provide the cflags/libs options: dnl --with-fontenc-cflags dnl --with-fontenc-libs AC_DEFUN([CF_X_FONTENC], [ AC_REQUIRE([CF_WITH_ZLIB]) AC_REQUIRE([CF_PKG_CONFIG]) cf_extra_fontenc_incs= cf_extra_fontenc_libs="-lfontenc -lX11" FONTENC_CONFIG= FONTENC_PARAMS= if test "$PKG_CONFIG" != none; then if "$PKG_CONFIG" --exists fontenc; then FONTENC_CONFIG=$PKG_CONFIG FONTENC_PARAMS="fontenc x11" cf_extra_fontenc_libs= fi fi AC_MSG_CHECKING(for optional font-encoding cflags) AC_ARG_WITH(fontenc-cflags, [ --with-fontenc-cflags -D/-I options for compiling with font encoding library], [cf_x_fontenc_incs="$withval"],[cf_x_fontenc_incs=auto]) test "$cf_x_fontenc_incs" = yes && cf_x_fontenc_incs=auto AC_MSG_RESULT($cf_x_fontenc_incs) AC_MSG_CHECKING(for optional font-encoding libraries) AC_ARG_WITH(fontenc-libs, [ --with-fontenc-libs -L/-l options to link font encoding library], [cf_x_fontenc_libs="$withval"],[cf_x_fontenc_libs=auto]) test "$cf_x_fontenc_libs" = yes && cf_x_fontenc_libs=auto AC_MSG_RESULT($cf_x_fontenc_libs) if test "$cf_x_fontenc_incs" = auto ; then AC_CACHE_CHECK(for X font-encoding headers,cf_cv_x_fontenc_incs,[ if test -n "$FONTENC_CONFIG" ; then cf_cv_x_fontenc_incs="`$FONTENC_CONFIG $FONTENC_PARAMS --cflags 2>/dev/null`" else cf_cv_x_fontenc_incs=$cf_extra_fontenc_incs fi ]) else cf_cv_x_fontenc_incs=$cf_x_fontenc_incs fi if test "$cf_x_fontenc_libs" = auto ; then AC_CACHE_CHECK(for X font-encoding libraries,cf_cv_x_fontenc_libs,[ if test -n "$FONTENC_CONFIG" ; then cf_cv_x_fontenc_libs="`$FONTENC_CONFIG $FONTENC_PARAMS --libs 2>/dev/null`" else cf_cv_x_fontenc_libs=$cf_extra_fontenc_libs fi ]) else cf_cv_x_fontenc_libs=$cf_x_fontenc_libs fi cf_save_LIBS="$LIBS" cf_save_INCS="$CPPFLAGS" LIBS="$cf_cv_x_fontenc_libs $LIBS $X_LIBS" CPPFLAGS="$CPPFLAGS $X_CFLAGS $cf_cv_x_fontenc_incs" AC_MSG_CHECKING(if we can link with font encoding library) AC_TRY_LINK([ $ac_includes_default #include #include ],[ FontMapPtr mapping = FontEncMapFind(0, FONT_ENCODING_UNICODE, -1, -1, NULL); ],[cf_have_fontenc_libs=yes],[cf_have_fontenc_libs=no]) AC_MSG_RESULT($cf_have_fontenc_libs) LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_INCS" if test $cf_have_fontenc_libs = yes ; then LIBS="$cf_cv_x_fontenc_libs $LIBS $X_LIBS" CF_ADD_CFLAGS($cf_cv_x_fontenc_incs) else AC_MSG_WARN(No libraries found for font-encoding) fi ]) dnl --------------------------------------------------------------------------- dnl CF__GRANTPT_BODY version: 6 updated: 2021/06/07 17:39:17 dnl ---------------- dnl Body for workability check of grantpt. define([CF__GRANTPT_BODY],[ int code = 0; int pty; int tty; char *slave; struct termios tio; (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); else if (grantpt(pty) < 0) failed(2); else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); #if (CONFTEST == 3) || defined(CONFTEST_isatty) else if (!isatty(pty)) failed(4); #endif #if CONFTEST >= 4 else if (tcgetattr(pty, &tio) < 0) failed(20); else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. * Linux does treat it that way. */ else if ((tty = open(slave, O_RDWR)) < 0) failed(5); #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 else if (tcgetattr(tty, &tio) < 0) failed(30); else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ (void) tty; ${cf_cv_main_return:-return}(code); ]) dnl --------------------------------------------------------------------------- dnl CF__GRANTPT_HEAD version: 4 updated: 2020/03/10 18:53:47 dnl ---------------- dnl Headers for workability check of grantpt. define([CF__GRANTPT_HEAD],[ #include #include #include #include #include #include #include #ifndef HAVE_POSIX_OPENPT #undef posix_openpt #define posix_openpt(mode) open("/dev/ptmx", mode) #endif #ifdef HAVE_STROPTS_H #include #endif static void failed(int code) { perror("conftest"); exit(code); } static void my_timeout(int sig) { (void)sig; exit(99); } ]) dnl --------------------------------------------------------------------------- dnl CF__ICONV_BODY version: 2 updated: 2007/07/26 17:35:47 dnl -------------- dnl Test-code needed for iconv compile-checks define([CF__ICONV_BODY],[ iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd);] )dnl dnl --------------------------------------------------------------------------- dnl CF__ICONV_HEAD version: 1 updated: 2007/07/26 15:57:03 dnl -------------- dnl Header-files needed for iconv compile-checks define([CF__ICONV_HEAD],[ #include #include ] )dnl dnl --------------------------------------------------------------------------- dnl CF__XOPEN_SOURCE_BODY version: 2 updated: 2023/02/18 17:41:25 dnl --------------------- dnl body of test when test-compiling for _XOPEN_SOURCE check define([CF__XOPEN_SOURCE_BODY], [ #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ]) dnl --------------------------------------------------------------------------- dnl CF__XOPEN_SOURCE_HEAD version: 2 updated: 2023/02/18 17:41:25 dnl --------------------- dnl headers to include when test-compiling for _XOPEN_SOURCE check define([CF__XOPEN_SOURCE_HEAD], [ $ac_includes_default ]) luit-20240910/configure0000755000000000000000000121226514670152003013346 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20240618. # # Copyright 2003-2022,2023 Thomas E. Dickey # Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 # Free Software Foundation, Inc. # This configure script is free software; the Free Software Foundation # gives unlimited permission to copy, distribute and modify it. # 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 # Sed expression to map a string onto a valid variable name. as_tr_sh="sed y%*+%pp%;s%[^_$as_cr_alnum]%_%g" # 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" # 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 # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` 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" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset="unset" else as_unset="false" fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # 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=:; 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. # 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}" ac_unique_file="luit.c" # Factoring default headers for most tests. ac_includes_default="\ #include #if HAVE_SYS_TYPES_H # include #endif #if HAVE_SYS_STAT_H # include #endif #if STDC_HEADERS # include # include #else # if HAVE_STDLIB_H # include # endif #endif #if HAVE_STRING_H # if !STDC_HEADERS && HAVE_MEMORY_H # include # endif # include #endif #if HAVE_STRINGS_H # include #endif #if HAVE_INTTYPES_H # include #else # if HAVE_STDINT_H # include # endif #endif #if HAVE_UNISTD_H # include #endif" # Initialize some variables set by options. ac_init_help= ac_init_version=false # The variables have the same names as the options, with # dashes changed to underlines. cache_file=/dev/null exec_prefix=NONE no_create= no_recursion= prefix=NONE program_prefix=NONE program_suffix=NONE program_transform_name=s,x,x, silent= site= srcdir= verbose= x_includes=NONE x_libraries=NONE # Installation directory options. # These are left unexpanded so users can "make install exec_prefix=/foo" # and all the variables that are supposed to be based on exec_prefix # by default will actually change. # Use braces instead of parens because sh, perl, etc. also accept them. bindir='${exec_prefix}/bin' sbindir='${exec_prefix}/sbin' libexecdir='${exec_prefix}/libexec' datarootdir='${prefix}/share' datadir='${datarootdir}' sysconfdir='${prefix}/etc' sharedstatedir='${prefix}/com' localstatedir='${prefix}/var' runstatedir='${localstatedir}/run' libdir='${exec_prefix}/lib' includedir='${prefix}/include' oldincludedir='/usr/include' infodir='${datarootdir}/info' mandir='${datarootdir}/man' # Identity of this package. PACKAGE_NAME= PACKAGE_TARNAME= PACKAGE_VERSION= PACKAGE_STRING= PACKAGE_BUGREPORT= 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" ac_prev= continue fi ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` # Accept the important Cygnus configure options, so we can diagnose typos. case "$ac_option" in -bindir | --bindir | --bindi | --bind | --bin | --bi) ac_prev=bindir ;; -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) bindir=$ac_optarg ;; -build | --build | --buil | --bui | --bu) ac_prev=build_alias ;; -build=* | --build=* | --buil=* | --bui=* | --bu=*) build_alias=$ac_optarg ;; -cache-file | --cache-file | --cache-fil | --cache-fi \ | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) ac_prev=cache_file ;; -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) cache_file=$ac_optarg ;; --config-cache | -C) cache_file=config.cache ;; -datadir | --datadir | --datadi | --datad | --data | --dat | --da) ac_prev=datadir ;; -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ | --da=*) datadir=$ac_optarg ;; -datarootdir | --datarootdir | --datarootdi | --datarootd | --dataroot \ | --dataroo | --dataro | --datar) ac_prev=datarootdir ;; -datarootdir=* | --datarootdir=* | --datarootdi=* | --datarootd=* \ | --dataroot=* | --dataroo=* | --dataro=* | --datar=*) datarootdir=$ac_optarg ;; -disable-* | --disable-*) ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo "$ac_feature" | sed 's/-/_/g'` eval "enable_$ac_feature=no" ;; -enable-* | --enable-*) ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid feature name: $ac_feature" >&2 { (exit 1); exit 1; }; } ac_feature=`echo "$ac_feature" | sed 's/-/_/g'` case "$ac_option" in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "enable_$ac_feature='$ac_optarg'" ;; -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ | --exec | --exe | --ex) ac_prev=exec_prefix ;; -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ | --exec=* | --exe=* | --ex=*) exec_prefix=$ac_optarg ;; -gas | --gas | --ga | --g) # Obsolete; use --with-gas. with_gas=yes ;; -help | --help | --hel | --he | -h) ac_init_help=long ;; -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) ac_init_help=recursive ;; -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) ac_init_help=short ;; -host | --host | --hos | --ho) ac_prev=host_alias ;; -host=* | --host=* | --hos=* | --ho=*) host_alias=$ac_optarg ;; -includedir | --includedir | --includedi | --included | --include \ | --includ | --inclu | --incl | --inc) ac_prev=includedir ;; -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ | --includ=* | --inclu=* | --incl=* | --inc=*) includedir=$ac_optarg ;; -infodir | --infodir | --infodi | --infod | --info | --inf) ac_prev=infodir ;; -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) infodir=$ac_optarg ;; -libdir | --libdir | --libdi | --libd) ac_prev=libdir ;; -libdir=* | --libdir=* | --libdi=* | --libd=*) libdir=$ac_optarg ;; -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ | --libexe | --libex | --libe) ac_prev=libexecdir ;; -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ | --libexe=* | --libex=* | --libe=*) libexecdir=$ac_optarg ;; -localstatedir | --localstatedir | --localstatedi | --localstated \ | --localstate | --localstat | --localsta | --localst \ | --locals | --local | --loca | --loc | --lo) ac_prev=localstatedir ;; -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ | --localstate=* | --localstat=* | --localsta=* | --localst=* \ | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) localstatedir=$ac_optarg ;; -runstatedir | --runstatedir | --runstatedi | --runstated \ | --runstate | --runstat | --runsta | --runst \ | --runs | --run | --ru) ac_prev=runstatedir ;; -runstatedir=* | --runstatedir=* | --runstatedi=* | --runstated=* \ | --runstate=* | --runstat=* | --runsta=* | --runst=* \ | --runs=* | --run=* | --ru=*) runstatedir=$ac_optarg ;; -mandir | --mandir | --mandi | --mand | --man | --ma | --m) ac_prev=mandir ;; -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) mandir=$ac_optarg ;; -nfp | --nfp | --nf) # Obsolete; use --without-fp. with_fp=no ;; -no-create | --no-create | --no-creat | --no-crea | --no-cre \ | --no-cr | --no-c) no_create=yes ;; -no-recursion | --no-recursion | --no-recursio | --no-recursi \ | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) no_recursion=yes ;; -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ | --oldin | --oldi | --old | --ol | --o) ac_prev=oldincludedir ;; -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) oldincludedir=$ac_optarg ;; -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) ac_prev=prefix ;; -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) prefix=$ac_optarg ;; -program-prefix | --program-prefix | --program-prefi | --program-pref \ | --program-pre | --program-pr | --program-p) ac_prev=program_prefix ;; -program-prefix=* | --program-prefix=* | --program-prefi=* \ | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) program_prefix=$ac_optarg ;; -program-suffix | --program-suffix | --program-suffi | --program-suff \ | --program-suf | --program-su | --program-s) ac_prev=program_suffix ;; -program-suffix=* | --program-suffix=* | --program-suffi=* \ | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) program_suffix=$ac_optarg ;; -program-transform-name | --program-transform-name \ | --program-transform-nam | --program-transform-na \ | --program-transform-n | --program-transform- \ | --program-transform | --program-transfor \ | --program-transfo | --program-transf \ | --program-trans | --program-tran \ | --progr-tra | --program-tr | --program-t) ac_prev=program_transform_name ;; -program-transform-name=* | --program-transform-name=* \ | --program-transform-nam=* | --program-transform-na=* \ | --program-transform-n=* | --program-transform-=* \ | --program-transform=* | --program-transfor=* \ | --program-transfo=* | --program-transf=* \ | --program-trans=* | --program-tran=* \ | --progr-tra=* | --program-tr=* | --program-t=*) program_transform_name=$ac_optarg ;; -q | -quiet | --quiet | --quie | --qui | --qu | --q \ | -silent | --silent | --silen | --sile | --sil) silent=yes ;; -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) ac_prev=sbindir ;; -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ | --sbi=* | --sb=*) sbindir=$ac_optarg ;; -sharedstatedir | --sharedstatedir | --sharedstatedi \ | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ | --sharedst | --shareds | --shared | --share | --shar \ | --sha | --sh) ac_prev=sharedstatedir ;; -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ | --sha=* | --sh=*) sharedstatedir=$ac_optarg ;; -site | --site | --sit) ac_prev=site ;; -site=* | --site=* | --sit=*) site=$ac_optarg ;; -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) ac_prev=srcdir ;; -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) srcdir=$ac_optarg ;; -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ | --syscon | --sysco | --sysc | --sys | --sy) ac_prev=sysconfdir ;; -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) sysconfdir=$ac_optarg ;; -target | --target | --targe | --targ | --tar | --ta | --t) ac_prev=target_alias ;; -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) target_alias=$ac_optarg ;; -v | -verbose | --verbose | --verbos | --verbo | --verb) verbose=yes ;; -version | --version | --versio | --versi | --vers | -V) ac_init_version=: ;; -with-* | --with-*) ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo "$ac_package" | sed 's/-/_/g'` case "$ac_option" in *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; *) ac_optarg=yes ;; esac eval "with_$ac_package='$ac_optarg'" ;; -without-* | --without-*) ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` # Reject names that are not valid shell variable names. expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid package name: $ac_package" >&2 { (exit 1); exit 1; }; } ac_package=`echo "$ac_package" | sed 's/-/_/g'` eval "with_$ac_package=no" ;; --x) # Obsolete; use --with-x. with_x=yes ;; -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ | --x-incl | --x-inc | --x-in | --x-i) ac_prev=x_includes ;; -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) x_includes=$ac_optarg ;; -x-libraries | --x-libraries | --x-librarie | --x-librari \ | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) ac_prev=x_libraries ;; -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) x_libraries=$ac_optarg ;; -*dir | -dvi* | -doc* | -html* | -local* | -pdf* | -ps* ) echo "$as_me: WARNING: unsupported option: $ac_option" >&2 ;; -*) { echo "$as_me: error: unrecognized option: $ac_option Try \`$0 --help' for more information." >&2 { (exit 1); exit 1; }; } ;; *=*) ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` # Reject names that are not valid shell variable names. expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 { (exit 1); exit 1; }; } 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}" ;; esac done if test -n "$ac_prev"; then ac_option=--`echo "$ac_prev" | sed 's/_/-/g'` { echo "$as_me: error: missing argument to $ac_option" >&2 { (exit 1); exit 1; }; } fi # Be sure to have absolute 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 path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # Be sure to have absolute paths. for ac_var in bindir sbindir libexecdir datarootdir datadir sysconfdir sharedstatedir \ localstatedir libdir includedir oldincludedir infodir mandir do eval ac_val=$`echo "$ac_var"` case "$ac_val" in [\\/$]* | ?:[\\/]* ) ;; *) { echo "$as_me: error: expected an absolute path for --$ac_var: $ac_val" >&2 { (exit 1); exit 1; }; };; esac done # There might be people who depend on the old broken behavior: `$host' # used to hold the argument of --host etc. build=$build_alias host=$host_alias target=$target_alias # FIXME: should be removed in autoconf 3.0. if test "x$host_alias" != x; then if test "x$build_alias" = x; then cross_compiling=maybe echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. If a cross compiler is detected then cross compile mode will be used." >&2 elif test "x$build_alias" != "x$host_alias"; then cross_compiling=yes fi fi ac_tool_prefix= test -n "$host_alias" && ac_tool_prefix=$host_alias- test "$silent" = yes && exec 6>/dev/null # 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_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=.. fi else ac_srcdir_defaulted=no fi if test ! -r "$srcdir/$ac_unique_file"; then if test "$ac_srcdir_defaulted" = yes; then { echo "$as_me: error: cannot find sources in $ac_confdir or .." >&2 { (exit 1); exit 1; }; } else { echo "$as_me: error: cannot find sources in $srcdir" >&2 { (exit 1); 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 < if you have libraries in a nonstandard directory CPPFLAGS C/C++ preprocessor flags, e.g. -I if you have headers in a nonstandard directory 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. EOF fi if test "$ac_init_help" = "recursive"; then # If there are subdirs, report their specific --help. ac_popdir=`pwd` for ac_subdir in : $ac_subdirs_all; do test "x$ac_subdir" = x: && continue cd "$ac_subdir" # A "../" for each directory in /$ac_subdir. ac_dots=`echo "$ac_subdir" | sed 's,^\./,,;s,[^/]$,&/,;s,[^/]*/,../,g'` case "$srcdir" in .) # No --srcdir option. We are building in place. ac_sub_srcdir="$srcdir" ;; [\\/]* | ?:[\\/]* ) # Absolute path. ac_sub_srcdir="$srcdir/$ac_subdir" ;; *) # Relative path. ac_sub_srcdir="$ac_dots$srcdir/$ac_subdir" ;; esac # Check for guested configure; otherwise get Cygnus style configure. if test -f "$ac_sub_srcdir/configure.gnu"; then echo $SHELL "$ac_sub_srcdir/configure.gnu" --help=recursive elif test -f "$ac_sub_srcdir/configure"; then echo $SHELL "$ac_sub_srcdir/configure" --help=recursive elif test -f "$ac_sub_srcdir/configure.ac" || test -f "$ac_sub_srcdir/configure.in"; then echo "$ac_configure" --help else echo "$as_me: WARNING: no configuration information is in $ac_subdir" >&2 fi cd "$ac_popdir" done fi test -n "$ac_init_help" && exit 0 if "$ac_init_version"; then cat <<\EOF Copyright 2003-2022,2023 Thomas E. Dickey Copyright 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. This configure script is free software; the Free Software Foundation gives unlimited permission to copy, distribute and modify it. EOF exit 0 fi exec 5>config.log cat >&5 </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` PATH = $PATH _ASUNAME } >&5 cat >&5 <\?\"\']*) ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" ac_sep=" " ;; *) 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. trap 'exit_status=$? # Save into config.log some information that might help in debugging. echo >&5 echo "## ----------------- ##" >&5 echo "## Cache variables. ##" >&5 echo "## ----------------- ##" >&5 echo >&5 # 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; } >&5 sed "/^$/d" confdefs.h >conftest.log if test -s conftest.log; then echo >&5 echo "## ------------ ##" >&5 echo "## confdefs.h. ##" >&5 echo "## ------------ ##" >&5 echo >&5 cat conftest.log >&5 fi (echo; echo) >&5 test "$ac_signal" != 0 && echo "$as_me: caught signal $ac_signal" >&5 echo "$as_me: exit $exit_status" >&5 rm -rf conftest* confdefs* core core.* *.core 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 # 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 CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" else CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" fi fi for ac_site_file in $CONFIG_SITE; do if test -r "$ac_site_file"; then { echo "$as_me:921: loading site script $ac_site_file" >&5 echo "$as_me: loading site script $ac_site_file" >&6;} cat "$ac_site_file" >&5 . "$ac_site_file" 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:932: loading cache $cache_file" >&5 echo "$as_me: loading cache $cache_file" >&6;} case $cache_file in [\\/]* | ?:[\\/]* ) . $cache_file;; *) . ./$cache_file;; esac fi else { echo "$as_me:940: 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:956: 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:960: 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:966: 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:968: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:970: 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. It doesn't matter if # we pass some twice (in addition to the command line arguments). if test "$ac_new_set" = set; then case "$ac_new_val" in *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ac_configure_args="$ac_configure_args '$ac_arg'" ;; *) ac_configure_args="$ac_configure_args $ac_var=$ac_new_val" ;; esac fi done if "$ac_cache_corrupted"; then { echo "$as_me:989: 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:991: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} { (exit 1); exit 1; }; } fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu ac_main_return="return" case `echo "testing\c" 2>/dev/null; echo 1,2,3`,`echo -n testing 2>/dev/null; echo 1,2,3` in *c*,-n*) ECHO_N= ECHO_C= # newlines do not sed ;-) only broken shells would use this case anyway ECHO_T=' ' ;; *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; *) ECHO_N= ECHO_C='\c' ECHO_T= ;; esac echo "#! $SHELL" >conftest.sh echo "exit 0" >>conftest.sh chmod +x conftest.sh if { (echo "$as_me:1020: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:1023: \$? = $ac_status" >&5 (exit "$ac_status"); }; then ac_path_separator=';' else ac_path_separator=: fi PATH_SEPARATOR="$ac_path_separator" rm -f conftest.sh ac_config_headers="$ac_config_headers config.h:config_h.in" ac_aux_dir= for ac_dir in $srcdir $srcdir/.. $srcdir/../..; do if test -f "$ac_dir/install-sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install-sh -c" break elif test -f "$ac_dir/install.sh"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/install.sh -c" break elif test -f "$ac_dir/shtool"; then ac_aux_dir=$ac_dir ac_install_sh="$ac_aux_dir/shtool install -c" break fi done if test -z "$ac_aux_dir"; then { { echo "$as_me:1051: 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. # Make sure we can run config.sub. $ac_config_sub sun4 >/dev/null 2>&1 || { { echo "$as_me:1061: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:1065: checking build system type" >&5 echo $ECHO_N "checking build system type... $ECHO_C" >&6 if test "${ac_cv_build+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_build_alias=$build_alias test -z "$ac_cv_build_alias" && ac_cv_build_alias=`$ac_config_guess` test -z "$ac_cv_build_alias" && { { echo "$as_me:1074: error: cannot guess build type; you must specify one" >&5 echo "$as_me: error: cannot guess build type; you must specify one" >&2;} { (exit 1); exit 1; }; } ac_cv_build=`$ac_config_sub "$ac_cv_build_alias"` || { { echo "$as_me:1078: error: $ac_config_sub $ac_cv_build_alias failed." >&5 echo "$as_me: error: $ac_config_sub $ac_cv_build_alias failed." >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1083: result: $ac_cv_build" >&5 echo "${ECHO_T}$ac_cv_build" >&6 build=$ac_cv_build build_cpu=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` build_vendor=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` build_os=`echo "$ac_cv_build" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then echo "$as_me:1091: checking host system type" >&5 echo $ECHO_N "checking host system type... $ECHO_C" >&6 if test "${ac_cv_host+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_host_alias=$host_alias test -z "$ac_cv_host_alias" && ac_cv_host_alias=$ac_cv_build_alias ac_cv_host=`$ac_config_sub "$ac_cv_host_alias"` || { { echo "$as_me:1100: error: $ac_config_sub $ac_cv_host_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_host_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1105: result: $ac_cv_host" >&5 echo "${ECHO_T}$ac_cv_host" >&6 host=$ac_cv_host host_cpu=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` host_vendor=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` host_os=`echo "$ac_cv_host" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && cat >>confdefs.h <&6 else cf_cv_system_name="$system_name" fi test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && echo "$as_me:1131: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$as_me:1135: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 { { echo "$as_me:1137: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi if test -f "$srcdir/config.guess" || test -f "$ac_aux_dir/config.guess" ; then echo "$as_me:1143: checking target system type" >&5 echo $ECHO_N "checking target system type... $ECHO_C" >&6 if test "${ac_cv_target+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_target_alias=$target_alias test "x$ac_cv_target_alias" = "x" && ac_cv_target_alias=$ac_cv_host_alias ac_cv_target=`$ac_config_sub "$ac_cv_target_alias"` || { { echo "$as_me:1152: error: $ac_config_sub $ac_cv_target_alias failed" >&5 echo "$as_me: error: $ac_config_sub $ac_cv_target_alias failed" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:1157: result: $ac_cv_target" >&5 echo "${ECHO_T}$ac_cv_target" >&6 target=$ac_cv_target target_cpu=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\1/'` target_vendor=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\2/'` target_os=`echo "$ac_cv_target" | sed 's/^\([^-]*\)-\([^-]*\)-\(.*\)$/\3/'` # The aliases save the names the user supplied, while $host etc. # will get canonicalized. test -n "$target_alias" && test "$program_prefix$program_suffix$program_transform_name" = \ NONENONEs,x,x, && program_prefix=${target_alias}- system_name="$host_os" else system_name="`(uname -s -r) 2>/dev/null`" if test -z "$system_name" ; then system_name="`(hostname) 2>/dev/null`" fi fi test -n "$system_name" && cat >>confdefs.h <&6 else cf_cv_system_name="$system_name" fi test -z "$system_name" && system_name="$cf_cv_system_name" test -n "$cf_cv_system_name" && echo "$as_me:1189: result: Configuring for $cf_cv_system_name" >&5 echo "${ECHO_T}Configuring for $cf_cv_system_name" >&6 if test ".$system_name" != ".$cf_cv_system_name" ; then echo "$as_me:1193: result: Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&5 echo "${ECHO_T}Cached system name ($system_name) does not agree with actual ($cf_cv_system_name)" >&6 { { echo "$as_me:1195: error: \"Please remove config.cache and try again.\"" >&5 echo "$as_me: error: \"Please remove config.cache and try again.\"" >&2;} { (exit 1); exit 1; }; } fi # Check whether --with-system-type or --without-system-type was given. if test "${with_system_type+set}" = set; then withval="$with_system_type" { echo "$as_me:1203: WARNING: overriding system type to $withval" >&5 echo "$as_me: WARNING: overriding system type to $withval" >&2;} cf_cv_system_name=$withval host_os=$withval fi; case "$cf_cv_system_name" in (cygwin*|msys*|mingw32*|mingw64|os2*) GLOB_FULLPATH_POSIX='/*' GLOB_FULLPATH_OTHER='[a-zA-Z]:[\\/]*' ;; (*) GLOB_FULLPATH_POSIX='/*' GLOB_FULLPATH_OTHER=$GLOB_FULLPATH_POSIX ;; esac test "$program_prefix" != NONE && program_transform_name="s,^,$program_prefix,;$program_transform_name" # Use a double $ so make ignores it. test "$program_suffix" != NONE && program_transform_name="s,\$,$program_suffix,;$program_transform_name" # Double any \ or $. echo might interpret backslashes. # By default was `s,x,x', remove it if useless. cat <<\_ACEOF >conftest.sed s/[\\$]/&&/g;s/;s,x,x,$// _ACEOF program_transform_name=`echo $program_transform_name | sed -f conftest.sed` rm conftest.sed 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_main_return="return" if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. set dummy ${ac_tool_prefix}gcc; ac_word=$2 echo "$as_me:1243: 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_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}gcc" echo "$as_me:1258: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1266: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1269: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "gcc", so it can be a program name with args. set dummy gcc; ac_word=$2 echo "$as_me:1278: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="gcc" echo "$as_me:1293: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1301: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1304: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. set dummy ${ac_tool_prefix}cc; ac_word=$2 echo "$as_me:1317: 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_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="${ac_tool_prefix}cc" echo "$as_me:1332: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1340: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1343: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_CC"; then ac_ct_CC=$CC # Extract the first word of "cc", so it can be a program name with args. set dummy cc; ac_word=$2 echo "$as_me:1352: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="cc" echo "$as_me:1367: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1375: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1378: result: no" >&5 echo "${ECHO_T}no" >&6 fi CC=$ac_ct_CC else CC="$ac_cv_prog_CC" 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:1391: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue if test "$ac_dir/$ac_word" = "/usr/ucb/cc"; then ac_prog_rejected=yes continue fi ac_cv_prog_CC="cc" echo "$as_me:1411: found $ac_dir/$ac_word" >&5 break done 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 "$ac_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:1433: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1436: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$CC"; then if test -n "$ac_tool_prefix"; then for ac_prog in cl 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:1447: 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_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CC="$ac_tool_prefix$ac_prog" echo "$as_me:1462: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1470: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1473: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CC" && break done fi if test -z "$CC"; then ac_ct_CC=$CC for ac_prog in cl 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:1486: 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 ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_CC="$ac_prog" echo "$as_me:1501: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_CC=$ac_cv_prog_ac_ct_CC if test -n "$ac_ct_CC"; then echo "$as_me:1509: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1512: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_CC" && break done CC=$ac_ct_CC fi fi test -z "$CC" && { { echo "$as_me:1524: error: no acceptable cc found in \$PATH" >&5 echo "$as_me: error: no acceptable cc found in \$PATH" >&2;} { (exit 1); exit 1; }; } # Provide some information about the compiler. echo "$as_me:1529:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo "$2"` { (eval echo "$as_me:1532: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1535: \$? = $ac_status" >&5 (exit "$ac_status"); } { (eval echo "$as_me:1537: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1540: \$? = $ac_status" >&5 (exit "$ac_status"); } { (eval echo "$as_me:1542: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1545: \$? = $ac_status" >&5 (exit "$ac_status"); } cat >"conftest.$ac_ext" <<_ACEOF #line 1549 "configure" #include "confdefs.h" int main (void) { ; 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:1565: 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:1568: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1571: \$? = $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. for ac_file in `ls a.exe conftest.exe 2>/dev/null; ls a.out conftest 2>/dev/null; ls a.* conftest.* 2>/dev/null`; do case $ac_file in *.$ac_ext | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; a.out ) # We found the default executable, but exeext='' is most # certainly right. break;; *.* ) 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 else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 { { echo "$as_me:1594: 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:1600: 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:1605: 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:1611: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1614: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1621: 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 fi echo "$as_me:1629: 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:1636: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1638: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1641: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1643: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1646: \$? = $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 | *.xcoff | *.tds | *.d | *.dbg | *.pdb | *.xSYM | *.bb | *.bbg | *.map | *.inf | *.o | *.obj ) ;; *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` export ac_cv_exeext break;; * ) break;; esac done else { { echo "$as_me:1662: error: cannot compute EXEEXT: cannot compile and link" >&5 echo "$as_me: error: cannot compute EXEEXT: cannot compile and link" >&2;} { (exit 1); exit 1; }; } fi rm -f "conftest$ac_cv_exeext" echo "$as_me:1668: 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:1674: checking for object suffix" >&5 echo $ECHO_N "checking for object suffix... $ECHO_C" >&6 if test "${ac_cv_objext+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 1680 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1692: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1695: \$? = $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 | *.dbg | *.pdb | *.xSYM | *.map | *.inf ) ;; *) 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:1707: error: cannot compute OBJEXT: cannot compile" >&5 echo "$as_me: error: cannot compute OBJEXT: cannot compile" >&2;} { (exit 1); exit 1; }; } fi rm -f "conftest.$ac_cv_objext" "conftest.$ac_ext" fi echo "$as_me:1714: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1718: checking whether we are using the GNU C compiler" >&5 echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 if test "${ac_cv_c_compiler_gnu+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 1724 "configure" #include "confdefs.h" int main (void) { #ifndef __GNUC__ choke me #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1739: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1742: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1745: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1748: \$? = $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:1760: 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:1766: checking whether $CC accepts -g" >&5 echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 if test "${ac_cv_prog_cc_g+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 1772 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1784: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1787: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1790: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1793: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; 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 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:1803: result: $ac_cv_prog_cc_g" >&5 echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 if test "$ac_test_CFLAGS" = set; then CFLAGS=$ac_save_CFLAGS elif test $ac_cv_prog_cc_g = yes; then if test "$GCC" = yes; then CFLAGS="-g -O2" else CFLAGS="-g" fi else if test "$GCC" = yes; then CFLAGS="-O2" else CFLAGS= fi fi # 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:1830: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1833: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1836: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1839: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then for ac_declaration in \ ''\ '#include ' \ '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 1851 "configure" #include "confdefs.h" #include $ac_declaration int main (void) { exit (42); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1864: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1867: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1870: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1873: \$? = $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 1883 "configure" #include "confdefs.h" $ac_declaration int main (void) { exit (42); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1895: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1898: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1901: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1904: \$? = $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 -rf 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_main_return="return" GCC_VERSION=none if test "$GCC" = yes ; then echo "$as_me:1934: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^[^(]*([^)][^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown echo "$as_me:1938: result: $GCC_VERSION" >&5 echo "${ECHO_T}$GCC_VERSION" >&6 fi INTEL_COMPILER=no if test "$GCC" = yes ; then case "$host_os" in (linux*|gnu*) echo "$as_me:1947: checking if this is really Intel C compiler" >&5 echo $ECHO_N "checking if this is really Intel C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS -no-gcc" cat >"conftest.$ac_ext" <<_ACEOF #line 1952 "configure" #include "confdefs.h" int main (void) { #ifdef __INTEL_COMPILER #else #error __INTEL_COMPILER is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1969: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1972: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1975: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1978: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then INTEL_COMPILER=yes cf_save_CFLAGS="$cf_save_CFLAGS -we147" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" echo "$as_me:1989: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi CLANG_COMPILER=no if test "$GCC" = yes ; then echo "$as_me:1998: checking if this is really Clang C compiler" >&5 echo $ECHO_N "checking if this is really Clang C compiler... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" cat >"conftest.$ac_ext" <<_ACEOF #line 2002 "configure" #include "confdefs.h" int main (void) { #ifdef __clang__ #else #error __clang__ is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:2019: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2022: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:2025: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2028: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then CLANG_COMPILER=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" echo "$as_me:2038: result: $CLANG_COMPILER" >&5 echo "${ECHO_T}$CLANG_COMPILER" >&6 fi CLANG_VERSION=none if test "x$CLANG_COMPILER" = "xyes" ; then case "$CC" in (c[1-9][0-9]|*/c[1-9][0-9]) { echo "$as_me:2047: WARNING: replacing broken compiler alias $CC" >&5 echo "$as_me: WARNING: replacing broken compiler alias $CC" >&2;} CFLAGS="$CFLAGS -std=`echo "$CC" | sed -e 's%.*/%%'`" CC=clang ;; esac echo "$as_me:2054: checking version of $CC" >&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 CLANG_VERSION="`$CC --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(CLANG[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$CLANG_VERSION" && CLANG_VERSION=unknown echo "$as_me:2058: result: $CLANG_VERSION" >&5 echo "${ECHO_T}$CLANG_VERSION" >&6 for cf_clang_opt in \ -Qunused-arguments \ -Wno-error=implicit-function-declaration do echo "$as_me:2065: checking if option $cf_clang_opt works" >&5 echo $ECHO_N "checking if option $cf_clang_opt works... $ECHO_C" >&6 cf_save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $cf_clang_opt" cat >"conftest.$ac_ext" <<_ACEOF #line 2070 "configure" #include "confdefs.h" #include int main (void) { printf("hello!\\n"); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:2084: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:2087: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:2090: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2093: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_clang_optok=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_clang_optok=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:2104: result: $cf_clang_optok" >&5 echo "${ECHO_T}$cf_clang_optok" >&6 CFLAGS="$cf_save_CFLAGS" if test "$cf_clang_optok" = yes; then test -n "$verbose" && echo " adding option $cf_clang_opt" 1>&6 echo "${as_me:-configure}:2110: testing adding option $cf_clang_opt ..." 1>&5 test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_clang_opt" fi done fi echo "$as_me:2119: checking for $CC option to accept ANSI C" >&5 echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 if test "${ac_cv_prog_cc_stdc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_prog_cc_stdc=no ac_save_CC=$CC cat >"conftest.$ac_ext" <<_ACEOF #line 2127 "configure" #include "confdefs.h" #include #include #include #include /* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ struct buf { int x; }; FILE * (*rcsopen) (struct buf *, struct stat *, int); static char *e (char **p, int i) { return p[i]; } static char *f (char * (*g) (char **, int), char **p, ...) { char *s; va_list v; va_start (v,p); s = g (p, va_arg (v,int)); va_end (v); return s; } int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); int argc; char **argv; int main (void) { return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; ; return 0; } _ACEOF # Don't try gcc -ansi; that turns off useful extensions and # breaks some systems' header files. # AIX -qlanglvl=ansi # Ultrix and OSF/1 -std1 # HP-UX 10.20 and later -Ae # HP-UX older versions -Aa -D_HPUX_SOURCE # SVR4 -Xc -D__EXTENSIONS__ for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" do CC="$ac_save_CC $ac_arg" rm -f "conftest.$ac_objext" if { (eval echo "$as_me:2174: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:2177: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:2180: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:2183: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_prog_cc_stdc=$ac_arg break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" done rm -f "conftest.$ac_ext" "conftest.$ac_objext" CC=$ac_save_CC fi case "x$ac_cv_prog_cc_stdc" in x|xno) echo "$as_me:2200: result: none needed" >&5 echo "${ECHO_T}none needed" >&6 ;; *) echo "$as_me:2203: result: $ac_cv_prog_cc_stdc" >&5 echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 CC="$CC $ac_cv_prog_cc_stdc" ;; esac # This should have been defined by AC_PROG_CC : "${CC:=cc}" echo "$as_me:2211: checking \$CFLAGS variable" >&5 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6 case "x$CFLAGS" in (*-[IUD]*) echo "$as_me:2215: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:2217: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&5 echo "$as_me: WARNING: your environment uses the CFLAGS variable to hold CPPFLAGS options" >&2;} cf_flags="$CFLAGS" CFLAGS= for cf_arg in $cf_flags do cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_arg do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi done ;; (*) echo "$as_me:2325: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac echo "$as_me:2330: checking \$CC variable" >&5 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 case "$CC" in (*[\ \ ]-*) echo "$as_me:2334: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:2336: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&5 echo "$as_me: WARNING: your environment uses the CC variable to hold CFLAGS/CPPFLAGS options" >&2;} # humor him... cf_prog=`echo "$CC" | sed -e 's/ / /g' -e 's/[ ]* / /g' -e 's/[ ]*[ ]-[^ ].*//'` cf_flags=`echo "$CC" | sed -e "s%^$cf_prog%%"` CC="$cf_prog" for cf_arg in $cf_flags do case "x$cf_arg" in (x-[IUDfgOW]*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_arg do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; (*) CC="$CC $cf_arg" ;; esac done test -n "$verbose" && echo " resulting CC: '$CC'" 1>&6 echo "${as_me:-configure}:2453: testing resulting CC: '$CC' ..." 1>&5 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 echo "${as_me:-configure}:2457: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 echo "${as_me:-configure}:2461: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 ;; (*) echo "$as_me:2465: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac for ac_prog in ggrep grep 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:2474: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_GREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$GREP"; then ac_cv_prog_GREP="$GREP" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_GREP="$ac_prog" echo "$as_me:2489: found $ac_dir/$ac_word" >&5 break done fi fi GREP=$ac_cv_prog_GREP if test -n "$GREP"; then echo "$as_me:2497: result: $GREP" >&5 echo "${ECHO_T}$GREP" >&6 else echo "$as_me:2500: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$GREP" && break done test -n "$GREP" || GREP=": " echo "$as_me:2508: checking for egrep" >&5 echo $ECHO_N "checking for egrep... $ECHO_C" >&6 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo a | $GREP -E '(a|b)' >/dev/null 2>&1 then ac_cv_path_EGREP="$GREP -E" else for ac_prog in gegrep egrep 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:2520: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_EGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $EGREP in [\\/]* | ?:[\\/]*) ac_cv_path_EGREP="$EGREP" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_EGREP="$ac_dir/$ac_word" echo "$as_me:2537: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi EGREP=$ac_cv_path_EGREP if test -n "$EGREP"; then echo "$as_me:2548: result: $EGREP" >&5 echo "${ECHO_T}$EGREP" >&6 else echo "$as_me:2551: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$EGREP" && break done test -n "$EGREP" || EGREP=": " test "x$ac_cv_path_EGREP" = "x:" && { { echo "$as_me:2559: error: cannot find workable egrep" >&5 echo "$as_me: error: cannot find workable egrep" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:2564: result: $ac_cv_path_EGREP" >&5 echo "${ECHO_T}$ac_cv_path_EGREP" >&6 EGREP="$ac_cv_path_EGREP" 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_main_return="return" echo "$as_me:2574: checking how to run the C preprocessor" >&5 echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 # On Suns, sometimes $CPP names a directory. if test -n "$CPP" && test -d "$CPP"; then CPP= fi if test -z "$CPP"; then if test "${ac_cv_prog_CPP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # Double quotes because CPP needs to be expanded for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" do ac_preproc_ok=false for ac_c_preproc_warn_flag in '' yes do # Use a header file that comes with gcc, so configuring glibc # with a fresh cross-compiler works. # 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 2595 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2600: \"$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:2606: \$? = $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 : 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 2629 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2633: \"$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:2639: \$? = $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 break fi done ac_cv_prog_CPP=$CPP fi CPP=$ac_cv_prog_CPP else ac_cv_prog_CPP=$CPP fi echo "$as_me:2676: 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 2686 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2691: \"$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:2697: \$? = $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 : 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 2720 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2724: \"$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:2730: \$? = $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 : else { { echo "$as_me:2758: 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 ac_main_return="return" # Find a good install program. We prefer a C program (faster), # so one script is as good as another. But avoid the broken or # incompatible versions: # SysV /etc/install, /usr/sbin/install # SunOS /usr/etc/install # IRIX /sbin/install # AIX /bin/install # AmigaOS /C/install, which installs bootblocks on floppy discs # AIX 4 /usr/bin/installbsd, which doesn't work without a -g flag # AFS /usr/afsws/bin/install, which mishandles nonexistent args # SVR4 /usr/ucb/install, which tries to use the nonexistent group "staff" # ./install, which can be erroneously created by make from ./install.sh. echo "$as_me:2782: checking for a BSD compatible install" >&5 echo $ECHO_N "checking for a BSD compatible install... $ECHO_C" >&6 if test -z "$INSTALL"; then if test "${ac_cv_path_install+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_save_IFS=$IFS; IFS=$ac_path_separator for ac_dir in $PATH; do IFS=$ac_save_IFS # Account for people who put trailing slashes in PATH elements. case $ac_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 if $as_executable_p "$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. : elif test $ac_prog = install && grep pwplus "$ac_dir/$ac_prog" >/dev/null 2>&1; then # program-specific install script used by HP pwplus--don't use. : else ac_cv_path_install="$ac_dir/$ac_prog -c" break 2 fi fi done ;; esac done fi if test "${ac_cv_path_install+set}" = set; then INSTALL=$ac_cv_path_install else # As a last resort, use the slow shell script. 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 fi fi echo "$as_me:2831: result: $INSTALL" >&5 echo "${ECHO_T}$INSTALL" >&6 # Use test -z because SunOS4 sh mishandles braces in ${var-val}. # It thinks the first close brace ends the variable substitution. test -z "$INSTALL_PROGRAM" && INSTALL_PROGRAM='${INSTALL}' test -z "$INSTALL_SCRIPT" && INSTALL_SCRIPT='${INSTALL}' test -z "$INSTALL_DATA" && INSTALL_DATA='${INSTALL} -m 644' for ac_prog in lint cppcheck splint 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:2846: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LINT+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LINT"; then ac_cv_prog_LINT="$LINT" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_LINT="$ac_prog" echo "$as_me:2861: found $ac_dir/$ac_word" >&5 break done fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then echo "$as_me:2869: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else echo "$as_me:2872: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$LINT" && break done case "x$LINT" in (xcppcheck|x*/cppcheck) test -z "$LINT_OPTS" && LINT_OPTS="--enable=all" ;; esac echo "$as_me:2885: checking if filesystem supports mixed-case filenames" >&5 echo $ECHO_N "checking if filesystem supports mixed-case filenames... $ECHO_C" >&6 if test "${cf_cv_mixedcase+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes ; then case "$target_alias" in (*-os2-emx*|*-msdosdjgpp*|*-cygwin*|*-msys*|*-mingw*|*-uwin*|darwin*) cf_cv_mixedcase=no ;; (*) cf_cv_mixedcase=yes ;; esac else rm -f conftest CONFTEST echo test >conftest if test -f CONFTEST ; then cf_cv_mixedcase=no else cf_cv_mixedcase=yes fi rm -f conftest CONFTEST fi fi echo "$as_me:2912: result: $cf_cv_mixedcase" >&5 echo "${ECHO_T}$cf_cv_mixedcase" >&6 test "$cf_cv_mixedcase" = yes && cat >>confdefs.h <<\EOF #define MIXEDCASE_FILENAMES 1 EOF for ac_prog in exctags ctags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2923: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_CTAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$CTAGS"; then ac_cv_prog_CTAGS="$CTAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_CTAGS="$ac_prog" echo "$as_me:2938: found $ac_dir/$ac_word" >&5 break done fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then echo "$as_me:2946: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else echo "$as_me:2949: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$CTAGS" && break done for ac_prog in exetags etags do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:2960: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ETAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ETAGS"; then ac_cv_prog_ETAGS="$ETAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ETAGS="$ac_prog" echo "$as_me:2975: found $ac_dir/$ac_word" >&5 break done fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then echo "$as_me:2983: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else echo "$as_me:2986: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ETAGS" && break done # Extract the first word of "${CTAGS:-ctags}", so it can be a program name with args. set dummy ${CTAGS:-ctags}; ac_word=$2 echo "$as_me:2995: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_LOWER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_LOWER_TAGS"; then ac_cv_prog_MAKE_LOWER_TAGS="$MAKE_LOWER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_LOWER_TAGS="yes" echo "$as_me:3010: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_LOWER_TAGS" && ac_cv_prog_MAKE_LOWER_TAGS="no" fi fi MAKE_LOWER_TAGS=$ac_cv_prog_MAKE_LOWER_TAGS if test -n "$MAKE_LOWER_TAGS"; then echo "$as_me:3019: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else echo "$as_me:3022: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "$cf_cv_mixedcase" = yes ; then # Extract the first word of "${ETAGS:-etags}", so it can be a program name with args. set dummy ${ETAGS:-etags}; ac_word=$2 echo "$as_me:3029: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_MAKE_UPPER_TAGS+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$MAKE_UPPER_TAGS"; then ac_cv_prog_MAKE_UPPER_TAGS="$MAKE_UPPER_TAGS" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_MAKE_UPPER_TAGS="yes" echo "$as_me:3044: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_MAKE_UPPER_TAGS" && ac_cv_prog_MAKE_UPPER_TAGS="no" fi fi MAKE_UPPER_TAGS=$ac_cv_prog_MAKE_UPPER_TAGS if test -n "$MAKE_UPPER_TAGS"; then echo "$as_me:3053: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else echo "$as_me:3056: result: no" >&5 echo "${ECHO_T}no" >&6 fi else MAKE_UPPER_TAGS=no fi if test "$MAKE_UPPER_TAGS" = yes ; then MAKE_UPPER_TAGS= else MAKE_UPPER_TAGS="#" fi if test "$MAKE_LOWER_TAGS" = yes ; then MAKE_LOWER_TAGS= else MAKE_LOWER_TAGS="#" fi echo "$as_me:3076: checking for an ANSI C-conforming const" >&5 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 if test "${ac_cv_c_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 3082 "configure" #include "confdefs.h" int main (void) { /* FIXME: Include the comments suggested by Paul. */ #ifndef __cplusplus /* Ultrix mips cc rejects this. */ typedef int charset[2]; const charset x; (void)x; /* SunOS 4.1.1 cc rejects this. */ char const *const *ccp; char **p; /* NEC SVR4.0.2 mips cc rejects this. */ struct point {int x, y;}; static struct point const zero = {0,0}; (void)zero; /* AIX XL C 1.02.0.0 rejects this. It does not let you subtract one const X* pointer from another in an arm of an if-expression whose if-part is not a constant expression */ const char *g = "string"; ccp = &g + (g ? g-g : 0); /* HPUX 7.0 cc rejects these. */ ++ccp; p = (char**) ccp; ccp = (char const *const *) p; { /* SCO 3.2v4 cc rejects this. */ char *t; char const *s = 0 ? (char *) 0 : (char const *) 0; *t++ = 0; (void)s; } { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ int x[] = {25, 17}; const int *foo = &x[0]; ++foo; (void)foo; } { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ typedef const int *iptr; iptr p = 0; ++p; (void)p; } { /* AIX XL C 1.02.0.0 rejects this saying "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ struct s { int j; const int *ap[3]; }; struct s *b; b->j = 5; } { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ const int foo = 10; (void)foo; } #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3144: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3147: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3150: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3153: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_c_const=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_c_const=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3163: result: $ac_cv_c_const" >&5 echo "${ECHO_T}$ac_cv_c_const" >&6 if test $ac_cv_c_const = no; then cat >>confdefs.h <<\EOF #define const EOF fi echo "$as_me:3173: checking if the POSIX test-macros are already defined" >&5 echo $ECHO_N "checking if the POSIX test-macros are already defined... $ECHO_C" >&6 if test "${cf_cv_posix_visible+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 3180 "configure" #include "confdefs.h" #include int main (void) { #if defined(__POSIX_VISIBLE) && ((__POSIX_VISIBLE - 0L) > 0) \ && defined(__XSI_VISIBLE) && ((__XSI_VISIBLE - 0L) > 0) \ && defined(__BSD_VISIBLE) && ((__BSD_VISIBLE - 0L) > 0) \ && defined(__ISO_C_VISIBLE) && ((__ISO_C_VISIBLE - 0L) > 0) #error conflicting symbols found #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3199: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3202: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3205: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3208: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_posix_visible=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_posix_visible=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3219: result: $cf_cv_posix_visible" >&5 echo "${ECHO_T}$cf_cv_posix_visible" >&6 if test "$cf_cv_posix_visible" = no; then cf_XOPEN_SOURCE=600 cf_POSIX_C_SOURCE=199506L cf_xopen_source= case "$host_os" in (aix[4-7]*) cf_xopen_source="-D_ALL_SOURCE" ;; (darwin[0-8].*) cf_xopen_source="-D_APPLE_C_SOURCE" ;; (darwin*) cf_xopen_source="-D_DARWIN_C_SOURCE" cf_XOPEN_SOURCE= ;; (freebsd*|dragonfly*|midnightbsd*) # 5.x headers associate # _XOPEN_SOURCE=600 with _POSIX_C_SOURCE=200112L # _XOPEN_SOURCE=500 with _POSIX_C_SOURCE=199506L cf_POSIX_C_SOURCE=200112L cf_XOPEN_SOURCE=600 cf_xopen_source="-D_BSD_TYPES -D__BSD_VISIBLE -D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE -D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" ;; (hpux11*) cf_xopen_source="-D_HPUX_SOURCE -D_XOPEN_SOURCE=500" ;; (hpux*) cf_xopen_source="-D_HPUX_SOURCE" ;; (irix[56].*) cf_xopen_source="-D_SGI_SOURCE" cf_XOPEN_SOURCE= ;; (linux*gnu|linux*gnuabi64|linux*gnuabin32|linux*gnueabi|linux*gnueabihf|linux*gnux32|uclinux*|gnu*|mint*|k*bsd*-gnu|cygwin|msys|mingw*|linux*uclibc) cf_gnu_xopen_source=$cf_XOPEN_SOURCE echo "$as_me:3261: checking if this is the GNU C library" >&5 echo $ECHO_N "checking if this is the GNU C library... $ECHO_C" >&6 if test "${cf_cv_gnu_library+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 3268 "configure" #include "confdefs.h" #include int main (void) { #if __GLIBC__ > 0 && __GLIBC_MINOR__ >= 0 return 0; #elif __NEWLIB__ > 0 && __NEWLIB_MINOR__ >= 0 return 0; #else # error not GNU C library #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3287: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3290: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3293: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3296: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_gnu_library=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_gnu_library=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3307: result: $cf_cv_gnu_library" >&5 echo "${ECHO_T}$cf_cv_gnu_library" >&6 if test x$cf_cv_gnu_library = xyes; then # With glibc 2.19 (13 years after this check was begun), _DEFAULT_SOURCE # was changed to help a little. newlib incorporated the change about 4 # years later. echo "$as_me:3315: checking if _DEFAULT_SOURCE can be used as a basis" >&5 echo $ECHO_N "checking if _DEFAULT_SOURCE can be used as a basis... $ECHO_C" >&6 if test "${cf_cv_gnu_library_219+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save="$CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" cat >"conftest.$ac_ext" <<_ACEOF #line 3327 "configure" #include "confdefs.h" #include int main (void) { #if (__GLIBC__ == 2 && __GLIBC_MINOR__ >= 19) || (__GLIBC__ > 2) return 0; #elif (__NEWLIB__ == 2 && __NEWLIB_MINOR__ >= 4) || (__GLIBC__ > 3) return 0; #else # error GNU C library __GLIBC__.__GLIBC_MINOR__ is too old #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3346: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3349: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3352: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3355: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_gnu_library_219=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_gnu_library_219=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS="$cf_save" fi echo "$as_me:3367: result: $cf_cv_gnu_library_219" >&5 echo "${ECHO_T}$cf_cv_gnu_library_219" >&6 if test "x$cf_cv_gnu_library_219" = xyes; then cf_save="$CPPFLAGS" echo "$as_me:3372: checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE=$cf_gnu_xopen_source works with _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_dftsrc_219+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -D_DEFAULT_SOURCE -D_XOPEN_SOURCE=$cf_gnu_xopen_source do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi cat >"conftest.$ac_ext" <<_ACEOF #line 3477 "configure" #include "confdefs.h" #include #include int main (void) { #if (_XOPEN_SOURCE >= $cf_gnu_xopen_source) && (MB_LEN_MAX > 1) return 0; #else # error GNU C library is too old #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3497: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3500: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3503: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3506: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_gnu_dftsrc_219=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_gnu_dftsrc_219=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3517: result: $cf_cv_gnu_dftsrc_219" >&5 echo "${ECHO_T}$cf_cv_gnu_dftsrc_219" >&6 test "x$cf_cv_gnu_dftsrc_219" = "xyes" || CPPFLAGS="$cf_save" else cf_cv_gnu_dftsrc_219=maybe fi if test "x$cf_cv_gnu_dftsrc_219" != xyes; then echo "$as_me:3526: checking if we must define _GNU_SOURCE" >&5 echo $ECHO_N "checking if we must define _GNU_SOURCE... $ECHO_C" >&6 if test "${cf_cv_gnu_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 3533 "configure" #include "confdefs.h" #include int main (void) { #ifndef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3548: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3551: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3554: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3557: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_save="$CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -D_GNU_SOURCE do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi cat >"conftest.$ac_ext" <<_ACEOF #line 3664 "configure" #include "confdefs.h" #include int main (void) { #ifdef _XOPEN_SOURCE #error expected _XOPEN_SOURCE to be undefined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3679: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3682: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3685: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3688: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_gnu_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_gnu_source=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS="$cf_save" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3703: result: $cf_cv_gnu_source" >&5 echo "${ECHO_T}$cf_cv_gnu_source" >&6 if test "$cf_cv_gnu_source" = yes then echo "$as_me:3708: checking if we should also define _DEFAULT_SOURCE" >&5 echo $ECHO_N "checking if we should also define _DEFAULT_SOURCE... $ECHO_C" >&6 if test "${cf_cv_default_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_GNU_SOURCE" cat >"conftest.$ac_ext" <<_ACEOF #line 3718 "configure" #include "confdefs.h" #include int main (void) { #ifdef _DEFAULT_SOURCE #error expected _DEFAULT_SOURCE to be undefined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3733: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3736: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3739: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3742: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_default_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_default_source=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3753: result: $cf_cv_default_source" >&5 echo "${ECHO_T}$cf_cv_default_source" >&6 if test "$cf_cv_default_source" = yes then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_DEFAULT_SOURCE" fi fi fi fi ;; (minix*) cf_xopen_source="-D_NETBSD_SOURCE" # POSIX.1-2001 features are ifdef'd with this... ;; (mirbsd*) # setting _XOPEN_SOURCE or _POSIX_SOURCE breaks and other headers which use u_int / u_short types cf_XOPEN_SOURCE= if test "$cf_cv_posix_visible" = no; then cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:3790: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:3796: testing if the symbol is already defined go no further ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 3799 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3814: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3817: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3820: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3823: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >"conftest.$ac_ext" <<_ACEOF #line 3844 "configure" #include "confdefs.h" #include int main (void) { #ifdef _POSIX_SOURCE #error _POSIX_SOURCE is defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3859: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3862: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3865: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3868: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "${as_me:-configure}:3879: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" echo "${as_me:-configure}:3887: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 3890 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3905: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3908: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3911: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3914: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:3930: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi fi # cf_cv_posix_visible ;; (netbsd*) cf_xopen_source="-D_NETBSD_SOURCE" # setting _XOPEN_SOURCE breaks IPv6 for lynx on NetBSD 1.6, breaks xterm, is not needed for ncursesw ;; (openbsd[6-9]*) # OpenBSD 6.x has broken locale support, both compile-time and runtime. # see https://www.mail-archive.com/bugs@openbsd.org/msg13200.html # Abusing the conformance level is a workaround. { echo "$as_me:4047: WARNING: this system does not provide usable locale support" >&5 echo "$as_me: WARNING: this system does not provide usable locale support" >&2;} cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=700 ;; (openbsd[4-5]*) # setting _XOPEN_SOURCE lower than 500 breaks g++ compile with wchar.h, needed for ncursesw cf_xopen_source="-D_BSD_SOURCE" cf_XOPEN_SOURCE=600 ;; (openbsd*) # setting _XOPEN_SOURCE breaks xterm on OpenBSD 2.8, is not needed for ncursesw ;; (osf[45]*) cf_xopen_source="-D_OSF_SOURCE" ;; (nto-qnx*) cf_xopen_source="-D_QNX_SOURCE" ;; (sco*) # setting _XOPEN_SOURCE breaks Lynx on SCO Unix / OpenServer ;; (solaris2.*) cf_xopen_source="-D__EXTENSIONS__" cf_cv_xopen_source=broken ;; (sysv4.2uw2.*) # Novell/SCO UnixWare 2.x (tested on 2.1.2) cf_XOPEN_SOURCE= cf_POSIX_C_SOURCE= ;; (*) echo "$as_me:4079: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 4086 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4104: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4107: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4110: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4113: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_save="$CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >"conftest.$ac_ext" <<_ACEOF #line 4125 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4143: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4146: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4149: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4152: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS="$cf_save" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:4167: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" for cf_add_cflags in $cf_temp_xopen_source do case "x$cf_add_cflags" in (x-[DU]*) cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` test "$CFLAGS" != "$cf_old_cflag" || break CFLAGS="$cf_old_cflag" done cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` test "$CPPFLAGS" != "$cf_old_cflag" || break CPPFLAGS="$cf_old_cflag" done ;; esac cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_add_cflags do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi done fi cf_save_xopen_cppflags="$CPPFLAGS" if test "$cf_cv_posix_visible" = no; then cf_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_trim_CFLAGS=`echo "$cf_save_CFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` cf_trim_CPPFLAGS=`echo "$cf_save_CPPFLAGS" | \ sed -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_POSIX_C_SOURCE"'\(=[^ ]*\)\?$//g'` echo "$as_me:4327: checking if we should define _POSIX_C_SOURCE" >&5 echo $ECHO_N "checking if we should define _POSIX_C_SOURCE... $ECHO_C" >&6 if test "${cf_cv_posix_c_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else echo "${as_me:-configure}:4333: testing if the symbol is already defined go no further ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 4336 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4351: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4354: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4357: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4360: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_posix_c_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_want_posix_source=no case .$cf_POSIX_C_SOURCE in (.[12]??*) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" ;; (.2) cf_cv_posix_c_source="-D_POSIX_C_SOURCE=$cf_POSIX_C_SOURCE" cf_want_posix_source=yes ;; (.*) cf_want_posix_source=yes ;; esac if test "$cf_want_posix_source" = yes ; then cat >"conftest.$ac_ext" <<_ACEOF #line 4381 "configure" #include "confdefs.h" #include int main (void) { #ifdef _POSIX_SOURCE #error _POSIX_SOURCE is defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4396: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4399: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4402: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4405: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source="$cf_cv_posix_c_source -D_POSIX_SOURCE" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "${as_me:-configure}:4416: testing ifdef from value $cf_POSIX_C_SOURCE ..." 1>&5 CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_cv_posix_c_source" echo "${as_me:-configure}:4424: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 4427 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE #error _POSIX_C_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4442: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4445: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4448: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4451: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_posix_c_source=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:4467: result: $cf_cv_posix_c_source" >&5 echo "${ECHO_T}$cf_cv_posix_c_source" >&6 if test "$cf_cv_posix_c_source" != no ; then CFLAGS="$cf_trim_CFLAGS" CPPFLAGS="$cf_trim_CPPFLAGS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_posix_c_source do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi fi fi # cf_cv_posix_visible # Some of these niche implementations use copy/paste, double-check... if test "$cf_cv_xopen_source" = no ; then test -n "$verbose" && echo " checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE" 1>&6 echo "${as_me:-configure}:4580: testing checking if _POSIX_C_SOURCE interferes with _XOPEN_SOURCE ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 4583 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4601: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4604: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4607: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4610: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 { echo "$as_me:4617: WARNING: _POSIX_C_SOURCE definition is not usable" >&5 echo "$as_me: WARNING: _POSIX_C_SOURCE definition is not usable" >&2;} CPPFLAGS="$cf_save_xopen_cppflags" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi ;; esac if test -n "$cf_xopen_source" ; then for cf_add_cflags in $cf_xopen_source do case "x$cf_add_cflags" in (x-[DU]*) cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` test "$CFLAGS" != "$cf_old_cflag" || break test -n "$verbose" && echo " removing old option $cf_add_cflags from CFLAGS" 1>&6 echo "${as_me:-configure}:4640: testing removing old option $cf_add_cflags from CFLAGS ..." 1>&5 CFLAGS="$cf_old_cflag" done cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` test "$CPPFLAGS" != "$cf_old_cflag" || break test -n "$verbose" && echo " removing old option $cf_add_cflags from CPPFLAGS" 1>&6 echo "${as_me:-configure}:4652: testing removing old option $cf_add_cflags from CPPFLAGS ..." 1>&5 CPPFLAGS="$cf_old_cflag" done ;; esac cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_add_cflags do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$verbose" && echo " add to \$CFLAGS $cf_new_cflags" 1>&6 echo "${as_me:-configure}:4740: testing add to \$CFLAGS $cf_new_cflags ..." 1>&5 test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$verbose" && echo " add to \$CPPFLAGS $cf_new_cppflags" 1>&6 echo "${as_me:-configure}:4750: testing add to \$CPPFLAGS $cf_new_cppflags ..." 1>&5 test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$verbose" && echo " add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags" 1>&6 echo "${as_me:-configure}:4760: testing add to \$EXTRA_CPPFLAGS $cf_new_extra_cppflags ..." 1>&5 test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi done fi if test -n "$cf_XOPEN_SOURCE" && test -z "$cf_cv_xopen_source" ; then echo "$as_me:4772: checking if _XOPEN_SOURCE really is set" >&5 echo $ECHO_N "checking if _XOPEN_SOURCE really is set... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 4775 "configure" #include "confdefs.h" #include int main (void) { #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4790: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4793: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4796: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4799: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_XOPEN_SOURCE_set=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_XOPEN_SOURCE_set=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" echo "$as_me:4808: result: $cf_XOPEN_SOURCE_set" >&5 echo "${ECHO_T}$cf_XOPEN_SOURCE_set" >&6 if test "$cf_XOPEN_SOURCE_set" = yes then cat >"conftest.$ac_ext" <<_ACEOF #line 4813 "configure" #include "confdefs.h" #include int main (void) { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE #error (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4828: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4831: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4834: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4837: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_XOPEN_SOURCE_set_ok=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_XOPEN_SOURCE_set_ok=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" if test "$cf_XOPEN_SOURCE_set_ok" = no then { echo "$as_me:4848: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else echo "$as_me:4853: checking if we should define _XOPEN_SOURCE" >&5 echo $ECHO_N "checking if we should define _XOPEN_SOURCE... $ECHO_C" >&6 if test "${cf_cv_xopen_source+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 4860 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4878: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4881: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4884: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4887: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_save="$CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D_XOPEN_SOURCE=$cf_XOPEN_SOURCE" cat >"conftest.$ac_ext" <<_ACEOF #line 4899 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef _XOPEN_SOURCE #error _XOPEN_SOURCE is not defined #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:4917: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4920: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4923: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4926: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_xopen_source=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_xopen_source=$cf_XOPEN_SOURCE fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS="$cf_save" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:4941: result: $cf_cv_xopen_source" >&5 echo "${ECHO_T}$cf_cv_xopen_source" >&6 if test "$cf_cv_xopen_source" != no ; then CFLAGS=`echo "$CFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"_XOPEN_SOURCE"'\(=[^ ]*\)\?$//g'` cf_temp_xopen_source="-D_XOPEN_SOURCE=$cf_cv_xopen_source" for cf_add_cflags in $cf_temp_xopen_source do case "x$cf_add_cflags" in (x-[DU]*) cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x$CFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` test "$CFLAGS" != "$cf_old_cflag" || break CFLAGS="$cf_old_cflag" done cf_tmp_cflag=`echo "x$cf_add_cflags" | sed -e 's/^.//' -e 's/=.*//'` while true do cf_old_cflag=`echo "x$CPPFLAGS" | sed -e 's/^.//' -e 's/[ ][ ]*-/ -/g' -e "s%$cf_tmp_cflag\\(=[^ ][^ ]*\\)\?%%" -e 's/^[ ]*//' -e 's%[ ][ ]*-D% -D%g' -e 's%[ ][ ]*-I% -I%g'` test "$CPPFLAGS" != "$cf_old_cflag" || break CPPFLAGS="$cf_old_cflag" done ;; esac cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_add_cflags do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi done fi fi fi fi # cf_cv_posix_visible echo "$as_me:5088: 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 5094 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:5102: \"$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:5108: \$? = $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 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 5130 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "memchr" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. cat >"conftest.$ac_ext" <<_ACEOF #line 5148 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "free" >/dev/null 2>&1; then : else ac_cv_header_stdc=no fi rm -rf conftest* fi if test $ac_cv_header_stdc = yes; then # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. if test "$cross_compiling" = yes; then : else cat >"conftest.$ac_ext" <<_ACEOF #line 5169 "configure" #include "confdefs.h" #include #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 (void) { int i; for (i = 0; i < 256; i++) if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) $ac_main_return(2); $ac_main_return (0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:5195: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5198: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:5200: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5203: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_header_stdc=no fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi fi fi echo "$as_me:5216: 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 <<\EOF #define STDC_HEADERS 1 EOF fi # On IRIX 5.3, sys/types and inttypes.h are conflicting. for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ inttypes.h stdint.h unistd.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:5232: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5238 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5244: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5247: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5250: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5253: \$? = $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:5263: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking whether exit is declared... $ECHO_C" >&6 if test "${ac_cv_have_decl_exit+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5279 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef exit (void) exit; #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5294: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5297: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5300: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5303: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_have_decl_exit=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_have_decl_exit=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:5313: result: $ac_cv_have_decl_exit" >&5 echo "${ECHO_T}$ac_cv_have_decl_exit" >&6 echo "$as_me:5316: checking if SIGWINCH is defined" >&5 echo $ECHO_N "checking if SIGWINCH is defined... $ECHO_C" >&6 if test "${cf_cv_define_sigwinch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5323 "configure" #include "confdefs.h" #include #include int main (void) { int x = SIGWINCH; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5338: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5341: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5344: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5347: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_define_sigwinch=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cat >"conftest.$ac_ext" <<_ACEOF #line 5354 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #include #include int main (void) { int x = SIGWINCH; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5372: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5375: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5378: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5381: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_define_sigwinch=maybe else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_define_sigwinch=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:5395: result: $cf_cv_define_sigwinch" >&5 echo "${ECHO_T}$cf_cv_define_sigwinch" >&6 if test "$cf_cv_define_sigwinch" = maybe ; then echo "$as_me:5399: checking for actual SIGWINCH definition" >&5 echo $ECHO_N "checking for actual SIGWINCH definition... $ECHO_C" >&6 if test "${cf_cv_fixup_sigwinch+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_fixup_sigwinch=unknown cf_sigwinch=32 while test "$cf_sigwinch" != 1 do cat >"conftest.$ac_ext" <<_ACEOF #line 5410 "configure" #include "confdefs.h" #undef _XOPEN_SOURCE #undef _POSIX_SOURCE #undef _POSIX_C_SOURCE #include #include int main (void) { #if SIGWINCH != $cf_sigwinch #error SIGWINCH is not $cf_sigwinch #endif int x = SIGWINCH; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5432: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5435: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5438: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5441: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_fixup_sigwinch=$cf_sigwinch break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" cf_sigwinch="`expr "$cf_sigwinch" - 1`" done fi echo "$as_me:5455: result: $cf_cv_fixup_sigwinch" >&5 echo "${ECHO_T}$cf_cv_fixup_sigwinch" >&6 if test "$cf_cv_fixup_sigwinch" != unknown ; then CPPFLAGS="$CPPFLAGS -DSIGWINCH=$cf_cv_fixup_sigwinch" fi fi echo "$as_me:5463: checking for elf_begin in -lelf" >&5 echo $ECHO_N "checking for elf_begin in -lelf... $ECHO_C" >&6 if test "${ac_cv_lib_elf_elf_begin+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lelf $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 5471 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char elf_begin (void); int main (void) { elf_begin (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:5490: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5493: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:5496: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5499: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_elf_elf_begin=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_elf_elf_begin=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:5510: result: $ac_cv_lib_elf_elf_begin" >&5 echo "${ECHO_T}$ac_cv_lib_elf_elf_begin" >&6 if test "$ac_cv_lib_elf_elf_begin" = yes; then echo "$as_me:5514: checking if this is an SVR4 system" >&5 echo $ECHO_N "checking if this is an SVR4 system... $ECHO_C" >&6 if test "${cf_cv_svr4+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5521 "configure" #include "confdefs.h" #if defined(__CYGWIN__) #error Cygwin is not SVr4 #endif #include #include int main (void) { static struct termio d_tio; d_tio.c_cc[VINTR] = 0; d_tio.c_cc[VQUIT] = 0; d_tio.c_cc[VERASE] = 0; d_tio.c_cc[VKILL] = 0; d_tio.c_cc[VEOF] = 0; d_tio.c_cc[VEOL] = 0; d_tio.c_cc[VMIN] = 0; d_tio.c_cc[VTIME] = 0; d_tio.c_cc[VLNEXT] = 0; ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5550: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5553: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5556: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5559: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_svr4=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_svr4=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:5570: result: $cf_cv_svr4" >&5 echo "${ECHO_T}$cf_cv_svr4" >&6 fi test "$cf_cv_svr4" = yes && cat >>confdefs.h <<\EOF #define SVR4 1 EOF echo "$as_me:5580: checking if external sys_nerr is declared" >&5 echo $ECHO_N "checking if external sys_nerr is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_sys_nerr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5587 "configure" #include "confdefs.h" $ac_includes_default #include int main (void) { int x = (int) sys_nerr; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5601: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5604: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5607: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5610: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_dcl_sys_nerr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_dcl_sys_nerr=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:5621: result: $cf_cv_dcl_sys_nerr" >&5 echo "${ECHO_T}$cf_cv_dcl_sys_nerr" >&6 if test "$cf_cv_dcl_sys_nerr" = no ; then cf_result=`echo "decl_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking if external sys_nerr exists... $ECHO_C" >&6 if test "${cf_cv_have_sys_nerr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5643 "configure" #include "confdefs.h" #undef sys_nerr extern int sys_nerr; int main (void) { sys_nerr = 2 ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:5658: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5661: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:5664: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5667: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_have_sys_nerr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_have_sys_nerr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:5678: result: $cf_cv_have_sys_nerr" >&5 echo "${ECHO_T}$cf_cv_have_sys_nerr" >&6 if test "$cf_cv_have_sys_nerr" = yes ; then cf_result=`echo "have_sys_nerr" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking if external sys_errlist is declared... $ECHO_C" >&6 if test "${cf_cv_dcl_sys_errlist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5698 "configure" #include "confdefs.h" $ac_includes_default #include int main (void) { int x = (int) sys_errlist; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5712: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5715: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5718: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5721: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_dcl_sys_errlist=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_dcl_sys_errlist=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:5732: result: $cf_cv_dcl_sys_errlist" >&5 echo "${ECHO_T}$cf_cv_dcl_sys_errlist" >&6 if test "$cf_cv_dcl_sys_errlist" = no ; then cf_result=`echo "decl_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking if external sys_errlist exists... $ECHO_C" >&6 if test "${cf_cv_have_sys_errlist+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5754 "configure" #include "confdefs.h" #undef sys_errlist extern int sys_errlist; int main (void) { sys_errlist = 2 ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:5769: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:5772: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:5775: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5778: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_have_sys_errlist=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_have_sys_errlist=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:5789: result: $cf_cv_have_sys_errlist" >&5 echo "${ECHO_T}$cf_cv_have_sys_errlist" >&6 if test "$cf_cv_have_sys_errlist" = yes ; then cf_result=`echo "have_sys_errlist" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5815 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:5819: \"$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:5825: \$? = $ac_status" >&5 (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi rm -f conftest.err "conftest.$ac_ext" fi echo "$as_me:5844: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if we should define SYSV... $ECHO_C" >&6 if test "${cf_cv_sysv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5861 "configure" #include "confdefs.h" #undef SYSV #define SYSV 1 /* get Xos.h to declare sys_errlist[] */ #ifdef HAVE_STDLIB_H #include /* look for wchar_t */ #endif #ifdef HAVE_X11_INTRINSIC_H #include /* Intrinsic.h has other traps... */ #endif #ifdef HAVE_TERMIOS_H /* needed for HPUX 10.20 */ #include #define STRUCT_TERMIOS struct termios #else #define STRUCT_TERMIOS struct termio #endif #include #include /* eliminate most BSD hacks */ #include /* declare sys_errlist on older systems */ #include /* eliminate most of the remaining ones */ int main (void) { static STRUCT_TERMIOS d_tio; d_tio.c_cc[VINTR] = 0; d_tio.c_cc[VQUIT] = 0; d_tio.c_cc[VERASE] = 0; d_tio.c_cc[VKILL] = 0; d_tio.c_cc[VEOF] = 0; d_tio.c_cc[VEOL] = 0; d_tio.c_cc[VMIN] = 0; d_tio.c_cc[VTIME] = 0; #if defined(HAVE_SYS_ERRLIST) && !defined(DECL_SYS_ERRLIST) sys_errlist[0] = ""; /* Cygwin mis-declares this */ #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5905: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5908: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5911: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5914: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_sysv=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_sysv=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:5925: result: $cf_cv_sysv" >&5 echo "${ECHO_T}$cf_cv_sysv" >&6 test "$cf_cv_sysv" = yes && cat >>confdefs.h <<\EOF #define SYSV 1 EOF echo "$as_me:5932: checking for uid_t in sys/types.h" >&5 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6 if test "${ac_cv_type_uid_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 5938 "configure" #include "confdefs.h" #include _ACEOF if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | $EGREP "uid_t" >/dev/null 2>&1; then ac_cv_type_uid_t=yes else ac_cv_type_uid_t=no fi rm -rf conftest* fi echo "$as_me:5952: result: $ac_cv_type_uid_t" >&5 echo "${ECHO_T}$ac_cv_type_uid_t" >&6 if test $ac_cv_type_uid_t = no; then cat >>confdefs.h <<\EOF #define uid_t int EOF cat >>confdefs.h <<\EOF #define gid_t int EOF fi echo "$as_me:5966: checking if you want to see long compiling messages" >&5 echo $ECHO_N "checking if you want to see long compiling messages... $ECHO_C" >&6 # Check whether --enable-echo or --disable-echo was given. if test "${enable_echo+set}" = set; then enableval="$enable_echo" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then ECHO_LT='--silent' ECHO_LD='@echo linking $@;' RULE_CC='@echo compiling $<' SHOW_CC='@echo compiling $@' ECHO_CC='@' else ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi else enableval=yes ECHO_LT='' ECHO_LD='' RULE_CC='' SHOW_CC='' ECHO_CC='' fi; echo "$as_me:6000: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 echo "$as_me:6003: checking for fgrep" >&5 echo $ECHO_N "checking for fgrep... $ECHO_C" >&6 if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if echo 'ab*c' | $GREP -F 'ab*c' >/dev/null 2>&1 then ac_cv_path_FGREP="$GREP -F" else for ac_prog in gfgrep fgrep 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:6015: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_FGREP+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $FGREP in [\\/]* | ?:[\\/]*) ac_cv_path_FGREP="$FGREP" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_FGREP="$ac_dir/$ac_word" echo "$as_me:6032: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi FGREP=$ac_cv_path_FGREP if test -n "$FGREP"; then echo "$as_me:6043: result: $FGREP" >&5 echo "${ECHO_T}$FGREP" >&6 else echo "$as_me:6046: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$FGREP" && break done test -n "$FGREP" || FGREP=": " test "x$ac_cv_path_FGREP" = "x:" && { { echo "$as_me:6054: error: cannot find workable fgrep" >&5 echo "$as_me: error: cannot find workable fgrep" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:6059: result: $ac_cv_path_FGREP" >&5 echo "${ECHO_T}$ac_cv_path_FGREP" >&6 FGREP="$ac_cv_path_FGREP" echo "$as_me:6063: checking if you want to use C11 _Noreturn feature" >&5 echo $ECHO_N "checking if you want to use C11 _Noreturn feature... $ECHO_C" >&6 # Check whether --enable-stdnoreturn or --disable-stdnoreturn was given. if test "${enable_stdnoreturn+set}" = set; then enableval="$enable_stdnoreturn" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_stdnoreturn=yes else enable_stdnoreturn=no fi else enableval=no enable_stdnoreturn=no fi; echo "$as_me:6080: result: $enable_stdnoreturn" >&5 echo "${ECHO_T}$enable_stdnoreturn" >&6 if test $enable_stdnoreturn = yes; then echo "$as_me:6084: checking for C11 _Noreturn feature" >&5 echo $ECHO_N "checking for C11 _Noreturn feature... $ECHO_C" >&6 if test "${cf_cv_c11_noreturn+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6090 "configure" #include "confdefs.h" $ac_includes_default #include static _Noreturn void giveup(void) { exit(0); } int main (void) { if (feof(stdin)) giveup() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6106: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6109: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6112: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6115: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_c11_noreturn=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_c11_noreturn=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:6126: result: $cf_cv_c11_noreturn" >&5 echo "${ECHO_T}$cf_cv_c11_noreturn" >&6 else cf_cv_c11_noreturn=no, fi if test "$cf_cv_c11_noreturn" = yes; then cat >>confdefs.h <<\EOF #define HAVE_STDNORETURN_H 1 EOF cat >>confdefs.h <&6 echo "${as_me:-configure}:6182: testing repairing CFLAGS: $CFLAGS ..." 1>&5 CFLAGS="$cf_temp_flags" test -n "$verbose" && echo " ... fixed $CFLAGS" 1>&6 echo "${as_me:-configure}:6187: testing ... fixed $CFLAGS ..." 1>&5 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 echo "${as_me:-configure}:6191: testing ... extra $EXTRA_CFLAGS ..." 1>&5 fi ;; esac fi if test "$GCC" = yes || test "$GXX" = yes then case $CPPFLAGS in (*-Werror=*) cf_temp_flags= for cf_temp_scan in $CPPFLAGS do case "x$cf_temp_scan" in (x-Werror=format*) test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " cf_temp_flags="${cf_temp_flags}$cf_temp_scan" ;; (x-Werror=*) test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS " EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan" ;; (*) test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " cf_temp_flags="${cf_temp_flags}$cf_temp_scan" ;; esac done if test "x$CPPFLAGS" != "x$cf_temp_flags" then test -n "$verbose" && echo " repairing CPPFLAGS: $CPPFLAGS" 1>&6 echo "${as_me:-configure}:6230: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5 CPPFLAGS="$cf_temp_flags" test -n "$verbose" && echo " ... fixed $CPPFLAGS" 1>&6 echo "${as_me:-configure}:6235: testing ... fixed $CPPFLAGS ..." 1>&5 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 echo "${as_me:-configure}:6239: testing ... extra $EXTRA_CFLAGS ..." 1>&5 fi ;; esac fi if test "$GCC" = yes || test "$GXX" = yes then case $LDFLAGS in (*-Werror=*) cf_temp_flags= for cf_temp_scan in $LDFLAGS do case "x$cf_temp_scan" in (x-Werror=format*) test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " cf_temp_flags="${cf_temp_flags}$cf_temp_scan" ;; (x-Werror=*) test -n "$EXTRA_CFLAGS" && EXTRA_CFLAGS="$EXTRA_CFLAGS " EXTRA_CFLAGS="${EXTRA_CFLAGS}$cf_temp_scan" ;; (*) test -n "$cf_temp_flags" && cf_temp_flags="$cf_temp_flags " cf_temp_flags="${cf_temp_flags}$cf_temp_scan" ;; esac done if test "x$LDFLAGS" != "x$cf_temp_flags" then test -n "$verbose" && echo " repairing LDFLAGS: $LDFLAGS" 1>&6 echo "${as_me:-configure}:6278: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5 LDFLAGS="$cf_temp_flags" test -n "$verbose" && echo " ... fixed $LDFLAGS" 1>&6 echo "${as_me:-configure}:6283: testing ... fixed $LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 echo "${as_me:-configure}:6287: testing ... extra $EXTRA_CFLAGS ..." 1>&5 fi ;; esac fi echo "$as_me:6294: checking if you want to turn on gcc warnings" >&5 echo $ECHO_N "checking if you want to turn on gcc warnings... $ECHO_C" >&6 # Check whether --enable-warnings or --disable-warnings was given. if test "${enable_warnings+set}" = set; then enableval="$enable_warnings" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then enable_warnings=yes else enable_warnings=no fi else enableval=no enable_warnings=no fi; echo "$as_me:6311: result: $enable_warnings" >&5 echo "${ECHO_T}$enable_warnings" >&6 if test "$enable_warnings" = "yes" then if test "$GCC" = yes || test "$GXX" = yes then cat > conftest.i <&5 echo "$as_me: checking for $CC __attribute__ directives..." >&6;} cat > "conftest.$ac_ext" < #include "confdefs.h" #include "conftest.h" #include "conftest.i" #if GCC_PRINTF #define GCC_PRINTFLIKE(fmt,var) __attribute__((format(printf,fmt,var))) #else #define GCC_PRINTFLIKE(fmt,var) /*nothing*/ #endif #if GCC_SCANF #define GCC_SCANFLIKE(fmt,var) __attribute__((format(scanf,fmt,var))) #else #define GCC_SCANFLIKE(fmt,var) /*nothing*/ #endif extern void wow(char *,...) GCC_SCANFLIKE(1,2); extern GCC_NORETURN void oops(char *,...) GCC_PRINTFLIKE(1,2); extern GCC_NORETURN void foo(void); int main(int argc GCC_UNUSED, char *argv[] GCC_UNUSED) { (void)argc; (void)argv; return 0; } EOF cf_printf_attribute=no cf_scanf_attribute=no for cf_attribute in scanf printf unused noreturn do cf_ATTRIBUTE=`echo "$cf_attribute" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cf_directive="__attribute__(($cf_attribute))" echo "checking for $CC $cf_directive" 1>&5 case "$cf_attribute" in (printf) cf_printf_attribute=yes cat >conftest.h <conftest.h <conftest.h <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6390: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:6392: result: ... $cf_attribute" >&5 echo "${ECHO_T}... $cf_attribute" >&6 cat conftest.h >>confdefs.h case "$cf_attribute" in (noreturn) cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_PRINTF 1 EOF fi cat >>confdefs.h <>confdefs.h <<\EOF #define GCC_SCANF 1 EOF fi cat >>confdefs.h <>confdefs.h <>confdefs.h fi rm -rf ./conftest* fi if test "x$have_x" = xyes; then echo "skipping X-const check"; fi cat > "conftest.$ac_ext" <&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" EXTRA_CFLAGS="$EXTRA_CFLAGS -Wall" for cf_opt in \ wd1419 \ wd1683 \ wd1684 \ wd193 \ wd593 \ wd279 \ wd810 \ wd869 \ wd981 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:6485: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6488: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:6490: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" elif test "$GCC" = yes && test "$GCC_VERSION" != "unknown" then { echo "$as_me:6498: checking for $CC warning options..." >&5 echo "$as_me: checking for $CC warning options..." >&6;} cf_save_CFLAGS="$CFLAGS" cf_warn_CONST="" test "$with_ext_const" = yes && cf_warn_CONST="Wwrite-strings" cf_gcc_warnings="Wignored-qualifiers Wlogical-op Wvarargs" test "x$CLANG_COMPILER" = xyes && cf_gcc_warnings= for cf_opt in W Wall \ Wbad-function-cast \ Wcast-align \ Wcast-qual \ Wdeclaration-after-statement \ Wextra \ Winline \ Wmissing-declarations \ Wmissing-prototypes \ Wnested-externs \ Wpointer-arith \ Wshadow \ Wstrict-prototypes \ Wundef Wno-inline $cf_gcc_warnings $cf_warn_CONST Wwrite-strings Wconversion do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:6521: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6524: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:6526: result: ... -$cf_opt" >&5 echo "${ECHO_T}... -$cf_opt" >&6 case "$cf_opt" in (Winline) case "$GCC_VERSION" in ([34].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 echo "${as_me:-configure}:6534: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; (Wpointer-arith) case "$GCC_VERSION" in ([12].*) test -n "$verbose" && echo " feature is broken in gcc $GCC_VERSION" 1>&6 echo "${as_me:-configure}:6544: testing feature is broken in gcc $GCC_VERSION ..." 1>&5 continue;; esac ;; esac EXTRA_CFLAGS="$EXTRA_CFLAGS -$cf_opt" fi done CFLAGS="$cf_save_CFLAGS" fi rm -rf ./conftest* fi fi for ac_header in \ poll.h \ pty.h \ stropts.h \ sys/ioctl.h \ sys/param.h \ sys/poll.h \ sys/select.h \ sys/time.h \ termios.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:6574: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6580 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:6584: \"$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:6590: \$? = $ac_status" >&5 (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi rm -f conftest.err "conftest.$ac_ext" fi echo "$as_me:6609: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6634 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:6665: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6668: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:6671: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6674: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:6684: result: `eval echo '${'"$as_ac_var"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for getgroups/setgroups... $ECHO_C" >&6 if test "${cf_cv_func_setgroups+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6701 "configure" #include "confdefs.h" $ac_includes_default #include int main (void) { gid_t my_list[10]; if (getgroups(0, my_list)) setgroups(0, NULL); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:6719: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6722: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:6725: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6728: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_func_setgroups=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_func_setgroups=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:6739: result: $cf_cv_func_setgroups" >&5 echo "${ECHO_T}$cf_cv_func_setgroups" >&6 test "$cf_cv_func_setgroups" = yes && cat >>confdefs.h <<\EOF #define HAVE_SETGROUPS 1 EOF echo "$as_me:6746: checking for nfds_t" >&5 echo $ECHO_N "checking for nfds_t... $ECHO_C" >&6 if test "${ac_cv_type_nfds_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6752 "configure" #include "confdefs.h" #include #ifdef HAVE_SYS_POLL_H #include #endif int main (void) { if ((nfds_t *) 0) return 0; if (sizeof (nfds_t)) return 0; ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6772: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6775: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6778: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6781: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_type_nfds_t=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_type_nfds_t=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:6791: result: $ac_cv_type_nfds_t" >&5 echo "${ECHO_T}$ac_cv_type_nfds_t" >&6 if test "$ac_cv_type_nfds_t" = yes; then ac_cv_type_nfds_t=yes else ac_cv_type_nfds_t=no fi if test "$ac_cv_type_nfds_t" = no; then cat >>confdefs.h <<\EOF #define nfds_t unsigned long EOF fi echo "$as_me:6807: checking if sys/time.h works with sys/select.h" >&5 echo $ECHO_N "checking if sys/time.h works with sys/select.h... $ECHO_C" >&6 if test "${cf_cv_sys_time_select+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6814 "configure" #include "confdefs.h" #include #ifdef HAVE_SYS_TIME_H #include #endif #ifdef HAVE_SYS_SELECT_H #include #endif int main (void) { ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6834: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6837: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6840: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6843: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_sys_time_select=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_sys_time_select=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:6855: result: $cf_cv_sys_time_select" >&5 echo "${ECHO_T}$cf_cv_sys_time_select" >&6 test "$cf_cv_sys_time_select" = yes && cat >>confdefs.h <<\EOF #define HAVE_SYS_TIME_SELECT 1 EOF # workaround for divergence of xterm/luit in the [CF_FUNC_GRANTPT] macro... for ac_func in grantpt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:6867: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6873 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:6904: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6907: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:6910: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6913: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:6923: result: `eval echo '${'"$as_ac_var"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 6946 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:6950: \"$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:6956: \$? = $ac_status" >&5 (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi rm -f conftest.err "conftest.$ac_ext" fi echo "$as_me:6975: result: `eval echo '${'"$as_ac_Header"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Header"'}'`" >&6 if test "`eval echo '${'"$as_ac_Header"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 7011 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7042: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7045: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7048: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7051: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:7061: result: `eval echo '${'"$as_ac_var"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if grantpt really works... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 7076 "configure" #include "confdefs.h" #include #include #include #include #include #include #include #ifndef HAVE_POSIX_OPENPT #undef posix_openpt #define posix_openpt(mode) open("/dev/ptmx", mode) #endif #ifdef HAVE_STROPTS_H #include #endif static void failed(int code) { perror("conftest"); exit(code); } static void my_timeout(int sig) { (void)sig; exit(99); } int main (void) { int code = 0; int pty; int tty; char *slave; struct termios tio; (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); else if (grantpt(pty) < 0) failed(2); else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); #if (CONFTEST == 3) || defined(CONFTEST_isatty) else if (!isatty(pty)) failed(4); #endif #if CONFTEST >= 4 else if (tcgetattr(pty, &tio) < 0) failed(20); else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. * Linux does treat it that way. */ else if ((tty = open(slave, O_RDWR)) < 0) failed(5); #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 else if (tcgetattr(tty, &tio) < 0) failed(30); else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ (void) tty; ${cf_cv_main_return:-return}(code); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7176: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7179: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7182: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7185: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then if test "$cross_compiling" = yes; then ac_cv_func_grantpt=maybe else cat >"conftest.$ac_ext" <<_ACEOF #line 7192 "configure" #include "confdefs.h" #include #include #include #include #include #include #include #ifndef HAVE_POSIX_OPENPT #undef posix_openpt #define posix_openpt(mode) open("/dev/ptmx", mode) #endif #ifdef HAVE_STROPTS_H #include #endif static void failed(int code) { perror("conftest"); exit(code); } static void my_timeout(int sig) { (void)sig; exit(99); } int main(void) { int code = 0; int pty; int tty; char *slave; struct termios tio; (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); else if (grantpt(pty) < 0) failed(2); else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); #if (CONFTEST == 3) || defined(CONFTEST_isatty) else if (!isatty(pty)) failed(4); #endif #if CONFTEST >= 4 else if (tcgetattr(pty, &tio) < 0) failed(20); else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. * Linux does treat it that way. */ else if ((tty = open(slave, O_RDWR)) < 0) failed(5); #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 else if (tcgetattr(tty, &tio) < 0) failed(30); else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ (void) tty; ${cf_cv_main_return:-return}(code); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:7290: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7293: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:7295: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7298: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_func_grantpt=no fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_func_grantpt=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:7317: result: $ac_cv_func_grantpt" >&5 echo "${ECHO_T}$ac_cv_func_grantpt" >&6 if test "x$ac_cv_func_grantpt" != "xno" ; then if test "x$ac_cv_func_grantpt" = "xyes" ; then echo "$as_me:7323: checking for pty features" >&5 echo $ECHO_N "checking for pty features... $ECHO_C" >&6 if test "x$ac_cv_header_stropts_h" = xyes then cf_pty_this=0 else cf_pty_this=3 fi cf_pty_defines= while test $cf_pty_this != 6 do cf_pty_feature= cf_pty_next="`expr $cf_pty_this + 1`" echo "${as_me:-configure}:7339: testing pty feature test $cf_pty_next:5 ..." 1>&5 if test "$cross_compiling" = yes; then { { echo "$as_me:7342: error: cannot run test program while cross compiling" >&5 echo "$as_me: error: cannot run test program while cross compiling" >&2;} { (exit 1); exit 1; }; } else cat >"conftest.$ac_ext" <<_ACEOF #line 7347 "configure" #include "confdefs.h" #define CONFTEST $cf_pty_this $cf_pty_defines #include #include #include #include #include #include #include #ifndef HAVE_POSIX_OPENPT #undef posix_openpt #define posix_openpt(mode) open("/dev/ptmx", mode) #endif #ifdef HAVE_STROPTS_H #include #endif static void failed(int code) { perror("conftest"); exit(code); } static void my_timeout(int sig) { (void)sig; exit(99); } int main(void) { int code = 0; int pty; int tty; char *slave; struct termios tio; (void)tio; signal(SIGALRM, my_timeout); if (alarm(2) == 9) failed(9); else if ((pty = posix_openpt(O_RDWR)) < 0) failed(1); else if (grantpt(pty) < 0) failed(2); else if (unlockpt(pty) < 0) failed(3); else if ((slave = ptsname(pty)) == 0) failed(4); #if (CONFTEST == 3) || defined(CONFTEST_isatty) else if (!isatty(pty)) failed(4); #endif #if CONFTEST >= 4 else if (tcgetattr(pty, &tio) < 0) failed(20); else if (tcsetattr(pty, TCSAFLUSH, &tio) < 0) failed(21); #endif /* BSD posix_openpt does not treat pty as a terminal until slave is opened. * Linux does treat it that way. */ else if ((tty = open(slave, O_RDWR)) < 0) failed(5); #ifdef CONFTEST #ifdef I_PUSH #if (CONFTEST == 0) || defined(CONFTEST_ptem) else if (ioctl(tty, I_PUSH, "ptem") < 0) failed(10); #endif #if (CONFTEST == 1) || defined(CONFTEST_ldterm) else if (ioctl(tty, I_PUSH, "ldterm") < 0) failed(11); #endif #if (CONFTEST == 2) || defined(CONFTEST_ttcompat) else if (ioctl(tty, I_PUSH, "ttcompat") < 0) failed(12); #endif #endif /* I_PUSH */ #if CONFTEST >= 5 else if (tcgetattr(tty, &tio) < 0) failed(30); else if (tcsetattr(tty, TCSAFLUSH, &tio) < 0) failed(31); #endif #endif /* CONFTEST */ (void) tty; ${cf_cv_main_return:-return}(code); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:7447: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7450: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:7452: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7455: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then case $cf_pty_next in (1) # - streams cf_pty_feature=ptem ;; (2) # - streams cf_pty_feature=ldterm ;; (3) # - streams cf_pty_feature=ttcompat ;; (4) cf_pty_feature=pty_isatty ;; (5) cf_pty_feature=pty_tcsetattr ;; (6) cf_pty_feature=tty_tcsetattr ;; esac else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 case $cf_pty_next in (1|2|3) echo "${as_me:-configure}:7487: testing skipping remaining streams features $cf_pty_this..2 ..." 1>&5 cf_pty_next=3 ;; esac fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi if test -n "$cf_pty_feature" then cf_pty_defines="$cf_pty_defines #define CONFTEST_$cf_pty_feature 1 " cf_grantpt_opts="$cf_grantpt_opts $cf_pty_feature" fi cf_pty_this=$cf_pty_next done echo "$as_me:7506: result: $cf_grantpt_opts" >&5 echo "${ECHO_T}$cf_grantpt_opts" >&6 cf_grantpt_opts=`echo "$cf_grantpt_opts" | sed -e 's/ isatty//'` fi fi fi if test "x$cf_prefer_posix_openpt" = "xyes" && test "x$ac_cv_func_posix_openpt" = "xyes" ; then test -n "$verbose" && echo " prefer posix_openpt over openpty" 1>&6 echo "${as_me:-configure}:7516: testing prefer posix_openpt over openpty ..." 1>&5 elif test "x$disable_openpty" != "xyes" || test -z "$cf_grantpt_opts" ; then echo "$as_me:7519: checking for openpty in -lutil" >&5 echo $ECHO_N "checking for openpty in -lutil... $ECHO_C" >&6 if test "${ac_cv_lib_util_openpty+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lutil $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 7527 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char openpty (void); int main (void) { openpty (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7546: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7549: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7552: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7555: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_util_openpty=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_util_openpty=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7566: result: $ac_cv_lib_util_openpty" >&5 echo "${ECHO_T}$ac_cv_lib_util_openpty" >&6 if test "$ac_cv_lib_util_openpty" = yes; then cf_have_openpty=yes else cf_have_openpty=no fi if test "$cf_have_openpty" = yes ; then ac_cv_func_grantpt=no LIBS="-lutil $LIBS" cat >>confdefs.h <<\EOF #define HAVE_OPENPTY 1 EOF for ac_header in \ util.h \ libutil.h \ pty.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:7589: checking for $ac_header" >&5 echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 if eval "test \"\${$as_ac_Header+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 7595 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:7599: \"$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:7605: \$? = $ac_status" >&5 (exit "$ac_status"); } >/dev/null; then if test -s conftest.err; then ac_cpp_err=$ac_c_preproc_warn_flag else ac_cpp_err= fi else ac_cpp_err=yes fi if test -z "$ac_cpp_err"; then eval "$as_ac_Header=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Header=no" fi rm -f conftest.err "conftest.$ac_ext" fi echo "$as_me:7624: 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 <&6 echo "${as_me:-configure}:7641: testing will rely upon grantpt ..." 1>&5 cat >>confdefs.h <<\EOF #define HAVE_WORKING_GRANTPT 1 EOF for cf_feature in $cf_grantpt_opts do cf_feature=`echo "$cf_feature" | sed -e 's/ //g'` cf_FEATURE=`echo "$cf_feature" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&6 echo "${as_me:-configure}:7662: testing will rely upon BSD-pseudoterminals ..." 1>&5 else test -n "$verbose" && echo " will rely upon openpty" 1>&6 echo "${as_me:-configure}:7667: testing will rely upon openpty ..." 1>&5 fi tty >/dev/null 2>&1 || { for ac_func in posix_openpt do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:7675: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 7681 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7712: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7715: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7718: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7721: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:7731: result: `eval echo '${'"$as_ac_var"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if poll really works... $ECHO_C" >&6 if test "${cf_cv_working_poll+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test "$cross_compiling" = yes; then cf_cv_working_poll=unknown else cat >"conftest.$ac_ext" <<_ACEOF #line 7751 "configure" #include "confdefs.h" $ac_includes_default #include #ifdef HAVE_POLL_H #include #else #include #endif int main(void) { struct pollfd myfds; int ret; /* check for Darwin bug with respect to "devices" */ myfds.fd = open("/dev/null", 1); /* O_WRONLY */ if (myfds.fd < 0) myfds.fd = 0; myfds.events = POLLIN; myfds.revents = 0; ret = poll(&myfds, 1, 100); if (ret < 0 || (myfds.revents & POLLNVAL)) { ret = -1; } else { int fd = 0; if (!isatty(fd)) { fd = open("/dev/tty", 2); /* O_RDWR */ } #ifdef HAVE_POSIX_OPENPT if (fd < 0) { fd = posix_openpt(O_RDWR); } #endif if (fd >= 0) { /* also check with standard input */ myfds.fd = fd; myfds.events = POLLIN; myfds.revents = 0; ret = poll(&myfds, 1, 100); } else { ret = -1; } } ${cf_cv_main_return:-return}(ret < 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:7804: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7807: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:7809: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7812: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_working_poll=yes else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_working_poll=no fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi fi echo "$as_me:7824: result: $cf_cv_working_poll" >&5 echo "${ECHO_T}$cf_cv_working_poll" >&6 test "$cf_cv_working_poll" = "yes" && cat >>confdefs.h <<\EOF #define HAVE_WORKING_POLL 1 EOF echo "$as_me:7831: checking if you want to use fontenc" >&5 echo $ECHO_N "checking if you want to use fontenc... $ECHO_C" >&6 # Check whether --enable-fontenc or --disable-fontenc was given. if test "${enable_fontenc+set}" = set; then enableval="$enable_fontenc" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then with_fontenc=yes else with_fontenc=maybe fi else enableval=no with_fontenc=maybe fi; echo "$as_me:7848: result: $with_fontenc" >&5 echo "${ECHO_T}$with_fontenc" >&6 echo "$as_me:7851: checking if you want to use iconv" >&5 echo $ECHO_N "checking if you want to use iconv... $ECHO_C" >&6 # Check whether --enable-iconv or --disable-iconv was given. if test "${enable_iconv+set}" = set; then enableval="$enable_iconv" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then with_iconv=no else with_iconv=maybe fi else enableval=yes with_iconv=maybe fi; echo "$as_me:7868: result: $with_iconv" >&5 echo "${ECHO_T}$with_iconv" >&6 case $with_iconv in yes) case $with_fontenc in yes) with_fontenc=no { echo "$as_me:7876: WARNING: overriding deprecated fontenc" >&5 echo "$as_me: WARNING: overriding deprecated fontenc" >&2;} ;; maybe|no) with_fontenc=no { echo "$as_me:7881: using iconv" >&5 echo "$as_me: using iconv" >&6;} ;; esac ;; no) case $with_fontenc in yes) ;; no) { { echo "$as_me:7891: error: you must choose between iconv and fontenc" >&5 echo "$as_me: error: you must choose between iconv and fontenc" >&2;} { (exit 1); exit 1; }; } ;; maybe) with_fontenc=yes { echo "$as_me:7897: using fontenc" >&5 echo "$as_me: using fontenc" >&6;} ;; esac ;; maybe) case $with_fontenc in yes) with_iconv=no { echo "$as_me:7906: using fontenc" >&5 echo "$as_me: using fontenc" >&6;} ;; no|maybe) with_iconv=yes with_fontenc=no { echo "$as_me:7912: using iconv" >&5 echo "$as_me: using iconv" >&6;} ;; esac ;; esac # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these # will be set on completion of the AC_TRY_LINK below. cf_cv_header_path_z= cf_cv_library_path_z= echo "${as_me:-configure}:7924: testing Starting FIND_LINKAGE(z,zlib) ..." 1>&5 cf_save_LIBS="$LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 7929 "configure" #include "confdefs.h" #include int main (void) { gzopen("name","mode") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7945: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7948: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7951: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7954: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_find_linkage_z=yes cf_cv_header_path_z=/usr/include cf_cv_library_path_z=/usr/lib else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 LIBS="-lz $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 7968 "configure" #include "confdefs.h" #include int main (void) { gzopen("name","mode") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7984: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7987: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7990: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7993: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_find_linkage_z=yes cf_cv_header_path_z=/usr/include cf_cv_library_path_z=/usr/lib cf_cv_library_file_z="-lz" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_find_linkage_z=no LIBS="$cf_save_LIBS" test -n "$verbose" && echo " find linkage for z library" 1>&6 echo "${as_me:-configure}:8010: testing find linkage for z library ..." 1>&5 echo "${as_me:-configure}:8012: testing Searching for headers in FIND_LINKAGE(z,zlib) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" cf_search= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case "$cf_header_path" in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` test "x$cf_header_path" != "xNONE" && \ test -d "$cf_header_path" && \ { test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include" test -d "$cf_header_path/include/zlib" && cf_search="$cf_search $cf_header_path/include/zlib" test -d "$cf_header_path/include/zlib/include" && cf_search="$cf_search $cf_header_path/include/zlib/include" test -d "$cf_header_path/zlib/include" && cf_search="$cf_search $cf_header_path/zlib/include" test -d "$cf_header_path/zlib/include/zlib" && cf_search="$cf_search $cf_header_path/zlib/include/zlib" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d "$prefix/include" && cf_search="$cf_search $prefix/include" test -d "$prefix/include/zlib" && cf_search="$cf_search $prefix/include/zlib" test -d "$prefix/include/zlib/include" && cf_search="$cf_search $prefix/include/zlib/include" test -d "$prefix/zlib/include" && cf_search="$cf_search $prefix/zlib/include" test -d "$prefix/zlib/include/zlib" && cf_search="$cf_search $prefix/zlib/include/zlib" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && { test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix" test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include" test -d "$cf_subdir_prefix/include/zlib" && cf_search="$cf_search $cf_subdir_prefix/include/zlib" test -d "$cf_subdir_prefix/include/zlib/include" && cf_search="$cf_search $cf_subdir_prefix/include/zlib/include" test -d "$cf_subdir_prefix/zlib/include" && cf_search="$cf_search $cf_subdir_prefix/zlib/include" test -d "$cf_subdir_prefix/zlib/include/zlib" && cf_search="$cf_search $cf_subdir_prefix/zlib/include/zlib" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d "$includedir" && cf_search="$cf_search $includedir" test -d "$includedir/zlib" && cf_search="$cf_search $includedir/zlib" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir" test -d "$oldincludedir/zlib" && cf_search="$cf_search $oldincludedir/zlib" } cf_search="$cf_search $cf_header_path_list" for cf_cv_header_path_z in $cf_search do if test -d "$cf_cv_header_path_z" ; then test -n "$verbose" && echo " ... testing $cf_cv_header_path_z" 1>&6 echo "${as_me:-configure}:8103: testing ... testing $cf_cv_header_path_z ..." 1>&5 CPPFLAGS="$cf_save_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_z" cat >"conftest.$ac_ext" <<_ACEOF #line 8111 "configure" #include "confdefs.h" #include int main (void) { gzopen("name","mode") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:8127: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8130: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:8133: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8136: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found z headers in $cf_cv_header_path_z" 1>&6 echo "${as_me:-configure}:8141: testing ... found z headers in $cf_cv_header_path_z ..." 1>&5 cf_cv_find_linkage_z=maybe cf_test_CPPFLAGS="$CPPFLAGS" break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi done if test "$cf_cv_find_linkage_z" = maybe ; then echo "${as_me:-configure}:8159: testing Searching for z library in FIND_LINKAGE(z,zlib) ..." 1>&5 cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-lz $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 8167 "configure" #include "confdefs.h" #include int main (void) { gzopen("name","mode") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8183: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8186: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8189: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8192: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found z library in system" 1>&6 echo "${as_me:-configure}:8197: testing ... found z library in system ..." 1>&5 cf_cv_find_linkage_z=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_z" != yes ; then cf_search= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case "$cf_library_path" in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` test "x$cf_library_path" != "xNONE" && \ test -d "$cf_library_path" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib" test -d "$cf_library_path/lib/z" && cf_search="$cf_search $cf_library_path/lib/z" test -d "$cf_library_path/lib/z/lib" && cf_search="$cf_search $cf_library_path/lib/z/lib" test -d "$cf_library_path/z/lib" && cf_search="$cf_search $cf_library_path/z/lib" test -d "$cf_library_path/z/lib/z" && cf_search="$cf_search $cf_library_path/z/lib/z" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib" test -d "$prefix/lib/z" && cf_search="$cf_search $prefix/lib/z" test -d "$prefix/lib/z/lib" && cf_search="$cf_search $prefix/lib/z/lib" test -d "$prefix/z/lib" && cf_search="$cf_search $prefix/z/lib" test -d "$prefix/z/lib/z" && cf_search="$cf_search $prefix/z/lib/z" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && { test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix" test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib" test -d "$cf_subdir_prefix/lib/z" && cf_search="$cf_search $cf_subdir_prefix/lib/z" test -d "$cf_subdir_prefix/lib/z/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/z/lib" test -d "$cf_subdir_prefix/z/lib" && cf_search="$cf_search $cf_subdir_prefix/z/lib" test -d "$cf_subdir_prefix/z/lib/z" && cf_search="$cf_search $cf_subdir_prefix/z/lib/z" } done cf_search="$cf_library_path_list $cf_search" for cf_cv_library_path_z in $cf_search do if test -d "$cf_cv_library_path_z" ; then test -n "$verbose" && echo " ... testing $cf_cv_library_path_z" 1>&6 echo "${as_me:-configure}:8278: testing ... testing $cf_cv_library_path_z ..." 1>&5 CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-lz $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_z" cat >"conftest.$ac_ext" <<_ACEOF #line 8284 "configure" #include "confdefs.h" #include int main (void) { gzopen("name","mode") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8300: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8303: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8306: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8309: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found z library in $cf_cv_library_path_z" 1>&6 echo "${as_me:-configure}:8314: testing ... found z library in $cf_cv_library_path_z ..." 1>&5 cf_cv_find_linkage_z=yes cf_cv_library_file_z="-lz" break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi done CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi else cf_cv_find_linkage_z=no fi fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_z" = yes ; then if test -n "$cf_cv_header_path_z" ; then for cf_add_incdir in $cf_cv_header_path_z do while test "$cf_add_incdir" != /usr/include do if test -d "$cf_add_incdir" then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir" cat >"conftest.$ac_ext" <<_ACEOF #line 8376 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:8388: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8391: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:8394: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8397: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_have_incdir=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:8414: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi if test -n "$cf_cv_library_path_z" ; then for cf_add_libdir in $cf_cv_library_path_z do if test "$cf_add_libdir" = /usr/lib ; then : elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 echo "${as_me:-configure}:8450: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -lz; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" else { echo "$as_me:8475: WARNING: Cannot find z library" >&5 echo "$as_me: WARNING: Cannot find z library" >&2;} fi for ac_func in \ zError \ do as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` echo "$as_me:8484: checking for $ac_func" >&5 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 if eval "test \"\${$as_ac_var+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 8490 "configure" #include "confdefs.h" #define $ac_func autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef $ac_func #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char $ac_func (void); int main (void) { /* The GNU C library defines stubs for functions which it implements to always fail with ENOSYS. Some functions are actually named something starting with __ and the normal name is an alias. */ #if defined (__stub_$ac_func) || defined (__stub___$ac_func) #error found stub for $ac_func #endif return $ac_func (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8521: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8524: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8527: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8530: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_var=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_var=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:8540: result: `eval echo '${'"$as_ac_var"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_var"'}'`" >&6 if test "`eval echo '${'"$as_ac_var"'}'`" = yes; then cat >>confdefs.h <>confdefs.h <<\EOF #define USE_ZLIB 1 EOF fi if test "$with_fontenc" = yes then echo "$as_me:8562: checking if you want to use pkg-config" >&5 echo $ECHO_N "checking if you want to use pkg-config... $ECHO_C" >&6 # Check whether --with-pkg-config or --without-pkg-config was given. if test "${with_pkg_config+set}" = set; then withval="$with_pkg_config" cf_pkg_config=$withval else cf_pkg_config=yes fi; echo "$as_me:8572: result: $cf_pkg_config" >&5 echo "${ECHO_T}$cf_pkg_config" >&6 case "$cf_pkg_config" in (no) PKG_CONFIG=none ;; (yes) if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}pkg-config", so it can be a program name with args. set dummy ${ac_tool_prefix}pkg-config; ac_word=$2 echo "$as_me:8584: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_PKG_CONFIG="$ac_dir/$ac_word" echo "$as_me:8601: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi PKG_CONFIG=$ac_cv_path_PKG_CONFIG if test -n "$PKG_CONFIG"; then echo "$as_me:8612: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:8615: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_path_PKG_CONFIG"; then ac_pt_PKG_CONFIG=$PKG_CONFIG # Extract the first word of "pkg-config", so it can be a program name with args. set dummy pkg-config; ac_word=$2 echo "$as_me:8624: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_ac_pt_PKG_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $ac_pt_PKG_CONFIG in [\\/]* | ?:[\\/]*) ac_cv_path_ac_pt_PKG_CONFIG="$ac_pt_PKG_CONFIG" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_ac_pt_PKG_CONFIG="$ac_dir/$ac_word" echo "$as_me:8641: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_ac_pt_PKG_CONFIG" && ac_cv_path_ac_pt_PKG_CONFIG="none" ;; esac fi ac_pt_PKG_CONFIG=$ac_cv_path_ac_pt_PKG_CONFIG if test -n "$ac_pt_PKG_CONFIG"; then echo "$as_me:8653: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 else echo "$as_me:8656: result: no" >&5 echo "${ECHO_T}no" >&6 fi PKG_CONFIG=$ac_pt_PKG_CONFIG else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi ;; (*) PKG_CONFIG=$withval ;; esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case "x$PKG_CONFIG" in (x\$\(*\)*|x\'*\'*) ;; (x.|x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER) ;; (x\$\{*prefix\}*|x\$\{*dir\}*) eval PKG_CONFIG="$PKG_CONFIG" case "x$PKG_CONFIG" in (xNONE/*) PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (xno|xNONE/*) PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:8697: error: expected a pathname, not \"$PKG_CONFIG\"" >&5 echo "$as_me: error: expected a pathname, not \"$PKG_CONFIG\"" >&2;} { (exit 1); exit 1; }; } ;; esac elif test "x$cf_pkg_config" != xno ; then { echo "$as_me:8704: WARNING: pkg-config is not installed" >&5 echo "$as_me: WARNING: pkg-config is not installed" >&2;} fi cf_extra_fontenc_incs= cf_extra_fontenc_libs="-lfontenc -lX11" FONTENC_CONFIG= FONTENC_PARAMS= if test "$PKG_CONFIG" != none; then if "$PKG_CONFIG" --exists fontenc; then FONTENC_CONFIG=$PKG_CONFIG FONTENC_PARAMS="fontenc x11" cf_extra_fontenc_libs= fi fi echo "$as_me:8721: checking for optional font-encoding cflags" >&5 echo $ECHO_N "checking for optional font-encoding cflags... $ECHO_C" >&6 # Check whether --with-fontenc-cflags or --without-fontenc-cflags was given. if test "${with_fontenc_cflags+set}" = set; then withval="$with_fontenc_cflags" cf_x_fontenc_incs="$withval" else cf_x_fontenc_incs=auto fi; test "$cf_x_fontenc_incs" = yes && cf_x_fontenc_incs=auto echo "$as_me:8732: result: $cf_x_fontenc_incs" >&5 echo "${ECHO_T}$cf_x_fontenc_incs" >&6 echo "$as_me:8735: checking for optional font-encoding libraries" >&5 echo $ECHO_N "checking for optional font-encoding libraries... $ECHO_C" >&6 # Check whether --with-fontenc-libs or --without-fontenc-libs was given. if test "${with_fontenc_libs+set}" = set; then withval="$with_fontenc_libs" cf_x_fontenc_libs="$withval" else cf_x_fontenc_libs=auto fi; test "$cf_x_fontenc_libs" = yes && cf_x_fontenc_libs=auto echo "$as_me:8746: result: $cf_x_fontenc_libs" >&5 echo "${ECHO_T}$cf_x_fontenc_libs" >&6 if test "$cf_x_fontenc_incs" = auto ; then echo "$as_me:8750: checking for X font-encoding headers" >&5 echo $ECHO_N "checking for X font-encoding headers... $ECHO_C" >&6 if test "${cf_cv_x_fontenc_incs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$FONTENC_CONFIG" ; then cf_cv_x_fontenc_incs="`$FONTENC_CONFIG $FONTENC_PARAMS --cflags 2>/dev/null`" else cf_cv_x_fontenc_incs=$cf_extra_fontenc_incs fi fi echo "$as_me:8763: result: $cf_cv_x_fontenc_incs" >&5 echo "${ECHO_T}$cf_cv_x_fontenc_incs" >&6 else cf_cv_x_fontenc_incs=$cf_x_fontenc_incs fi if test "$cf_x_fontenc_libs" = auto ; then echo "$as_me:8770: checking for X font-encoding libraries" >&5 echo $ECHO_N "checking for X font-encoding libraries... $ECHO_C" >&6 if test "${cf_cv_x_fontenc_libs+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$FONTENC_CONFIG" ; then cf_cv_x_fontenc_libs="`$FONTENC_CONFIG $FONTENC_PARAMS --libs 2>/dev/null`" else cf_cv_x_fontenc_libs=$cf_extra_fontenc_libs fi fi echo "$as_me:8783: result: $cf_cv_x_fontenc_libs" >&5 echo "${ECHO_T}$cf_cv_x_fontenc_libs" >&6 else cf_cv_x_fontenc_libs=$cf_x_fontenc_libs fi cf_save_LIBS="$LIBS" cf_save_INCS="$CPPFLAGS" LIBS="$cf_cv_x_fontenc_libs $LIBS $X_LIBS" CPPFLAGS="$CPPFLAGS $X_CFLAGS $cf_cv_x_fontenc_incs" echo "$as_me:8795: checking if we can link with font encoding library" >&5 echo $ECHO_N "checking if we can link with font encoding library... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 8798 "configure" #include "confdefs.h" $ac_includes_default #include #include int main (void) { FontMapPtr mapping = FontEncMapFind(0, FONT_ENCODING_UNICODE, -1, -1, NULL); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8815: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8818: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8821: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8824: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_have_fontenc_libs=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_have_fontenc_libs=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:8833: result: $cf_have_fontenc_libs" >&5 echo "${ECHO_T}$cf_have_fontenc_libs" >&6 LIBS="$cf_save_LIBS" CPPFLAGS="$cf_save_INCS" if test $cf_have_fontenc_libs = yes ; then LIBS="$cf_cv_x_fontenc_libs $LIBS $X_LIBS" cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_x_fontenc_incs do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi else { echo "$as_me:8941: WARNING: No libraries found for font-encoding" >&5 echo "$as_me: WARNING: No libraries found for font-encoding" >&2;} fi if test $cf_have_fontenc_libs = yes ; then cat >>confdefs.h <<\EOF #define USE_FONTENC 1 EOF else { { echo "$as_me:8952: error: cannot link with fontenc" >&5 echo "$as_me: error: cannot link with fontenc" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:8958: checking for nl_langinfo and CODESET" >&5 echo $ECHO_N "checking for nl_langinfo and CODESET... $ECHO_C" >&6 if test "${am_cv_langinfo_codeset+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 8964 "configure" #include "confdefs.h" $ac_includes_default #include int main (void) { char* cs = nl_langinfo(CODESET); (void)cs ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8978: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8981: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8984: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8987: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then am_cv_langinfo_codeset=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 am_cv_langinfo_codeset=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:8998: result: $am_cv_langinfo_codeset" >&5 echo "${ECHO_T}$am_cv_langinfo_codeset" >&6 if test "$am_cv_langinfo_codeset" = yes; then cat >>confdefs.h <<\EOF #define HAVE_LANGINFO_CODESET 1 EOF fi # Since iconv is widely available, fallback to using it if fontenc is neither # requested nor available. if test "$with_iconv" = yes then echo "$as_me:9013: checking for PATH separator" >&5 echo $ECHO_N "checking for PATH separator... $ECHO_C" >&6 case "$cf_cv_system_name" in (os2*) PATH_SEPARATOR=';' ;; (*) ${PATH_SEPARATOR:=':'} ;; esac echo "$as_me:9020: result: $PATH_SEPARATOR" >&5 echo "${ECHO_T}$PATH_SEPARATOR" >&6 # Check whether --with-libiconv-prefix or --without-libiconv-prefix was given. if test "${with_libiconv_prefix+set}" = set; then withval="$with_libiconv_prefix" case "x$withval" in (xno|xyes|x) ;; (*) for cf_searchpath in `echo "$withval" | tr $PATH_SEPARATOR ' '`; do if test -d "$cf_searchpath/include" ; then if test -n "$cf_searchpath/include" ; then for cf_add_incdir in $cf_searchpath/include do while test "$cf_add_incdir" != /usr/include do if test -d "$cf_add_incdir" then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir" cat >"conftest.$ac_ext" <<_ACEOF #line 9062 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9074: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9077: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9080: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9083: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_have_incdir=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:9100: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi elif test -d "$cf_searchpath/../include" ; then if test -n "$cf_searchpath/../include" ; then for cf_add_incdir in $cf_searchpath/../include do while test "$cf_add_incdir" != /usr/include do if test -d "$cf_add_incdir" then cf_have_incdir=no if test -n "$CFLAGS$CPPFLAGS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_incdir in $CFLAGS $CPPFLAGS ; do if test ".$cf_test_incdir" = ".-I$cf_add_incdir" ; then cf_have_incdir=yes; break fi done fi if test "$cf_have_incdir" = no ; then if test "$cf_add_incdir" = /usr/local/include ; then if test "$GCC" = yes then cf_save_CPPFLAGS=$CPPFLAGS test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-I$cf_add_incdir" cat >"conftest.$ac_ext" <<_ACEOF #line 9146 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9158: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9161: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9164: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9167: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_have_incdir=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:9184: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi else { { echo "$as_me:9202: error: cannot find libiconv under $withval" >&5 echo "$as_me: error: cannot find libiconv under $withval" >&2;} { (exit 1); exit 1; }; } fi if test -d "$cf_searchpath/lib" ; then if test -n "$cf_searchpath/lib" ; then for cf_add_libdir in $cf_searchpath/lib do if test "$cf_add_libdir" = /usr/lib ; then : elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 echo "${as_me:-configure}:9227: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi elif test -d "$cf_searchpath" ; then if test -n "$cf_searchpath" ; then for cf_add_libdir in $cf_searchpath do if test "$cf_add_libdir" = /usr/lib ; then : elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 echo "${as_me:-configure}:9256: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi else { { echo "$as_me:9265: error: cannot find libiconv under $withval" >&5 echo "$as_me: error: cannot find libiconv under $withval" >&2;} { (exit 1); exit 1; }; } fi done test -n "$verbose" && echo " setting path value for libiconv to $withval" 1>&6 echo "${as_me:-configure}:9273: testing setting path value for libiconv to $withval ..." 1>&5 ;; esac fi; echo "$as_me:9280: checking for iconv" >&5 echo $ECHO_N "checking for iconv... $ECHO_C" >&6 if test "${am_cv_func_iconv+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # If the linkage is not already in the $CPPFLAGS/$LDFLAGS configuration, these # will be set on completion of the AC_TRY_LINK below. cf_cv_header_path_iconv= cf_cv_library_path_iconv= echo "${as_me:-configure}:9291: testing Starting FIND_LINKAGE(iconv,) ..." 1>&5 cf_save_LIBS="$LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 9296 "configure" #include "confdefs.h" #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:9315: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9318: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:9321: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9324: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_find_linkage_iconv=yes cf_cv_header_path_iconv=/usr/include cf_cv_library_path_iconv=/usr/lib else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 LIBS="-liconv $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 9338 "configure" #include "confdefs.h" #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:9357: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9360: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:9363: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9366: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_find_linkage_iconv=yes cf_cv_header_path_iconv=/usr/include cf_cv_library_path_iconv=/usr/lib cf_cv_library_file_iconv="-liconv" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_find_linkage_iconv=no LIBS="$cf_save_LIBS" test -n "$verbose" && echo " find linkage for iconv library" 1>&6 echo "${as_me:-configure}:9383: testing find linkage for iconv library ..." 1>&5 echo "${as_me:-configure}:9385: testing Searching for headers in FIND_LINKAGE(iconv,) ..." 1>&5 cf_save_CPPFLAGS="$CPPFLAGS" cf_test_CPPFLAGS="$CPPFLAGS" cf_search= # collect the current set of include-directories from compiler flags cf_header_path_list="" if test -n "${CFLAGS}${CPPFLAGS}" ; then for cf_header_path in $CPPFLAGS $CFLAGS do case "$cf_header_path" in (-I*) cf_header_path=`echo ".$cf_header_path" |sed -e 's/^...//' -e 's,/include$,,'` test "x$cf_header_path" != "xNONE" && \ test -d "$cf_header_path" && \ { test -n "$verbose" && echo " ... testing for include-directories under $cf_header_path" test -d "$cf_header_path/include" && cf_search="$cf_search $cf_header_path/include" test -d "$cf_header_path/include/iconv" && cf_search="$cf_search $cf_header_path/include/iconv" test -d "$cf_header_path/include/iconv/include" && cf_search="$cf_search $cf_header_path/include/iconv/include" test -d "$cf_header_path/iconv/include" && cf_search="$cf_search $cf_header_path/iconv/include" test -d "$cf_header_path/iconv/include/iconv" && cf_search="$cf_search $cf_header_path/iconv/include/iconv" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for include-directories under $prefix" test -d "$prefix/include" && cf_search="$cf_search $prefix/include" test -d "$prefix/include/iconv" && cf_search="$cf_search $prefix/include/iconv" test -d "$prefix/include/iconv/include" && cf_search="$cf_search $prefix/include/iconv/include" test -d "$prefix/iconv/include" && cf_search="$cf_search $prefix/iconv/include" test -d "$prefix/iconv/include/iconv" && cf_search="$cf_search $prefix/iconv/include/iconv" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && { test -n "$verbose" && echo " ... testing for include-directories under $cf_subdir_prefix" test -d "$cf_subdir_prefix/include" && cf_search="$cf_search $cf_subdir_prefix/include" test -d "$cf_subdir_prefix/include/iconv" && cf_search="$cf_search $cf_subdir_prefix/include/iconv" test -d "$cf_subdir_prefix/include/iconv/include" && cf_search="$cf_search $cf_subdir_prefix/include/iconv/include" test -d "$cf_subdir_prefix/iconv/include" && cf_search="$cf_search $cf_subdir_prefix/iconv/include" test -d "$cf_subdir_prefix/iconv/include/iconv" && cf_search="$cf_search $cf_subdir_prefix/iconv/include/iconv" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d "$includedir" && cf_search="$cf_search $includedir" test -d "$includedir/iconv" && cf_search="$cf_search $includedir/iconv" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir" test -d "$oldincludedir/iconv" && cf_search="$cf_search $oldincludedir/iconv" } cf_search="$cf_search $cf_header_path_list" for cf_cv_header_path_iconv in $cf_search do if test -d "$cf_cv_header_path_iconv" ; then test -n "$verbose" && echo " ... testing $cf_cv_header_path_iconv" 1>&6 echo "${as_me:-configure}:9476: testing ... testing $cf_cv_header_path_iconv ..." 1>&5 CPPFLAGS="$cf_save_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_iconv" cat >"conftest.$ac_ext" <<_ACEOF #line 9484 "configure" #include "confdefs.h" #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9503: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9506: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9509: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9512: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found iconv headers in $cf_cv_header_path_iconv" 1>&6 echo "${as_me:-configure}:9517: testing ... found iconv headers in $cf_cv_header_path_iconv ..." 1>&5 cf_cv_find_linkage_iconv=maybe cf_test_CPPFLAGS="$CPPFLAGS" break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 CPPFLAGS="$cf_save_CPPFLAGS" fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi done if test "$cf_cv_find_linkage_iconv" = maybe ; then echo "${as_me:-configure}:9535: testing Searching for iconv library in FIND_LINKAGE(iconv,) ..." 1>&5 cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" if test "$cf_cv_find_linkage_iconv" != yes ; then cf_search= cf_library_path_list="" if test -n "${LDFLAGS}${LIBS}" ; then for cf_library_path in $LDFLAGS $LIBS do case "$cf_library_path" in (-L*) cf_library_path=`echo ".$cf_library_path" |sed -e 's/^...//' -e 's,/lib$,,'` test "x$cf_library_path" != "xNONE" && \ test -d "$cf_library_path" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $cf_library_path" test -d "$cf_library_path/lib" && cf_search="$cf_search $cf_library_path/lib" test -d "$cf_library_path/lib/iconv" && cf_search="$cf_search $cf_library_path/lib/iconv" test -d "$cf_library_path/lib/iconv/lib" && cf_search="$cf_search $cf_library_path/lib/iconv/lib" test -d "$cf_library_path/iconv/lib" && cf_search="$cf_search $cf_library_path/iconv/lib" test -d "$cf_library_path/iconv/lib/iconv" && cf_search="$cf_search $cf_library_path/iconv/lib/iconv" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "x$prefix" != "xNONE" && \ test -d "$prefix" && \ { test -n "$verbose" && echo " ... testing for lib-directories under $prefix" test -d "$prefix/lib" && cf_search="$cf_search $prefix/lib" test -d "$prefix/lib/iconv" && cf_search="$cf_search $prefix/lib/iconv" test -d "$prefix/lib/iconv/lib" && cf_search="$cf_search $prefix/lib/iconv/lib" test -d "$prefix/iconv/lib" && cf_search="$cf_search $prefix/iconv/lib" test -d "$prefix/iconv/lib/iconv" && cf_search="$cf_search $prefix/iconv/lib/iconv" } for cf_subdir_prefix in \ /usr \ /usr/local \ /usr/pkg \ /opt \ /opt/local \ $HOME do test "x$cf_subdir_prefix" != "x$prefix" && \ test -d "$cf_subdir_prefix" && \ { test -z "$prefix" || test "x$prefix" = xNONE || test "x$cf_subdir_prefix" != "x$prefix"; } && { test -n "$verbose" && echo " ... testing for lib-directories under $cf_subdir_prefix" test -d "$cf_subdir_prefix/lib" && cf_search="$cf_search $cf_subdir_prefix/lib" test -d "$cf_subdir_prefix/lib/iconv" && cf_search="$cf_search $cf_subdir_prefix/lib/iconv" test -d "$cf_subdir_prefix/lib/iconv/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/iconv/lib" test -d "$cf_subdir_prefix/iconv/lib" && cf_search="$cf_search $cf_subdir_prefix/iconv/lib" test -d "$cf_subdir_prefix/iconv/lib/iconv" && cf_search="$cf_search $cf_subdir_prefix/iconv/lib/iconv" } done cf_search="$cf_library_path_list $cf_search" for cf_cv_library_path_iconv in $cf_search do if test -d "$cf_cv_library_path_iconv" ; then test -n "$verbose" && echo " ... testing $cf_cv_library_path_iconv" 1>&6 echo "${as_me:-configure}:9610: testing ... testing $cf_cv_library_path_iconv ..." 1>&5 CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-liconv $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_iconv" cat >"conftest.$ac_ext" <<_ACEOF #line 9616 "configure" #include "confdefs.h" #include #include int main (void) { iconv_t cd = iconv_open("",""); iconv(cd,NULL,NULL,NULL,NULL); iconv_close(cd); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:9635: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9638: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:9641: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9644: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found iconv library in $cf_cv_library_path_iconv" 1>&6 echo "${as_me:-configure}:9649: testing ... found iconv library in $cf_cv_library_path_iconv ..." 1>&5 cf_cv_find_linkage_iconv=yes cf_cv_library_file_iconv="-liconv" break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi done CPPFLAGS="$cf_save_CPPFLAGS" LDFLAGS="$cf_save_LDFLAGS" fi else cf_cv_find_linkage_iconv=no fi fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS="$cf_save_LIBS" if test "$cf_cv_find_linkage_iconv" = yes ; then am_cv_func_iconv=yes else am_cv_func_iconv="no, consider installing GNU libiconv" fi fi echo "$as_me:9689: result: $am_cv_func_iconv" >&5 echo "${ECHO_T}$am_cv_func_iconv" >&6 if test "$am_cv_func_iconv" = yes; then cat >>confdefs.h <<\EOF #define HAVE_ICONV 1 EOF echo "$as_me:9698: checking if the declaration of iconv() needs const." >&5 echo $ECHO_N "checking if the declaration of iconv() needs const.... $ECHO_C" >&6 if test "${am_cv_proto_iconv_const+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 9705 "configure" #include "confdefs.h" #include #include extern #ifdef __cplusplus "C" #endif #if defined(__STDC__) || defined(__cplusplus) size_t iconv (iconv_t cd, char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft); #else size_t iconv(); #endif int main (void) { ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9730: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9733: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9736: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9739: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then am_cv_proto_iconv_const=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 am_cv_proto_iconv_const=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:9749: result: $am_cv_proto_iconv_const" >&5 echo "${ECHO_T}$am_cv_proto_iconv_const" >&6 if test "$am_cv_proto_iconv_const" = yes ; then am_cv_proto_iconv_arg1="const" else am_cv_proto_iconv_arg1="" fi cat >>confdefs.h <"conftest.$ac_ext" <<_ACEOF #line 9794 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9806: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9809: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9812: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9815: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_have_incdir=yes fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" CPPFLAGS=$cf_save_CPPFLAGS fi fi fi if test "$cf_have_incdir" = no ; then test -n "$verbose" && echo " adding $cf_add_incdir to include-path" 1>&6 echo "${as_me:-configure}:9832: testing adding $cf_add_incdir to include-path ..." 1>&5 CPPFLAGS="$CPPFLAGS -I$cf_add_incdir" cf_top_incdir=`echo "$cf_add_incdir" | sed -e 's%/include/.*$%/include%'` test "$cf_top_incdir" = "$cf_add_incdir" && break cf_add_incdir="$cf_top_incdir" else break fi else break fi done done fi if test -n "$cf_cv_library_file_iconv" ; then LIBICONV="-liconv" if test -n "$cf_cv_library_path_iconv" ; then for cf_add_libdir in $cf_cv_library_path_iconv do if test "$cf_add_libdir" = /usr/lib ; then : elif test -d "$cf_add_libdir" then cf_have_libdir=no if test -n "$LDFLAGS$LIBS" ; then # a loop is needed to ensure we can add subdirs of existing dirs for cf_test_libdir in $LDFLAGS $LIBS ; do if test ".$cf_test_libdir" = ".-L$cf_add_libdir" ; then cf_have_libdir=yes; break fi done fi if test "$cf_have_libdir" = no ; then test -n "$verbose" && echo " adding $cf_add_libdir to library-path" 1>&6 echo "${as_me:-configure}:9871: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi fi fi cat >>confdefs.h <<\EOF #define USE_ICONV 1 EOF cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $LIBICONV; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" EXTRASRCS="$EXTRASRCS luitconv.c builtin.c" EXTRAOBJS="$EXTRAOBJS luitconv\$o builtin\$o" fi echo "$as_me:9906: checking for location of encodings.dir file" >&5 echo $ECHO_N "checking for location of encodings.dir file... $ECHO_C" >&6 # Check whether --with-encodings-dir or --without-encodings-dir was given. if test "${with_encodings_dir+set}" = set; then withval="$with_encodings_dir" ENCODINGS_DIR_FILE=$withval else ENCODINGS_DIR_FILE=auto fi; test -n "$verbose" && echo " " 1>&6 echo "${as_me:-configure}:9919: testing ..." 1>&5 case "x$ENCODINGS_DIR_FILE" in (xauto|xyes|xno) ENCODINGS_DIR_FILE=unknown for cf_leaf in lib share do for cf_path in \ /usr/X11R7/$cf_leaf/X11/fonts \ /usr/X11R6/$cf_leaf/X11/fonts \ /usr/local/$cf_leaf/X11/fonts \ /opt/local/$cf_leaf/fonts/X11 \ /opt/X11/$cf_leaf/X11/fonts \ /usr/$cf_leaf/fonts/X11 \ /usr/$cf_leaf/X11/fonts do test -d "$cf_path" || continue cf_encodings_dir=$cf_path/encodings/encodings.dir test -n "$verbose" && echo " ...testing $cf_encodings_dir" 1>&6 echo "${as_me:-configure}:9939: testing ...testing $cf_encodings_dir ..." 1>&5 if test -f $cf_encodings_dir ; then ENCODINGS_DIR_FILE=$cf_encodings_dir break fi done done ;; (*) if test ! -f "$ENCODINGS_DIR_FILE" ; then { echo "$as_me:9950: WARNING: Encodings file not found: $ENCODINGS_DIR_FILE" >&5 echo "$as_me: WARNING: Encodings file not found: $ENCODINGS_DIR_FILE" >&2;} ENCODINGS_DIR_FILE=/usr/share/fonts/X11 fi ;; esac echo "$as_me:9956: result: $ENCODINGS_DIR_FILE" >&5 echo "${ECHO_T}$ENCODINGS_DIR_FILE" >&6 test $ENCODINGS_DIR_FILE = unknown && ENCODINGS_DIR_FILE= cat >>confdefs.h <&5 echo $ECHO_N "checking for location of locale alias file... $ECHO_C" >&6 # Check whether --with-locale-alias or --without-locale-alias was given. if test "${with_locale_alias+set}" = set; then withval="$with_locale_alias" LOCALE_ALIAS_FILE=$withval else LOCALE_ALIAS_FILE=auto fi; test -n "$verbose" && echo " " 1>&6 echo "${as_me:-configure}:9977: testing ..." 1>&5 case "x$LOCALE_ALIAS_FILE" in (xauto|xyes|xno) LOCALE_ALIAS_FILE=unknown for cf_leaf in lib share do for cf_path in \ /usr/openwin/$cf_leaf/locale \ /usr/$cf_leaf/X11/locale \ /usr/X11R7/$cf_leaf/X11/locale \ /usr/X11R6/$cf_leaf/X11/locale \ /opt/local/$cf_leaf/X11/locale \ /opt/X11/$cf_leaf/X11/locale \ /usr/X11/$cf_leaf/X11/locale do test -d $cf_path || continue cf_alias_file=$cf_path/locale.alias test -n "$verbose" && echo " testing $cf_alias_file" 1>&6 echo "${as_me:-configure}:9997: testing testing $cf_alias_file ..." 1>&5 if test -f $cf_alias_file ; then LOCALE_ALIAS_FILE=$cf_alias_file break fi done test "$LOCALE_ALIAS_FILE" = unknown || break done ;; (*) if test ! -f "$LOCALE_ALIAS_FILE" ; then { echo "$as_me:10009: WARNING: Alias file not found: $LOCALE_ALIAS_FILE" >&5 echo "$as_me: WARNING: Alias file not found: $LOCALE_ALIAS_FILE" >&2;} fi ;; esac echo "$as_me:10014: result: $LOCALE_ALIAS_FILE" >&5 echo "${ECHO_T}$LOCALE_ALIAS_FILE" >&6 # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 echo "$as_me:10019: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_GROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $GROFF_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_GROFF_PATH="$GROFF_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_GROFF_PATH="$ac_dir/$ac_word" echo "$as_me:10036: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_GROFF_PATH" && ac_cv_path_GROFF_PATH="no" ;; esac fi GROFF_PATH=$ac_cv_path_GROFF_PATH if test -n "$GROFF_PATH"; then echo "$as_me:10048: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else echo "$as_me:10051: result: no" >&5 echo "${ECHO_T}no" >&6 fi for ac_prog in nroff mandoc 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:10059: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_NROFF_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $NROFF_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_NROFF_PATH="$NROFF_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_NROFF_PATH="$ac_dir/$ac_word" echo "$as_me:10076: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi NROFF_PATH=$ac_cv_path_NROFF_PATH if test -n "$NROFF_PATH"; then echo "$as_me:10087: result: $NROFF_PATH" >&5 echo "${ECHO_T}$NROFF_PATH" >&6 else echo "$as_me:10090: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NROFF_PATH" && break done test -n "$NROFF_PATH" || NROFF_PATH="no" # Extract the first word of "tbl", so it can be a program name with args. set dummy tbl; ac_word=$2 echo "$as_me:10100: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_TBL_PATH+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $TBL_PATH in [\\/]* | ?:[\\/]*) ac_cv_path_TBL_PATH="$TBL_PATH" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_TBL_PATH="$ac_dir/$ac_word" echo "$as_me:10117: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_TBL_PATH" && ac_cv_path_TBL_PATH="cat" ;; esac fi TBL_PATH=$ac_cv_path_TBL_PATH if test -n "$TBL_PATH"; then echo "$as_me:10129: result: $TBL_PATH" >&5 echo "${ECHO_T}$TBL_PATH" >&6 else echo "$as_me:10132: result: no" >&5 echo "${ECHO_T}no" >&6 fi if test "x$GROFF_PATH" = xno then NROFF_NOTE= GROFF_NOTE="#" else NROFF_NOTE="#" GROFF_NOTE= fi case "x${with_man2html}" in (xno) cf_man2html=no ;; (x|xyes) # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 echo "$as_me:10152: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cf_man2html in [\\/]* | ?:[\\/]*) ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" echo "$as_me:10169: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" ;; esac fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then echo "$as_me:10181: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else echo "$as_me:10184: result: no" >&5 echo "${ECHO_T}no" >&6 fi case "x$cf_man2html" in (x/*) echo "$as_me:10190: checking for the modified Earl Hood script" >&5 echo $ECHO_N "checking for the modified Earl Hood script... $ECHO_C" >&6 if ( $cf_man2html -help 2>&1 | grep 'Make an index of headers at the end' >/dev/null ) then cf_man2html_ok=yes else cf_man2html=no cf_man2html_ok=no fi echo "$as_me:10199: result: $cf_man2html_ok" >&5 echo "${ECHO_T}$cf_man2html_ok" >&6 ;; (*) cf_man2html=no ;; esac esac echo "$as_me:10208: checking for program to convert manpage to html" >&5 echo $ECHO_N "checking for program to convert manpage to html... $ECHO_C" >&6 # Check whether --with-man2html or --without-man2html was given. if test "${with_man2html+set}" = set; then withval="$with_man2html" cf_man2html=$withval else cf_man2html=$cf_man2html fi; cf_with_groff=no case $cf_man2html in (yes) echo "$as_me:10223: result: man2html" >&5 echo "${ECHO_T}man2html" >&6 # Extract the first word of "man2html", so it can be a program name with args. set dummy man2html; ac_word=$2 echo "$as_me:10227: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_path_cf_man2html+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case $cf_man2html in [\\/]* | ?:[\\/]*) ac_cv_path_cf_man2html="$cf_man2html" # Let the user override the test with a path. ;; *) ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. if $as_executable_p "$ac_dir/$ac_word"; then ac_cv_path_cf_man2html="$ac_dir/$ac_word" echo "$as_me:10244: found $ac_dir/$ac_word" >&5 break fi done test -z "$ac_cv_path_cf_man2html" && ac_cv_path_cf_man2html="no" ;; esac fi cf_man2html=$ac_cv_path_cf_man2html if test -n "$cf_man2html"; then echo "$as_me:10256: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else echo "$as_me:10259: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH echo "$as_me:10267: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; (*) echo "$as_me:10271: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; esac MAN2HTML_TEMP="man2html.tmp" cat >$MAN2HTML_TEMP <>$MAN2HTML_TEMP <&5 echo $ECHO_N "checking if nroff is really groff... $ECHO_C" >&6 cf_check_groff="`$NROFF_PATH --version 2>/dev/null | grep groff`" test -n "$cf_check_groff" && cf_check_groff=yes test -n "$cf_check_groff" || cf_check_groff=no echo "$as_me:10317: result: $cf_check_groff" >&5 echo "${ECHO_T}$cf_check_groff" >&6 test "x$cf_check_groff" = xyes && NROFF_OPTS="-rHY=0" fi MAN2HTML_NOTE="" if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case "x$cf_man2html" in (x\$\(*\)*|x\'*\'*) ;; (x.|x$GLOB_FULLPATH_POSIX|x$GLOB_FULLPATH_OTHER) ;; (x\$\{*prefix\}*|x\$\{*dir\}*) eval cf_man2html="$cf_man2html" case "x$cf_man2html" in (xNONE/*) cf_man2html=`echo "$cf_man2html" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (xno|xNONE/*) cf_man2html=`echo "$cf_man2html" | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:10346: error: expected a pathname, not \"$cf_man2html\"" >&5 echo "$as_me: error: expected a pathname, not \"$cf_man2html\"" >&2;} { (exit 1); exit 1; }; } ;; esac MAN2HTML_PATH="$cf_man2html" echo "$as_me:10353: checking for $cf_man2html top/bottom margins" >&5 echo $ECHO_N "checking for $cf_man2html top/bottom margins... $ECHO_C" >&6 # for this example, expect 3 lines of content, the remainder is head/foot cat >conftest.in <conftest.out cf_man2html_1st="`${FGREP-fgrep} -n MARKER conftest.out |sed -e 's/^[^0-9]*://' -e 's/:.*//'`" cf_man2html_top=`expr "$cf_man2html_1st" - 2` cf_man2html_bot="`wc -l conftest.out |sed -e 's/[^0-9]//g'`" cf_man2html_bot=`expr "$cf_man2html_bot" - 2 - "$cf_man2html_top"` cf_man2html_top_bot="-topm=$cf_man2html_top -botm=$cf_man2html_bot" echo "$as_me:10371: result: $cf_man2html_top_bot" >&5 echo "${ECHO_T}$cf_man2html_top_bot" >&6 echo "$as_me:10374: checking for pagesize to use" >&5 echo $ECHO_N "checking for pagesize to use... $ECHO_C" >&6 for cf_block in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 do cat >>conftest.in <conftest.out cf_man2html_page="`${FGREP-fgrep} -n HEAD1 conftest.out |sed -n '$p' |sed -e 's/^[^0-9]*://' -e 's/:.*//'`" test -z "$cf_man2html_page" && cf_man2html_page=99999 test "$cf_man2html_page" -gt 100 && cf_man2html_page=99999 rm -rf conftest* echo "$as_me:10399: result: $cf_man2html_page" >&5 echo "${ECHO_T}$cf_man2html_page" >&6 cat >>$MAN2HTML_TEMP <&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. if test "${with_dmalloc+set}" = set; then withval="$with_dmalloc" case "x$withval" in (x|xno) ;; (*) : "${with_cflags:=-g}" : "${enable_leaks:=no}" with_dmalloc=yes cat >>confdefs.h <&5 echo "${ECHO_T}${with_dmalloc:-no}" >&6 case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; esac ;; esac if test "$with_dmalloc" = yes ; then echo "$as_me:10554: checking for dmalloc.h" >&5 echo $ECHO_N "checking for dmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 10560 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:10564: \"$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:10570: \$? = $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_dmalloc_h=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_header_dmalloc_h=no fi rm -f conftest.err "conftest.$ac_ext" fi echo "$as_me:10589: result: $ac_cv_header_dmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dmalloc_h" >&6 if test "$ac_cv_header_dmalloc_h" = yes; then echo "$as_me:10593: checking for dmalloc_debug in -ldmalloc" >&5 echo $ECHO_N "checking for dmalloc_debug in -ldmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dmalloc_dmalloc_debug+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldmalloc $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10601 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char dmalloc_debug (void); int main (void) { dmalloc_debug (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10620: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10623: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10626: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10629: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_dmalloc_dmalloc_debug=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_dmalloc_dmalloc_debug=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:10640: result: $ac_cv_lib_dmalloc_dmalloc_debug" >&5 echo "${ECHO_T}$ac_cv_lib_dmalloc_dmalloc_debug" >&6 if test "$ac_cv_lib_dmalloc_dmalloc_debug" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if you want to use dbmalloc for testing... $ECHO_C" >&6 # Check whether --with-dbmalloc or --without-dbmalloc was given. if test "${with_dbmalloc+set}" = set; then withval="$with_dbmalloc" case "x$withval" in (x|xno) ;; (*) : "${with_cflags:=-g}" : "${enable_leaks:=no}" with_dbmalloc=yes cat >>confdefs.h <&5 echo "${ECHO_T}${with_dbmalloc:-no}" >&6 case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; esac ;; esac if test "$with_dbmalloc" = yes ; then echo "$as_me:10791: checking for dbmalloc.h" >&5 echo $ECHO_N "checking for dbmalloc.h... $ECHO_C" >&6 if test "${ac_cv_header_dbmalloc_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 10797 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:10801: \"$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:10807: \$? = $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_dbmalloc_h=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_header_dbmalloc_h=no fi rm -f conftest.err "conftest.$ac_ext" fi echo "$as_me:10826: result: $ac_cv_header_dbmalloc_h" >&5 echo "${ECHO_T}$ac_cv_header_dbmalloc_h" >&6 if test "$ac_cv_header_dbmalloc_h" = yes; then echo "$as_me:10830: checking for debug_malloc in -ldbmalloc" >&5 echo $ECHO_N "checking for debug_malloc in -ldbmalloc... $ECHO_C" >&6 if test "${ac_cv_lib_dbmalloc_debug_malloc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-ldbmalloc $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10838 "configure" #include "confdefs.h" /* Override any gcc2 internal prototype to avoid an error. */ #ifdef __cplusplus extern "C" #endif /* We use char because int might match the return type of a gcc2 builtin and then its argument prototype would still apply. */ char debug_malloc (void); int main (void) { debug_malloc (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10857: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10860: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10863: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10866: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_dbmalloc_debug_malloc=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_dbmalloc_debug_malloc=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:10877: result: $ac_cv_lib_dbmalloc_debug_malloc" >&5 echo "${ECHO_T}$ac_cv_lib_dbmalloc_debug_malloc" >&6 if test "$ac_cv_lib_dbmalloc_debug_malloc" = yes; then cat >>confdefs.h <&5 echo $ECHO_N "checking if you want to use valgrind for testing... $ECHO_C" >&6 # Check whether --with-valgrind or --without-valgrind was given. if test "${with_valgrind+set}" = set; then withval="$with_valgrind" case "x$withval" in (x|xno) ;; (*) : "${with_cflags:=-g}" : "${enable_leaks:=no}" with_valgrind=yes cat >>confdefs.h <&5 echo "${ECHO_T}${with_valgrind:-no}" >&6 case ".$with_cflags" in (.*-g*) case .$CFLAGS in (.*-g*) ;; (*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in -g do case "$cf_fix_cppflags" in (no) case "$cf_add_cflags" in (-undef|-nostdinc*|-I*|-D*|-U*|-E|-P|-C) case "$cf_add_cflags" in (-D*) cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^-D[^=]*='\''\"[^"]*//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=yes if test "$cf_fix_cppflags" = yes ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue elif test "${cf_tst_cflags}" = "\"'" ; then test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" continue fi ;; esac case "$CPPFLAGS" in (*$cf_add_cflags) ;; (*) case "$cf_add_cflags" in (-D*) cf_tst_cppflags=`echo "x$cf_add_cflags" | sed -e 's/^...//' -e 's/=.*//'` CPPFLAGS=`echo "$CPPFLAGS" | \ sed -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?[ ]/ /g' \ -e 's/-[UD]'"$cf_tst_cppflags"'\(=[^ ]*\)\?$//g'` ;; esac test -n "$cf_new_cppflags" && cf_new_cppflags="$cf_new_cppflags " cf_new_cppflags="${cf_new_cppflags}$cf_add_cflags" ;; esac ;; (*) test -n "$cf_new_cflags" && cf_new_cflags="$cf_new_cflags " cf_new_cflags="${cf_new_cflags}$cf_add_cflags" ;; esac ;; (yes) test -n "$cf_new_extra_cppflags" && cf_new_extra_cppflags="$cf_new_extra_cppflags " cf_new_extra_cppflags="${cf_new_extra_cppflags}$cf_add_cflags" cf_tst_cflags=`echo "${cf_add_cflags}" |sed -e 's/^[^"]*"'\''//'` test "x${cf_add_cflags}" != "x${cf_tst_cflags}" \ && test -z "${cf_tst_cflags}" \ && cf_fix_cppflags=no ;; esac done if test -n "$cf_new_cflags" ; then test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_new_cflags" fi if test -n "$cf_new_cppflags" ; then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_new_cppflags" fi if test -n "$cf_new_extra_cppflags" ; then test -n "$EXTRA_CPPFLAGS" && EXTRA_CPPFLAGS="$EXTRA_CPPFLAGS " EXTRA_CPPFLAGS="${EXTRA_CPPFLAGS}$cf_new_extra_cppflags" fi ;; esac ;; esac echo "$as_me:11027: checking if you want to perform memory-leak testing" >&5 echo $ECHO_N "checking if you want to perform memory-leak testing... $ECHO_C" >&6 # Check whether --enable-leaks or --disable-leaks was given. if test "${enable_leaks+set}" = set; then enableval="$enable_leaks" enable_leaks=$enableval else enable_leaks=yes fi; if test "x$enable_leaks" = xno; then with_no_leaks=yes; else with_no_leaks=no; fi echo "$as_me:11038: result: $with_no_leaks" >&5 echo "${ECHO_T}$with_no_leaks" >&6 if test "$enable_leaks" = no ; then cat >>confdefs.h <<\EOF #define NO_LEAKS 1 EOF cat >>confdefs.h <<\EOF #define YY_NO_LEAKS 1 EOF fi echo "$as_me:11053: checking if you want to enable debugging trace" >&5 echo $ECHO_N "checking if you want to enable debugging trace... $ECHO_C" >&6 # Check whether --enable-trace or --disable-trace was given. if test "${enable_trace+set}" = set; then enableval="$enable_trace" test "$enableval" != yes && enableval=no if test "$enableval" != "no" ; then with_trace=yes else with_trace=no fi else enableval=no with_trace=no fi; echo "$as_me:11070: result: $with_trace" >&5 echo "${ECHO_T}$with_trace" >&6 if test "$with_trace" = "yes" then cat >>confdefs.h <<\EOF #define OPT_TRACE 1 EOF fi if test "$with_trace" != no then EXTRASRCS="$EXTRASRCS trace.c" EXTRAOBJS="$EXTRAOBJS trace\$o" fi LD_RPATH_OPT= if test "x$cf_cv_enable_rpath" != xno then echo "$as_me:11090: checking for an rpath option" >&5 echo $ECHO_N "checking for an rpath option... $ECHO_C" >&6 case "$cf_cv_system_name" in (irix*) if test "$GCC" = yes; then LD_RPATH_OPT="-Wl,-rpath," else LD_RPATH_OPT="-rpath " fi ;; (linux*|gnu*|k*bsd*-gnu|freebsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (openbsd[2-9].*|mirbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (dragonfly*) LD_RPATH_OPT="-rpath " ;; (netbsd*) LD_RPATH_OPT="-Wl,-rpath," ;; (osf*|mls+*) LD_RPATH_OPT="-rpath " ;; (solaris2*) LD_RPATH_OPT="-R" ;; (*) ;; esac echo "$as_me:11121: result: $LD_RPATH_OPT" >&5 echo "${ECHO_T}$LD_RPATH_OPT" >&6 case "x$LD_RPATH_OPT" in (x-R*) echo "$as_me:11126: checking if we need a space after rpath option" >&5 echo $ECHO_N "checking if we need a space after rpath option... $ECHO_C" >&6 cf_save_LIBS="$LIBS" cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in ${LD_RPATH_OPT}$libdir; do cf_add_0lib="$cf_add_1lib $cf_add_0lib"; done # filter duplicates for cf_add_1lib in $cf_add_0lib; do for cf_add_2lib in $cf_add_libs; do if test "x$cf_add_1lib" = "x$cf_add_2lib"; then cf_add_1lib= break fi done test -n "$cf_add_1lib" && cf_add_libs="$cf_add_1lib $cf_add_libs" done LIBS="$cf_add_libs" cat >"conftest.$ac_ext" <<_ACEOF #line 11147 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:11159: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11162: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:11165: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11168: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_rpath_space=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_rpath_space=yes fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS="$cf_save_LIBS" echo "$as_me:11178: result: $cf_rpath_space" >&5 echo "${ECHO_T}$cf_rpath_space" >&6 test "$cf_rpath_space" = yes && LD_RPATH_OPT="$LD_RPATH_OPT " ;; esac fi echo "$as_me:11185: checking if rpath-hack should be disabled" >&5 echo $ECHO_N "checking if rpath-hack should be disabled... $ECHO_C" >&6 # Check whether --enable-rpath-hack or --disable-rpath-hack was given. if test "${enable_rpath_hack+set}" = set; then enableval="$enable_rpath_hack" test "$enableval" != no && enableval=yes if test "$enableval" != "yes" ; then enable_rpath_hack=no else enable_rpath_hack=yes fi else enableval=yes enable_rpath_hack=yes fi; if test "x$enable_rpath_hack" = xno; then cf_disable_rpath_hack=yes; else cf_disable_rpath_hack=no; fi echo "$as_me:11203: result: $cf_disable_rpath_hack" >&5 echo "${ECHO_T}$cf_disable_rpath_hack" >&6 if test "$enable_rpath_hack" = yes ; then echo "$as_me:11208: checking for updated LDFLAGS" >&5 echo $ECHO_N "checking for updated LDFLAGS... $ECHO_C" >&6 if test -n "$LD_RPATH_OPT" ; then echo "$as_me:11211: result: maybe" >&5 echo "${ECHO_T}maybe" >&6 for ac_prog in ldd do # Extract the first word of "$ac_prog", so it can be a program name with args. set dummy $ac_prog; ac_word=$2 echo "$as_me:11218: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_cf_ldd_prog+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$cf_ldd_prog"; then ac_cv_prog_cf_ldd_prog="$cf_ldd_prog" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_cf_ldd_prog="$ac_prog" echo "$as_me:11233: found $ac_dir/$ac_word" >&5 break done fi fi cf_ldd_prog=$ac_cv_prog_cf_ldd_prog if test -n "$cf_ldd_prog"; then echo "$as_me:11241: result: $cf_ldd_prog" >&5 echo "${ECHO_T}$cf_ldd_prog" >&6 else echo "$as_me:11244: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$cf_ldd_prog" && break done test -n "$cf_ldd_prog" || cf_ldd_prog="no" cf_rpath_list="/usr/lib /lib" if test "$cf_ldd_prog" != no then cf_rpath_oops= cat >"conftest.$ac_ext" <<_ACEOF #line 11258 "configure" #include "confdefs.h" #include int main (void) { printf("Hello"); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:11270: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11273: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:11276: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11279: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_rpath_oops=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} ' not found' | sed -e 's% =>.*$%%' |sort | uniq` cf_rpath_list=`"$cf_ldd_prog" "conftest$ac_exeext" | ${FGREP-fgrep} / | sed -e 's%^.*[ ]/%/%' -e 's%/[^/][^/]*$%%' |sort | uniq` else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" # If we passed the link-test, but get a "not found" on a given library, # this could be due to inept reconfiguration of gcc to make it only # partly honor /usr/local/lib (or whatever). Sometimes this behavior # is intentional, e.g., installing gcc in /usr/bin and suppressing the # /usr/local libraries. if test -n "$cf_rpath_oops" then for cf_rpath_src in $cf_rpath_oops do for cf_rpath_dir in \ /usr/local \ /usr/pkg \ /opt/sfw do if test -f "$cf_rpath_dir/lib/$cf_rpath_src" then test -n "$verbose" && echo " ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src" 1>&6 echo "${as_me:-configure}:11307: testing ...adding -L$cf_rpath_dir/lib to LDFLAGS for $cf_rpath_src ..." 1>&5 LDFLAGS="$LDFLAGS -L$cf_rpath_dir/lib" break fi done done fi fi test -n "$verbose" && echo " ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 echo "${as_me:-configure}:11319: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 echo "${as_me:-configure}:11323: testing ...checking LDFLAGS $LDFLAGS ..." 1>&5 cf_rpath_dst= for cf_rpath_src in $LDFLAGS do case "$cf_rpath_src" in (-L*) # check if this refers to a directory which we will ignore cf_rpath_skip=no if test -n "$cf_rpath_list" then for cf_rpath_item in $cf_rpath_list do if test "x$cf_rpath_src" = "x-L$cf_rpath_item" then cf_rpath_skip=yes break fi done fi if test "$cf_rpath_skip" = no then # transform the option if test "$LD_RPATH_OPT" = "-R " ; then cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` else cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` fi # if we have not already added this, add it now cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" then test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 echo "${as_me:-configure}:11360: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi fi ;; esac cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" done LDFLAGS=$cf_rpath_dst test -n "$verbose" && echo " ...checked LDFLAGS $LDFLAGS" 1>&6 echo "${as_me:-configure}:11373: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 echo "${as_me:-configure}:11377: testing ...checking LIBS $LIBS ..." 1>&5 cf_rpath_dst= for cf_rpath_src in $LIBS do case "$cf_rpath_src" in (-L*) # check if this refers to a directory which we will ignore cf_rpath_skip=no if test -n "$cf_rpath_list" then for cf_rpath_item in $cf_rpath_list do if test "x$cf_rpath_src" = "x-L$cf_rpath_item" then cf_rpath_skip=yes break fi done fi if test "$cf_rpath_skip" = no then # transform the option if test "$LD_RPATH_OPT" = "-R " ; then cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%-R %"` else cf_rpath_tmp=`echo "$cf_rpath_src" |sed -e "s%-L%$LD_RPATH_OPT%"` fi # if we have not already added this, add it now cf_rpath_tst=`echo "$EXTRA_LDFLAGS" | sed -e "s%$cf_rpath_tmp %%"` if test "x$cf_rpath_tst" = "x$EXTRA_LDFLAGS" then test -n "$verbose" && echo " ...Filter $cf_rpath_src ->$cf_rpath_tmp" 1>&6 echo "${as_me:-configure}:11414: testing ...Filter $cf_rpath_src ->$cf_rpath_tmp ..." 1>&5 EXTRA_LDFLAGS="$cf_rpath_tmp $EXTRA_LDFLAGS" fi fi ;; esac cf_rpath_dst="$cf_rpath_dst $cf_rpath_src" done LIBS=$cf_rpath_dst test -n "$verbose" && echo " ...checked LIBS $LIBS" 1>&6 echo "${as_me:-configure}:11427: testing ...checked LIBS $LIBS ..." 1>&5 test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 echo "${as_me:-configure}:11431: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 else echo "$as_me:11434: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi ac_config_files="$ac_config_files Makefile" ac_config_commands="$ac_config_commands default" cat >confcache <<\_ACEOF # This file is a shell script that caches the results of configure # tests run on this system so they can be shared between configure # scripts and configure runs, see configure's option --config-cache. # It is not useful on other systems. If it contains results you don't # want to keep, you may remove or edit it. # # config.status only pays attention to the cache file if you give it # the --recheck option to rerun configure. # # `ac_cv_env_foo' variables (set or unset) will be overridden when # loading this file, other *unset* `ac_cv_foo' will be assigned the # following values. _ACEOF # The following way of writing the cache mishandles newlines in values, # but we know of no workaround that is simple, portable, and efficient. # So, 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 if test -w $cache_file; then test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" cat confcache >$cache_file else echo "not updating unwritable cache $cache_file" fi fi rm -f confcache test "x$prefix" = xNONE && prefix=$ac_default_prefix # Let make expand exec_prefix. test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' # VPATH may cause trouble with some makes, so we remove $(srcdir), # ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and # trailing colons and then remove the whole line if VPATH becomes empty # (actually we leave an empty line to preserve line numbers). if test "x$srcdir" = x.; then ac_vpsub='/^[ ]*VPATH[ ]*=/{ s/:*\$(srcdir):*/:/; s/:*\${srcdir}:*/:/; s/:*@srcdir@:*/:/; s/^\([^=]*=[ ]*\):*/\1/; s/:*$//; s/^[^=]*=[ ]*$//; }' fi DEFS=-DHAVE_CONFIG_H : "${CONFIG_STATUS=./config.status}" ac_clean_files_save=$ac_clean_files ac_clean_files="$ac_clean_files $CONFIG_STATUS" { echo "$as_me:11521: creating $CONFIG_STATUS" >&5 echo "$as_me: creating $CONFIG_STATUS" >&6;} cat >"$CONFIG_STATUS" <<_ACEOF #! $SHELL # Generated automatically by configure. # Run this file to recreate the current configuration. # Compiler output produced by configure, useful for debugging # configure, is in config.log if it exists. me=\`echo "\$0" | sed -e 's,.*\\/,,'\` debug=false SHELL=\${CONFIG_SHELL-$SHELL} ac_cs_invocation="\$0 \$@" CLICOLOR_FORCE= GREP_OPTIONS= unset CLICOLOR_FORCE GREP_OPTIONS _ACEOF cat >>"$CONFIG_STATUS" <<\_ACEOF # 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 # Name of the executable. as_me=`echo "$0" |sed 's,.*[\\/],,'` 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" # Support unset when possible. if (FOO=FOO; unset FOO) >/dev/null 2>&1; then as_unset="unset" else as_unset="false" fi # NLS nuisances. $as_unset LANG || test "${LANG+set}" != set || { LANG=C; export LANG; } $as_unset LC_ALL || test "${LC_ALL+set}" != set || { LC_ALL=C; export LC_ALL; } $as_unset LC_TIME || test "${LC_TIME+set}" != set || { LC_TIME=C; export LC_TIME; } $as_unset LC_CTYPE || test "${LC_CTYPE+set}" != set || { LC_CTYPE=C; export LC_CTYPE; } $as_unset LANGUAGE || test "${LANGUAGE+set}" != set || { LANGUAGE=C; export LANGUAGE; } $as_unset LC_COLLATE || test "${LC_COLLATE+set}" != set || { LC_COLLATE=C; export LC_COLLATE; } $as_unset LC_NUMERIC || test "${LC_NUMERIC+set}" != set || { LC_NUMERIC=C; export LC_NUMERIC; } $as_unset LC_MESSAGES || test "${LC_MESSAGES+set}" != set || { LC_MESSAGES=C; export LC_MESSAGES; } # 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=:; export CDPATH; } exec 6>&1 _ACEOF # 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" <<\EOF 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 Configuration commands: $config_commands Report bugs to ." EOF cat >>"$CONFIG_STATUS" <>"$CONFIG_STATUS" <<\EOF # If no file are specified by the user, then we need to provide default # value. By we need to know if files were specified by the user. ac_need_defaults=: while test $# != 0 do case $1 in --*=*) ac_option=`expr "x$1" : 'x\([^=]*\)='` ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` 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. EOF cat >>"$CONFIG_STATUS" <>"$CONFIG_STATUS" <<\EOF --version | --vers* | -V ) echo "$ac_cs_version"; exit 0 ;; --he | --h) # Conflict between --help and --header { { echo "$as_me:11702: 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:11721: 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" ;; esac shift done exec 5>>config.log cat >&5 << _ACEOF ## ----------------------- ## ## Running config.status. ## ## ----------------------- ## This file was extended by $as_me 2.52.20240618, executed with CONFIG_FILES = $CONFIG_FILES CONFIG_HEADERS = $CONFIG_HEADERS CONFIG_LINKS = $CONFIG_LINKS CONFIG_COMMANDS = $CONFIG_COMMANDS > "$ac_cs_invocation" on `(hostname || uname -n) 2>/dev/null | sed 1q` _ACEOF EOF cat >>"$CONFIG_STATUS" <<\EOF for ac_config_target in $ac_config_targets do case "$ac_config_target" in # Handling of arguments. "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; "default" ) CONFIG_COMMANDS="$CONFIG_COMMANDS default" ;; "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h:config_h.in" ;; *) { { echo "$as_me:11759: 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 test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands 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; } } EOF cat >>"$CONFIG_STATUS" <"\$tmp"/subs.sed <<\\CEOF s,@X_CFLAGS@,$X_CFLAGS,;t t s,@X_LIBS@,$X_LIBS,;t t s,@SHELL@,$SHELL,;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,@datarootdir@,$datarootdir,;t t s,@datadir@,$datadir,;t t s,@sysconfdir@,$sysconfdir,;t t s,@sharedstatedir@,$sharedstatedir,;t t s,@localstatedir@,$localstatedir,;t t s,@runstatedir@,$runstatedir,;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,@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,@build_alias@,$build_alias,;t t s,@host_alias@,$host_alias,;t t s,@target_alias@,$target_alias,;t t s,@ECHO_C@,$ECHO_C,;t t s,@ECHO_N@,$ECHO_N,;t t s,@ECHO_T@,$ECHO_T,;t t s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t s,@DEFS@,$DEFS,;t t s,@LIBS@,$LIBS,;t t s,@build@,$build,;t t s,@build_cpu@,$build_cpu,;t t s,@build_vendor@,$build_vendor,;t t s,@build_os@,$build_os,;t t s,@host@,$host,;t t s,@host_cpu@,$host_cpu,;t t s,@host_vendor@,$host_vendor,;t t s,@host_os@,$host_os,;t t s,@target@,$target,;t t s,@target_cpu@,$target_cpu,;t t s,@target_vendor@,$target_vendor,;t t s,@target_os@,$target_os,;t t s,@GLOB_FULLPATH_POSIX@,$GLOB_FULLPATH_POSIX,;t t s,@GLOB_FULLPATH_OTHER@,$GLOB_FULLPATH_OTHER,;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,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;t t s,@CPP@,$CPP,;t t s,@GREP@,$GREP,;t t s,@EGREP@,$EGREP,;t t s,@INSTALL_PROGRAM@,$INSTALL_PROGRAM,;t t s,@INSTALL_SCRIPT@,$INSTALL_SCRIPT,;t t s,@INSTALL_DATA@,$INSTALL_DATA,;t t s,@LINT@,$LINT,;t t s,@LINT_OPTS@,$LINT_OPTS,;t t s,@LINT_LIBS@,$LINT_LIBS,;t t s,@CTAGS@,$CTAGS,;t t s,@ETAGS@,$ETAGS,;t t s,@MAKE_LOWER_TAGS@,$MAKE_LOWER_TAGS,;t t s,@MAKE_UPPER_TAGS@,$MAKE_UPPER_TAGS,;t t s,@ECHO_LT@,$ECHO_LT,;t t s,@ECHO_LD@,$ECHO_LD,;t t s,@RULE_CC@,$RULE_CC,;t t s,@SHOW_CC@,$SHOW_CC,;t t s,@ECHO_CC@,$ECHO_CC,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@FGREP@,$FGREP,;t t s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t s,@STDC_NORETURN@,$STDC_NORETURN,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t s,@LIBICONV@,$LIBICONV,;t t s,@ENCODINGS_DIR_FILE@,$ENCODINGS_DIR_FILE,;t t s,@LOCALE_ALIAS_FILE@,$LOCALE_ALIAS_FILE,;t t s,@GROFF_PATH@,$GROFF_PATH,;t t s,@NROFF_PATH@,$NROFF_PATH,;t t s,@TBL_PATH@,$TBL_PATH,;t t s,@GROFF_NOTE@,$GROFF_NOTE,;t t s,@NROFF_NOTE@,$NROFF_NOTE,;t t s,@cf_man2html@,$cf_man2html,;t t s,@MAN2HTML_NOTE@,$MAN2HTML_NOTE,;t t s,@MAN2HTML_PATH@,$MAN2HTML_PATH,;t t s,@MAN2HTML_TEMP@,$MAN2HTML_TEMP,;t t s,@cf_ldd_prog@,$cf_ldd_prog,;t t s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@EXTRASRCS@,$EXTRASRCS,;t t s,@EXTRAOBJS@,$EXTRAOBJS,;t t CEOF EOF cat >>"$CONFIG_STATUS" <<\EOF # 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 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' && sed -e 's/\\\\*$//g' -e 's/$/\\/' -e 's/;t t\\/;t t/' -e 't' -e '3,'$ac_max_sed_lines's/$/\\/' "$tmp"/subs.frag) >"$tmp"/subs-$ac_sed_frag.sed # It is possible to make a multiline substitution using escaped newlines. # Ensure that we do not split the substitution between script fragments. ac_BEG=$ac_end ac_END=`expr "$ac_end" + "$ac_max_sed_lines"` sed "1,${ac_BEG}d; ${ac_END}p; q" "$tmp"/subs.sed >"$tmp"/subs.next if test -s "$tmp"/subs.next; then grep '^s,@[^@,][^@,]*@,.*$' "$tmp"/subs.next | grep -v '^s,@.*;t t$' >"$tmp"/subs.edit if test ! -s "$tmp"/subs.edit; then grep "^s,@[^@,][^@,]*@,.*,;t t$" "$tmp"/subs.next >"$tmp"/subs.edit if test ! -s "$tmp"/subs.edit; then if test "$ac_beg" -gt 1; then ac_end=`expr "$ac_end" - 1` continue fi fi fi fi 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"` fi done if test -z "$ac_sed_cmds"; then ac_sed_cmds="cat" fi fi # test -n "$CONFIG_FILES" EOF cat >>"$CONFIG_STATUS" <<\EOF 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=`$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'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { 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" ;; esac done; } 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 "$srcdir" in .) ac_srcdir=. if test -z "$ac_dots"; then ac_top_srcdir=. else ac_top_srcdir=`echo "$ac_dots" | sed 's,/$,,'` fi ;; [\\/]* | ?:[\\/]* ) ac_srcdir="$srcdir$ac_dir_suffix"; ac_top_srcdir="$srcdir" ;; *) # Relative path. ac_srcdir="$ac_dots$srcdir$ac_dir_suffix" ac_top_srcdir="$ac_dots$srcdir" ;; esac case $INSTALL in [\\/$]* | ?:[\\/]* ) ac_INSTALL=$INSTALL ;; *) ac_INSTALL=$ac_dots$INSTALL ;; esac if test x"$ac_file" != x-; then { echo "$as_me:12039: 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 automatically by config.status. */ configure_input="Generated automatically 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:12057: 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:12070: 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; } EOF cat >>"$CONFIG_STATUS" <<\EOF ac_warn_datarootdir=no if test x"$ac_file" != x-; then for ac_item in $ac_file_inputs do ac_seen=`grep '@\(datadir\|mandir\|infodir\)@' "$ac_item"` if test -n "$ac_seen"; then ac_used=`grep '@datarootdir@' "$ac_item"` if test -z "$ac_used"; then { echo "$as_me:12086: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used implicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi fi ac_seen=`grep '${datarootdir}' "$ac_item"` if test -n "$ac_seen"; then { echo "$as_me:12095: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&5 echo "$as_me: WARNING: datarootdir was used explicitly but not set: $ac_seen" >&2;} ac_warn_datarootdir=yes fi done fi if test "x$ac_warn_datarootdir" = xyes; then ac_sed_cmds="$ac_sed_cmds | sed -e 's,@datarootdir@,\${prefix}/share,g' -e 's,\${datarootdir},\${prefix}/share,g'" fi EOF cat >>"$CONFIG_STATUS" <>"$CONFIG_STATUS" <<\EOF :t /@[a-zA-Z_][a-zA-Z_0-9]*@/!b s,@configure_input@,$configure_input,;t t s,@srcdir@,$ac_srcdir,;t t s,@top_srcdir@,$ac_top_srcdir,;t t s,@INSTALL@,$ac_INSTALL,;t t " $ac_file_inputs | (eval "$ac_sed_cmds") >"$tmp"/out rm -f "$tmp"/stdin EOF test -n "${FGREP}" || FGREP="grep -F" test -n "${EGREP}" || EGREP="grep -E" cat >>"$CONFIG_STATUS" <>"$CONFIG_STATUS" <<\EOF if test x"$ac_file" != x-; then cp "$tmp/out" "$ac_file" for ac_name in prefix exec_prefix datarootdir do ac_seen=`$FGREP -n '${'$ac_name'[:=].*}' "$ac_file"` if test -n "$ac_seen"; then ac_init=`$EGREP '[ ]*'$ac_name'[ ]*=' "$ac_file"` if test -z "$ac_init"; then ac_seen=`echo "$ac_seen" |sed -e 's,^,'"$ac_file"':,'` { echo "$as_me:12140: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&5 echo "$as_me: WARNING: Variable $ac_name is used but was not set: $ac_seen" >&2;} fi fi done $EGREP -n '@[a-z_][a-z_0-9]+@' "$ac_file" >"$tmp"/out $EGREP -n '@[A-Z_][A-Z_0-9]+@' "$ac_file" >>"$tmp"/out if test -s "$tmp"/out; then ac_seen=`sed -e 's,^,'"$ac_file"':,' < "$tmp"/out` { echo "$as_me:12151: WARNING: Some variables may not be substituted: $ac_seen" >&5 echo "$as_me: WARNING: Some variables may not be substituted: $ac_seen" >&2;} fi else cat "$tmp"/out fi rm -f "$tmp"/out done EOF cat >>"$CONFIG_STATUS" <<\EOF # # CONFIG_HEADER section. # # 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_i turns "#undef NAME" with trailing blanks into "#define NAME VALUE". ac_iA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' ac_iB='\([ ]\),\1#\2define\3' ac_iC=' ' ac_iD='\4,;t' # ac_u turns "#undef NAME" without 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 # 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:12200: 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:12211: 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:12224: 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 EOF # Transform confdefs.h into a list of #define's. We won't use it as a sed # script, but as data to insert where we see @DEFS@. We expect AC_SAVE_DEFS to # be either 'cat' or 'sort'. cat confdefs.h | uniq >conftest.vals # 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 echo ' rm -f conftest.frag' >> "$CONFIG_STATUS" while grep . conftest.vals >/dev/null do # Write chunks of a limited-size here document to conftest.frag. echo ' cat >> conftest.frag <> "$CONFIG_STATUS" sed "${ac_max_here_lines}q" conftest.vals | sed -e 's/#ifdef.*/#if 0/' >> "$CONFIG_STATUS" echo 'CEOF' >> "$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 # Run sed to substitute the contents of conftest.frag into $tmp/in at the # marker @DEFS@. echo ' cat >> conftest.edit < "$tmp"/out rm -f "$tmp"/in mv "$tmp"/out "$tmp"/in rm -f conftest.edit conftest.frag ' >> "$CONFIG_STATUS" cat >>"$CONFIG_STATUS" <<\EOF # 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 automatically by config.status. */ if test x"$ac_file" = x-; then echo "/* Generated automatically by configure. */" >"$tmp"/config.h else echo "/* $ac_file. Generated automatically 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:12282: $ac_file is unchanged" >&5 echo "$as_me: $ac_file is unchanged" >&6;} else ac_dir=`$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'` if test "$ac_dir" != "$ac_file" && test "$ac_dir" != .; then { 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" ;; esac done; } fi rm -f "$ac_file" mv "$tmp/config.h" "$ac_file" fi else cat "$tmp"/config.h rm -f "$tmp"/config.h fi done EOF cat >>"$CONFIG_STATUS" <<\EOF { (exit 0); exit 0; } EOF chmod +x "$CONFIG_STATUS" ac_clean_files=$ac_clean_files_save # configure is writing to config.log, and then calls config.status. # config.status does its own redirection, appending to config.log. # Unfortunately, on DOS this fails, as config.log is still kept open # by configure, so config.status won't be able to write to it; its # output is simply discarded. So we exec the FD to /dev/null, # effectively closing config.log, so it can be properly (re)opened and # appended to by config.status. When coming back to configure, we # need to make the FD available again. if test "$no_create" != yes; then ac_cs_success=: 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 test -z "$cf_make_docs" && cf_make_docs=0 cf_output=makefile test -f "$cf_output" || cf_output=Makefile if test "$cf_make_docs" = 0 then cat >>$cf_output <\$@ ${GROFF_NOTE}.ps.pdf : ${GROFF_NOTE} ps2pdf \$*.ps ${GROFF_NOTE} ${GROFF_NOTE}.\$(manext).ps : ${GROFF_NOTE} \$(SHELL) -c "tbl \$*.\$(manext) | groff -man" >\$@ ${GROFF_NOTE} ${GROFF_NOTE}.\$(manext).txt : ${GROFF_NOTE} GROFF_NO_SGR=stupid \$(SHELL) -c "tbl \$*.\$(manext) | nroff -rHY=0 -Tascii -man | col -bx" >\$@ ${MAN2HTML_NOTE}.\$(manext).html : ${MAN2HTML_NOTE} ./${MAN2HTML_TEMP} \$* \$(manext) man >\$@ CF_EOF cf_make_docs=1 fi for cf_name in luit do cat >>$cf_output <