tack-1.09-20230201/0000755000000000000000000000000014366605123011760 5ustar rootroottack-1.09-20230201/control.c0000644000000000000000000003476413615560366013627 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2015,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include #if HAVE_SYS_TIME_H #include #endif MODULE_ID("$Id: control.c,v 1.20 2020/02/02 14:47:18 tom Exp $") /* terminfo test program control subroutines */ #if HAVE_GETTIMEOFDAY #define MY_TIMER struct timeval #else #define MY_TIMER time_t #endif /* globals */ int test_complete; /* counts number of tests completed */ char txt_longer_test_time[80]; /* +) use longer time */ char txt_shorter_test_time[80]; /* -) use shorter time */ static int pad_test_duration = 1; /* number of seconds for a pad test */ int auto_pad_mode; /* run the time tests */ SIG_ATOMIC_T no_alarm_event; /* TRUE if the alarm has not gone off yet */ unsigned long usec_run_time; /* length of last test in microseconds */ static MY_TIMER stop_watch[MAX_TIMERS]; /* Hold the start timers */ char txt_longer_augment[80]; /* >) use bigger augment */ char txt_shorter_augment[80]; /* <) use smaller augment */ /* caps under test data base */ int tt_delay_max; /* max number of milliseconds we can delay */ int tt_delay_used; /* number of milliseconds consumed in delay */ const char *tt_cap[TT_MAX]; /* value of string */ int tt_affected[TT_MAX]; /* lines or columns effected (repetition factor) */ int tt_count[TT_MAX]; /* Number of times sent */ int tt_delay[TT_MAX]; /* Number of milliseconds delay */ int ttp; /* number of entries used */ /* Saved value of the above data base */ const char *tx_cap[TT_MAX]; /* value of string */ int tx_affected[TT_MAX]; /* lines or columns effected (repetition factor) */ int tx_count[TT_MAX]; /* Number of times sent */ int tx_index[TT_MAX]; /* String index */ int tx_delay[TT_MAX]; /* Number of milliseconds delay */ int txp; /* number of entries used */ int tx_characters; /* printing characters sent by test */ unsigned long tx_cps; /* characters per second */ static TestList *tx_source; /* The test that generated this data */ #define RESULT_BLOCK 1024 static int blocks; /* number of result blocks available */ static TestResults *results; /* pointer to next available */ static TestResults **pads; /* save pad results here */ static void alloc_arrays(void) { if (pads == 0) { pads = (TestResults **) calloc((size_t) MAX_STRINGS, sizeof(TestResults *)); } } /* ** event_start(number) ** ** Begin the stopwatch at the current time-of-day. */ void event_start(int n) { #if HAVE_GETTIMEOFDAY (void) gettimeofday(&stop_watch[n], (struct timezone *) 0); #else stop_watch[n] = time((time_t *) 0); #endif } /* ** event_time(number) ** ** Return the number of milliseconds since this stop watch began. */ long event_time(int n) { #if HAVE_GETTIMEOFDAY MY_TIMER current_time; (void) gettimeofday(¤t_time, (struct timezone *) 0); return ((current_time.tv_sec - stop_watch[n].tv_sec) * 1000000) + current_time.tv_usec - stop_watch[n].tv_usec; #else return (time((time_t *) 0) - stop_watch[n]) * 1000; #endif } /***************************************************************************** * * Execution control for string capability tests * *****************************************************************************/ /* ** get_next_block() ** ** Get a results block for pad test data. */ static TestResults * get_next_block(void) { if (blocks <= 0) { results = (TestResults *) malloc(sizeof(TestResults) * RESULT_BLOCK); if (!results) { ptextln("Malloc failed"); return (TestResults *) 0; } blocks = RESULT_BLOCK; } blocks--; return results++; } /* ** set_augment_txt() ** ** Initialize the augment menu selections */ void set_augment_txt(void) { sprintf(txt_longer_augment, ">) Change lines/characters effected to %d", augment << 1); sprintf(txt_shorter_augment, "<) Change lines/characters effected to %d", augment >> 1); } void control_init(void) { sprintf(txt_longer_test_time, "+) Change test time to %d seconds", pad_test_duration + 1); sprintf(txt_shorter_test_time, "-) Change test time to %d seconds", pad_test_duration - 1); set_augment_txt(); } /* ** msec_cost(cap, affected-count) ** ** Return the number of milliseconds delay needed by the cap. */ int msec_cost( const char *const cap, int affcnt) { int dec, value, total, star, ch; const char *cp; if (!cap) { return 0; } total = 0; for (cp = cap; *cp; cp++) { if (*cp == '$' && cp[1] == '<') { star = 1; value = dec = 0; for (cp += 2; (ch = *cp); cp++) { if (ch >= '0' && ch <= '9') { value = value * 10 + (ch - '0'); dec *= 10; } else if (ch == '.') { dec = 1; } else if (ch == '*') { star = affcnt; } else if (ch == '>') { break; } } if (dec > 1) { total += (value * star) / dec; } else { total += (value * star); } } } return total; } /* ** liberated(cap) ** ** Return the cap without padding */ char * liberated(const char *cap) { static char cb[1024]; char *ts, *ls; cb[0] = '\0'; ls = NULL; if (cap) { for (ts = cb; (*ts = *cap); ++cap) { if (*cap == '$' && cap[1] == '<') { ls = ts; } ++ts; if (*cap == '>') { if (ls) { ts = ls; ls = NULL; } } } } return cb; } /* ** page_loop() ** ** send CR/LF or go home and bump letter */ void page_loop(void) { if (line_count + 2 >= lines) { NEXT_LETTER; go_home(); } else { put_crlf(); } } /* ** skip_pad_test(test-list-entry, state, ch, text) ** ** Print the start test line. Handle start up commands. ** Return TRUE if a return is requested. */ int skip_pad_test( TestList * test, int *state, int *ch, const char *text) { char rep_text[16]; while (1) { if (text) { ptext(text); } if ((test->flags & MENU_LC_MASK)) { sprintf(rep_text, " *%d", augment); ptext(rep_text); } ptext(" [n] > "); *ch = wait_here(); if (*ch == 's') { /* Skip is converted to next */ *ch = 'n'; return TRUE; } if (*ch == 'q') { /* Quit is converted to help */ *ch = '?'; return TRUE; } if (*ch == '\r' || *ch == '\n' || *ch == 'n' || *ch == 'r') { /* this is the only response that allows the test to run */ *ch = 0; } if (subtest_menu(pad_test_list, state, ch)) { continue; } return (*ch != 0); } } /* ** pad_done_message(test_list) ** ** Print the Done message and request input. */ void pad_done_message( TestList * test, int *state, int *ch) { int default_action = 0; char done_message[128]; char rep_text[16]; while (1) { if ((test->flags & MENU_LC_MASK)) { sprintf(rep_text, "*%d", augment); } else { rep_text[0] = '\0'; } if (test->caps_done) { sprintf(done_message, "(%s)%s Done ", test->caps_done, rep_text); ptext(done_message); } else { if (rep_text[0]) { ptext(rep_text); ptext(" "); } ptext("Done "); } if (debug_level & 2) { dump_test_stats(test, state, ch); } else { *ch = wait_here(); } if (*ch == '\r' || *ch == '\n') { *ch = default_action; return; } if (*ch == 's' || *ch == 'n') { *ch = 0; return; } if ((strchr) (pad_repeat_test, *ch)) { /* default action is now repeat */ default_action = 'r'; } if (subtest_menu(pad_test_list, state, ch)) { continue; } return; } } /* ** sliding_scale(dividend, factor, divisor) ** ** Return (dividend * factor) / divisor */ int sliding_scale( int dividend, int factor, unsigned long divisor) { double d = dividend; if (divisor) { d = (d * (double) factor) / (double) divisor; return (int) (d + 0.5); } return 0; } /* ** pad_test_startup() ** ** Do the stuff needed to begin a test. */ void pad_test_startup( int do_clear) { if (do_clear) { put_clear(); } repeats = augment; raw_characters_sent = 0; test_complete = ttp = char_count = tt_delay_used = 0; letter = letters[letter_number = 0]; if (pad_test_duration <= 0) { pad_test_duration = 1; } tt_delay_max = pad_test_duration * 1000; set_alarm_clock(pad_test_duration); event_start(TIME_TEST); } /* ** still_testing() ** ** This function is called to see if the test loop should be terminated. */ int still_testing(void) { fflush(stdout); test_complete++; return EXIT_CONDITION; } /* ** pad_test_shutdown() ** ** Do the stuff needed to end a test. */ void pad_test_shutdown( TestList * t, int crlf) { int i; int counts; /* total counts */ int ss; /* Save string index */ int cpo; /* characters per operation */ long delta; /* difference in characters */ int bogus; /* Time is inaccurate */ TestResults *r; /* Results of current test */ int ss_index[TT_MAX]; /* String index */ alloc_arrays(); if (tty_can_sync == SYNC_TESTED) { bogus = tty_sync_error(); } else { bogus = 1; } usec_run_time = (unsigned long) event_time(TIME_TEST); tx_source = t; tx_characters = raw_characters_sent; tx_cps = (unsigned long) sliding_scale(tx_characters, 1000000, usec_run_time); /* save the data base */ for (txp = ss = counts = 0; txp < ttp; txp++) { tx_cap[txp] = tt_cap[txp]; tx_count[txp] = tt_count[txp]; tx_delay[txp] = tt_delay[txp]; tx_affected[txp] = tt_affected[txp]; tx_index[txp] = get_string_cap_byvalue(tt_cap[txp]); if (tx_index[txp] >= 0) { if (cap_match(t->caps_done, strnames[tx_index[txp]])) { ss_index[ss++] = txp; counts += tx_count[txp]; } } } if (crlf) { put_crlf(); } if (counts == 0 || tty_cps == 0 || bogus) { /* nothing to do */ return; } /* calculate the suggested pad times */ delta = (long) (usec_run_time - (unsigned long) sliding_scale(tx_characters, 1000000, tty_cps)); if (delta < 0) { /* probably should bump tx_characters */ delta = 0; } cpo = (int) (delta / counts); for (i = 0; i < ss; i++) { if (!(r = get_next_block())) { return; } r->next = pads[tx_index[ss_index[i]]]; pads[tx_index[ss_index[i]]] = r; r->test = t; r->reps = tx_affected[ss_index[i]]; r->delay = cpo; } } /* ** show_cap_results(index) ** ** Display the previous results */ static void show_cap_results( int x) { TestResults *r; /* a result */ alloc_arrays(); if ((r = pads[x])) { sprintf(temp, "(%s)", strnames[x]); ptext(temp); while (r) { sprintf(temp, "$<%d>", r->delay / 1000); put_columns(temp, (int) strlen(temp), 10); r = r->next; } r = pads[x]; while (r) { if (r->reps > 1) { int delay = r->delay / (r->reps * 100); sprintf(temp, "$<%d.%d*>", delay / 10, delay % 10); put_columns(temp, (int) strlen(temp), 10); } r = r->next; } put_crlf(); } } /* ** dump_test_stats(test_list, status, ch) ** ** Dump the statistics about the last test */ void dump_test_stats( TestList * t, int *state, int *ch) { int i; char tbuf[32]; put_crlf(); if (tx_source && tx_source->caps_done) { int x[32]; cap_index(tx_source->caps_done, x); if (x[0] >= 0) { sprintf(temp, "Caps summary for (%s)", tx_source->caps_done); ptextln(temp); for (i = 0; x[i] >= 0; i++) { show_cap_results(x[i]); } put_crlf(); } } sprintf(tbuf, "%011lu", usec_run_time); sprintf(temp, "Test time: %lu.%s, characters per second %lu, characters %d", usec_run_time / 1000000UL, &tbuf[5], tx_cps, tx_characters); ptextln(temp); for (i = 0; i < txp; i++) { int j; if ((j = get_string_cap_byvalue(tx_cap[i])) >= 0) { sprintf(tbuf, "(%s)", strnames[j]); } else { strcpy(tbuf, "(?)"); } sprintf(temp, "%8d %3d $<%3d> %8s %s", tx_count[i], tx_affected[i], tx_delay[i], tbuf, expand(tx_cap[i])); putln(temp); } generic_done_message(t, state, ch); } /* ** longer_test_time(test_list, status, ch) ** ** Extend the number of seconds for each test. */ void longer_test_time( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { pad_test_duration += 1; sprintf(txt_longer_test_time, "+) Change test time to %d seconds", pad_test_duration + 1); sprintf(txt_shorter_test_time, "-) Change test time to %d seconds", pad_test_duration - 1); sprintf(temp, "Tests will run for %d seconds", pad_test_duration); ptext(temp); *ch = REQUEST_PROMPT; } /* ** shorter_test_time(test_list, status, ch) ** ** Shorten the number of seconds for each test. */ void shorter_test_time( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { if (pad_test_duration > 1) { pad_test_duration -= 1; sprintf(txt_longer_test_time, "+) Change test time to %d seconds", pad_test_duration + 1); sprintf(txt_shorter_test_time, "-) Change test time to %d seconds", pad_test_duration - 1); } sprintf(temp, "Tests will run for %d second%s", pad_test_duration, pad_test_duration > 1 ? "s" : ""); ptext(temp); *ch = REQUEST_PROMPT; } /* ** longer_augment(test_list, status, ch) ** ** Lengthen the number of lines/characters effected */ void longer_augment( TestList * t, int *state GCC_UNUSED, int *ch) { augment <<= 1; set_augment_txt(); if (augment_test) { t = augment_test; } sprintf(temp, "The pad tests will effect %d %s.", augment, ((t->flags & MENU_LC_MASK) == MENU_lines) ? "lines" : "characters"); ptextln(temp); *ch = REQUEST_PROMPT; } /* ** shorter_augment(test_list, status, ch) ** ** Shorten the number of lines/characters effected */ void shorter_augment( TestList * t, int *state GCC_UNUSED, int *ch) { if (augment > 1) { /* don't let the augment go to zero */ augment >>= 1; } set_augment_txt(); if (augment_test) { t = augment_test; } sprintf(temp, "The pad tests will effect %d %s.", augment, ((t->flags & MENU_LC_MASK) == MENU_lines) ? "lines" : "characters"); ptextln(temp); *ch = REQUEST_PROMPT; } tack-1.09-20230201/sysdep.c0000644000000000000000000002627614063472760013453 0ustar rootroot/* ** Copyright 2017-2020,2021 Thomas E. Dickey ** Copyright 1997-2010,2012 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ /* * Operating system dependent functions. We assume the POSIX API. * Note: on strict-POSIX systems (including BSD/OS) the select_delay_type * global has no effect. */ #include #include #include #if defined(__BEOS__) #undef false #undef true #include #endif #if HAVE_SELECT #if HAVE_SYS_TIME_H #include #endif #if HAVE_SYS_SELECT_H #include #endif #endif MODULE_ID("$Id: sysdep.c,v 1.34 2021/06/19 22:55:44 tom Exp $") #ifdef TERMIOS #define PUT_TTY(fd, buf) tcsetattr(fd, TCSAFLUSH, buf) #else #define PUT_TTY(fd, buf) stty(fd, buf) #endif /* globals */ int tty_frame_size; /* asynch frame size times 2 */ unsigned tty_baud_rate; /* baud rate - bits per second */ SIG_ATOMIC_T not_a_tty; /* TRUE if output is not a tty (i.e. pipe) */ int nodelay_read; /* TRUE if NDELAY is set */ #ifdef TERMIOS #define TTY_IS_NOECHO !(new_modes.c_lflag & ECHO) #define TTY_IS_OUT_TRANS (new_modes.c_oflag & OPOST) #define TTY_IS_CHAR_MODE !(new_modes.c_lflag & ICANON) #define TTY_WAS_CS8 ((old_modes.c_cflag & CSIZE) == CS8) #define TTY_WAS_XON_XOFF (old_modes.c_iflag & (IXON|IXOFF)) #else #define TTY_IS_NOECHO !(new_modes.sg_flags & (ECHO)) #define TTY_IS_OUT_TRANS (new_modes.sg_flags & (CRMOD)) #define TTY_IS_CHAR_MODE (new_modes.sg_flags & (RAW|CBREAK)) #define TTY_WAS_CS8 (old_modes.sg_flags & (PASS8)) #define TTY_WAS_XON_XOFF (old_modes.sg_flags & (TANDEM|MDMBUF|DECCTQ)) #endif static TTY old_modes, new_modes; void catchsig(void); /* * These are a sneaky way of conditionalizing bit unsets so strict-POSIX * systems won't see them. */ #ifndef XCASE #define XCASE 0 #endif #ifndef OLCUC #define OLCUC 0 #endif #ifndef IUCLC #define IUCLC 0 #endif #ifndef TABDLY #define TABDLY 0 #endif #ifndef IXANY #define IXANY 0 #endif void tty_raw(int minch GCC_UNUSED, int mask) { /* set tty to raw noecho */ if (debug_fp) { fprintf(debug_fp, "tty_raw:\n"); } new_modes = old_modes; #ifdef TERMIOS #if HAVE_SELECT new_modes.c_cc[VMIN] = 1; #else new_modes.c_cc[VMIN] = minch; #endif new_modes.c_cc[VTIME] = 2; new_modes.c_lflag &= (tcflag_t) ~(ISIG | ICANON | XCASE | ECHO | ECHOE | ECHOK | ECHONL); #ifdef LOBLK new_modes.c_lflag &= (tcflag_t) ~LOBLK; #endif new_modes.c_oflag &= (tcflag_t) ~(OPOST | OLCUC | TABDLY); if (mask == ALLOW_PARITY) { new_modes.c_cflag &= (tcflag_t) ~(CSIZE | PARENB | HUPCL); new_modes.c_cflag |= CS8; } new_modes.c_iflag &= (tcflag_t) ~(IGNBRK | BRKINT | IGNPAR | PARMRK | INPCK | ISTRIP | INLCR | IGNCR | ICRNL | IUCLC | IXON | IXANY | IXOFF); #else new_modes.sg_flags |= RAW; #endif if (not_a_tty) { if (debug_fp) { fprintf(debug_fp, "...tty_raw: not a tty\n"); } return; } PUT_TTY(fileno(stdin), &new_modes); if (debug_fp) { fprintf(debug_fp, "...tty_raw: done\n"); } } void tty_set(void) { /* set tty to special modes */ if (debug_fp) { fprintf(debug_fp, "tty_set:\n"); } new_modes = old_modes; #ifdef TERMIOS new_modes.c_cc[VMIN] = 1; new_modes.c_cc[VTIME] = 0; new_modes.c_lflag &= (tcflag_t) ~(ISIG | ICANON | ECHO | ECHOE | ECHOK | ECHONL); #if defined(ONLCR) && defined(OCRNL) && defined(ONLRET) && defined(OFILL) new_modes.c_oflag &= (tcflag_t) ~(ONLCR | OCRNL | ONLRET | OFILL); #else new_modes.c_oflag &= (tcflag_t) ~(OPOST); #endif if (char_mask == ALLOW_PARITY) new_modes.c_iflag &= (tcflag_t) ~ISTRIP; switch (select_xon_xoff) { case 0: new_modes.c_iflag &= (tcflag_t) ~(IXON | IXOFF); break; case 1: #if defined(sequent) && sequent /* the sequent System V emulation is broken */ new_modes = old_modes; new_modes.c_cc[VEOL] = 6; /* control F (ACK) */ #endif new_modes.c_iflag |= IXON | IXOFF; break; } switch (select_delay_type) { case 0: #ifdef NLDLY new_modes.c_oflag &= (tcflag_t) ~(NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY); #endif /* NLDLY */ break; case 1: #ifdef NLDLY new_modes.c_oflag &= (tcflag_t) ~(NLDLY | CRDLY | TABDLY | BSDLY | VTDLY | FFDLY); #endif /* NLDLY */ #ifdef NL1 new_modes.c_oflag |= NL1 | CR2; #endif /* NL1 */ break; } if ((new_modes.c_oflag & (tcflag_t) ~OPOST) == 0) new_modes.c_oflag &= (tcflag_t) ~OPOST; #else new_modes.sg_flags |= RAW; if (not_a_tty) { if (debug_fp) { fprintf(debug_fp, "...tty_set: not a tty\n"); } return; } #endif PUT_TTY(fileno(stdin), &new_modes); if (debug_fp) { fprintf(debug_fp, "...tty_set: done\n"); } } void tty_reset(void) { /* reset the tty to the original modes */ if (debug_fp) { fprintf(debug_fp, "tty_reset:\n"); } fflush(stdout); if (not_a_tty) { if (debug_fp) { fprintf(debug_fp, "...tty_reset: not a tty\n"); } return; } PUT_TTY(fileno(stdin), &old_modes); if (debug_fp) { fprintf(debug_fp, "...tty_reset: done\n"); } } void tty_init(void) { /* ATT terminal init */ #if defined(F_GETFL) && defined(O_NDELAY) int flags; flags = fcntl(fileno(stdin), F_GETFL, 0); nodelay_read = flags & O_NDELAY; #else nodelay_read = FALSE; #endif not_a_tty = FALSE; if (GET_TTY(fileno(stdin), &old_modes) == -1) { if (errno == ENOTTY) { tty_frame_size = 20; not_a_tty = TRUE; return; } printf("tcgetattr error: %d\n", errno); ExitProgram(EXIT_FAILURE); } /* if TAB3 is set then setterm() wipes out tabs (ht) */ new_modes = old_modes; #ifdef TERMIOS #ifdef TABDLY new_modes.c_oflag &= (tcflag_t) ~TABDLY; #endif /* TABDLY */ #endif if (PUT_TTY(fileno(stdin), &new_modes) == -1) { printf("tcsetattr error: %d\n", errno); ExitProgram(EXIT_FAILURE); } #ifdef sequent /* the sequent ATT emulation is broken soooo. */ old_modes.c_cflag &= ~(CSIZE | CSTOPB); old_modes.c_cflag |= CS7 | PARENB; #endif catchsig(); #ifdef TERMIOS switch (old_modes.c_cflag & CSIZE) { #if defined(CS5) && (CS5 != 0) case CS5: tty_frame_size = 10; break; #endif #if defined(CS6) && (CS6 != 0) case CS6: tty_frame_size = 12; break; #endif #if defined(CS7) && (CS7 != 0) case CS7: tty_frame_size = 14; break; #endif #if defined(CS8) && (CS8 != 0) case CS8: tty_frame_size = 16; break; #endif } tty_frame_size += 2 + ((old_modes.c_cflag & PARENB) ? 2 : 0) + ((old_modes.c_cflag & CSTOPB) ? 4 : 2); #else tty_frame_size = 6 + (old_modes.sg_flags & PASS8) ? 16 : 14; #endif } /* ** stty_query(question) ** ** Does the current driver settings have this property? */ int stty_query(int q) { switch (q) { case TTY_NOECHO: return TTY_IS_NOECHO; case TTY_OUT_TRANS: return (int) TTY_IS_OUT_TRANS; case TTY_CHAR_MODE: return TTY_IS_CHAR_MODE; } return (-1); } /* ** initial_stty_query(question) ** ** Did the initial driver settings have this property? */ int initial_stty_query(int q) { switch (q) { case TTY_8_BIT: return TTY_WAS_CS8; case TTY_XON_XOFF: return (int) TTY_WAS_XON_XOFF; } return (-1); } #if HAVE_SELECT && defined(FD_ZERO) static int char_ready(void) { int n; fd_set ifds; struct timeval tv; FD_ZERO(&ifds); FD_SET(fileno(stdin), &ifds); tv.tv_sec = 0; tv.tv_usec = 200000; n = select(fileno(stdin) + 1, &ifds, NULL, NULL, &tv); return (n != 0); } #else #ifdef FIONREAD int char_ready(void) { int i, j; /* the following loop has to be tuned for each computer */ for (j = 0; j < 1000; j++) { ioctl(fileno(stdin), FIONREAD, &i); if (i) return i; } return i; } #else #if defined(__BEOS__) int char_ready(void) { int n = 0; int howmany = ioctl(0, 'ichr', &n); return (howmany >= 0 && n > 0); } #else #define char_ready() 1 #endif #endif #endif /* ** spin_flush() ** ** Wait for the input stream to stop. ** Throw away all input characters. */ void spin_flush(void) { unsigned char buf[64]; fflush(stdout); event_start(TIME_FLUSH); /* start the timer */ do { if (char_ready()) { if (read(fileno(stdin), &buf, sizeof(buf)) != 0) break; } } while (event_time(TIME_FLUSH) < 400000); } /* ** read_key(input-buffer, length-of-buffer) ** ** read one function key from the input stream. ** A null character is converted to 0x80. */ void read_key(char *buf, size_t max) { int ask, i, l; char *s; if (debug_fp) { fprintf(debug_fp, "read_key: max=%lu\n", (unsigned long) max); } *buf = '\0'; s = buf; fflush(stdout); /* ATT unix may return 0 or 1, Berkeley Unix should be 1 */ while (read(fileno(stdin), s, (size_t) 1) <= 0) { ; /* EMPTY */ } ++s; --max; while ((int) max > 0 && (ask = char_ready()) > 0) { int got; if (ask > (int) max) { ask = (int) max; } if ((got = (int) read(fileno(stdin), s, (size_t) ask)) > 0) { s += got; } else { break; } max -= (size_t) got; } *s = '\0'; l = (int) (s - buf); for (s = buf, i = 0; i < l; i++) { if ((*s & 0x7f) == 0) { /* convert nulls to 0x80 */ *(unsigned char *) s = 128; } else { /* strip high order bits (if any) */ *s = (char) (*s & char_mask); } } if (debug_fp) { fprintf(debug_fp, "...read_key: result="); log_str(debug_fp, buf); fprintf(debug_fp, "\n"); } } void ignoresig(void) { /* ignore signals */ signal(SIGINT, SIG_IGN); signal(SIGHUP, SIG_IGN); signal(SIGQUIT, SIG_IGN); signal(SIGTERM, SIG_IGN); signal(SIGALRM, SIG_IGN); } /* * onintr( ) * * is the interrupt handling routine. * onintr turns off interrupts while doing clean-up. * * onintr always exits fatally */ static void onintr(int sig GCC_UNUSED) { ignoresig(); tty_reset(); ExitProgram(EXIT_FAILURE); } /* * catchsig( ) * * set up to field interrupts (via function onintr( )) so that if interrupted * we can restore the correct terminal modes * * catchsig simply returns */ void catchsig(void) { if ((signal(SIGINT, SIG_IGN)) == SIG_DFL) signal(SIGINT, onintr); if ((signal(SIGHUP, SIG_IGN)) == SIG_DFL) signal(SIGHUP, onintr); if ((signal(SIGQUIT, SIG_IGN)) == SIG_DFL) signal(SIGQUIT, onintr); if ((signal(SIGTERM, SIG_IGN)) == SIG_DFL) signal(SIGTERM, onintr); } /* ** alarm_event(sig) ** ** Come here for an alarm event */ static void alarm_event( int sig GCC_UNUSED) { no_alarm_event = 0; } /* ** set_alarm_clock(seconds) ** ** Set the alarm clock to fire in */ void set_alarm_clock( int seconds) { signal(SIGALRM, alarm_event); no_alarm_event = 1; (void) alarm((unsigned) seconds); } tack-1.09-20230201/tack.c0000644000000000000000000004231413760452326013054 0ustar rootroot/* ** Copyright 2017-2019,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include #include #include MODULE_ID("$Id: tack.c,v 1.38 2020/11/28 13:47:02 tom Exp $") /* This program is designed to test terminfo, not curses. Therefore I have used as little of curses as possible. Pads associated with the following capabilities are used to set delay times in the handler: (cr), (ind), (cub1), (ff), (tab). I use the (nxon) capability to set the tty handler with/without xon/xoff. If (smxon)/(rmxon) is defined I will change the terminal too. (xon) inhibits the sending of delay characters in putp(). If the terminal is defined with no padding then the (xon) boolean is a don't care. In this case I recommend that it be reset. */ /***************************************************************************** * * Option processing * *****************************************************************************/ /* options and modes */ int debug_level; /* debugging level */ int translate_mode; /* translate tab, bs, cr, lf, ff */ int scan_mode; /* use scan codes */ int char_mask; /* either 0xFF else 0x7F, eight bit data mask */ int select_delay_type; /* set handler delays for */ int select_xon_xoff; /* TTY driver XON/XOFF mode select */ int hex_out; /* Display output in hex */ int send_reset_init; /* Send the reset and initialization strings */ FILE *log_fp; /* Terminal logfile */ #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) int ignore_unused; #endif /***************************************************************************** * * Menu definitions * *****************************************************************************/ static void tools_hex_echo(TestList *, int *, int *); static void tools_debug(TestList *, int *, int *); #define MENU_ENABLE_HEX_OUTPUT "h) enable hex output on echo tool" #define MENU_DISABLE_HEX_OUTPUT "h) disable hex output on echo tool" static char hex_echo_menu_entry[80]; static TestList tools_test_list[] = { {0, 0, 0, 0, "s) ANSI status reports", tools_status, 0}, {0, 0, 0, 0, "g) ANSI SGR modes (bold, underline, reverse)", tools_sgr, 0}, {0, 0, 0, 0, "c) ANSI character sets", tools_charset, 0}, {0, 0, 0, 0, hex_echo_menu_entry, tools_hex_echo, 0}, {0, 0, 0, 0, "e) echo tool", tools_report, 0}, {1, 0, 0, 0, "r) reply tool", tools_report, 0}, {0, 0, 0, 0, "p) performance testing", 0, &sync_menu}, {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, {0, 0, "u8) (u9", 0, "u) test ENQ/ACK handshake", sync_handshake, 0}, {0, 0, 0, 0, "d) change debug level", tools_debug, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; static TestMenu tools_menu = { 0, 'q', 0, "Tools Menu", "tools", 0, 0, tools_test_list, 0, 0, 0 }; static void tty_width(TestList *, int *, int *); static void tty_delay(TestList *, int *, int *); static void tty_xon(TestList *, int *, int *); static void tty_trans(TestList *, int *, int *); static void tty_show_state(TestMenu *); static char tty_width_menu[80]; static char tty_delay_menu[80]; static char tty_xon_menu[80]; static char tty_trans_menu[80]; static char enable_xon_xoff[] = {"x) enable xon/xoff"}; static char disable_xon_xoff[] = {"x) disable xon/xoff"}; static TestList tty_test_list[] = { {0, 0, 0, 0, tty_width_menu, tty_width, 0}, {0, 0, 0, 0, tty_delay_menu, tty_delay, 0}, {0, 0, 0, 0, tty_xon_menu, tty_xon, 0}, {0, 0, 0, 0, tty_trans_menu, tty_trans, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; static TestMenu tty_menu = { 0, 'q', 0, "Terminal and driver configuration", "tty", 0, tty_show_state, tty_test_list, 0, 0, 0 }; #if TACK_CAN_EDIT TestMenu edit_menu = { 0, 'q', 0, "Edit terminfo menu", "edit", 0, 0, edit_test_list, 0, 0, 0 }; #endif static TestMenu mode_menu = { 0, 'n', 0, "Test modes and glitches:", "mode", "n) run standard tests", 0, mode_test_list, 0, 0, 0 }; static TestMenu acs_menu = { 0, 'n', 0, "Test alternate character set and graphics rendition:", "acs", "n) run standard tests", 0, acs_test_list, 0, 0, 0 }; static TestMenu color_menu = { 0, 'n', 0, "Test color:", "color", "n) run standard tests", 0, color_test_list, 0, 0, 0 }; static TestMenu crum_menu = { 0, 'n', 0, "Test cursor movement:", "move", "n) run standard tests", 0, crum_test_list, 0, 0, 0 }; static TestMenu funkey_menu = { 0, 'n', 0, "Test function keys:", "fkey", "n) run standard tests", sync_test, funkey_test_list, 0, 0, 0 }; static TestMenu printer_menu = { 0, 'n', 0, "Test printer:", "printer", "n) run standard tests", 0, printer_test_list, 0, 0, 0 }; static void pad_gen(TestList *, int *, int *); static TestMenu pad_menu = { 0, 'n', 0, "Test padding and string capabilities:", "pad", "n) run standard tests", sync_test, pad_test_list, 0, 0, 0 }; /* *INDENT-OFF* */ static TestList normal_test_list[] = { MY_EDIT_MENU {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, {MENU_NEXT, 0, 0, 0, "x) test modes and glitches", 0, &mode_menu}, {MENU_NEXT, 0, 0, 0, "a) test alternate character set and graphic rendition", 0, &acs_menu}, {MENU_NEXT, 0, 0, 0, "c) test color", 0, &color_menu}, {MENU_NEXT, 0, 0, 0, "m) test cursor movement", 0, &crum_menu}, {MENU_NEXT, 0, 0, 0, "f) test function keys", 0, &funkey_menu}, {MENU_NEXT, 0, 0, 0, "p) test padding and string capabilities", 0, &pad_menu}, {0, 0, 0, 0, "P) test printer", 0, &printer_menu}, {MENU_MENU, 0, 0, 0, "/) test a specific capability", 0, 0}, {0, 0, 0, 0, "t) auto generate pad delays", pad_gen, &pad_menu}, {0, 0, "u8) (u9", 0, 0, sync_handshake, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ static TestMenu normal_menu = { 0, 'n', 0, "Main test menu", "test", "n) run standard tests", 0, normal_test_list, 0, 0, 0 }; static void start_tools(TestList *, int *, int *); static void start_modes(TestList *, int *, int *); static void start_basic(TestList *, int *, int *); static void start_log(TestList *, int *, int *); #define MENU_START_LOGGING "l) start logging" #define MENU_STOP_LOGGING "l) stop logging" static char logging_menu_entry[80] = MENU_START_LOGGING; static TestList start_test_list[] = { {0, 0, 0, 0, "b) display basic information", start_basic, 0}, {0, 0, 0, 0, "m) change modes", start_modes, 0}, {0, 0, 0, 0, "t) tools", start_tools, 0}, {MENU_COMPLETE, 0, 0, 0, "n) begin testing", 0, &normal_menu}, {0, 0, 0, 0, logging_menu_entry, start_log, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; static TestMenu start_menu = { 0, 'n', 0, "Main Menu", "tack", 0, 0, start_test_list, 0, 0, 0 }; #if TACK_CAN_EDIT static TestList write_terminfo_list[] = { {0, 0, 0, 0, "w) write the current terminfo to a file", save_info, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; #endif /***************************************************************************** * * Menu command interpretation. * *****************************************************************************/ /* ** tools_hex_echo(testlist, state, ch) ** ** Flip the hex echo flag. */ static void tools_hex_echo( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (hex_out) { hex_out = FALSE; strcpy(hex_echo_menu_entry, MENU_ENABLE_HEX_OUTPUT); } else { hex_out = TRUE; strcpy(hex_echo_menu_entry, MENU_DISABLE_HEX_OUTPUT); } } /* ** tools_debug(testlist, state, ch) ** ** Change the debug level. */ static void tools_debug( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { char buf[32]; ptext("Enter a new value: "); read_string(buf, sizeof(buf)); if (buf[0]) { sscanf(buf, "%d", &debug_level); } sprintf(temp, "Debug level is now %d", debug_level); ptext(temp); *ch = REQUEST_PROMPT; } /* ** start_tools(testlist, state, ch) ** ** Run the generic test tools */ static void start_tools( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (hex_out) { strcpy(hex_echo_menu_entry, MENU_DISABLE_HEX_OUTPUT); } else { strcpy(hex_echo_menu_entry, MENU_ENABLE_HEX_OUTPUT); } menu_display(&tools_menu, 0); } /* ** tty_show_state() ** ** Display the current state on the tty driver settings */ static void tty_show_state( TestMenu * menu GCC_UNUSED) { put_crlf(); (void) sprintf(temp, "Accepting %d bits, UNIX delays %d, XON/XOFF %sabled, speed %u, translate %s, scan-code mode %s.", (char_mask == ALLOW_PARITY) ? 8 : 7, select_delay_type, select_xon_xoff ? "en" : "dis", tty_baud_rate, translate_mode ? "on" : "off", scan_mode ? "on" : "off"); ptextln(temp); put_crlf(); } /* ** tty_width(testlist, state, ch) ** ** Change the character width */ static void tty_width( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (char_mask == STRIP_PARITY) { char_mask = ALLOW_PARITY; strcpy(tty_width_menu, "7) treat terminal as 7-bit"); } else { char_mask = STRIP_PARITY; strcpy(tty_width_menu, "8) treat terminal as 8-bit"); } } /* ** tty_delay(testlist, state, ch) ** ** Change the delay for in the TTY driver */ static void tty_delay( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (select_delay_type) { select_delay_type = FALSE; strcpy(tty_delay_menu, "d) enable UNIX tty driver delays for "); } else { select_delay_type = TRUE; strcpy(tty_delay_menu, "d) disable UNIX tty driver delays for "); } } /* ** tty_xon(testlist, state, ch) ** ** Change the XON/XOFF flags in the TTY driver */ static void tty_xon( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (select_xon_xoff) { if (needs_xon_xoff) { ptextln("This terminal is marked as needing XON/XOFF protocol with (nxon)"); } if (exit_xon_mode) { tc_putp(exit_xon_mode); } ChangeTermInfo(xon_xoff, FALSE); select_xon_xoff = FALSE; strcpy(tty_xon_menu, enable_xon_xoff); } else { if (enter_xon_mode) { tc_putp(enter_xon_mode); } ChangeTermInfo(xon_xoff, TRUE); select_xon_xoff = TRUE; strcpy(tty_xon_menu, disable_xon_xoff); } tty_set(); } /* ** tty_trans(testlist, state, ch) ** ** Change the translation mode for special characters */ static void tty_trans( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (translate_mode) { translate_mode = FALSE; strcpy(tty_trans_menu, "t) use terminfo values for \\b\\f\\n\\r\\t"); } else { translate_mode = TRUE; strcpy(tty_trans_menu, "t) override terminfo values for \\b\\f\\n\\r\\t"); } } /* ** pad_gen(testlist, state, ch) ** ** Menu function for automatic pad generation */ static void pad_gen( TestList * t, int *state GCC_UNUSED, int *ch) { control_init(); if (tty_can_sync == SYNC_NOT_TESTED) { verify_time(); } auto_pad_mode = TRUE; menu_display(t->sub_menu, ch); auto_pad_mode = FALSE; } /* ** start_modes(testlist, state, ch) ** ** Change the TTY modes */ static void start_modes( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (select_delay_type) { strcpy(tty_delay_menu, "d) disable UNIX tty driver delays for "); } else { strcpy(tty_delay_menu, "d) enable UNIX tty driver delays for "); } if (char_mask == ALLOW_PARITY) { strcpy(tty_width_menu, "7) treat terminal as 7-bit"); } else { strcpy(tty_width_menu, "8) treat terminal as 8-bit"); } if (select_xon_xoff) { strcpy(tty_xon_menu, disable_xon_xoff); } else { strcpy(tty_xon_menu, enable_xon_xoff); } if (translate_mode) { strcpy(tty_trans_menu, "t) override terminfo values for \\b\\f\\n\\r\\t"); } else { strcpy(tty_trans_menu, "t) use terminfo values for \\b\\f\\n\\r\\t"); } menu_display(&tty_menu, 0); tty_set(); } /* ** start_basic(testlist, state, ch) ** ** Display basic terminal information */ static void start_basic( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { display_basic(); *ch = REQUEST_PROMPT; } /* ** start_log(testlist, state, ch) ** ** Start/stop in logging function */ static void start_log( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { if (!strcmp(logging_menu_entry, MENU_START_LOGGING)) { ptextln("The log file will capture all characters sent to the terminal."); if ((log_fp = fopen(LOG_FILENAME, "w"))) { ptextln("Start logging to file: " LOG_FILENAME); strcpy(logging_menu_entry, MENU_STOP_LOGGING); } else { ptextln("File open error: " LOG_FILENAME); } } else { if (log_fp) { fclose(log_fp); log_fp = 0; } ptextln("Terminal output logging stopped."); strcpy(logging_menu_entry, MENU_START_LOGGING); } } /* ** show_usage() ** ** Tell the user how its done. */ void show_usage( char *name) { (void) fprintf(stderr, "usage: %s [-diltV] [term]\n", name); } /* ** print_version() ** ** Print version and other useful information. */ void print_version(void) { printf("tack version %d.%02d (%d)\n", MAJOR_VERSION, MINOR_VERSION, PATCH_VERSION); printf("Copyright 2017-2020 Thomas E. Dickey\n"); printf("Copyright 1997-2017 Free Software Foundation, Inc.\n"); printf("Tack comes with NO WARRANTY, to the extent permitted by law.\n"); printf("You may redistribute copies of Tack under the terms of the\n"); printf("GNU General Public License. For more information about\n"); printf("these matters, see the file named COPYING.\n"); } #ifdef DEBUG void TackMsg(const char *fmt, ...) { static FILE *my_fp; static const char *my_filename = "TackMsg.out"; va_list ap; if (my_fp == 0) { if ((my_fp = fopen(my_filename, "w")) == 0) { fprintf(stderr, "Cannot open %s\n", my_filename); ExitProgram(EXIT_FAILURE); } } va_start(ap, fmt); vfprintf(my_fp, fmt, ap); va_end(ap); fflush(my_fp); } #endif static char * validate_term(char *value) { char *result = NULL; if (value != NULL && *value != '\0' && strlen(value) <= 128) { int n; result = value; for (n = 0; value[n] != '\0'; ++n) { int ch = UChar(value[n]); if (ch >= 128 || ch == '/' || !isgraph(ch)) { result = NULL; break; } } } if (result == NULL) { fprintf(stderr, "no useful value found for $TERM\n"); ExitProgram(EXIT_FAILURE); } return strdup(result); } /***************************************************************************** * * Main sequence * *****************************************************************************/ int main(int argc, char *argv[]) { #if TACK_CAN_EDIT int i, j; #endif int ch; /* scan the option flags */ send_reset_init = TRUE; translate_mode = FALSE; tty_can_sync = SYNC_NOT_TESTED; while ((ch = getopt(argc, argv, "diltV")) != -1) { switch (ch) { case 'V': print_version(); ExitProgram(EXIT_FAILURE); /* NOTREACHED */ case 'd': if ((debug_fp = fopen(DBG_FILENAME, "w")) == 0) { perror(DBG_FILENAME); ExitProgram(EXIT_FAILURE); } break; case 'i': send_reset_init = FALSE; break; case 'l': if ((log_fp = fopen(LOG_FILENAME, "w"))) { strcpy(logging_menu_entry, MENU_STOP_LOGGING); } else { perror(LOG_FILENAME); ExitProgram(EXIT_FAILURE); } break; case 't': translate_mode = FALSE; break; default: show_usage(argv[0]); ExitProgram(EXIT_SUCCESS); /* NOTREACHED */ } } if (optind >= argc) { tty_basename = validate_term(getenv("TERM")); } else if (optind + 1 >= argc) { tty_basename = validate_term(argv[optind]); } else { show_usage(argv[0]); ExitProgram(EXIT_FAILURE); } curses_setup(argv[0]); menu_can_scan(&normal_menu); /* extract which caps can be tested */ menu_display(&start_menu, 0); #if TACK_CAN_EDIT if (user_modified()) { sprintf(temp, "Hit y to save changes to file: %.256s ? ", tty_basename); ptext(temp); if (wait_here() == 'y') { save_info(write_terminfo_list, &i, &j); } } #endif put_str("\nTerminal test complete\n"); bye_kids(EXIT_SUCCESS); ExitProgram(EXIT_SUCCESS); } #if NO_LEAKS void ExitProgram(int code) { free(tty_basename); del_curterm(cur_term); tack_edit_leaks(); tack_fun_leaks(); #if defined(HAVE_EXIT_TERMINFO) exit_terminfo(code); #elif defined(HAVE__NC_FREE_TINFO) _nc_free_tinfo(code); #else exit(code); #endif } #endif tack-1.09-20230201/modes.c0000644000000000000000000004737613615560366013261 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2010,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: modes.c,v 1.14 2020/02/02 14:47:18 tom Exp $") /* * Tests boolean flags and terminal modes. */ /* ** subtest_os(test_list, status, ch) ** ** test over strike mode (os) */ static void subtest_os( TestList * t, int *state, int *ch) { ptext("(os) should be true, not false."); put_cr(); ptextln("(os) should be false."); sprintf(temp, "(os) over-strike is %s in the data base. ", over_strike ? "true" : "false"); ptext(temp); generic_done_message(t, state, ch); } /* ** subtest_rmam(test_list, status, ch) ** ** test exit automatic margins mode (rmam) */ static void subtest_rmam( TestList * t, int *state, int *ch) { int j; if (!exit_am_mode) { ptext("(rmam) not present. "); } else if (!can_go_home) { ptext("(rmam) not tested, no way to home cursor. "); } else if (over_strike) { put_clear(); go_home(); tc_putp(exit_am_mode); ptext("\n(rmam) will reset (am)"); go_home(); for (j = 0; j < columns; j++) put_this(' '); ptext("(rmam) will not reset (am)"); go_home(); put_newlines(2); } else { put_clear(); go_home(); tc_putp(exit_am_mode); ptext("\n(rmam) will reset (am)"); go_home(); for (j = 0; j < columns; j++) put_this(' '); ptext("(rmam) will not reset (am) "); go_home(); put_str(" "); go_home(); put_newlines(2); } ptext("Exit-automatic-margins "); generic_done_message(t, state, ch); } /* ** subtest_smam(test_list, status, ch) ** ** test enter automatic margins mode (smam) */ static void subtest_smam( TestList * t, int *state, int *ch) { int i, j; if (!enter_am_mode) { ptext("(smam) not present. "); } else if (!can_go_home) { ptext("(smam) not tested, no way to home cursor. "); } else if (over_strike) { put_clear(); go_home(); tc_putp(enter_am_mode); ptext("\n(smam) will "); i = char_count; ptext("not set (am)"); go_home(); for (j = -i; j < columns; j++) put_this(' '); put_str("@@@"); put_newlines(2); } else { put_clear(); go_home(); tc_putp(enter_am_mode); ptext("\n(smam) will not set (am)"); go_home(); for (j = 0; j < columns; j++) put_this(' '); ptext("(smam) will set (am) "); go_home(); put_str(" "); put_newlines(2); } ptext("Enter-automatic-margins "); generic_done_message(t, state, ch); } /* ** subtest_am(test_list, status, ch) ** ** test automatic margins (am) */ static void subtest_am( TestList * t, int *state, int *ch) { int i, j; if (!can_go_home) { ptextln("(am) not tested, no way to home cursor. "); } else if (over_strike) { put_clear(); go_home(); ptext("\n(am) should "); i = char_count; ptext("not be set"); go_home(); for (j = -i; j < columns; j++) put_this(' '); put_str("@@@"); go_home(); put_newlines(2); sprintf(temp, "(am) is %s in the data base", auto_right_margin ? "true" : "false"); ptextln(temp); } else { put_clear(); go_home(); ptext("\n(am) should not be set"); go_home(); for (j = 0; j < columns; j++) put_this(' '); ptext("(am) should be set "); go_home(); put_str(" \n\n"); sprintf(temp, "(am) is %s in the data base", auto_right_margin ? "true" : "false"); ptextln(temp); } ptext("Automatic-right-margin "); generic_done_message(t, state, ch); } /* Note: uprint() sends underscore back-space character, and ucprint() sends character back-space underscore. */ /* ** uprint(string) ** ** underline string for (ul) test */ static void uprint(const char *s) { if (s) { while (*s) { put_str("_\b"); putchp(*s++); } } } /* ** ucprint(string) ** ** underline string for (uc) test */ static void ucprint(const char *s) { if (s) { while (*s) { putchp(*s++); putchp('\b'); tc_putp(underline_char); } } } /* ** subtest_ul(test_list, status, ch) ** ** test transparent underline (ul) */ static void subtest_ul( TestList * t, int *state, int *ch) { if (!over_strike) { /* (ul) is used only if (os) is reset */ put_crlf(); sprintf(temp, "This text should %sbe underlined.", transparent_underline ? "" : "not "); uprint(temp); put_crlf(); ptextln("If the above line is not underlined the (ul) should be false."); sprintf(temp, "(ul) Transparent-underline is %s in the data base", transparent_underline ? "true" : "false"); ptextln(temp); generic_done_message(t, state, ch); } } /* ** subtest_uc(test_list, status, ch) ** ** test underline character (uc) */ static void subtest_uc( TestList * t, int *state, int *ch) { if (!over_strike) { if (underline_char) { ucprint("This text should be underlined."); put_crlf(); ptextln("If the above text is not underlined the (uc) has failed."); ptext("Underline-character "); } else { ptext("(uc) underline-character is not defined. "); } generic_done_message(t, state, ch); } } /* ** subtest_bw(test_list, status, ch) ** ** test auto left margin (bw) */ static void subtest_bw( TestList * t, int *state, int *ch) { int i; if (over_strike) { int j; /* test (bw) */ ptext("\n(bw) should "); i = char_count; ptextln("not be set."); for (j = i; j < columns; j++) put_str("\b"); put_str("@@@"); put_crlf(); sprintf(temp, "(bw) Auto-left-margin is %s in the data base", auto_left_margin ? "true" : "false"); ptextln(temp); } else { /* test (bw) */ ptextln("(bw) should not be set."); for (i = 12; i < columns; i++) put_str("\b"); if (delete_character) { for (i = 0; i < 4; i++) tc_putp(delete_character); } else { put_str(" "); } put_crlf(); sprintf(temp, "(bw) Auto-left-margin is %s in the data base", auto_left_margin ? "true" : "false"); ptextln(temp); } generic_done_message(t, state, ch); } /* ** subtest_tbc(test_list, status, ch) ** ** test clear tabs (tbc) */ static void subtest_tbc( TestList * t, int *state, int *ch) { int tabat; /* the tab spacing we end up with */ int i; if (clear_all_tabs && !set_tab) { ptext("(tbc) Clear-all-tabs is defined but (hts) set-tab is not. "); ptext("Once the tabs are cleared there is no way to set them. "); } else if (clear_all_tabs) { tabat = set_tab ? 8 : init_tabs; tc_putp(clear_all_tabs); ptext("Clear tabs (tbc)"); go_home(); put_crlf(); putchp('\t'); putchp('T'); go_home(); put_newlines(2); for (i = 0; i < columns; i++) { if (i == tabat) { putchp('T'); } else { putchp('.'); } } go_home(); ptext("\n\n\nIf the above two lines have T's in the same column then (tbc) has failed. "); } else { ptext("(tbc) Clear-all-tabs is not defined. "); } generic_done_message(t, state, ch); } /* ** subtest_hts(test_list, status, ch) ** ** (ht) and set tabs with (hts) */ static void subtest_hts( TestList * t, int *state, int *ch) { int tabat; /* the tab spacing we end up with */ int i; tabat = init_tabs; if (set_tab) { ptext("Tabs set with (hts)"); put_crlf(); for (i = 1; i < columns; i++) { if (i % 8 == 1) { tc_putp(set_tab); } putchp(' '); } tabat = 8; } else { sprintf(temp, "(hts) Set-tabs not defined. (it) Initial-tabs at %d", init_tabs); ptext(temp); } go_home(); put_newlines(2); if (tabat <= 0) { tabat = 8; } for (i = tabat; i < columns; i += tabat) { putchp('\t'); putchp('T'); } go_home(); put_newlines(3); for (i = 1; i < columns; i++) { putchp('.'); } go_home(); put_newlines(3); for (i = tabat; i < columns; i += tabat) { putchp('\t'); putchp('T'); } go_home(); put_newlines(4); putchp('.'); for (i = 2; i < columns; i++) { if (i % tabat == 1) { putchp('T'); } else { putchp('.'); } } go_home(); put_newlines(5); if (set_tab) { ptextln("If the last two lines are not the same then (hts) has failed."); } else if (init_tabs > 0) { ptextln("If the last two lines are not the same then (it) is wrong."); } else { ptextln("If the last two lines are the same then maybe you do have tabs and (it) should be changed."); } generic_done_message(t, state, ch); } /* ** subtest_xt(test_list, status, ch) ** ** (xt) glitch */ static void subtest_xt( TestList * t, int *state, int *ch) { int tabat; /* the tab spacing we end up with */ tabat = set_tab ? 8 : init_tabs; if (!over_strike && (tabat > 0)) { int cc; ptext("(xt) should not "); put_cr(); ptext("(xt) should"); cc = char_count; while (cc < 16) { putchp('\t'); cc = ((cc / tabat) + 1) * tabat; } putln("be set."); sprintf(temp, "(xt) Destructive-tab is %s in the data base.", dest_tabs_magic_smso ? "true" : "false"); ptextln(temp); generic_done_message(t, state, ch); } } /* ** subtest_cbt(test_list, status, ch) ** ** (cbt) back tab */ static void subtest_cbt( TestList * t, int *state, int *ch) { if (back_tab) { int i; put_clear(); ptext("Back-tab (cbt)"); go_home(); put_crlf(); for (i = 1; i < columns; i++) { putchp(' '); } for (i = 0; i < columns; i += 8) { tc_putp(back_tab); putchp('T'); tc_putp(back_tab); } go_home(); put_newlines(2); for (i = 1; i < columns; i++) { if (i % 8 == 1) { putchp('T'); } else { putchp(' '); } } go_home(); put_newlines(3); ptextln("The preceding two lines should be the same."); } else { ptextln("(cbt) Back-tab not present"); } generic_done_message(t, state, ch); } /* ** subtest_xenl(test_list, status, ch) ** ** (xenl) eat newline glitch */ static void subtest_xenl( TestList * t, int *state, int *ch) { if (over_strike) { int i, j, k; /* test (xenl) on overstrike terminals */ if (!can_go_home || !can_clear_screen) { ptextln("(xenl) Newline-glitch not tested, can't home cursor and clear."); generic_done_message(t, state, ch); return; } put_clear(); /* this test must be done in raw mode. Otherwise UNIX will translate CR to CRLF. */ if (stty_query(TTY_OUT_TRANS)) tty_raw(1, char_mask); ptext("\nreset (xenl). Does "); i = char_count; put_str("not ignore CR, does "); k = char_count; put_str("not ignore LF"); go_home(); for (j = 0; j < columns; j++) put_this(' '); put_cr(); for (j = 0; j < i; j++) putchp(' '); put_str("@@@\n@@"); go_home(); for (j = 0; j < columns; j++) put_this(' '); put_lf(); for (j = 0; j < k; j++) putchp(' '); put_str("@@@\r@@"); tty_set(); go_home(); put_newlines(4); sprintf(temp, "(xenl) Newline-glitch is %s in the data base", eat_newline_glitch ? "true" : "false"); ptextln(temp); } else { int j; /* test (xenl) when (os) is reset */ if (!can_go_home) { ptextln("(xenl) Newline-glitch not tested, can't home cursor"); generic_done_message(t, state, ch); return; } /* (xenl) test */ put_clear(); /* this test must be done in raw mode. Otherwise UNIX will translate CR to CRLF. */ if (stty_query(TTY_OUT_TRANS)) tty_raw(1, char_mask); for (j = 0; j < columns; j++) put_this(' '); put_cr(); ptext("(xenl) should be set. Does not ignore CR"); go_home(); put_crlf(); for (j = 0; j < columns; j++) put_this(' '); put_lf(); /* test (cud1) */ ptext("(xenl) should be set. Ignores (cud1)"); go_home(); put_newlines(3); if (scroll_forward && cursor_down && strcmp(scroll_forward, cursor_down)) { for (j = 0; j < columns; j++) put_this(' '); put_ind(); /* test (ind) */ ptext("(xenl) should be set. Ignores (ind)"); go_home(); put_newlines(5); } tty_set(); ptextln("If you don't see text above telling you to set it, (xenl) should be false"); sprintf(temp, "(xenl) Newline-glitch is %s in the data base", eat_newline_glitch ? "true" : "false"); ptextln(temp); } generic_done_message(t, state, ch); } /* ** subtest_eo(test_list, status, ch) ** ** (eo) erase overstrike */ static void subtest_eo( TestList * t, int *state, int *ch) { if (transparent_underline || over_strike || underline_char) { ptext("(eo) should "); if (underline_char) { ucprint("not"); } else { uprint("not"); } put_cr(); ptextln("(eo) should be set"); sprintf(temp, "\n(eo) Erase-overstrike is %s in the data base", erase_overstrike ? "true" : "false"); ptextln(temp); generic_done_message(t, state, ch); } } /* ** subtest_xmc(test_list, status, ch) ** ** (xmc) magic cookie glitch */ static void subtest_xmc( TestList * t, int *state, int *ch) { if (enter_standout_mode) { int i, j; sprintf(temp, "\n(xmc) Magic-cookie-glitch is %d in the data base", magic_cookie_glitch); ptextln(temp); j = magic_cookie_glitch * 8; for (i = 0; i < j; i++) { put_str(" "); } ptextln(" These two lines should line up."); if (j > 0) { char_count += j; } for (i = 0; i < 4; i++) { put_mode(enter_standout_mode); putchp(' '); put_mode(exit_standout_mode); putchp(' '); } ptextln("These two lines should line up."); ptext("If they don't line up then (xmc) magic-cookie-glitch should be greater than zero. "); generic_done_message(t, state, ch); } } /* ** subtest_xhp(test_list, status, ch) ** ** (xhp) erase does not clear standout mode */ static void subtest_xhp( TestList * t, int *state, int *ch) { if (enter_standout_mode) { put_crlf(); put_mode(enter_standout_mode); put_str("Stand out"); put_mode(exit_standout_mode); put_cr(); ptextln("If any part of this line is standout then (xhp) should be set."); sprintf(temp, "(xhp) Erase-standout-glitch is %s in the data base", ceol_standout_glitch ? "true" : "false"); ptextln(temp); generic_done_message(t, state, ch); } } /* ** subtest_mir(test_list, status, ch) ** ** (mir) move in insert mode */ static void subtest_mir( TestList * t, int *state, int *ch) { if (enter_insert_mode && exit_insert_mode && cursor_address) { int i; char *s; put_clear(); i = line_count; put_str("\nXXX\nXXX\nXXX\nXXX"); tc_putp(enter_insert_mode); s = TPARM_2(cursor_address, i + 1, 0); tputs(s, lines, tc_putch); putchp('X'); s = TPARM_2(cursor_address, i + 2, 1); tputs(s, lines, tc_putch); putchp('X'); s = TPARM_2(cursor_address, i + 3, 2); tputs(s, lines, tc_putch); putchp('X'); s = TPARM_2(cursor_address, i + 4, 3); tputs(s, lines, tc_putch); putchp('X'); tc_putp(exit_insert_mode); put_newlines(2); ptextln("If you see a 4 by 4 block of X's then (mir) should be true."); sprintf(temp, "(mir) Move-in-insert-mode is %s in the data base", move_insert_mode ? "true" : "false"); ptextln(temp); } else { ptext("(mir) Move-in-insert-mode not tested, "); if (!enter_insert_mode) { ptext("(smir) "); } if (!exit_insert_mode) { ptext("(rmir) "); } if (!cursor_address) { ptext("(cup) "); } ptext("not present. "); } generic_done_message(t, state, ch); } /* ** subtest_msgr(test_list, status, ch) ** ** (msgr) move in sgr mode */ static void subtest_msgr( TestList * t, int *state, int *ch) { if (cursor_address && ((enter_standout_mode && exit_standout_mode) || (enter_alt_charset_mode && exit_alt_charset_mode))) { int i; put_crlf(); i = line_count + 1; tputs(TPARM_2(cursor_address, i, 0), lines, tc_putch); put_mode(enter_alt_charset_mode); put_crlf(); /* some versions of the wy-120 can not clear lines or screen when in alt charset mode. If (el) and (ed) are defined then I can test them. If they are not defined then they can not break (msgr) */ tc_putp(clr_eos); tc_putp(clr_eol); put_mode(exit_alt_charset_mode); put_mode(enter_standout_mode); putchp('X'); tputs(TPARM_2(cursor_address, i + 2, 1), lines, tc_putch); putchp('X'); tputs(TPARM_2(cursor_address, i + 3, 2), lines, tc_putch); putchp('X'); tputs(TPARM_2(cursor_address, i + 4, 3), lines, tc_putch); putchp('X'); put_mode(exit_standout_mode); put_crlf(); tc_putp(clr_eos); /* OK if missing */ put_crlf(); ptextln("If you see a diagonal line of standout X's then (msgr) should be true. If any of the blanks are standout then (msgr) should be false."); sprintf(temp, "(msgr) Move-in-SGR-mode is %s in the data base", move_standout_mode ? "true" : "false"); ptextln(temp); } else { ptextln("(smso) (rmso) (smacs) (rmacs) missing; (msgr) Move-in-SGR-mode not tested."); } generic_done_message(t, state, ch); } /* ** subtest_in(test_list, status, ch) ** ** (in) insert null glitch */ static void subtest_in( TestList * t, int *state, int *ch) { if (enter_insert_mode && exit_insert_mode) { ptextln("\nTesting (in) with (smir) and (rmir)"); putln("\tIf these two lines line up ..."); put_str("\tIf these two lines line up ..."); put_cr(); tc_putp(enter_insert_mode); putchp(' '); tc_putp(exit_insert_mode); ptext("\nthen (in) should be set. "); sprintf(temp, "(in) Insert-null-glitch is %s in the data base.", insert_null_glitch ? "true" : "false"); ptextln(temp); generic_done_message(t, state, ch); } } /* ** subtest_dadb(test_list, status, ch) ** ** (da) (db) data above, (db) data below */ static void subtest_dadb( TestList * t, int *state, int *ch) { if (can_clear_screen && scroll_reverse && scroll_forward) { put_clear(); if (scroll_reverse) ptext("(da) Data-above should be set\r"); home_down(); if (scroll_forward) ptext("(db) Data-below should be set\r"); tc_putp(scroll_forward); go_home(); tc_putp(scroll_reverse); tc_putp(scroll_reverse); home_down(); tc_putp(scroll_forward); go_home(); ptextln("\n\n\n\n\nIf the top line is blank then (da) should be false."); ptextln("If the bottom line is blank then (db) should be false."); sprintf(temp, "\n(da) Data-above is %s, and (db) Data-below is %s, in the data base.", memory_above ? "true" : "false", memory_below ? "true" : "false"); ptextln(temp); line_count = lines; } else { ptextln("(da) Data-above, (db) Data-below not tested, scrolls or (clear) is missing."); } generic_done_message(t, state, ch); } TestList mode_test_list[] = { MY_EDIT_MENU {MENU_NEXT, 3, "os", 0, 0, subtest_os, 0}, {MENU_NEXT, 1, "rmam", 0, 0, subtest_rmam, 0}, {MENU_NEXT, 1, "smam", 0, 0, subtest_smam, 0}, {MENU_NEXT, 1, "am", 0, 0, subtest_am, 0}, {MENU_NEXT, 3, "ul", 0, 0, subtest_ul, 0}, {MENU_NEXT, 3, "uc", 0, 0, subtest_uc, 0}, {MENU_NEXT, 3, "bw", 0, 0, subtest_bw, 0}, {MENU_NEXT, 4, "xenl", 0, 0, subtest_xenl, 0}, {MENU_NEXT, 3, "eo", 0, 0, subtest_eo, 0}, {MENU_NEXT, 3, "xmc", 0, 0, subtest_xmc, 0}, {MENU_NEXT, 3, "xhp", 0, 0, subtest_xhp, 0}, {MENU_NEXT, 6, "mir", 0, 0, subtest_mir, 0}, {MENU_NEXT, 6, "msgr", 0, 0, subtest_msgr, 0}, {MENU_NEXT | MENU_CLEAR, 0, "tbc", "it", 0, subtest_tbc, 0}, {MENU_NEXT | MENU_CLEAR, 0, "hts", "it", 0, subtest_hts, 0}, {MENU_NEXT, 4, "xt", "it", 0, subtest_xt, 0}, {MENU_NEXT, 1, "cbt", "it", 0, subtest_cbt, 0}, {MENU_NEXT, 6, "in", 0, 0, subtest_in, 0}, {MENU_NEXT, 1, "da) (db", 0, 0, subtest_dadb, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; tack-1.09-20230201/tack.10000644000000000000000000004261013756263726013002 0ustar rootroot.\"*************************************************************************** .\" Copyright 2020 Thomas E. Dickey * .\" Copyright 1997-2011,2017 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * .\" "Software"), to deal in the Software without restriction, including * .\" without limitation the rights to use, copy, modify, merge, publish, * .\" distribute, distribute with modifications, sublicense, and/or sell * .\" copies of the Software, and to permit persons to whom the Software is * .\" furnished to do so, subject to the following conditions: * .\" * .\" The above copyright notice and this permission notice shall be included * .\" in all copies or substantial portions of the Software. * .\" * .\" THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * .\" OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * .\" MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * .\" IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * .\" DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * .\" OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * .\" THE USE OR OTHER DEALINGS IN THE SOFTWARE. * .\" * .\" Except as contained in this notice, the name(s) of the above copyright * .\" holders shall not be used in advertising or otherwise to promote the * .\" sale, use or other dealings in this Software without prior written * .\" authorization. * .\"*************************************************************************** .\" .\" $Id: tack.1,v 1.9 2020/11/21 19:17:42 tom Exp $ .TH tack 1 "" .ie \n(.g .ds `` \(lq .el .ds `` `` .ie \n(.g .ds '' \(rq .el .ds '' '' .ds n 5 .SH NAME \fBtack\fR \- \fIterminfo\fR action checker .SH SYNOPSIS \fBtack\fR [\-diltV] [term] .br .SH DESCRIPTION The \fBtack\fR program has three purposes: .TP 4 (1) to help you build a new terminfo entry describing an unknown terminal, .TP 4 (2) to test the correctness of an existing entry, and .TP 4 (3) to develop the correct pad timings needed to ensure that screen updates do not fall behind the incoming data stream. .PP \fBTack\fR presents a series of screen-painting and interactive tests in ways which are intended to make any mismatches between the terminfo entry and reality visually obvious. \fBTack\fR also provides tools that can help in understanding how the terminal operates. .SS OPTIONS .TP .I "\-d" Start \fBtack\fP with the debug-file \*(``debug.log\*('' opened. .TP .I "\-i" Usually \fBtack\fR will send the reset and init strings to the terminal when the program starts up. The \fI\-i\fR option will inhibit the terminal initialization. .TP .I "\-l" Start \fBtack\fP with the log-file \*(``tack.log\*('' opened. This is also a menu item. .TP .I "\-t" Tell \fBtack\fR to override the terminfo settings for basic terminal functions. When this option is set, \fBtack\fR will translate .RS .PP (cr) to \\r, .br (cud1) to \\n, .br (ind) to \\n, .br (nel) to \\r\\n, .br (cub1) to \\b, .br (bel) to \\007, .br (ff) to \\f and .br (ht) to \\t. .RE .TP .I "\-V" Display the version information and exit. .TP .I "term" Terminfo terminal name to be tested. If not present, then the $TERM environment variable will be used. .SH OVERVIEW Since \fBtack\fR is designed to test terminfo entries it is not possible to rely on the correctness of the terminfo data base. Because of this, the menuing system used with \fBtack\fR is very primitive. When a menu is printed, it will scroll the entire screen. To compensate for this verbose menu system, \fBtack\fR permits menu selection type ahead. If you already know what action you would like \fBtack\fR to perform then you can enter that value immediately and avoid the menu display. When in doubt the question mark (?) is a good character to type. A carriage return will execute the default action. These default actions are designed to run all the standard tests. .PP When \fBtack\fR first comes up it will display some basic information about the terminal. Take some time to verify this information. If it is wrong many of the subsequent tests will fail. The most important item is the screen size. If the screen size is wrong, there is no point in proceeding. (home) and (clear) are also critical to the success of subsequent tests. The values of (cr) (ind) (cub1) and (ht) may effect the tests if they are defined incorrectly. If they are undefined \fBtack\fR will set them to reasonable defaults. The last two entries on the display are the enquire and acknowledge strings. These strings are taken from the user strings (u9) and (u8). .PP By now you must be wondering why the terminfo names are enclosed in parenthesis. This has no profound meaning other than it makes them stand out. The \fBtack\fR program uses this convention any time it displays a terminfo name. Remember that \fBtack\fR is designed to rely on as little of the terminfo entry as possible. .SH CREATING NEW ENTRIES \fBTack\fR has a number of tools that are designed to help gather information about the terminal. Although these functions are not dependent on terminal type, you may wish to execute \fBtack\fR with options \fI\-it\fR. This will turn off initialization and default the standard entries. .PP These tools may be reached from the main menu by selecting the \*(``tools\*('' entry. .PP \fBEcho tool\fR: All data typed from the keyboard will be echoed back to the terminal. Control characters are not translated to the up arrow format but are sent as control characters. This allows you to test an escape sequence and see what it actually does. You may also elect to \fBenable hex output on echo tool\fR this will echo the characters in hexadecimal. Once the test is running you may enter the \*(``lines\*('' or \*(``columns\*('' keywords which will display a pattern that will help you determine your screen size. A complete list of keywords will be displayed when the test starts. Type \*(``help\*('' to redisplay the list of available commands. .PP \fBReply tool\fR: This tool acts much like the echo tool, but control characters that are sent from the terminal more than one character after a carriage return will be expanded to the up arrow format. For example on a standard ANSI terminal you may type: CR ESC [ c and the response will be echoed as something like: ^[ [ ? 6 c .PP \fBANSI sgr display\fR: This test assumes you have an ANSI terminal. It goes through attribute numbers 0 to 79, displaying each in turn and using that SGR number to write the text. This shows you which of the SGR modes are actually implemented by the terminal. Note: some terminals (such as Tektronix color) use the private use characters to augment the functionality of the SGR command. These private use characters may be interjected into the escape sequence by typing the character ( <, =, >, ? ) after the original display has been shown. .PP \fBANSI status reports\fR: This test queries the terminal in standard ANSI/VT-100 fashion. The results of this test may help determine what options are supported by your terminal. .PP \fBANSI character sets\fR: This test displays the character sets available on a ANSI/VT-100 style terminal. Character sets on a real VT-100 terminal are usually defined with smacs=\\E(0 and rmacs=\\E(B. The first character after the escape defines the font bank. The second character defines the character set. This test allows you to view any of the possible combinations. Private use character sets are defined by the digits. Standard character sets are located in the alphabetic range. .SH VERIFYING AN EXISTING ENTRY .PP You can verify the correctness of an entry with the \*(``begin testing\*('' function. This entry is the default action and will be chosen if you hit carriage return (or enter). This will bring up a secondary menu that allows you to select more specific tests. .PP The general philosophy of the program is, for each capability, to send an appropriate test pattern to the terminal then send a description of what the user should expect. Occasionally (as when checking function-key capabilities) the program will ask you to enter input for it to check. .PP If the test fails then you have the option of dynamically changing the terminfo entry and re-running the test. This is done with the \*(``edit terminfo\*('' menu item. The edit submenu allows you to change the offending terminfo entry and immediately retest the capability. The edit menu lets you do other things with the terminfo, such as; display the entire terminfo entry, display which caps have been tested and display which caps cannot be tested. This menu also allows you to write the newly modified terminfo to disc. If you have made any modifications to the terminfo \fBtack\fR will ask you if you want to save the file to disc before it exits. The filename will be the same as the terminal name. After the program exits you can run the tic(1M) compiler on the new terminfo to install it in the terminfo data base. .PP .SH CORRECTING PAD TIMINGS .SS Theory of Overruns and Padding .PP Some terminals require significant amounts of time (that is, more than one transmitted-character interval) to do screen updates that change large portions of the screen, such as screen clears, line insertions, line deletions, and scrolls (including scrolls triggered by line feeds or a write to the lowest, right-hand-most cell of the screen). .PP If the computer continues to send characters to the terminal while one of these time-consuming operations is going on, the screen may be garbled. Since the length of a character transmission time varies inversely with transmission speed in cps, entries which function at lower speeds may break at higher speeds. .PP Similar problems result if the host machine is simply sending characters at a sustained rate faster than the terminal can buffer and process them. In either case, when the terminal cannot process them and cannot tell the host to stop soon enough, it will just drop them. The dropped characters could be text, escape sequences or the escape character itself, causing some really strange-looking displays. This kind of glitch is called an \fIoverrun\fR. .PP In terminfo entries, you can attach a \fIpad time\fR to each string capability that is a number of milliseconds to delay after sending it. This will give the terminal time to catch up and avoid overruns. .PP If you are running a software terminal emulator, or you are on an X pseudo-tty, or your terminal is on an RS-232C line which correctly handles RTS/CTS hardware flow control, then pads are not strictly necessary. However, some display packages (such as \fBncurses\fP(3X)) use the pad counts to calculate the fastest way to implement certain functions. For example: scrolling the screen may be faster than deleting the top line. .PP One common way to avoid overruns is with XON/XOFF handshaking. But even this handshake may have problems at high baud rates. This is a result of the way XON/XOFF works. The terminal tells the host to stop with an XOFF. When the host gets this character, it stops sending. However, there is a small amount of time between the stop request and the actual stop. During this window, the terminal must continue to accept characters even though it has told the host to stop. If the terminal sends the stop request too late, then its internal buffer will overflow. If it sends the stop character too early, then the terminal is not getting the most efficient use out of its internal buffers. In a real application at high baud rates, a terminal could get a dozen or more characters before the host gets around to suspending transmission. Connecting the terminal over a network will make the problem much worse. .PP (RTS/CTS handshaking does not have this problem because the UARTs are signal-connected and the "stop flow" is done at the lowest level, without software intervention). .PP .SS Timing your terminal .PP In order to get accurate timings from your terminal \fBtack\fR needs to know when the terminal has finished processing all the characters that were sent. This requires a different type of handshaking than the XON/XOFF that is supported by most terminals. \fBTack\fR needs to send a request to the terminal and wait for its reply. Many terminals will respond with an ACK when they receive an ENQ. This is the preferred method since the sequence is short. ANSI/VT-100 style terminals can mimic this handshake with the escape sequence that requests \*(``primary device attributes\*(''. ESC [ c The terminal will respond with a sequence like: ESC [ ? 1 ; 0 c \fBTack\fR assumes that (u9) is the enquire sequence and that (u8) is the acknowledge string. A VT-100 style terminal could set u9=\\E[c and u8=\\E[?1;0c. Acknowledge strings fall into two categories. .TP 4 1) Strings with a unique terminating character and, .TP 4 2) strings of fixed length. .PP The acknowledge string for the VT-100 is of the first type since it always ends with the letter \*(``c\*(''. Some Tektronix terminals have fixed length acknowledge strings. \fBTack\fR supports both types of strings by scanning for the terminating character until the length of the expected acknowledge string has arrived. (u8) should be set to some typical acknowledge that will be returned when (u9) is sent. .PP \fBTack\fR will test this sequence before running any of the pad tests or the function key tests. \fBTack\fR will ask you the following: Hit lower case g to start testing... After it sends this message it will send the enquire string. It will then read characters from the terminal until it sees the letter g. .PP .SS Testing and Repairing Pad Timings .PP The pad timings in distributed terminfo entries are often incorrect. One major motivation for this program is to make it relatively easy to tune these timings. .PP You can verify and edit the pad timings for a terminal with the \*(``test string capabilities\*('' function (this is also part of the \*(``normal test sequence\*('' function). .PP The key to determining pad times is to find out the effective baud rate of the terminal. The effective baud rate determines the number of characters per second that the terminal can accept without either handshaking or losing data. This rate is frequently less than the nominal cps rate on the RS-232 line. .PP \fBTack\fR uses the effective baud rate to judge the duration of the test and how much a particular escape sequence will perturb the terminal. .PP Each pad test has two associated variables that can be tweaked to help verify the correctness of the pad timings. One is the pad test length. The other is the pad multiplier, which is used if the pad prefix includes \*(``*\*(''. In curses use, it is often the first parameter of the capability (if there is one). For a capability like (dch) or (il) this will be the number of character positions or lines affected, respectively. .PP \fBTack\fR will run the pad tests and display the results to the terminal. On capabilities that have multipliers \fBtack\fR will not tell you if the pad needs the multiplier or not. You must make this decision yourself by rerunning the test with a different multiplier. If the padding changes in proportion to the multiplier than the multiplier is required. If the multiplier has little or no effect on the suggested padding then the multiplier is not needed. Some capabilities will take several runs to get a good feel for the correct values. You may wish to make the test longer to get more accurate results. System load will also effect the results (a heavily loaded system will not stress the terminal as much, possibly leading to pad timings that are too short). .PP .SH NOTE The tests done at the beginning of the program are assumed to be correct later in the code. In particular, \fBtack\fR displays the number of lines and columns indicated in the terminfo entry as part of its initial output. If these values are wrong a large number of tests will fail or give incorrect results. .SH FILES .TP 12 tack.log If logging is enabled then all characters written to the terminal will also be written to the log file. This gives you the ability to see how the tests were performed. This feature is disabled by default. .TP 12 .I "term" If you make changes to the terminfo entry \fBtack\fR will save the new terminfo to a file. The file will have the same name as the terminal name. .SH SEE ALSO \fBterminfo\fR(\*n), \fBncurses\fR(3X), \fBtic\fR(1M), \fBinfocmp\fR(1M). You should also have the documentation supplied by the terminal manufacturer. .SH BUGS If the screen size is incorrect, many of the tests will fail. .SH AUTHOR .na .hy 0 .PP Concept, design, and original implementation by Daniel Weaver . .PP Portions of the code and documentation are by Eric S. Raymond . .PP Refactored by Thomas E. Dickey to eliminate dependency on \fBncurses\fP internal functions, and to allow \fBtack\fP to work with other implementations of curses and terminfo than \fBncurses\fP. .\"# .\"# The following sets edit modes for GNU EMACS .\"# Local Variables: .\"# mode:nroff .\"# fill-column:79 .\"# End: tack-1.09-20230201/configure.in0000644000000000000000000001517414366604363014306 0ustar rootrootdnl*************************************************************************** dnl Copyright 2017-2021,2023 Thomas E. Dickey * dnl Copyright 2007-2015,2017 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl Author: Thomas E. Dickey 2007-on dnl dnl $Id: configure.in,v 1.47 2023/02/02 00:50:59 tom Exp $ dnl This is a simple configuration-script for tack which makes it simpler to dnl build outside the ncurses tree (provided that ncurses was configured using dnl the --with-ticlib option). dnl dnl See http://invisible-island.net/autoconf/ for additional information. dnl --------------------------------------------------------------------------- AC_PREREQ(2.52.20230114) AC_INIT(tack.c) AC_CONFIG_HEADER(ncurses_cfg.h:ncurses_tst.hin) AC_DEFUN([CF_PDCURSES_X11],[ AC_MSG_ERROR(tack cannot be built with PDCurses) ])dnl CF_INHERIT_SCRIPT(config.guess) CF_INHERIT_SCRIPT(config.sub) CF_CHECK_CACHE AC_ARG_PROGRAM AC_PROG_MAKE_SET AC_PROG_CC AC_PROG_CPP CF_WITHOUT_X CF_PROG_INSTALL CF_PROG_LINT CF_MAKEFLAGS CF_MAKE_TAGS dnl These are standard among *NIX systems, but not when cross-compiling AC_CHECK_TOOL(RANLIB, ranlib, ':') AC_CHECK_TOOL(LD, ld, ld) AC_CHECK_TOOL(AR, ar, ar) AC_CHECK_TOOL(NM, nm, nm) CF_AR_FLAGS dnl Things that we don't need (or must override) if we're not building ncurses CC_G_OPT="-g" AC_SUBST(CC_G_OPT) CC_SHARED_OPTS=unknown AC_SUBST(CC_SHARED_OPTS) DESTDIR="" AC_SUBST(DESTDIR) DFT_DEP_SUFFIX="" AC_SUBST(DFT_DEP_SUFFIX) DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` AC_SUBST(DFT_OBJ_SUBDIR) DFT_LWR_MODEL="normal" AC_SUBST(DFT_LWR_MODEL) DFT_UPR_MODEL="NORMAL" AC_SUBST(DFT_UPR_MODEL) EXTRA_LDFLAGS="" AC_SUBST(EXTRA_LDFLAGS) LDFLAGS_SHARED="" AC_SUBST(LDFLAGS_SHARED) LD_MODEL="" AC_SUBST(LD_MODEL) LD_SHARED_OPTS="" AC_SUBST(LD_SHARED_OPTS) LIBTOOL="" AC_SUBST(LIBTOOL) LIB_CLEAN="" AC_SUBST(LIB_CLEAN) LIB_COMPILE="" AC_SUBST(LIB_COMPILE) LIB_INSTALL="" AC_SUBST(LIB_INSTALL) LIB_LINK='$(CC)' AC_SUBST(LIB_LINK) LIB_SUFFIX="" AC_SUBST(LIB_SUFFIX) LIB_UNINSTALL="" AC_SUBST(LIB_UNINSTALL) LINK_PROGS="" AC_SUBST(LINK_PROGS) LOCAL_LDFLAGS="" AC_SUBST(LOCAL_LDFLAGS) TINFO_LDFLAGS="" AC_SUBST(TINFO_LDFLAGS) TINFO_LIBS="" AC_SUBST(TINFO_LIBS) cf_cv_abi_version="" AC_SUBST(cf_cv_abi_version) cf_cv_rel_version="" AC_SUBST(cf_cv_rel_version) NCURSES_TREE="#" AC_SUBST(NCURSES_TREE) CF_TOP_BUILDDIR cf_cv_screen=ncurses cf_cv_libtype= AC_EXEEXT AC_OBJEXT AC_SYS_LONG_FILE_NAMES CF_WITH_LIB_PREFIX CF_ANSI_CC_REQD CF_DISABLE_ECHO # ncurses uses a different symbol as of 2012/02/26 (workaround) ECHO_LINK="$ECHO_LD" AC_SUBST(ECHO_LINK) CF_ENABLE_WARNINGS CF_GCC_ATTRIBUTES CF_XOPEN_SOURCE AC_CHECK_DECL(exit) ### Checks for external-data CF_LINK_DATAONLY dnl --------------------------------------------------------------------------- CF_PKG_CONFIG CF_WITH_NCURSES_ETC CF_CURSES_TERM_H CF_CURSES_CHECK_DATA(boolnames boolfnames) CF_CURSES_CHECK_DATA(acs_map _acs_map __acs_map acs32map, break) # The CF_*CURSES_CONFIG stuff provides curses/ncurses, which may include tinfo. # Check if (a) we have tinfo library and (b) if we need ncurses library too. cf_curses_lib=$cf_cv_screen$cf_cv_libtype cf_tinfo_lib=tinfo$cf_cv_libtype # If we do not have and/or do not need tinfo, reset cf_tinfo_lib to empty. AC_CHECK_FUNC(setupterm,[ case "x$LIBS" in #(vi *$cf_tinfo_lib*) #(vi ;; *) AC_CHECK_LIB($cf_tinfo_lib,reset_shell_mode, [LIBS="-l$cf_tinfo_lib $LIBS"], [cf_tinfo_lib='']) ;; esac ],[ AC_CHECK_LIB($cf_tinfo_lib, setupterm, [LIBS="-l$cf_tinfo_lib $LIBS"], [cf_tinfo_lib='']) ]) CF_DISABLE_RPATH_HACK CF_DISABLE_LEAKS # look for curses-related headers AC_CHECK_HEADERS( \ term_entry.h \ ) AC_CHECK_HEADERS( \ sys/select.h \ sys/time.h \ ) AC_CHECK_FUNCS( \ exit_terminfo \ _nc_free_tinfo \ gettimeofday \ select \ ) CF_SIG_ATOMIC_T CF_TERMIOS_TYPES CF_WITH_MAN2HTML ### Now that we're done running tests, add the compiler-warnings, if any CF_ADD_CFLAGS($EXTRA_CFLAGS) dnl --------------------------------------------------------------------------- AC_OUTPUT(Makefile,[ cat >>Makefile <>Makefile <>$CONFIG_STATUS cat]) # vi:ts=4 sw=4 CF_MAKE_DOCS(tack,1) tack-1.09-20230201/charset.c0000644000000000000000000004652013615560366013571 0ustar rootroot/* ** Copyright 2017-2019,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: charset.c,v 1.28 2020/02/02 14:47:18 tom Exp $") /* Menu definitions for alternate character set and SGR tests. */ #undef BIT #define BIT(n) (1 << (n)) /* *INDENT-OFF* */ const struct mode_list alt_modes[] = { {"normal", "(sgr0)", "(sgr0)", BIT(0)}, {"standout", "(smso)", "(rmso)", BIT(1)}, {"underline", "(smul)", "(rmul)", BIT(2)}, {"reverse", "(rev)", "(sgr0)", BIT(3)}, {"blink", "(blink)", "(sgr0)", BIT(4)}, {"dim", "(dim)", "(sgr0)", BIT(5)}, {"bold", "(bold)", "(sgr0)", BIT(6)}, {"invis", "(invis)", "(sgr0)", BIT(7)}, {"protect", "(prot)", "(sgr0)", BIT(8)}, {"altcharset", "(smacs)", "(rmacs)", BIT(9)}, }; /* *INDENT-ON* */ /* On many terminals the underline attribute is the last scan line. This is OK unless the following line is reverse video. Then the underline attribute does not show up. The following map will reorder the display so that the underline attribute will show up. */ const int mode_map[10] = {0, 1, 3, 4, 5, 6, 7, 8, 9, 2}; struct graphics_pair { unsigned char c; const char *name; }; static struct graphics_pair glyph[] = { {'+', "arrow pointing right"}, {',', "arrow pointing left"}, {'.', "arrow pointing down"}, {'0', "solid square block"}, {'i', "lantern symbol"}, {'-', "arrow pointing up"}, {'`', "diamond"}, {'a', "checker board (stipple)"}, {'f', "degree symbol"}, {'g', "plus/minus"}, {'h', "board of squares"}, {'j', "lower right corner"}, {'k', "upper right corner"}, {'l', "upper left corner"}, {'m', "lower left corner"}, {'n', "plus"}, {'o', "scan line 1"}, {'p', "scan line 3"}, {'q', "horizontal line"}, {'r', "scan line 7"}, {'s', "scan line 9"}, {'t', "left tee (|-)"}, {'u', "right tee (-|)"}, {'v', "bottom tee(_|_)"}, {'w', "top tee (T)"}, {'x', "vertical line"}, {'y', "less/equal"}, {'z', "greater/equal"}, {'{', "Pi"}, {'|', "not equal"}, {'}', "UK pound sign"}, {'~', "bullet"}, {'\0', "\0"} }; /* ** charset_hs(test_list, status, ch) ** ** (hs) test Has status line */ static void charset_hs( TestList * t, int *state, int *ch) { if (has_status_line != 1) { ptext("(hs) Has-status line is not defined. "); generic_done_message(t, state, ch); } } /* ** charset_status(test_list, status, ch) ** ** (tsl) (fsl) (wsl) test Status line */ static void charset_status( TestList * t, int *state, int *ch) { int i, max; char *s; static char m[] = "*** status line *** 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789."; if (has_status_line != 1) { return; } put_clear(); max = width_status_line == -1 ? columns : width_status_line; sprintf(temp, "Terminal has status line of %d characters", max); ptextln(temp); put_str("This line s"); s = TPARM_1(to_status_line, 0); tc_putp(s); for (i = 0; i < max; i++) putchp(m[i]); tc_putp(from_status_line); putln("hould not be broken."); ptextln("If the previous line is not a complete sentence then (tsl) to-status-line, (fsl) from-status-line, or (wsl) width-of-status-line is incorrect."); generic_done_message(t, state, ch); } /* ** charset_eslok(test_list, status, ch) ** ** (eslok) test Status line with cursor addressing and erasure. */ static void charset_eslok( TestList * t, int *state, int *ch) { int i, max; char *s; static char m[] = "*** status line *** 123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789.123456789."; if (has_status_line != 1) { return; } if (status_line_esc_ok != 1) { ptextln("(eslok) status_line_esc_ok not present"); return; } put_clear(); max = width_status_line == -1 ? columns : width_status_line; sprintf(temp, "Terminal has status line of %d characters", max); ptextln(temp); put_str("This line s"); s = TPARM_1(to_status_line, 10); tc_putp(s); for (i = 10; i < max; i++) putchp(m[i]); putchp('\r'); for (i = 0; i < 10; i++) putchp(m[i]); if (cursor_address) { tputs(TPARM_2(cursor_address, 4, 4), lines, tc_putch); put_str("STATUS"); } tc_putp(from_status_line); putln("hould not be broken."); ptextln("If the previous line is not a complete sentence then the preceding test failed, or (eslok) status_line_esc_ok is incorrect. The status line should have \"STATUS\"."); generic_done_message(t, state, ch); } /* ** charset_dsl(test_list, status, ch) ** ** (dsl) test Disable status line */ static void charset_dsl( TestList * t, int *state, int *ch) { if (has_status_line != 1) { return; } if (dis_status_line) { ptextln("Disable status line (dsl)"); tc_putp(dis_status_line); ptext("If you can still see the status line then (dsl) disable-status-line has failed. "); } else { ptext("(dsl) Disable-status-line is not defined. "); } generic_done_message(t, state, ch); } void eat_cookie(void) { /* put a blank if this is not a magic cookie terminal */ if (magic_cookie_glitch < 1) putchp(' '); } void put_mode(const char *s) { /* send the attribute string (with or without % execution) */ tc_putp(TPARM_0(s)); /* allow % execution */ } void set_attr(int a) { /* set the attribute from the bits in a */ int i, b[10]; int use_sgr = 0; if (magic_cookie_glitch > 0) { char_count += magic_cookie_glitch; } if (a == 0 && exit_attribute_mode) { put_mode(exit_attribute_mode); return; } memset(b, 0, sizeof(b)); for (i = 0; i < 10; i++) { b[i] = (a >> i) & 1; if (b[i]) use_sgr = 1; } if (use_sgr) { tc_putp(TPARM_9(set_attributes, b[1], b[2], b[3], b[4], b[5], b[6], b[7], b[8], b[9])); } } /* ** charset_sgr(test_list, status, ch) ** ** (sgr) test Set Graphics Rendition */ static void charset_sgr( TestList * t, int *state, int *ch) { int i; if (!set_attributes) { ptext("(sgr) Set-graphics-rendition is not defined. "); generic_done_message(t, state, ch); return; } if (!exit_attribute_mode) { ptextln("(sgr0) Set-graphics-rendition-zero is not defined."); /* go ahead and test anyway */ } ptext("Test video attributes"); for (i = 0; i < (int) (sizeof(alt_modes) / sizeof(struct mode_list)); i++) { put_crlf(); sprintf(temp, "%2d %-20s", i, alt_modes[i].name); put_str(temp); set_attr(alt_modes[i].number); sprintf(temp, "%s", alt_modes[i].name); put_str(temp); set_attr(0); } put_crlf(); generic_done_message(t, state, ch); } static void charset_sgr2( TestList * t, int *state, int *ch) { int i, j; putln("Double mode test"); for (i = 0; i <= 9; i++) { sprintf(temp, " %2d ", mode_map[i]); put_str(temp); } for (i = 0; i <= 9; i++) { put_crlf(); sprintf(temp, "%d", mode_map[i]); put_str(temp); for (j = 0; j <= 9; j++) { eat_cookie(); set_attr((1 << mode_map[i]) | (1 << mode_map[j])); put_str("Aa"); set_attr(0); if (j < 9) eat_cookie(); } } put_crlf(); #ifdef max_attributes if (max_attributes >= 0) { sprintf(temp, "(ma) Maximum attributes %d ", max_attributes); ptext(temp); } #endif generic_done_message(t, state, ch); } static void charset_italics( TestList * t, int *state, int *ch) { putln("Testing italics"); if (enter_italics_mode && exit_italics_mode) { put_mode(enter_italics_mode); ptext(" This should be in ITALICS"); put_mode(exit_italics_mode); put_crlf(); } else { putln("your terminal description does not tell how to show italics"); } generic_done_message(t, state, ch); } /* * rmxx/smxx describes the ECMA-48 strikeout/crossed-out attributes, as an * experimental feature of tmux. */ static void charset_crossed( TestList * t, int *state, int *ch) { const char *smxx = safe_tgets("smxx"); const char *rmxx = safe_tgets("rmxx"); putln("Testing cross-out/strike-out (ncurses/tmux extension)"); if (VALID_STRING(smxx) && VALID_STRING(rmxx)) { put_mode(smxx); ptext(" This should be CROSSED-OUT"); put_mode(rmxx); put_crlf(); } else { putln("your terminal description does not tell how to cross-out text"); } ptext("(smxx) (rmxx) "); generic_done_message(t, state, ch); } /* ** test_one_attr(mode-number, begin-string, end-string) ** ** Display one attribute line. */ static void test_one_attr( int n, const char *begin_mode, const char *end_mode) { int i; sprintf(temp, "%-10s %s ", alt_modes[n].name, alt_modes[n].begin_mode); ptext(temp); for (; char_count < 19;) { putchp(' '); } if (begin_mode) { putchp('.'); put_mode(begin_mode); put_str(alt_modes[n].name); for (i = (int) strlen(alt_modes[n].name); i < 13; i++) { putchp(' '); } if (end_mode) { put_mode(end_mode); sprintf(temp, ". %s", alt_modes[n].end_mode); } else { set_attr(0); strcpy(temp, ". (sgr)"); } ptextln(temp); } else { for (i = 0; i < magic_cookie_glitch; i++) putchp('*'); put_str("*** missing ***"); for (i = 0; i < magic_cookie_glitch; i++) putchp('*'); put_crlf(); } } /* ** charset_attributes(test_list, status, ch) ** ** Test SGR */ static void charset_attributes( TestList * t, int *state, int *ch) { put_clear(); putln("Test video attributes"); test_one_attr(1, enter_standout_mode, exit_standout_mode); test_one_attr(2, enter_underline_mode, exit_underline_mode); test_one_attr(9, enter_alt_charset_mode, exit_alt_charset_mode); if (!exit_attribute_mode && !set_attributes) { ptextln("(sgr0) exit attribute mode is not defined."); generic_done_message(t, state, ch); return; } test_one_attr(3, enter_reverse_mode, exit_attribute_mode); test_one_attr(4, enter_blink_mode, exit_attribute_mode); test_one_attr(5, enter_dim_mode, exit_attribute_mode); test_one_attr(6, enter_bold_mode, exit_attribute_mode); test_one_attr(7, enter_secure_mode, exit_attribute_mode); test_one_attr(8, enter_protected_mode, exit_attribute_mode); generic_done_message(t, state, ch); } #define GLYPHS 256 /* ** charset_smacs(test_list, status, ch) ** ** display all possible acs characters ** (smacs) (rmacs) */ static void charset_smacs( TestList * t, int *state, int *ch) { if (enter_alt_charset_mode) { int i, c; put_clear(); ptextln("The following characters are available. (smacs) (rmacs)"); for (i = ' '; i <= '`'; i += 32) { put_crlf(); put_mode(exit_alt_charset_mode); for (c = 0; c < 32; c++) { putchp(c + i); } put_crlf(); put_mode(enter_alt_charset_mode); for (c = 0; c < 32; c++) { putchp(c + i); } put_mode(exit_alt_charset_mode); put_crlf(); } put_mode(exit_alt_charset_mode); put_crlf(); generic_done_message(t, state, ch); } } static void test_acs( int attr) { /* alternate character set */ int i; char valid_glyph[GLYPHS]; char acs_table[GLYPHS]; line_count = 0; for (i = 0; i < GLYPHS; i++) { valid_glyph[i] = FALSE; acs_table[i] = (char) i; } if (acs_chars) { putln("Alternate character set map:"); putln(expand(acs_chars)); put_crlf(); for (i = 0; acs_chars[i]; i += 2) { int j; if (acs_chars[i + 1] == 0) { break; } for (j = 0;; j++) { if (glyph[j].c == (unsigned char) acs_chars[i]) { acs_table[glyph[j].c] = acs_chars[i + 1]; valid_glyph[glyph[j].c] = TRUE; break; } if (glyph[j].name[0] == '\0') { if (isgraph(UChar(acs_chars[i]))) { sprintf(temp, " %c", acs_chars[i]); } else { sprintf(temp, " 0x%02x", UChar(acs_chars[i])); } strcpy(&temp[5], " *** has no mapping ***"); putln(temp); break; } } } } else { static unsigned char vt100[] = "`afgjklmnopqrstuvwxyz{|}~"; ptextln("acs_chars not defined (acsc)"); /* enable the VT-100 graphics characters (default) */ for (i = 0; vt100[i]; i++) { valid_glyph[vt100[i]] = TRUE; } } if (attr) { set_attr(attr); } put_mode(ena_acs); for (i = 0; glyph[i].name[0]; i++) { if (valid_glyph[glyph[i].c]) { put_mode(enter_alt_charset_mode); put_this(acs_table[glyph[i].c]); char_count++; put_mode(exit_alt_charset_mode); if (magic_cookie_glitch >= 1) { sprintf(temp, " %-30.30s", glyph[i].name); put_str(temp); if (char_count + 33 >= columns) put_crlf(); } else { sprintf(temp, " %-24.24s", glyph[i].name); put_str(temp); if (char_count + 26 >= columns) put_crlf(); } if (line_count >= lines) { (void) wait_here(); put_clear(); } } } if (char_count > 1) { put_crlf(); } #ifdef ACS_ULCORNER maybe_wait(5); put_mode(enter_alt_charset_mode); put_that(ACS_ULCORNER); put_that(ACS_TTEE); put_that(ACS_URCORNER); put_that(ACS_ULCORNER); put_that(ACS_HLINE); put_that(ACS_URCORNER); char_count += 6; put_mode(exit_alt_charset_mode); put_crlf(); put_mode(enter_alt_charset_mode); put_that(ACS_LTEE); put_that(ACS_PLUS); put_that(ACS_RTEE); put_that(ACS_VLINE); if (magic_cookie_glitch >= 1) put_this(' '); else { put_mode(exit_alt_charset_mode); put_this(' '); put_mode(enter_alt_charset_mode); } put_that(ACS_VLINE); char_count += 6; put_mode(exit_alt_charset_mode); put_str(" Here are 2 boxes"); put_crlf(); put_mode(enter_alt_charset_mode); put_that(ACS_LLCORNER); put_that(ACS_BTEE); put_that(ACS_LRCORNER); put_that(ACS_LLCORNER); put_that(ACS_HLINE); put_that(ACS_LRCORNER); char_count += 6; put_mode(exit_alt_charset_mode); put_crlf(); #endif } /* ** charset_bel(test_list, status, ch) ** ** (bel) test Bell */ static void charset_bel( TestList * t, int *state, int *ch) { if (bell) { ptextln("Testing bell (bel)"); tc_putp(bell); ptext("If you did not hear the Bell then (bel) has failed. "); } else { ptext("(bel) Bell is not defined. "); } generic_done_message(t, state, ch); } /* ** charset_flash(test_list, status, ch) ** ** (flash) test Visual bell */ static void charset_flash( TestList * t, int *state, int *ch) { if (flash_screen) { ptextln("Testing visual bell (flash)"); tc_putp(flash_screen); ptext("If you did not see the screen flash then (flash) has failed. "); } else { ptext("(flash) Flash is not defined. "); } generic_done_message(t, state, ch); } /* ** charset_civis(test_list, status, ch) ** ** (civis) test Cursor invisible */ static void charset_civis( TestList * t, int *state, int *ch) { if (cursor_normal) { if (cursor_invisible) { ptext("(civis) Turn off the cursor. "); tc_putp(cursor_invisible); ptext("If you can still see the cursor then (civis) has failed. "); } else { ptext("(civis) Cursor-invisible is not defined. "); } generic_done_message(t, state, ch); tc_putp(cursor_normal); } } /* ** charset_cvvis(test_list, status, ch) ** ** (cvvis) test Cursor very visible */ static void charset_cvvis( TestList * t, int *state, int *ch) { if (cursor_normal) { if (cursor_visible) { ptext("(cvvis) Make cursor very visible. "); tc_putp(cursor_visible); ptext("If the cursor is not very visible then (cvvis) has failed. "); } else { ptext("(cvvis) Cursor-very-visible is not defined. "); } generic_done_message(t, state, ch); tc_putp(cursor_normal); } } /* ** charset_cnorm(test_list, status, ch) ** ** (cnorm) test Cursor normal */ static void charset_cnorm( TestList * t, int *state, int *ch) { if (cursor_normal) { ptext("(cnorm) Normal cursor. "); tc_putp(cursor_normal); ptext("If the cursor is not normal then (cnorm) has failed. "); } else { ptext("(cnorm) Cursor-normal is not defined. "); } generic_done_message(t, state, ch); } /* ** charset_enacs(test_list, status, ch) ** ** test Alternate character set mode and alternate characters ** (acsc) (enacs) (smacs) (rmacs) */ static void charset_enacs( TestList * t, int *state, int *ch) { if (enter_alt_charset_mode || acs_chars) { int c, i; c = 0; while (1) { put_clear(); /* for terminals that use separate fonts for attributes (such as X windows) the line drawing characters must be checked for each font. */ if (c >= '0' && c <= '9') { test_acs(alt_modes[c - '0'].number); set_attr(0); } else { test_acs(0); } while (1) { ptextln("[r] to repeat, [012345789] to test with attributes on, [?] for a list of attributes, anything else to go to next test. "); generic_done_message(t, state, ch); if (*ch != '?') { break; } for (i = 0; i <= 9; i++) { sprintf(temp, " %d %s %s", i, alt_modes[i].begin_mode, alt_modes[i].name); ptextln(temp); } } if (*ch >= '0' && *ch <= '9') { c = *ch; } else if (*ch != 'r') { break; } } } else { ptext("(smacs) Enter-alt-char-set-mode and (acsc) Alternate-char-set are not defined. "); generic_done_message(t, state, ch); } } /* ** charset_can_test() ** ** Initialize the can_test data base */ void charset_can_test(void) { int i; for (i = 0; i < 9; i++) { can_test(alt_modes[i].begin_mode, FLAG_CAN_TEST); can_test(alt_modes[i].end_mode, FLAG_CAN_TEST); } } /* *INDENT-OFF* */ TestList acs_test_list[] = { MY_EDIT_MENU {MENU_NEXT, 3, "bel", 0, "b) bel/flash", charset_bel, 0}, {MENU_NEXT, 3, "flash", 0, 0, charset_flash, 0}, {MENU_NEXT, 3, "civis", 0, "c) cursor appearance", charset_civis, 0}, {MENU_NEXT, 3, "cvvis", 0, 0, charset_cvvis, 0}, {MENU_NEXT, 3, "cnorm", 0, 0, charset_cnorm, 0}, {MENU_NEXT, 3, "hs", 0, "t) title/statusline", charset_hs, 0}, {MENU_NEXT, 3, "tsl) (fsl) (wsl", "hs", 0, charset_status, 0}, {MENU_NEXT, 3, "eslok", "hs", 0, charset_eslok, 0}, {MENU_NEXT, 3, "dsl", "hs", 0, charset_dsl, 0}, {MENU_NEXT, 0, "acsc) (enacs) (smacs) (rmacs", 0, "a) alternate character set", charset_enacs, 0}, {MENU_NEXT, 12, "smacs) (rmacs", 0, 0, charset_smacs, 0}, {MENU_NEXT, 12, "sgr) (sgr0", 0, 0, charset_attributes, 0}, {MENU_NEXT, 12, "sgr) (sgr0", "ma", 0, charset_sgr, 0}, {MENU_NEXT, 12, "sgr) (sgr0", "ma", 0, charset_sgr2, 0}, {MENU_NEXT, 3, "sitm) (ritm", 0, 0, charset_italics, 0}, {MENU_NEXT, 3, 0, 0, 0, charset_crossed, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ tack-1.09-20230201/config.guess0000755000000000000000000014115114271704511014277 0ustar rootroot#! /bin/sh # Attempt to guess a canonical system name. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-08-01' # 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-2022 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 c89 c99 ; 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" #include #if defined(__UCLIBC__) LIBC=uclibc #elif defined(__dietlibc__) LIBC=dietlibc #elif defined(__GLIBC__) LIBC=gnu #else #include /* First heuristic to detect musl libc. */ #ifdef __DEFINED_va_list LIBC=musl #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 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=`/usr/bin/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 ;; *:Minix:*:*) GUESS=$UNAME_MACHINE-unknown-minix ;; aarch64:Linux:*:*) GUESS=$UNAME_MACHINE-unknown-linux-$LIBC ;; 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 ;; 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 ;; 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 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: tack-1.09-20230201/HISTORY0000644000000000000000000000505213615574731013054 0ustar rootroot Current history: 2020/02/02 1.09 Update copyright and license. Also, portability fixes. 2017/07/26 1.08 Reduce reliance on ncurses internals. 2009/12/26 1.07 Fix an allocation-size. 2007/08/11 1.06 Updates to build with ncurses 5.6 patch 20070811 2007/04/29 1.05 Updates to build with ncurses 5.6 patch 20070428 2007/04/08 1.04 Fixes from Coverity scan for ncurses 5.6 2007/01/28 1.03 Separate releases of tack from ncurses tree. 2006/11/25 Fixes for ncurses tparm() prototype. 2006/06/24 1.02 Modify to support ncurses extended string capabilities. 2003/10/18 1.01 Fix some logic in pad.c, improve bce test. 2003/09/20 Modified to allow running from compiled-in terminfo. 2001/10/20 Make menu titles agree with descriptions. 2000/03/04 Fix a few spelling errors 1999/09/04 Minor fix to build/link on BeOS 1999/05/16 Minor fix to build/link on CLIX 1999/05/09 Update to build/link on NeXT 1999/04/17 Update to work with ncurses 5.0 beta1 (TERMTYPE struct) 1999/02/07 Build with ncurses 4.2 981219 (renamed function) 1998/01/09 1.00 First release under GPL 1997/12/24 0.02 First version that requires ncurses 1997/10/29 0.01 Second beta release to the ncurses mailing list. 1997/10/06 0.00 First beta release to the ncurses mailing list. Ancient history: TACK -- the terminfo action checker The purpose of this program is to verify the correctness of terminfos and to calculate the pads needed for each capability. This program is not designed to test curses and therefore uses as little of curses as possible. This program was originally called TED. In 1991 it was released to USENET in comp.sources. TED was originally written to test both terminfos and termcaps. The original intent was to create a terminfo editor. This code fell quite short of its goal. Tests were controlled by command line switches and editing was done with pen and paper. In 1995 Eric S. Raymond got interested in the program and added a first cut at making the program menu driven. He also converted the code from K&R C to an ANSI/POSIX-conforming C. He re-christened the program TAC (Terminfo Action Checker). Eric also wrote a man page for TAC. In 1997 I decided to dust off the code and make it easier to use by the novice. I totally rewrote the menu system and added the editing features I originally planned for TED. I also did a total rewrite of the code that does the timings. In the process of rewriting the code I changed it to be more tightly coupled with ncurses. By this time someone had taken the name TAC so I re-christened the program TACK. Daniel Weaver tack-1.09-20230201/init.c0000644000000000000000000002647113623600047013074 0ustar rootroot/* ** Copyright 2017-2019,2020 Thomas E. Dickey ** Copyright 1997-2013,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ /* initialization and wrapup code */ #ifdef _ALL_SOURCE #define _ACS_COMPAT_CODE /* hack for AIX */ #endif #include MODULE_ID("$Id: init.c,v 1.41 2020/02/20 21:54:47 tom Exp $") FILE *debug_fp; char temp[TEMP_SIZE]; char *tty_basename = NULL; #if !(defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)) char **boolnames; char **numnames; char **strnames; size_t max_booleans; size_t max_numbers; size_t max_strings; #endif static void put_name(const char *cap, const char *name) { /* send the cap name followed by the cap */ if (cap) { ptext(name); tc_putp(cap); } } static void report_cap(const char *tag, const char *s) { /* expand the cap or print *** missing *** */ int i; ptext(tag); for (i = char_count; i < 13; i++) { putchp(' '); } put_str(" = "); if (s) { putln(expand(s)); } else { putln("*** missing ***"); } } void reset_init(void) { /* send the reset and init strings */ int i; ptext("Terminal reset"); i = char_count; put_name(reset_1string, " (rs1)"); put_name(reset_2string, " (rs2)"); /* run the reset file */ if (reset_file && reset_file[0]) { FILE *fp; can_test("rf", FLAG_TESTED); if ((fp = fopen(reset_file, "r"))) { /* send the reset file */ sprintf(temp, " (rf) %s", reset_file); ptextln(temp); while (1) { int ch = getc(fp); if (ch == EOF) break; put_this(ch); } fclose(fp); } else { sprintf(temp, "\nCannot open reset file (rf) %s", reset_file); ptextln(temp); } } put_name(reset_3string, " (rs3)"); if (i != char_count) { put_crlf(); } ptext(" init"); put_name(init_1string, " (is1)"); put_name(init_2string, " (is2)"); if (set_tab && clear_all_tabs && init_tabs != 8) { put_crlf(); tc_putp(clear_all_tabs); for (char_count = 0; char_count < columns; char_count++) { put_this(' '); if ((char_count & 7) == 7) { tc_putp(set_tab); } } put_cr(); } /* run the initialization file */ if (init_file && init_file[0]) { FILE *fp; can_test("if", FLAG_TESTED); if ((fp = fopen(init_file, "r"))) { /* send the init file */ sprintf(temp, " (if) %s", init_file); ptextln(temp); while (1) { int ch = getc(fp); if (ch == EOF) break; put_this(ch); } fclose(fp); } else { sprintf(temp, "\nCannot open init file (if) %s", init_file); ptextln(temp); } } if (init_prog) { can_test("iprog", FLAG_TESTED); IGNORE_RC(system(init_prog)); } put_name(init_3string, " (is3)"); fflush(stdout); } /* ** display_basic() ** ** display the basic terminal definitions */ void display_basic(void) { char *s; put_str("Name: "); put_str(termname()); if ((s = longname()) != 0) { put_str("|"); putln(s); } report_cap("\\r ^M (cr)", carriage_return); report_cap("\\n ^J (ind)", scroll_forward); report_cap("\\b ^H (cub1)", cursor_left); report_cap("\\t ^I (ht)", tab); /* report_cap("\\f ^L (ff)", form_feed); */ if (newline) { /* OK if missing */ report_cap(" (nel)", newline); } report_cap(" (clear)", clear_screen); if (!cursor_home && cursor_address) { report_cap("(cup) (home)", TPARM_2(cursor_address, 0, 0)); } else { report_cap(" (home)", cursor_home); } #ifdef user9 report_cap("ENQ (u9)", user9); #endif #ifdef user8 report_cap("ACK (u8)", user8); #endif sprintf(temp, "\nTerminal size: %d x %d. Baud rate: %u. Frame size: %d.%d", columns, lines, tty_baud_rate, tty_frame_size >> 1, (tty_frame_size & 1) * 5); putln(temp); } /* * Conventional infocmp (Unix or ncurses) will print a comment at the * beginning of the terminal description, where the pathname of the terminfo * information is after a "file" or "file:" keyword. */ static char * ask_infocmp(void) { char *result = 0; size_t need = strlen(tty_basename) + 20; char *command = malloc(need); if (command != 0) { FILE *pp; sprintf(command, "infocmp -1 \"%s\"", tty_basename); if ((pp = popen(command, "r")) != 0) { char buffer[BUFSIZ]; char *s, *t; if (fgets(buffer, (int) (sizeof(buffer) - 1), pp) != 0 && *buffer == '#' && ((t = strstr(buffer, " file: ")) || (t = strstr(buffer, " file ")) || ((t = strstr(buffer, " Reconstructed ")) && (t = strstr(t, " from ")))) && (s = strchr(buffer, '\n')) != 0) { *s = '\0'; s = strchr(t + 1, ' '); result = strdup(s + 1); } #if !(defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)) if (result) { int max_b = 200; int max_n = 200; int max_s = 200; boolnames = calloc(max_b, sizeof(*boolnames)); numnames = calloc(max_n, sizeof(*numnames)); strnames = calloc(max_s, sizeof(*strnames)); while (fgets(buffer, sizeof(buffer) - 1, pp) != 0) { int mytype = BOOLEAN; if (*buffer != '\t') continue; for (s = buffer; isspace(UChar(*s)); ++s) ; for (t = s; *t != '\0'; ++t) { if (strchr("@,", *t)) { *t = '\0'; break; } else if (*t == '#') { mytype = NUMBER; *t = '\0'; break; } else if (*t == '=') { mytype = STRING; *t = '\0'; break; } } s = strdup(s); switch (mytype) { case 0: boolnames[max_booleans++] = s; break; case 1: numnames[max_numbers++] = s; break; case 2: strnames[max_strings++] = s; break; } } } #endif pclose(pp); } free(command); } return result; } /* * ncurses initializes acs_map[] in setupterm; Unix curses does not. */ static void init_acs(void) { const char *value = acs_chars; #ifdef HAVE_CURSES_DATA_ACS_MAP #elif defined(HAVE_CURSES_DATA__ACS_MAP) #define acs_map _acs_map #elif defined(HAVE_CURSES_DATA___ACS_MAP) #define acs_map __acs_map #elif !defined(DECL_CURSES_DATA_ACS32MAP) #define NEED_ACS_MAP #endif /* * HPUX and AIX, which do #define's for acs_map, make those arrays. * Solaris makes it a pointer (which we allocate). */ #if (defined(HAVE_CURSES_DATA_ACS_MAP) || defined(NEED_ACS_MAP)) && ! (defined(NUM_ACS) || defined(NCURSES_VERSION)) if (acs_map == 0) { acs_map = calloc((size_t) 256, sizeof(acs_map[0])); } #endif if (value != 0) { while (*value != '\0') { int s, d; if ((s = UChar(*value++)) == '\0') break; if ((d = UChar(*value++)) == '\0') break; acs_map[s] = (chtype) d; } } } /* * curses provides baudrate(), but not for low-level applications. */ static unsigned init_baudrate(void) { struct speed { int given_speed; /* values for 'ospeed' */ unsigned actual_speed; /* the actual speed */ }; #define DATA(number) { B##number, number } static struct speed const speeds[] = { DATA(0), DATA(50), DATA(75), DATA(110), DATA(134), DATA(150), DATA(200), DATA(300), DATA(600), DATA(1200), DATA(1800), DATA(2400), DATA(4800), DATA(9600), #ifdef B19200 DATA(19200), #elif defined(EXTA) {EXTA, 19200}, #endif #ifdef B28800 DATA(28800), #endif #ifdef B38400 DATA(38400), #elif defined(EXTB) {EXTB, 38400}, #endif #ifdef B57600 DATA(57600), #endif /* ifdef to prevent overflow when OLD_TTY is not available */ }; #undef DATA struct termios data; unsigned result = 1; if (tcgetattr(fileno(stdout), &data) == 0) { int ospeed = (int) cfgetospeed(&data); size_t n; for (n = 0; n < sizeof(speeds) / sizeof(speeds[0]); ++n) { if (ospeed == speeds[n].given_speed) { result = speeds[n].actual_speed; break; } } } return result; } /* ** curses_setup(exec_name) ** ** Startup ncurses */ void curses_setup( char *exec_name) { int status; char *tty_name; tty_init(); /** * Load the terminfo data base and set the cur_term variable. */ if (setupterm(tty_basename, 1, &status) != OK) { if (status < 0) { fprintf(stderr, "The terminal database could not be found\n"); } else { fprintf(stderr, "The \"%s\" terminal is listed as %s\n", tty_basename, (status > 0) ? "hardcopy" : "generic"); } show_usage(exec_name); ExitProgram(EXIT_FAILURE); } init_acs(); tty_baud_rate = init_baudrate(); tty_cps = (tty_baud_rate << 1) / (unsigned) tty_frame_size; /* * "everyone" has infocmp, and its first line of output should be a * comment telling which database is used. */ tty_name = ask_infocmp(); /* set up the defaults */ replace_mode = TRUE; scan_mode = 0; char_count = 0; select_delay_type = debug_level = 0; char_mask = (meta_on && meta_on[0] == '\0') ? ALLOW_PARITY : STRIP_PARITY; /* Don't change the XON/XOFF modes yet. */ select_xon_xoff = initial_stty_query(TTY_XON_XOFF) ? 1 : needs_xon_xoff; fflush(stdout); /* flush any output */ tty_set(); go_home(); /* set can_go_home */ put_clear(); /* set can_clear_screen */ if (send_reset_init) { reset_init(); } /* * I assume that the reset and init strings may not have the correct * pads. (Because that part of the test comes much later.) Because * of this, I allow the terminal some time to catch up. */ fflush(stdout); /* waste some time */ sleep(1); /* waste more time */ charset_can_test(); can_test("lines cols cr nxon rf if iprog rmp smcup rmcup", FLAG_CAN_TEST); edit_init(); /* initialize the edit data base */ if (send_reset_init && enter_ca_mode) { tc_putp(enter_ca_mode); put_clear(); /* just in case we switched pages */ } /* * "everyone" has infocmp, and its first line of output should be a * comment telling which database is used. */ if (tty_name != 0) { ptext("Using terminfo from: "); ptextln(tty_name); put_crlf(); free(tty_name); } if (tty_can_sync == SYNC_NEEDED) { verify_time(); } display_basic(); } /* ** bye_kids(exit-condition) ** ** Shutdown the terminal, clear the signals, and exit */ void bye_kids(int n) { /* reset the tty and exit */ ignoresig(); if (send_reset_init) { if (exit_ca_mode) { tc_putp(exit_ca_mode); } if (initial_stty_query(TTY_XON_XOFF)) { if (enter_xon_mode) { tc_putp(enter_xon_mode); } } else if (exit_xon_mode) { tc_putp(exit_xon_mode); } } if (debug_fp) { fclose(debug_fp); debug_fp = NULL; } if (log_fp) { fclose(log_fp); log_fp = NULL; } tty_reset(); fclose(stdin); fclose(stdout); fclose(stderr); if (not_a_tty) sleep(1); ExitProgram(n); } const char * safe_tgets(NCURSES_CONST char *name) { char *value = (char *) tigetstr(name); if (!VALID_STRING(value)) value = 0; return value; } tack-1.09-20230201/pad.c0000644000000000000000000012703213760471174012701 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2010,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include #include MODULE_ID("$Id: pad.c,v 1.18 2020/11/28 15:53:32 tom Exp $") /* test the pad counts on the terminal */ /* Any command found in this list, executed from a "Done" prompt will force the default action to repeat rather than next. */ const char *pad_repeat_test = "ep-+<>"; /* globals */ static int hzcc; /* horizontal character count */ char letter; /* current character being displayed */ int letter_number; /* points into letters[] */ int augment, repeats; /* number of characters (or lines) effected */ char letters[] = "AbCdefghiJklmNopQrStuVwXyZ"; static char every_line[] = "This text should be on every line."; static char all_lines[] = "Each char on any line should be the same. "; static char above_line[] = "The above lines should be all Xs. "; static char no_visual[] = "This loop test has no visual failure indicator. "; /* ** pad_standard(test_list, status, ch) ** ** Run a single cap pad test. */ static void pad_standard( TestList * t, int *state, int *ch) { const char *long_name; const char *cap; if ((cap = get_string_cap_byname(t->caps_done, &long_name))) { int i; int l = 2; char tbuf[128]; sprintf(tbuf, "(%s) %s, start testing", t->caps_done, long_name); if (skip_pad_test(t, state, ch, tbuf)) { return; } i = 1; pad_test_startup(1); do { if (i >= columns) { page_loop(); l++; i = 1; } tt_putp(cap); putchp(letter); i++; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); if (l >= lines) { home_down(); } else { put_crlf(); } ptextln(no_visual); } else { CAP_NOT_FOUND; /* Note: get_string_cap_byname() always sets long_name */ sprintf(temp, "(%s) %s, not present. ", t->caps_done, long_name); ptext(temp); } pad_done_message(t, state, ch); } /* ** init_xon_xoff(test_list, status, ch) ** ** Initialize the xon_xoff values */ static void init_xon_xoff( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { /* the reset strings may dink with the XON/XOFF modes */ if (select_xon_xoff == 0 && exit_xon_mode) { tc_putp(exit_xon_mode); } if (select_xon_xoff == 1 && enter_xon_mode) { tc_putp(enter_xon_mode); } } /* ** pad_rmxon(test_list, status, ch) ** ** Test (rmxon) exit XON/XOFF mode */ static void pad_rmxon( TestList * t, int *state, int *ch) { if (select_xon_xoff == 0 && exit_xon_mode) { pad_standard(t, state, ch); } } /* ** init_cup(test_list, status, ch) ** ** Send the initialization strings for XON/XOFF and (smcup) ** Stop pad testing if clear screen is missing. */ static void init_cup( TestList * t, int *state, int *ch) { init_xon_xoff(t, state, ch); if (enter_ca_mode) { tc_putp(enter_ca_mode); } if (!can_clear_screen) { ptext("(clear) clear screen not present,"); ptext(" pad processing terminated. "); pad_done_message(t, state, ch); if (*ch == 0 || *ch == 'n' || *ch == 's' || *ch == 'r') { *ch = '?'; } return; } } /* ** pad_home1(test_list, status, ch) ** ** Test (home) when (am) is set. */ static void pad_home1( TestList * t, int *state, int *ch) { if (can_go_home && auto_right_margin) { /* truly brain damaged terminals will fail this test because they cannot accept data at full rate */ if (skip_pad_test(t, state, ch, "(home) Home start testing")) { return; } pad_test_startup(1); do { int j; go_home(); for (j = 1; j < lines; j++) { int k; for (k = 0; k < columns; k++) { if (k & 0xF) { put_this(letter); } else { put_this('.'); } } SLOW_TERMINAL_EXIT; } NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext("All the dots should line up. "); pad_done_message(t, state, ch); put_clear(); } } /* ** pad_home2(test_list, status, ch) ** ** Test (home) and (nel). (am) is reset. */ static void pad_home2( TestList * t, int *state, int *ch) { if (can_go_home) { if (skip_pad_test(t, state, ch, "(home) Home, (nel) newline start testing")) { return; } pad_test_startup(1); do { int j; go_home(); for (j = 1; j < lines; j++) { int k; for (k = 2; k < columns; k++) { if (k & 0xF) { put_this(letter); } else { put_this('.'); } } put_crlf(); /* this does the (nel) */ SLOW_TERMINAL_EXIT; } NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext("All the dots should line up. "); pad_done_message(t, state, ch); put_clear(); } } /* ** pad_clear(test_list, status, ch) ** ** Test (clear) and (ed) ** run the clear screen tests (also clear-to-end-of-screen) ** ** 0) full page ** 1) sparse page ** 2) short lines ** 3) one full line ** 4) one short line */ static void pad_clear( TestList * t, int *state, int *ch) { const char *end_message = 0; const char *txt; int j, k, is_clear; int clear_select; /* select the test number */ is_clear = t->flags & 1; clear_select = auto_right_margin ? 0 : 1; if (is_clear) { txt = "(clear) clear-screen start testing"; } else { if (!clr_eos) { CAP_NOT_FOUND; ptext("(ed) erase-to-end-of-display, not present. "); pad_done_message(t, state, ch); return; } txt = "(ed) erase-to-end-of-display start testing"; } if (skip_pad_test(t, state, ch, txt)) { return; } if (enter_am_mode) { tc_putp(enter_am_mode); clear_select = 0; } for (; clear_select < 5; clear_select++) { if (augment > lines || is_clear || !cursor_address) { augment = lines; } else { if (augment <= 1) { augment = 2; } if (augment < lines) { put_clear(); tt_putparm(cursor_address, 1, lines - augment - 1, 0); ptextln("This line should not be erased (ed)"); } } repeats = augment; switch (clear_select) { case 0: end_message = "Clear full screen. "; break; case 1: end_message = "Clear sparse screen. "; if (cursor_down) { break; } clear_select++; /* FALLTHRU */ case 2: end_message = "Clear one character per line. "; if (newline) { break; } clear_select++; /* FALLTHRU */ case 3: end_message = "Clear one full line. "; break; case 4: end_message = "Clear single short line. "; break; } pad_test_startup(0); do { switch (clear_select) { case 0: /* full screen test */ for (j = 1; j < repeats; j++) { for (k = 0; k < columns; k++) { if (k & 0xF) { put_this(letter); } else { put_this('.'); } } SLOW_TERMINAL_EXIT; } break; case 1: /* sparse screen test */ for (j = columns - repeats; j > 2; j--) { put_this(letter); } for (j = 2; j < repeats; j++) { tt_putp(cursor_down); put_this(letter); } break; case 2: /* short lines */ for (j = 2; j < repeats; j++) { put_this(letter); tt_putp(newline); } put_this(letter); break; case 3: /* one full line */ for (j = columns - 5; j > 1; j--) { put_this(letter); } break; case 4: /* one short line */ put_str("Erase this!"); break; } if (is_clear) { put_clear(); } else { if (augment == lines) { go_home(); } else { tt_putparm(cursor_address, 1, lines - repeats, 0); } tt_tputs(clr_eos, repeats); } NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 1); ptext(end_message); pad_done_message(t, state, ch); if (*ch != 0 && *ch != 'n') { return; } } } /* ** pad_ech(test_list, status, ch) ** ** Test (ech) erase characters */ static void pad_ech( TestList * t, int *state, int *ch) { int i, j; if (!erase_chars) { CAP_NOT_FOUND; ptext("(ech) Erase-characters, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(ech) Erase-characters start testing")) { return; } if (augment > columns - 2) { augment = columns - 2; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { for (j = 0; j <= repeats; j++) { putchp(letter); } put_cr(); tt_putparm(erase_chars, repeats, repeats, 0); put_crlf(); SLOW_TERMINAL_EXIT; } for (i = 1; i <= repeats; i++) { putchp(' '); } putchp(letter); put_crlf(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext(all_lines); pad_done_message(t, state, ch); put_clear(); } /* ** pad_el1(test_list, status, ch) ** ** Test (el1) erase to start of line also (cub1) and (nel) */ static void pad_el1( TestList * t, int *state, int *ch) { int i, j; if (!clr_bol) { CAP_NOT_FOUND; ptext("(el1) Erase-to-beginning-of-line, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(el1) Erase-to-beginning-of-line start testing")) { return; } if (augment > columns - 2) { augment = columns - 2; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { for (j = 0; j <= repeats; j++) { putchp(letter); } tt_putp(cursor_left); tt_putp(cursor_left); tt_tputs(clr_bol, repeats); put_crlf(); SLOW_TERMINAL_EXIT; } for (i = 1; i <= repeats; i++) { putchp(' '); } putchp(letter); put_crlf(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext(all_lines); pad_done_message(t, state, ch); put_clear(); } /* ** pad_el(test_list, status, ch) ** ** Test (el) clear to end of line also (nel) */ static void pad_el( TestList * t, int *state, int *ch) { int i, j; if (!clr_eol) { CAP_NOT_FOUND; ptext("(el) Clear-to-end-of-line, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(el) Clear-to-end-of-line start testing")) { return; } hzcc = columns * 8 / 10; /* horizontal character count */ if (augment > hzcc) { augment = hzcc; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { for (j = -1; j < augment; j++) { putchp(letter); } put_cr(); putchp(letter); tt_putp(clr_eol); put_crlf(); SLOW_TERMINAL_EXIT; } putchp(letter); put_crlf(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext(all_lines); pad_done_message(t, state, ch); put_clear(); } /* ** pad_smdc(test_list, status, ch) ** ** Test (smdc) (rmdc) Delete mode */ static void pad_smdc( TestList * t, int *state, int *ch) { int i; if (!enter_delete_mode) { CAP_NOT_FOUND; ptext("(smdc) Enter-delete-mode"); if (!exit_delete_mode) { ptext(", (rmdc) Exit-delete-mode"); } ptext(", not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(smdc) (rmdc) Enter/Exit-delete-mode start testing")) { return; } pad_test_startup(1); do { page_loop(); for (i = 1; i < columns; i++) { tt_putp(enter_delete_mode); tt_putp(exit_delete_mode); putchp(letter); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext(no_visual); pad_done_message(t, state, ch); put_clear(); } /* ** pad_dch(test_list, status, ch) ** ** Test (smdc) (rmdc) Delete mode and (dch) */ static void pad_dch( TestList * t, int *state, int *ch) { int i, j; if (!parm_dch) { CAP_NOT_FOUND; ptext("(dch) Delete-characters, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(dch) Delete-characters start testing")) { return; } hzcc = columns * 8 / 10; /* horizontal character count */ if (augment > hzcc) { augment = hzcc; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { for (j = 0; j <= repeats; j++) { putchp(letter); } put_cr(); tt_putp(enter_delete_mode); tt_putparm(parm_dch, repeats, repeats, 0); tt_putp(exit_delete_mode); put_crlf(); SLOW_TERMINAL_EXIT; } putchp(letter); put_crlf(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext(all_lines); pad_done_message(t, state, ch); put_clear(); } /* ** pad_dch1(test_list, status, ch) ** ** Test (smdc) (rmdc) Delete mode and (dch1) */ static void pad_dch1( TestList * t, int *state, int *ch) { int i, j; if (!delete_character) { if (parm_dch) { /* if the other one is defined then its OK */ return; } CAP_NOT_FOUND; ptext("(dch1) Delete-character, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(dch1) Delete-character start testing")) { return; } hzcc = columns * 8 / 10; /* horizontal character count */ if (augment > hzcc) { augment = hzcc; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { for (j = -1; j < augment; j++) { putchp(letter); } put_cr(); tt_putp(enter_delete_mode); for (j = 0; j < augment; j++) { tt_putp(delete_character); } tt_putp(exit_delete_mode); put_crlf(); SLOW_TERMINAL_EXIT; } putchp(letter); put_crlf(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext(all_lines); pad_done_message(t, state, ch); put_clear(); } /* ** pad_smir(test_list, status, ch) ** ** Test (smir) (rmir) Insert mode */ static void pad_smir( TestList * t, int *state, int *ch) { int i; if (!enter_insert_mode) { CAP_NOT_FOUND; ptext("(smir) Enter-insert-mode"); if (!exit_insert_mode) { ptext(", (rmir) Exit-insert-mode"); } ptext(", not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(smir) (rmir) Enter/Exit-insert-mode start testing")) { return; } pad_test_startup(1); do { page_loop(); for (i = 1; i < columns; i++) { tt_putp(enter_insert_mode); tt_putp(exit_insert_mode); putchp(letter); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext(no_visual); pad_done_message(t, state, ch); put_clear(); } /* ** pad_ich(test_list, status, ch) ** ** Test (smir) (rmir) Insert mode and (ich) and (ip) */ static void pad_ich( TestList * t, int *state, int *ch) { int i, j; if (!parm_ich) { CAP_NOT_FOUND; ptext("(ich) Insert-characters, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(ich) Insert-characters, (ip) Insert-padding start testing")) { return; } j = columns * 9 / 10; if (augment > j) { augment = j; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { putchp(letter); put_cr(); tt_putp(enter_insert_mode); replace_mode = 0; tt_putparm(parm_ich, repeats, repeats, 0); tt_putp(exit_insert_mode); replace_mode = 1; put_crlf(); SLOW_TERMINAL_EXIT; } for (i = 0; i < repeats; i++) { putchp(' '); } putchp(letter); NEXT_LETTER; put_crlf(); ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext(all_lines); pad_done_message(t, state, ch); tc_putp(exit_insert_mode); } /* ** pad_ich1(test_list, status, ch) ** ** Test (smir) (rmir) Insert mode and (ich1) and (ip) */ static void pad_ich1( TestList * t, int *state, int *ch) { int i, j; if (!insert_character) { CAP_NOT_FOUND; ptext("(ich1) Insert-character, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(ich1) Insert-character, (ip) Insert-padding start testing")) { return; } if (augment > columns - 2) { augment = columns - 2; } pad_test_startup(1); do { put_clear(); for (i = 2; i < lines; i++) { putchp(letter); put_cr(); tt_putp(enter_insert_mode); replace_mode = 0; if (!insert_padding && !insert_character) { /* only enter/exit is needed */ for (j = 0; j < augment; j++) { putchp('.'); } } else { for (j = 0; j < augment; j++) { tt_putp(insert_character); putchp('.'); tt_putp(insert_padding); } } tt_putp(exit_insert_mode); replace_mode = 1; put_crlf(); SLOW_TERMINAL_EXIT; } for (j = 0; j < augment; j++) { putchp('.'); } putchp(letter); NEXT_LETTER; put_crlf(); ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptext(all_lines); pad_done_message(t, state, ch); tc_putp(exit_insert_mode); } /* ** pad_xch1(test_list, status, ch) ** ** Test (ich1) (ip) (dch1) */ static void pad_xch1( TestList * t, int *state, int *ch) { static char xch1[] = "This line should not be garbled. It should be left justified."; if (enter_insert_mode || exit_insert_mode || enter_delete_mode || exit_delete_mode || !insert_character || !delete_character) { /* this test is quietly ignored */ return; } if (skip_pad_test(t, state, ch, "(ich1) Insert-character, (dch1) Delete-character start testing")) { return; } put_crlf(); ptext(xch1); put_cr(); pad_test_startup(0); do { tt_putp(insert_character); tt_putp(delete_character); ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 1); ptextln(xch1); ptext("The preceding two lines should be the same. "); pad_done_message(t, state, ch); } /* ** pad_rep(test_list, status, ch) ** ** Test (rep) repeat character */ static void pad_rep( TestList * t, int *state, int *ch) { int i, j; if (!repeat_char) { CAP_NOT_FOUND; ptext("(rep) Repeat-character, not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(rep) Repeat-character start testing")) { return; } if (augment > columns - 2) { augment = columns - 2; } if (augment < 2) { augment = 2; } pad_test_startup(1); do { go_home(); for (i = 2; i < lines; i++) { tt_putparm(repeat_char, repeats, letter, repeats); put_crlf(); } for (j = 0; j < repeats; j++) { putchp(letter); } put_crlf(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptextln(all_lines); pad_done_message(t, state, ch); } /* ** pad_cup(test_list, status, ch) ** ** Test (cup) Cursor address */ static void pad_cup( TestList * t, int *state, int *ch) { int i, j, l, r, c; if (!cursor_address) { CAP_NOT_FOUND; ptext("(cup) Cursor-address not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(cup) Cursor-address start testing")) { return; } put_clear(); ptext("Each line should be filled with the same letter. There should"); ptext(" be no gaps, or single letters scattered over the screen. "); if (char_count + 15 > columns) { put_crlf(); } if (((lines - line_count) & 1) == 0) { /* this removes the gap in the middle of the test when the number of lines is odd. */ put_crlf(); } r = line_count; c = char_count; l = (columns - 4) >> 1; pad_test_startup(0); do { for (i = 1; i + i + r < lines; i++) { for (j = 0; j <= l; j++) { tt_putparm(cursor_address, 1, r + i, j); putchp(letter); tt_putparm(cursor_address, 1, r + i, l + l + 1 - j); putchp(letter); tt_putparm(cursor_address, 1, lines - i, j); putchp(letter); tt_putparm(cursor_address, 1, lines - i, l + l + 1 - j); putchp(letter); } SLOW_TERMINAL_EXIT; } NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); tt_putparm(cursor_address, 1, line_count = r, char_count = c); pad_done_message(t, state, ch); put_clear(); } /* ** pad_hd(test_list, status, ch) ** ** Test (hd) Half down */ static void pad_hd( TestList * t, int *state, int *ch) { int i, j, k; if (!down_half_line) { CAP_NOT_FOUND; ptext("(hd) Half-line-down not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(hd) Half-line-down start testing")) { return; } pad_test_startup(1); do { for (i = 1; i < columns; i += 2) { for (j = 1; j < i; ++j) { putchp(' '); } tt_putp(down_half_line); for (k = lines + lines; k > 4; k--) { if (j++ >= columns) { break; } tt_putp(down_half_line); putchp(letter); } go_home(); SLOW_TERMINAL_EXIT; } NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); pad_done_message(t, state, ch); put_clear(); } /* ** pad_hu(test_list, status, ch) ** ** Test (hu) Half line up */ static void pad_hu( TestList * t, int *state, int *ch) { int i, j, k; if (!up_half_line) { CAP_NOT_FOUND; ptext("(hu) Half-line-up not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(hu) Half-line-up start testing")) { return; } pad_test_startup(1); do { for (i = 1; i < columns; i += 2) { home_down(); for (j = 1; j < i; ++j) { putchp(' '); } tt_putp(up_half_line); for (k = lines + lines; k > 4; k--) { if (j++ >= columns) { break; } tt_putp(up_half_line); putchp(letter); } SLOW_TERMINAL_EXIT; } go_home(); NEXT_LETTER; ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); pad_done_message(t, state, ch); put_clear(); } /* ** pad_rin(test_list, status, ch) ** ** Test (rin) and (ri) Reverse index */ static void pad_rin( TestList * t, int *state, int *ch) { const char *start_message; if (t->flags & 1) { /* rin */ if (!parm_rindex) { CAP_NOT_FOUND; ptext("(rin) Scroll-reverse-n-lines not present. "); pad_done_message(t, state, ch); return; } start_message = "(rin) Scroll-reverse-n-lines start testing"; } else { /* ri */ if (!scroll_reverse) { CAP_NOT_FOUND; ptext("(ri) Scroll-reverse not present. "); pad_done_message(t, state, ch); return; } start_message = "(ri) Scroll-reverse start testing"; augment = 1; } if (skip_pad_test(t, state, ch, start_message)) { return; } pad_test_startup(1); do { sprintf(temp, "%d\r", test_complete); put_str(temp); if (scroll_reverse && repeats == 1) { tt_putp(scroll_reverse); } else { tt_putparm(parm_rindex, repeats, repeats, 0); } ENSURE_DELAY; } while (still_testing()); put_str("This line should be on the bottom.\r"); if (scroll_reverse && augment == 1) { int i; for (i = 1; i < lines; i++) { tt_putp(scroll_reverse); } } else { tt_putparm(parm_rindex, lines - 1, lines - 1, 0); } putln("The screen should have text on the bottom line."); sprintf(temp, "Scroll reverse %d line%s. ", augment, augment == 1 ? "" : "s"); put_str(temp); pad_test_shutdown(t, 0); pad_done_message(t, state, ch); put_clear(); } /* ** pad_il(test_list, status, ch) ** ** Test (il) and (il1) Insert line */ static void pad_il( TestList * t, int *state, int *ch) { const char *start_message; if (t->flags & 1) { /* il */ if (!parm_insert_line) { CAP_NOT_FOUND; ptext("(il) Insert-lines not present. "); pad_done_message(t, state, ch); return; } start_message = "(il) Insert-lines start testing"; } else { /* il1 */ if (!insert_line) { CAP_NOT_FOUND; ptext("(il1) Insert-line not present. "); pad_done_message(t, state, ch); return; } start_message = "(il1) Insert-line start testing"; augment = 1; } if (skip_pad_test(t, state, ch, start_message)) { return; } pad_test_startup(1); do { sprintf(temp, "%d\r", test_complete); put_str(temp); if (insert_line && repeats == 1) { tt_putp(insert_line); } else { tt_putparm(parm_insert_line, repeats, repeats, 0); } ENSURE_DELAY; } while (still_testing()); put_str("This line should be on the bottom.\r"); if (insert_line && augment == 1) { int i; for (i = 1; i < lines; i++) { tt_putp(insert_line); } } else { tt_putparm(parm_insert_line, lines - 1, lines - 1, 0); } putln("The screen should have text on the bottom line."); sprintf(temp, "Insert %d line%s. ", augment, augment == 1 ? "" : "s"); put_str(temp); pad_test_shutdown(t, 0); pad_done_message(t, state, ch); put_clear(); } /* ** pad_indn(test_list, status, ch) ** ** Test (indn) and (ind) Scroll forward */ static void pad_indn( TestList * t, int *state, int *ch) { const char *start_message; if (t->flags & 1) { /* indn */ if (!parm_index) { CAP_NOT_FOUND; ptext("(indn) Scroll-forward-n-lines not present. "); pad_done_message(t, state, ch); return; } start_message = "(indn) Scroll-forward-n-lines start testing"; } else { /* ind */ if (!scroll_forward) { CAP_NOT_FOUND; ptext("(ind) Scroll-forward not present. "); pad_done_message(t, state, ch); return; } if (over_strike) { ptext("(ind) Scroll-forward not tested on overstrike terminals. "); pad_done_message(t, state, ch); return; } start_message = "(ind) Scroll-forward start testing"; augment = 1; } if (skip_pad_test(t, state, ch, start_message)) { return; } pad_test_startup(1); /* go to the bottom of the screen */ home_down(); do { sprintf(temp, "%d\r", test_complete); put_str(temp); if (scroll_forward && repeats == 1) { put_ind(); } else { tt_putparm(parm_index, repeats, repeats, 0); } ENSURE_DELAY; } while (still_testing()); put_str("This line should be on the top.\r"); if (scroll_forward && augment == 1) { int i; for (i = 1; i < lines; i++) { put_ind(); } } else { tt_putparm(parm_index, lines - 1, lines - 1, 0); } go_home(); sprintf(temp, "\nScroll forward %d line%s. ", augment, augment == 1 ? "" : "s"); put_str(temp); pad_test_shutdown(t, 0); pad_done_message(t, state, ch); } /* ** pad_dl(test_list, status, ch) ** ** Test (dl) and (dl1) Delete lines */ static void pad_dl( TestList * t, int *state, int *ch) { const char *start_message; if (t->flags & 1) { /* dl */ if (!parm_delete_line) { CAP_NOT_FOUND; ptext("(dl) Delete-lines not present. "); pad_done_message(t, state, ch); return; } start_message = "(dl) Delete-lines start testing"; } else { /* dl1 */ if (!delete_line) { CAP_NOT_FOUND; ptext("(dl1) Delete-line not present. "); pad_done_message(t, state, ch); return; } start_message = "(dl1) Delete-line start testing"; augment = 1; } if (skip_pad_test(t, state, ch, start_message)) { return; } pad_test_startup(1); do { sprintf(temp, "%d\r", test_complete); if (augment < lines - 1) { go_home(); putln(temp); } put_str(temp); if (delete_line && repeats == 1) { tt_putp(delete_line); } else { tt_putparm(parm_delete_line, repeats, repeats, 0); } ENSURE_DELAY; } while (still_testing()); home_down(); put_str("This line should be on the top."); go_home(); if (delete_line && augment == 1) { int i; for (i = 1; i < lines; i++) { tt_putp(delete_line); } } else { tt_putparm(parm_delete_line, lines - 1, lines - 1, 0); } sprintf(temp, "\nDelete %d line%s. ", augment, augment == 1 ? "" : "s"); put_str(temp); pad_test_shutdown(t, 0); pad_done_message(t, state, ch); } /* ** pad_xl(test_list, status, ch) ** ** Test (il1) Insert and (dl1) Delete lines */ static void pad_xl( TestList * t, int *state, int *ch) { if (!insert_line && !delete_line) { /* quietly skip this test */ return; } if (skip_pad_test(t, state, ch, "(il1) Insert-line, (dl1) Delete-line start testing")) { return; } put_clear(); putln("\rThis text is written on the first line."); ptext("This sentence begins on the second line. As this"); ptext(" test runs the bottom part of this paragraph will"); ptext(" jump up and down. Don't worry, that's normal. When"); ptext(" the jumping stops, the entire paragraph should"); ptext(" still be on the screen and in the same place as when"); ptext(" the test started. If this paragraph has scrolled"); ptext(" off the top or bottom of the screen then the test"); ptext(" has failed. Scrolling off the top of the screen"); ptext(" usually means that the delete line capability is"); ptext(" working better than the insert line capability. If"); ptext(" the text scrolls off the bottom then delete line may"); ptext(" be broken. If parts of the text are missing then"); ptext(" you should get professional help."); put_crlf(); go_home(); put_newlines(2); pad_test_startup(0); do { tt_putp(insert_line); put_cr(); tt_putp(delete_line); ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext("The top of the screen should have a paragraph of text. "); pad_done_message(t, state, ch); } /* ** pad_scrc(test_list, status, ch) ** ** Test (sc) (rc) Save/restore cursor */ static void pad_scrc( TestList * t, int *state, int *ch) { int i; if (!save_cursor || !restore_cursor) { CAP_NOT_FOUND; if (save_cursor) { ptext("(rc) Restore-cursor"); } else if (restore_cursor) { ptext("(sc) Save-cursor"); } else { ptext("(sc) Save-cursor, (rc) Restore-cursor"); } ptext(" not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(sc) (rc) Save/Restore-cursor start testing")) { return; } pad_test_startup(1); do { page_loop(); for (i = 1; i < columns; i++) { tt_putp(save_cursor); putchp(letter); tt_putp(restore_cursor); putchp('X'); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext(above_line); pad_done_message(t, state, ch); } /* ** pad_csrind(test_list, status, ch) ** ** Test (csr) and (ind) Change scroll region and index. */ static void pad_csrind( TestList * t, int *state, int *ch) { int i; if (!change_scroll_region) { CAP_NOT_FOUND; ptext("(csr) Change-scroll-region not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(csr) Save/Restore-cursor, (ind) index start testing")) { return; } if (augment < 2) { augment = 2; } if (augment > lines - 1) { augment = lines - 1; } put_clear(); ptext("This text is on the top line."); tt_putparm(change_scroll_region, 1, lines - augment, lines - 1); /* go to the bottom of the screen */ home_down(); pad_test_startup(0); do { sprintf(temp, "%d\r", test_complete); put_str(temp); put_ind(); ENSURE_DELAY; } while (still_testing()); ptextln("(csr) is broken."); for (i = augment; i > 1; i--) { put_ind(); } pad_test_shutdown(t, 0); ptext("All but top and bottom lines should be blank. "); pad_done_message(t, state, ch); tt_putparm(change_scroll_region, 1, 0, lines - 1); put_clear(); } /* ** pad_sccsrrc(test_list, status, ch) ** ** Test (sc) (csr) and (rc) Save/Change/Restore scroll region */ static void pad_sccsrrc( TestList * t, int *state, int *ch) { int i; if (!save_cursor || !change_scroll_region || !restore_cursor) { /* quietly ignore this test */ return; } if (skip_pad_test(t, state, ch, "(sc) (csr) (rc) Save/Change/Restore-cursor, start testing")) { return; } pad_test_startup(1); do { page_loop(); for (i = 1; i < columns; i++) { tt_putp(save_cursor); putchp(letter); tt_putparm(change_scroll_region, 1, 0, lines - 1); tt_putp(restore_cursor); putchp('X'); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext(above_line); pad_done_message(t, state, ch); tt_putparm(change_scroll_region, 1, 0, lines - 1); } /* ** pad_csr_nel(test_list, status, ch) ** ** Test (sc) (csr) (nel) and (rc) Save/Change/Restore scroll region */ static void pad_csr_nel( TestList * t, int *state, int *ch) { int i, j; if (!save_cursor || !change_scroll_region || !restore_cursor) { /* quietly ignore this test */ return; } if (skip_pad_test(t, state, ch, "(csr) Change-scroll-region, (nel) newline start testing")) { return; } pad_test_startup(1); do { for (i = 0; i < lines; i++) { for (j = lines - i; j > 0; j--) { put_crlf(); } tt_putp(save_cursor); tt_putparm(change_scroll_region, 1, i, lines - 1); tt_putp(restore_cursor); put_str(every_line); } tt_putp(save_cursor); tt_putparm(change_scroll_region, 1, 0, lines - 1); tt_putp(restore_cursor); ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); put_str(" "); pad_done_message(t, state, ch); tt_putparm(change_scroll_region, 1, 0, lines - 1); } /* ** pad_csr_cup(test_list, status, ch) ** ** Test (csr) (cup) Change scroll region and cursor address */ static void pad_csr_cup( TestList * t, int *state, int *ch) { int i, j; if (!change_scroll_region || !cursor_address) { /* quietly ignore this test */ return; } if (skip_pad_test(t, state, ch, "(csr) Change-scroll-region, (cup) cursor-address start testing")) { return; } pad_test_startup(1); do { for (i = 0; i < lines; i++) { for (j = lines - i; j > 0; j--) { put_crlf(); } tt_putparm(change_scroll_region, 1, i, lines - 1); tt_putparm(cursor_address, 1, lines - 1, 0); put_str(every_line); } tt_putparm(change_scroll_region, 1, 0, lines - 1); tt_putparm(cursor_address, 1, lines - 1, (int) strlen(every_line)); ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); put_str(" "); pad_done_message(t, state, ch); tt_putparm(change_scroll_region, 1, 0, lines - 1); } /* ** pad_ht(test_list, status, ch) ** ** Test (ht) Tabs */ static void pad_ht( TestList * t, int *state, int *ch) { int i, j; if (!set_tab && init_tabs <= 0) { CAP_NOT_FOUND; ptext("(ht) Tab not tested. (hts) Set-tabs and (it) initial-tabs not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(ht) Tab start testing")) { return; } pad_test_startup(1); do { /* it is not always possible to test tabs with caps that do not already have padding. The following test uses a mixed bag of tests in order to avoid this problem. Note: I do not scroll */ if (auto_right_margin && can_go_home) for (i = 1, go_home(); i < lines - 2; i++) { for (j = 8; j < columns; j += 8) { putchp('\t'); } put_str("A "); } if (cursor_down && can_go_home) for (i = 1, go_home(); i < lines - 2; i++) { for (j = 8; j < columns; j += 8) { putchp('\t'); } put_str("D\r"); tt_putp(cursor_down); } if (cursor_address) for (i = 1; i < lines - 2; i++) { tt_putparm(cursor_address, 1, i - 1, 0); for (j = 8; j < columns; j += 8) { putchp('\t'); } put_str("C"); } go_home(); for (i = 1; i < lines - 2; i++) { for (j = 8; j < columns; j += 8) { putchp('\t'); } putln("N"); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); ptextln("Letters on the screen other than Ns at the right margin indicate failure."); ptext("A-(am) D-(cud1) C-(cup) N-(nel) "); pad_done_message(t, state, ch); } /* ** pad_smso(test_list, status, ch) ** ** Test (smso) (rmso) Enter/exit mode */ static void pad_smso( TestList * t, int *state, int *ch) { if (!enter_standout_mode || !exit_standout_mode) { CAP_NOT_FOUND; ptext("(smso) (rmso) Enter/Exit-standout-mode not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(smso) (rmso) Enter/Exit-standout-mode start testing")) { return; } /* In terminals that emulate non-hidden attributes with hidden attributes, the amount of time that it takes to fill the screen with an attribute is nontrivial. The following test is designed to catch those delays */ pad_test_startup(1); do { int i, j; page_loop(); j = magic_cookie_glitch > 0 ? magic_cookie_glitch : 0; for (i = 2 + j + j; i < columns;) { put_mode(enter_standout_mode); i += j + j + 2; putchp('X'); put_mode(exit_standout_mode); putchp('X'); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext(above_line); pad_done_message(t, state, ch); put_mode(exit_standout_mode); } /* ** pad_smacs(test_list, status, ch) ** ** Test (smacs) (rmacs) Enter/exit altcharset mode */ static void pad_smacs( TestList * t, int *state, int *ch) { /* test enter even if exit is missing */ if (!enter_alt_charset_mode) { CAP_NOT_FOUND; ptext("(smacs) Enter-altcharset-mode not present. "); pad_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(smacs) (rmacs) Enter/Exit-altcharset-mode start testing")) { return; } pad_test_startup(1); do { int i, j; page_loop(); j = magic_cookie_glitch > 0 ? magic_cookie_glitch : 0; for (i = 2 + j + j; i < columns;) { put_mode(enter_alt_charset_mode); i += j + j + 2; putchp(letter); put_mode(exit_alt_charset_mode); putchp(letter); } ENSURE_DELAY; } while (still_testing()); pad_test_shutdown(t, 0); home_down(); ptext("Every other character is from the alternate character set. "); pad_done_message(t, state, ch); put_mode(exit_alt_charset_mode); } /* ** pad_crash(test_list, status, ch) ** ** Test (clear) without padding */ static void pad_crash( TestList * t, int *state, int *ch) { char save_xon_xoff; if (!clear_screen) { ptext("(clear) Clear-screen not present. "); pad_done_message(t, state, ch); return; } ptext("If you would like to see if the terminal will really lock up."); ptextln(" I will send the clear screen sequence without the pads."); if (skip_pad_test(t, state, ch, "(clear) Clear-screen start crash testing")) { return; } save_xon_xoff = xon_xoff; ChangeTermInfo(xon_xoff, 1); pad_test_startup(0); do { put_str("Erase this!"); tt_putp(clear_screen); ENSURE_DELAY; } while (still_testing()); ChangeTermInfo(xon_xoff, save_xon_xoff); pad_test_shutdown(t, 1); pad_done_message(t, state, ch); } /* *INDENT-OFF* */ TestList pad_test_list[] = { MY_EDIT_MENU MY_PADS_MENU {0, 0, 0, 0, "@) display statistics about the last test", dump_test_stats, 0}, {0, 0, 0, 0, "c) clear screen", menu_clear_screen, 0}, {0, 0, 0, 0, "i) send reset and init", menu_reset_init, 0}, {0, 0, 0, 0, txt_longer_test_time, longer_test_time, 0}, {0, 0, 0, 0, txt_shorter_test_time, shorter_test_time, 0}, {0, 0, 0, 0, txt_longer_augment, longer_augment, 0}, {0, 0, 0, 0, txt_shorter_augment, shorter_augment, 0}, /*** Phase 1: Test initialization and reset strings. (rs1) (rs2) (rs3) (is1) (is2) (is3) are very difficult to test. They have no defined output. To make matters worse, the cap builder could partition (rs1) (rs2) (rs3) by length, leaving the terminal in some unknown state between (rs1) and (rs2) or between (r2) and (rs3). Some reset strings clear the screen when done. We have no control over this. The only thing we can do for certain is to test the pad times by checking for overruns. ***/ {MENU_NEXT, 3, "rs1", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "rs2", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "rs3", 0, 0, pad_standard, 0}, {MENU_NEXT | MENU_INIT, 0, 0, 0, 0, init_xon_xoff, 0}, {MENU_NEXT, 3, "is1", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "is2", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "is3", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "rmxon", "smxon", 0, pad_rmxon, 0}, {MENU_NEXT | MENU_INIT, 0, 0, 0, 0, init_cup, 0}, /* Phase 2: Test home, screen clears and erases. */ {MENU_NEXT, 0, "home", 0, 0, pad_home1, 0}, {MENU_NEXT, 0, "home) (nel", 0, 0, pad_home2, 0}, {MENU_NEXT | 1, 0, "clear", 0, 0, pad_clear, 0}, {MENU_NEXT | MENU_LM1, 0, "ed", 0, 0, pad_clear, 0}, {MENU_NEXT | MENU_80c, 0, "ech", 0, 0, pad_ech, 0}, {MENU_NEXT | MENU_80c, 0, "el1", "cub1 nel", 0, pad_el1, 0}, {MENU_NEXT | MENU_10c, 0, "el", "nel", 0, pad_el, 0}, /* Phase 3: Character deletions and insertions */ {MENU_NEXT, 0, "smdc) (rmdc", 0, 0, pad_smdc, 0}, {MENU_NEXT | MENU_80c, 0, "dch", "smdc rmdc", 0, pad_dch, 0}, {MENU_NEXT | MENU_80c, 0, "dch1", "smdc rmdc", 0, pad_dch1, 0}, {MENU_NEXT, 0, "smir) (rmir", 0, 0, pad_smir, 0}, {MENU_NEXT | MENU_90c, 0, "ich) (ip", "smir rmir", 0, pad_ich, 0}, {MENU_NEXT | MENU_90c, 0, "ich1) (ip", "smir rmir", 0, pad_ich1, 0}, {MENU_NEXT, 4, "ich1) (dch1", "smir rmir", 0, pad_xch1, 0}, {MENU_NEXT | MENU_90c, 0, "rep", 0, 0, pad_rep, 0}, /* Phase 4: Test cursor addressing pads. */ {MENU_NEXT, 0, "cup", 0, 0, pad_cup, 0}, /* Phase 5: Test scrolling and cursor save/restore. */ {MENU_NEXT, 0, "hd", 0, 0, pad_hd, 0}, {MENU_NEXT, 0, "hu", 0, 0, pad_hu, 0}, {MENU_NEXT | MENU_LM1 | 1, 0, "rin", 0, 0, pad_rin, 0}, {MENU_NEXT, 0, "ri", 0, 0, pad_rin, 0}, {MENU_NEXT | MENU_LM1 | 1, 0, "il", 0, 0, pad_il, 0}, {MENU_NEXT, 0, "il1", 0, 0, pad_il, 0}, {MENU_NEXT | MENU_LM1 | 1, 0, "indn", 0, 0, pad_indn, 0}, {MENU_NEXT, 0, "ind", 0, 0, pad_indn, 0}, {MENU_NEXT | MENU_LM1 | 1, 0, "dl", 0, 0, pad_dl, 0}, {MENU_NEXT, 0, "dl1", 0, 0, pad_dl, 0}, {MENU_NEXT, 0, "il1) (dl1", 0, 0, pad_xl, 0}, {MENU_NEXT, 0, "sc) (rc", 0, 0, pad_scrc, 0}, {MENU_NEXT | MENU_50l, 0, "csr) (ind", 0, 0, pad_csrind, 0}, {MENU_NEXT, 0, "sc) (csr) (rc", 0, 0, pad_sccsrrc, 0}, {MENU_NEXT, 0, "csr) (nel", "sc rc", 0, pad_csr_nel, 0}, {MENU_NEXT, 0, "csr) (cup", 0, 0, pad_csr_cup, 0}, /* Phase 6: Test tabs. */ {MENU_NEXT, 0, "ht", 0, 0, pad_ht, 0}, /* Phase 7: Test character-set-switch pads. */ {MENU_NEXT, 0, "smso) (rmso", 0, 0, pad_smso, 0}, {MENU_NEXT, 0, "smacs) (rmacs", 0, 0, pad_smacs, 0}, /* Phase 8: Tests for miscellaneous mode-switch pads. */ {MENU_NEXT, 3, "flash", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "smkx", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "rmkx", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "smm", 0, 0, pad_standard, 0}, {MENU_NEXT, 3, "rmm", 0, 0, pad_standard, 0}, /* Phase 9: Test crash-and-burn properties of unpadded (clear). */ {0, 0, "clear", "xon", "k) run clear test with no padding", pad_crash, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ tack-1.09-20230201/menu.c0000644000000000000000000002112713615560366013100 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2010,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: menu.c,v 1.13 2020/02/02 14:47:18 tom Exp $") /* Menu control */ static void test_byname(TestMenu *, int *, int *); TestList *augment_test; char prompt_string[80]; /* menu prompt storage */ /* ** menu_prompt() ** ** Print the menu prompt string. */ void menu_prompt(void) { ptext(&prompt_string[1]); } /* ** menu_test_loop(test-structure, state, control-character) ** ** This function implements the repeat test function. */ static void menu_test_loop( TestList * test, int *state, int *ch) { int nch; if ((test->flags & MENU_REP_MASK) && (augment_test != test)) { int p; /* set the augment variable (first time only) */ p = (test->flags >> 8) & 15; if ((test->flags & MENU_REP_MASK) == MENU_LM1) { augment = lines - 1; } else if ((test->flags & MENU_ONE_MASK) == MENU_ONE) { augment = 1; } else if ((test->flags & MENU_LC_MASK) == MENU_lines) { augment = lines * p / 10; } else if ((test->flags & MENU_LC_MASK) == MENU_columns) { augment = columns * p / 10; } else { augment = 1; } augment_test = test; set_augment_txt(); } do { if ((test->flags | *state) & MENU_CLEAR) { put_clear(); } else if (line_count + test->lines_needed >= lines) { put_clear(); } nch = 0; if (test->test_procedure) { /* The procedure takes precedence so I can pass the menu entry as an argument. */ can_test(test->caps_done, FLAG_TESTED); can_test(test->caps_tested, FLAG_TESTED); test->test_procedure(test, state, &nch); } else if (test->sub_menu) { /* nested menu's */ menu_display(test->sub_menu, &nch); *state = 0; if (nch == 'q' || nch == 's') { /* Quit and skip are killed here */ nch = '?'; } } else { break; /* cya */ } if (nch == '\r' || nch == '\n' || nch == 'n') { nch = 0; break; } } while (nch == 'r'); *ch = nch; } /* ** menu_display(menu-structure, flags) ** ** This function implements menu control. */ void menu_display( TestMenu * menu, int *last_ch) { int test_state = 0, run_standard_tests; int hot_topic, ch = 0, nch = 0; TestList *mt; TestList *repeat_tests = 0; int repeat_state = 0; int prompt_length; prompt_length = (int) strlen(prompt_string); if (menu->ident) { sprintf(&prompt_string[prompt_length], "/%s", menu->ident); } hot_topic = menu->default_action; run_standard_tests = menu->standard_tests ? menu->standard_tests[0] : -1; if (!last_ch) { last_ch = &ch; } while (1) { if (ch == 0) { /* Display the menu */ put_crlf(); if (menu->menu_function) { /* this function may be used to restrict menu entries. If used it must print the title. */ menu->menu_function(menu); } else if (menu->menu_title) { ptextln(menu->menu_title); } for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { if (mt->menu_entry) { ptext(" "); ptextln(mt->menu_entry); } } if (menu->standard_tests) { ptext(" "); ptextln(menu->standard_tests); ptextln(" r) repeat test"); ptextln(" s) skip to next test"); } ptextln(" q) quit"); ptextln(" ?) help"); } if (ch == 0 || ch == REQUEST_PROMPT) { put_crlf(); ptext(&prompt_string[1]); if (hot_topic) { ptext(" ["); putchp(hot_topic); ptext("]"); } ptext(" > "); /* read a character */ ch = wait_here(); } if (ch == '\r' || ch == '\n') { ch = hot_topic; } if (ch == 'q') { break; } if (ch == '?') { ch = 0; continue; } nch = ch; ch = 0; /* Run one of the standard tests (by request) */ for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { if (mt->menu_entry && (nch == mt->menu_entry[0])) { if (mt->flags & MENU_MENU) { test_byname(menu, &test_state, &nch); } else { menu_test_loop(mt, &test_state, &nch); } ch = nch; if ((mt->flags & MENU_COMPLETE) && ch == 0) { /* top level */ hot_topic = 'q'; ch = '?'; } } } if (menu->standard_tests && nch == 'r') { menu->resume_tests = repeat_tests; test_state = repeat_state; nch = run_standard_tests; } if (nch == run_standard_tests) { if (!(mt = menu->resume_tests)) { mt = menu->tests; } if (mt->flags & MENU_LAST) { mt = menu->tests; } /* Run the standard test suite */ for (; (mt->flags & MENU_LAST) == 0;) { if ((mt->flags & MENU_NEXT) == MENU_NEXT) { repeat_tests = mt; repeat_state = test_state; nch = run_standard_tests; menu_test_loop(mt, &test_state, &nch); if (nch != 0 && nch != 'n') { ch = nch; break; } if (test_state & MENU_STOP) { break; } } mt++; } if (ch == 0) { ch = hot_topic; } menu->resume_tests = mt; menu->resume_state = test_state; menu->resume_char = ch; if (ch == run_standard_tests) { /* pop up a level */ break; } } } *last_ch = ch; prompt_string[prompt_length] = '\0'; } /* ** generic_done_message(test_list) ** ** Print the Done message and request input. */ void generic_done_message( TestList * test, int *state, int *ch) { if (test->caps_done) { char done_message[128]; sprintf(done_message, "(%s) Done ", test->caps_done); ptext(done_message); } else { ptext("Done "); } *ch = wait_here(); if (*ch == '\r' || *ch == '\n' || *ch == 'n') { *ch = 0; } if (*ch == 's') { *state |= MENU_STOP; *ch = 0; } } /* ** menu_clear_screen(test, state, ch) ** ** Just clear the screen. */ void menu_clear_screen( TestList * test GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { put_clear(); } /* ** menu_reset_init(test, state, ch) ** ** Send the reset and init strings. */ void menu_reset_init( TestList * test GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { reset_init(); put_crlf(); } /* ** subtest_menu(test, state, ch) ** ** Scan the menu looking for something to execute ** Return TRUE if we found anything. */ int subtest_menu( TestList * test, int *state, int *ch) { if (*ch) { TestList *mt; for (mt = test; (mt->flags & MENU_LAST) == 0; mt++) { if (mt->menu_entry && (*ch == mt->menu_entry[0])) { *ch = 0; menu_test_loop(mt, state, ch); return TRUE; } } } return FALSE; } /* ** menu_can_scan(menu-structure) ** ** Recursively scan the menu tree and find which cap names can be tested. */ void menu_can_scan( const TestMenu * menu) { TestList *mt; for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { can_test(mt->caps_done, FLAG_CAN_TEST); can_test(mt->caps_tested, FLAG_CAN_TEST); if (!(mt->test_procedure)) { if (mt->sub_menu) { menu_can_scan(mt->sub_menu); } } } } /* ** menu_search(menu-structure, cap) ** ** Recursively search the menu tree and execute any tests that use cap. */ static void menu_search( TestMenu * menu, int *state, int *ch, char *cap) { TestList *mt; int nch; for (mt = menu->tests; (mt->flags & MENU_LAST) == 0; mt++) { nch = 0; if (cap_match(mt->caps_done, cap) || cap_match(mt->caps_tested, cap)) { menu_test_loop(mt, state, &nch); } if (!(mt->test_procedure)) { if (mt->sub_menu) { menu_search(mt->sub_menu, state, &nch, cap); } } if (*state & MENU_STOP) { break; } if (nch != 0 && nch != 'n') { *ch = nch; break; } } } /* ** test_byname(menu, state, ch) ** ** Get a cap name then run all tests that use that cap. */ static void test_byname( TestMenu * menu, int *state GCC_UNUSED, int *ch) { int test_state = 0; char cap[32]; if (tty_can_sync == SYNC_NOT_TESTED) { verify_time(); } ptext("enter name: "); read_string(cap, sizeof(cap)); if (cap[0]) { menu_search(menu, &test_state, ch, cap); } *ch = '?'; } tack-1.09-20230201/package/0000755000000000000000000000000014366602345013356 5ustar rootroottack-1.09-20230201/package/tack.spec0000644000000000000000000000275614366602345015166 0ustar rootrootSummary: terminfo action checker %global AppProgram tack %global AppVersion 1.09 %global AppPatched 20230201 %global MySite https://invisible-island.net # $XTermId: tack.spec,v 1.31 2023/02/02 00:33:41 tom Exp $ Name: %{AppProgram} Version: %{AppVersion} Release: %{AppPatched} License: GPL2 Group: Applications/Development URL: %{MySite}/ncurses/tack Source0: %{MySite}/archives/ncurses/current/%{AppProgram}-%{AppVersion}-%{AppPatched}.tgz Packager: Thomas Dickey %description The 'tack' program is a diagnostic tool that is designed to create and verify the correctness of terminfo's. This program can be used to create new terminal descriptions that are not included in the standard ncurses release. %prep %define debug_package %{nil} %setup -q -n %{AppProgram}-%{AppVersion}-%{AppPatched} %build INSTALL_PROGRAM='${INSTALL}' \ %configure \ --target %{_target_platform} \ --prefix=%{_prefix} \ --bindir=%{_bindir} \ --libdir=%{_libdir} \ --mandir=%{_mandir} \ --with-ncurses make %install [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT make install DESTDIR=$RPM_BUILD_ROOT strip $RPM_BUILD_ROOT%{_bindir}/%{AppProgram} %clean [ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT %files %defattr(-,root,root) %{_prefix}/bin/%{AppProgram} %{_mandir}/man1/%{AppProgram}.* %changelog # each patch should add its ChangeLog entries here * Wed Jul 26 2017 Thomas Dickey use system-defined build-flags * Sat Sep 04 2010 Thomas Dickey - initial version tack-1.09-20230201/package/debian/0000755000000000000000000000000014366602345014600 5ustar rootroottack-1.09-20230201/package/debian/copyright0000644000000000000000000001254113615561053016532 0ustar rootrootAuthor: Thomas Dickey Upstream source http://invisible-island.net/ncurses/ncurses.html Files: * Copyright: 2017-2019,2020 Thomas E. Dickey Copyright: 1991-2017 Free Software Foundation, Inc. License: GPL-2 This program 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, version 2. . This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. . You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. Files: aclocal.m4 Licence: other-BSD Copyright: 2017-2019,2020 Thomas E. Dickey Copyright: 2007-2015,2017 Free Software Foundation, Inc. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, distribute with modifications, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. Except as contained in this notice, the name(s) of the above copyright holders shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization. See https://invisible-island.net/autoconf/ for additional information. Files: install-sh Copyright: 1994 X Consortium Licence: other-BSD 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: debian/* Copyright: 2010-2019,2020 Thomas E. Dickey Licence: other-BSD 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. On Debian systems, the complete text of the GNU General Public License can be found in '/usr/share/common-licenses/GPL-2' tack-1.09-20230201/package/debian/docs0000644000000000000000000000002711440461167015445 0ustar rootrootAUTHORS HISTORY README tack-1.09-20230201/package/debian/compat0000644000000000000000000000000314353307464015777 0ustar rootroot12 tack-1.09-20230201/package/debian/rules0000755000000000000000000000376613615563212015667 0ustar rootroot#!/usr/bin/make -f # $Id: rules,v 1.4 2020/02/02 15:11:06 tom Exp $ # Uncomment this to turn on verbose mode. #export DH_VERBOSE=1 # These are used for cross-compiling and for saving the configure script # from having to guess our platform (since we know it already) DEB_HOST_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_HOST_GNU_TYPE) DEB_BUILD_GNU_TYPE ?= $(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE) CPPFLAGS := $(shell dpkg-buildflags --get CPPFLAGS) CFLAGS := $(shell dpkg-buildflags --get CFLAGS) LDFLAGS := $(shell dpkg-buildflags --get LDFLAGS) ifneq (,$(findstring noopt,$(DEB_BUILD_OPTIONS))) CFLAGS += -O0 else CFLAGS += -O2 endif ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) INSTALL_PROGRAM += -s endif configure: configure-stamp configure-stamp: dh_testdir CPPFLAGS="$(CPPFLAGS)" \ CFLAGS="$(CFLAGS)" \ LDFLAGS="$(LDFLAGS)" \ ./configure \ --host=$(DEB_HOST_GNU_TYPE) \ --build=$(DEB_BUILD_GNU_TYPE) \ --prefix=/usr \ --mandir=\$${prefix}/share/man \ --sysconfdir=/etc \ --with-screen=ncursesw6 touch configure-stamp build: build-stamp build-stamp: configure-stamp dh_testdir $(MAKE) touch build-stamp clean: dh_testdir dh_testroot [ ! -f Makefile ] || $(MAKE) clean rm -f configure-stamp build-stamp install-stamp \ config.cache config.h config.status config.log makefile rm -f *.o tack dh_clean install: install-stamp install-stamp: build-stamp dh_testdir dh_testroot dh_prep dh_installdirs $(MAKE) install DESTDIR=$(CURDIR)/debian/tack touch install-stamp # Build architecture-independent files here. binary-indep: build install # No binary-indep target. # Build architecture-dependent files here. binary-arch: build install dh_testdir dh_testroot dh_installdocs dh_installexamples dh_installchangelogs CHANGES 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 install-stamp tack-1.09-20230201/package/debian/control0000644000000000000000000000112114353307441016171 0ustar rootrootSource: tack Maintainer: Thomas E. Dickey Section: misc Priority: optional Standards-Version: 4.6.0.1 Build-Depends: debhelper (>= 5) Homepage: http://invisible-island.net/ncurses/ Package: tack Architecture: any Depends: ${shlibs:Depends}, ${misc:Depends} Description: generate C function prototypes and convert function definitions The 'tack' program is a diagnostic tool that is designed to create and verify the correctness of terminfo's. This program can be used to create new terminal descriptions that are not included in the standard ncurses release. tack-1.09-20230201/package/debian/source/0000755000000000000000000000000011440457154016074 5ustar rootroottack-1.09-20230201/package/debian/source/format0000644000000000000000000000001511440457154017303 0ustar rootroot3.0 (native) tack-1.09-20230201/package/debian/watch0000644000000000000000000000016114353307752015627 0ustar rootrootversion=3 opts=passive https://invisible-island.net/archives/ncurses/current/tack-(\d+)\.tgz \ debian uupdate tack-1.09-20230201/package/debian/changelog0000644000000000000000000001060214366602345016451 0ustar rootroottack (1.09+20230201) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 01 Feb 2023 19:33:41 -0500 tack (1.09+20221229) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Thu, 29 Dec 2022 07:46:18 -0500 tack (1.09+20220528) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 28 May 2022 09:19:00 -0400 tack (1.09+20210619) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 19 Jun 2021 17:27:48 -0400 tack (1.09+20210429) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Thu, 29 Apr 2021 17:13:04 -0400 tack (1.09+20210324) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Wed, 24 Mar 2021 16:41:32 -0400 tack (1.09+20201128) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 28 Nov 2020 08:26:15 -0500 tack (1.09+20201121) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 21 Nov 2020 13:53:51 -0500 tack (1.09+20200220) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Thu, 20 Feb 2020 18:31:45 -0500 tack (1.09+20200208) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Thu, 08 Feb 2020 20:55:01 -0500 tack (1.09+20200202) unstable; urgency=low * update copyright and license -- Thomas E. Dickey Sun, 02 Feb 2020 08:51:23 -0500 tack (1.08+20190721) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sun, 21 Jul 2019 08:26:44 -0400 tack (1.08+20170818) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Fri, 18 Aug 2017 12:43:54 -0400 tack (1.08+20170728) unstable; urgency=low * port to AIX and HPUX -- Thomas E. Dickey Fri, 28 Jul 2017 14:40:33 -0400 tack (1.08+20170726) unstable; urgency=low * new release -- Thomas E. Dickey Tue, 25 Jul 2017 21:15:36 -0400 tack (1.07+20170723) unstable; urgency=low * drop dependency on tic-library -- Thomas E. Dickey Sun, 23 Jul 2017 17:21:30 -0400 tack (1.07+20170318) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Sat, 18 Mar 2017 10:04:06 -0400 tack (1.07+20150706) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Mon, 06 Jul 2015 04:45:30 -0400 tack (1.07+20150606) unstable; urgency=low * maintenance updates -- Thomas E. Dickey Tue, 02 Jun 2015 04:45:21 -0400 tack (1.07-20130713) unstable; urgency=low * improvements for configure script -- Thomas E. Dickey Sat, 13 Jul 2013 11:44:55 -0400 tack (1.07-20120916) unstable; urgency=low * improvements for configure script -- Thomas E. Dickey Sun, 16 Sep 2012 10:01:00 -0400 tack (1.07-20120429) unstable; urgency=low * add makefile rules for generated documentation. * corrected ncv test to handle the default case. * improve cleanup after color palette tests. * add test for eslok. * portability-fix for configure script. -- Thomas E. Dickey Sun, 29 Apr 2012 11:17:02 -0400 tack (1.07-20120303) unstable; urgency=low * code cleanup -- Thomas E. Dickey Fri, 02 Mar 2012 05:56:16 -0500 tack (1.07-20120226) unstable; urgency=low * improvements for configure script -- Thomas E. Dickey Sun, 26 Feb 2012 20:01:01 -0500 tack (1.07-20110626) unstable; urgency=low * minor fixes for character-set display, etc., from Daniel Weaver -- Thomas E. Dickey Sun, 26 Jun 2011 14:45:27 -0400 tack (1.07-20110501) unstable; urgency=low * fix sign-extension bug. -- Thomas E. Dickey Sun, 01 May 2011 11:16:54 -0400 tack (1.07-20100904) unstable; urgency=low * Add package scripts to upstream source, for test-builds. -- Thomas E. Dickey Sat, 04 Sep 2010 10:58:27 -0400 tack-1.09-20230201/output.c0000644000000000000000000004144613622642022013466 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ /* screen formatting and I/O utility functions */ #include #include MODULE_ID("$Id: output.c,v 1.31 2020/02/18 01:55:30 tom Exp $") /* globals */ long char_sent; /* number of characters sent */ int char_count; /* counts characters */ int line_count; /* counts line feeds */ int expand_chars; /* length of expand() string */ int replace_mode; /* used to output replace mode padding */ int can_go_home; /* TRUE if we can fashion a home command */ int can_clear_screen; /* TRUE if we can somehow clear the screen */ int raw_characters_sent; /* Total output characters */ /* local */ static int log_column; /* Number of characters on a log line */ static int in_logging; /* Filter debug logging for clarity */ /* translate mode default strings */ #define TM_carriage_return TM_string[0].value #define TM_cursor_down TM_string[1].value #define TM_scroll_forward TM_string[2].value #define TM_newline TM_string[3].value #define TM_cursor_left TM_string[4].value #define TM_bell TM_string[5].value #define TM_form_feed TM_string[6].value #define TM_tab TM_string[7].value struct default_string_list TM_string[TM_last] = { {"cr", "\r", 0}, {"cud1", "\n", 0}, {"ind", "\n", 0}, {"nel", "\r\n", 0}, {"cub1", "\b", 0}, {"bel", "\007", 0}, {"ff", "\f", 0}, {"ht", "\t", 0} }; static const char *c0[32] = { "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US" }; static const char *c1[32] = { "", "", "", "", "IND", "NEL", "SSA", "ESA", "HTS", "HTJ", "VTS", "PLD", "PLU", "RI", "SS2", "SS3", "DCS", "PU1", "PU2", "STS", "CCH", "MW", "SPA", "EPA", "", "", "", "CSI", "ST", "OSC", "PM", "APC" }; int getnext(int mask) { /* get the next character without scan mode conversion */ int ch; unsigned char buf; if (debug_fp) { fprintf(debug_fp, "getnext:\n"); } tc_putp(req_for_input); fflush(stdout); if (nodelay_read) { while (1) { ch = (int) read(fileno(stdin), &buf, sizeof(buf)); if (ch == -1) { if (debug_fp) { fprintf(debug_fp, "...getnext: EOF (nodelay)\n"); } return EOF; } else if (ch == 1) { if (debug_fp) { fprintf(debug_fp, "...getnext: 0x%02X (nodelay)\n", ch); } return buf; } } } ch = getchar(); if (ch != EOF) { ch &= mask; if (debug_fp) { fprintf(debug_fp, "...getnext: 0x%02X\n", ch); } } else { if (debug_fp) { fprintf(debug_fp, "...getnext: EOF\n"); } } return ch; } int getchp(int mask) { /* read a character with scan mode conversion */ if (scan_mode) { tc_putp(req_for_input); fflush(stdout); return scan_key(); } else return getnext(mask); } int log_chr(FILE *fp, int ch, int col) { if (ch < 32) { fprintf(fp, "<%s>", c0[ch]); col += 5; } else if (ch < 127) { fprintf(fp, "%c", (char) ch); col += 1; } else { fprintf(fp, "<%02x>", ch); col += 4; } if ((ch == '\n' && col > 0) || col >= 80) { fprintf(fp, "\n"); col = 0; } return col; } void log_str(FILE *fp, const char *value) { if (value == 0) { fputs("", fp); } else if (value == (const char *) -1) { fputs("", fp); } else { int ch; while ((ch = UChar(*value++)) != '\0') { log_chr(fp, ch, -10); } } } /* ** tc_putch(c) ** ** Output one character */ int tc_putch(TC_PUTCH c) { char_sent++; raw_characters_sent++; putchar(c); if ((raw_characters_sent & 31) == 31) { fflush(stdout); } if (log_fp) { log_column = log_chr(log_fp, UChar(c), log_column); } return (c); } /* ** tt_tputs(string, reps) ** ** Output a string with tputs() translation. ** Use this function inside timing tests. */ void tt_tputs(const char *string, int reps) { ++in_logging; if (debug_fp && (in_logging == 1)) { fprintf(debug_fp, "tt_tputs: string="); log_str(debug_fp, string); fprintf(debug_fp, ", reps=%d\n", reps); } if (string) { int i; for (i = 0; i < TT_MAX; i++) { if (i >= ttp) { tt_cap[i] = string; tt_affected[i] = reps; tt_count[i] = 1; tt_delay[i] = msec_cost(string, reps); ttp++; break; } if (string == tt_cap[i] && reps == tt_affected[i]) { tt_count[i]++; tt_delay_used += tt_delay[i]; break; } } (void) tputs(string, reps, tc_putch); } --in_logging; } /* ** tt_putp(string) ** ** Output a string with tputs() translation. ** Use this function inside timing tests. */ void tt_putp(const char *string) { ++in_logging; if (debug_fp && (in_logging == 1)) { fprintf(debug_fp, "tt_putp: string="); log_str(debug_fp, string); fprintf(debug_fp, "\n"); } tt_tputs(string, 1); --in_logging; } /* ** tt_putparm(string, reps, arg1, arg2) ** ** Send tt_tputs(tparm(string, args1, arg2), reps) ** Use this function inside timing tests. */ void tt_putparm( NCURSES_CONST char *string, int reps, int arg1, int arg2) { if (string) { int i; ++in_logging; if (debug_fp && (in_logging == 1)) { fprintf(debug_fp, "tc_putparm: string="); log_str(debug_fp, string); fprintf(debug_fp, ", reps=%d\n", reps); } for (i = 0; i < TT_MAX; i++) { if (i >= ttp) { tt_cap[i] = string; tt_affected[i] = reps; tt_count[i] = 1; tt_delay[i] = msec_cost(string, reps); ttp++; break; } if (string == tt_cap[i] && reps == tt_affected[i]) { tt_count[i]++; tt_delay_used += tt_delay[i]; break; } } (void) tputs(TPARM_2((NCURSES_CONST char *) string, arg1, arg2), reps, tc_putch); --in_logging; } } /* ** tc_putp(string) ** ** Output a string with tputs() translation. ** Use this function instead of putp() so we can track ** the actual number of characters sent. */ int tc_putp(const char *string) { int rc = -1; if (VALID_STRING(string)) { ++in_logging; rc = tputs(string, 1, tc_putch); if (debug_fp && (in_logging == 1)) { fprintf(debug_fp, "tc_putp: string="); log_str(debug_fp, string); fprintf(debug_fp, ", rc=%d\n", rc); } --in_logging; } return rc; } void put_this(int c) { /* output one character (with padding) */ tc_putch((TC_PUTCH) c); if (char_padding && replace_mode) tt_putp(char_padding); } void put_cr(void) { if (translate_mode && carriage_return) { tt_putp(carriage_return); } else { tt_putp(TM_carriage_return); } char_count = 0; } void put_lf(void) { /* send a linefeed (only works in RAW or CBREAK mode) */ if (translate_mode && cursor_down) { tt_putp(cursor_down); } else { tt_putp(TM_cursor_down); } line_count++; } void put_ind(void) { /* scroll forward (only works in RAW or CBREAK mode) */ if (translate_mode && scroll_forward) { tt_putp(scroll_forward); } else { tt_putp(TM_scroll_forward); } line_count++; } /* ** put_crlf() ** ** Send (nel) or */ void put_crlf(void) { if (translate_mode && newline) { tt_putp(newline); } else { tt_putp(TM_newline); } char_count = 0; line_count++; } /* ** put_new_lines(count) ** ** Send a number of newlines. (nel) */ void put_newlines(int n) { while (n-- > 0) { put_crlf(); } } /* ** putchp(character) ** ** Send one character to the terminal. ** This function does translation of control characters. */ void putchp(int c) { switch (c) { case '\b': if (translate_mode && cursor_left) { tt_putp(cursor_left); } else { tt_putp(TM_cursor_left); } char_count--; break; case 7: if (translate_mode && bell) { tt_putp(bell); } else { tt_putp(TM_bell); } break; case '\f': if (translate_mode && form_feed) { tt_putp(form_feed); } else { tt_putp(TM_form_feed); } char_count = 0; line_count++; break; case '\n': put_crlf(); break; case '\r': put_cr(); break; case '\t': if (translate_mode && tab) { tt_putp(tab); } else { tt_putp(TM_tab); } char_count = ((char_count / 8) + 1) * 8; break; default: put_this(c); char_count++; break; } } void put_str(const char *s) { /* send the string to the terminal */ for (; *s; putchp(*s++)) ; } void putln(const char *s) { /* output a string followed by a CR LF */ for (; *s; putchp(*s++)) ; put_crlf(); } void put_columns(const char *s, int len, int w) { /* put out s in column format */ int l; if (char_count + w > columns) { put_crlf(); } l = char_count % w; if (l) { while (l < w) { putchp(' '); l++; } } else if (char_count) { putchp(' '); } if (char_count && char_count + len >= columns) { put_crlf(); } l = char_count; put_str(s); char_count = l + len; } /* ** ptext(string) ** ** Output a string but do not assume the terminal will wrap to a ** new line. Break the line at a word boundary then send a CR LF. ** This is more esthetic on 40 column terminals. */ void ptext(const char *s) { const char *t; while (*s) { for (t = s + 1; *t > ' '; t++) ; if ((char_count != 0) && ((t - s) + char_count >= columns)) { put_crlf(); while (*s == ' ') s++; } while (s < t) { putchp(*s++); } } } void ptextln(const char *s) { /* print the text using ptext() then add a CR LF */ ptext(s); put_crlf(); } static void expand_one(int ch, char **v) { /* expand one character */ char *t = *v; if (ch & 0x80) { /* dump it in octal (yuck) */ *t++ = '\\'; *t++ = (char) ('0' + ((ch >> 6) & 3)); *t++ = (char) ('0' + ((ch >> 3) & 7)); *t++ = (char) ('0' + (ch & 7)); expand_chars += 4; } else if (ch == 127) { /* DEL */ *t++ = '^'; *t++ = '?'; expand_chars += 2; } else if (ch >= ' ') { *t++ = (char) ch; expand_chars++; } else { /* control characters */ *t++ = '^'; *t++ = (char) (ch + '@'); expand_chars += 2; } *v = t; } char * expand(const char *s) { /* convert the string to printable form */ static char buf[4096]; char *t; const char *v; if (magic_cookie_glitch <= 0 && exit_attribute_mode) { v = enter_reverse_mode; } else { v = NULL; } expand_chars = 0; t = buf; if (s) { int ch; for (; (ch = *s); s++) { if ((ch & 0x80) && v) { /* print it in reverse video mode */ strcpy(t, liberated(TPARM_0(v))); for (; *t; t++) ; expand_one(ch & 0x7f, &t); strcpy(t, liberated(TPARM_0(exit_attribute_mode))); for (; *t; t++) ; } else { expand_one(ch, &t); } } } *t = '\0'; return buf; } char * print_expand(char *s) { /* convert the string to 7-bit printable form */ static char buf[4096]; char *t; expand_chars = 0; t = buf; if (s) { int ch; for (; (ch = *s); s++) { expand_one(ch, &t); } } *t = '\0'; return buf; } char * expand_to(char *s, int l) { /* expand s to length l */ char *t; for (s = t = expand(s); *t; t++) ; for (; expand_chars < l; expand_chars++) { *t++ = ' '; } *t = '\0'; return s; } char * hex_expand_to(char *s, int l) { /* expand s to length l in hex */ static char buf[4096]; char *t; for (t = buf; *s; s++) { sprintf(t, "%02X ", UChar(*s)); t += 3; if (t - buf > (int) sizeof(buf) - 4) { break; } } for (; t - buf < l;) { *t++ = ' '; } *t = '\0'; expand_chars = (int) (t - buf); return buf; } char * expand_command(const char *c) { /* expand an ANSI escape sequence */ static char buf[256]; int i, j, ch; char *s; s = buf; for (i = FALSE; (ch = UChar(*c)) != 0; c++) { if (i) { *s++ = ' '; } i = TRUE; if (ch < 32) { j = UChar(c[1]); if (ch == '\033' && j >= '@' && j <= '_') { ch = j - '@'; c++; for (j = 0; (*s = c1[ch][j++]); s++) ; } else for (j = 0; (*s = c0[ch][j++]); s++) ; } else { *s++ = (char) ch; j = UChar(c[1]); if (ch >= '0' && ch <= '9' && j >= '0' && j <= '9') { i = FALSE; } } } *s = '\0'; return buf; } /* ** go_home() ** ** Move the cursor to the home position */ void go_home(void) { int i; if (cursor_home) tt_putp(cursor_home); else if (cursor_address) tt_putparm(cursor_address, lines, 0, 0); else if (row_address) { /* use (vpa) */ put_cr(); tt_putparm(row_address, 1, 0, 0); } else if (cursor_up && cursor_to_ll) { tt_putp(cursor_to_ll); for (i = 1; i < lines; i++) { tt_putp(cursor_up); } } else { can_go_home = FALSE; return; } char_count = line_count = 0; can_go_home = TRUE; } void home_down(void) { /* move the cursor to the lower left hand corner */ int i; if (cursor_to_ll) tt_putp(cursor_to_ll); else if (cursor_address) tt_putparm(cursor_address, lines, lines - 1, 0); else if (row_address) { /* use (vpa) */ put_cr(); tt_putparm(row_address, 1, lines - 1, 0); } else if (cursor_down && cursor_home) { tt_putp(cursor_home); for (i = 1; i < lines; i++) tt_putp(cursor_down); } else return; char_count = 0; line_count = lines - 1; } void put_clear(void) { /* clear the screen */ int i; if (debug_fp) { fprintf(debug_fp, "put_clear:\n"); } if (clear_screen) tt_tputs(clear_screen, lines); else if (clr_eos && can_go_home) { go_home(); tt_tputs(clr_eos, lines); } else if (scroll_forward && !over_strike && (can_go_home || cursor_up)) { /* clear the screen by scrolling */ put_cr(); if (cursor_to_ll) { tt_putp(cursor_to_ll); } else if (cursor_address) { tt_putparm(cursor_address, lines, lines - 1, 0); } else if (row_address) { tt_putparm(row_address, 1, lines - 1, 0); } else { for (i = 1; i < lines; i++) { tt_putp(scroll_forward); } } for (i = 1; i < lines; i++) { tt_putp(scroll_forward); } if (can_go_home) { go_home(); } else { for (i = 1; i < lines; i++) { tt_putp(cursor_up); } } } else { can_clear_screen = FALSE; if (debug_fp) { fprintf(debug_fp, "...put_clear: ERR\n"); } return; } char_count = line_count = 0; can_clear_screen = TRUE; if (debug_fp) { fprintf(debug_fp, "...put_clear: OK\n"); } } /* ** wait_here() ** ** read one character from the input stream ** If the terminal is not in RAW mode then this function will ** wait for a or . */ int wait_here(void) { char cc[64]; char message[16]; int i, j; for (i = 0; i < (int) sizeof(cc); i++) { int ch = getchp(STRIP_PARITY); if (ch == EOF) return ch; cc[i] = (char) ch; if (ch == '\r' || ch == '\n') { put_crlf(); char_sent = 0; return cc[i ? i - 1 : 0]; } if (ch >= ' ') { if (stty_query(TTY_CHAR_MODE)) { put_crlf(); char_sent = 0; return ch; } continue; } if (ch == 023) { /* Control S */ /* ignore control S, but tell me about it */ while (ch == 023 || ch == 021) { ch = getchp(STRIP_PARITY); if (ch == EOF) break; if (i + 1 < (int) sizeof(cc)) cc[++i] = (char) ch; } put_str("\nThe terminal sent a ^S -"); for (j = 0; j <= i; j++) { sprintf(message, " %02X", cc[j] & 0xFF); put_str(message); } put_crlf(); i = -1; } else if (ch != 021) { /* Not Control Q */ /* could be abort character */ spin_flush(); if (tty_can_sync == SYNC_TESTED) { (void) tty_sync_error(); } else { put_str("\n? "); } } } return '?'; } /* ** read_string(buffer, length) ** ** Read a string of characters from the input stream. */ void read_string(char *buf, size_t length) { size_t i; if (length > 1) { for (i = 0; i < length - 1;) { int ch = getchp(STRIP_PARITY); if (ch == '\r' || ch == '\n' || ch == EOF) { break; } if (ch == '\b' || ch == 127) { if (i) { putchp('\b'); putchp(' '); putchp('\b'); i--; } } else { buf[i++] = (char) ch; putchp(ch); } } } else { i = 0; } buf[i] = '\0'; put_crlf(); char_sent = 0; } /* ** maybe_wait(lines) ** ** wait if near the end of the screen, then clear screen */ void maybe_wait(int n) { if (line_count + n >= lines) { if (char_sent != 0) { ptext("Go? "); (void) wait_here(); } put_clear(); } else { put_crlf(); } } tack-1.09-20230201/sync.c0000644000000000000000000002416213615560366013112 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include #include MODULE_ID("$Id: sync.c,v 1.17 2020/02/02 14:47:18 tom Exp $") /* terminal-synchronization and performance tests */ static void sync_home(TestList *, int *, int *); static void sync_lines(TestList *, int *, int *); static void sync_clear(TestList *, int *, int *); static void sync_summary(TestList *, int *, int *); static TestList sync_test_list[] = { {MENU_NEXT, 0, 0, 0, "b) baud rate test", sync_home, 0}, {MENU_NEXT, 0, 0, 0, "l) scroll performance", sync_lines, 0}, {MENU_NEXT, 0, 0, 0, "c) clear screen performance", sync_clear, 0}, {MENU_NEXT, 0, 0, 0, "p) summary of results", sync_summary, 0}, {0, 0, 0, 0, txt_longer_test_time, longer_test_time, 0}, {0, 0, 0, 0, txt_shorter_test_time, shorter_test_time, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; TestMenu sync_menu = { 0, 'n', 0, "Performance tests", "perf", "n) run standard tests", sync_test, sync_test_list, 0, 0, 0 }; int tty_can_sync; /* TRUE if tty_sync_error() returned FALSE */ static int tty_newline_rate; /* The number of newlines per second */ static int tty_clear_rate; /* The number of clear-screens per second */ unsigned long tty_cps; /* The number of characters per second */ #define TTY_ACK_SIZE 64 static int ACK_terminator; /* terminating ACK character */ static int ACK_length; /* length of ACK string */ static const char *tty_ENQ; /* enquire string */ static char tty_ACK[TTY_ACK_SIZE]; /* ACK response, set by tty_sync_error() */ /***************************************************************************** * * Terminal synchronization. * * These functions handle the messy business of enq-ack handshaking * for timing purposes. * *****************************************************************************/ int tty_sync_error(void) { int trouble; trouble = FALSE; for (;;) { int ch, ack; tt_putp(tty_ENQ); /* send ENQ */ ch = getnext(STRIP_PARITY); event_start(TIME_SYNC); /* start the timer */ /* The timer doesn't start until we get the first character. After that I expect to get the remaining characters of the acknowledge string in a short period of time. If that is not true then these characters are coming from the user and we need to send the ENQ sequence out again. */ for (ack = 0;;) { if (ack < TTY_ACK_SIZE - 2) { tty_ACK[ack] = (char) ch; tty_ACK[ack + 1] = '\0'; } if (ch == ACK_terminator) { return trouble; } if (++ack >= ACK_length) { return trouble; } ch = getnext(STRIP_PARITY); if (event_time(TIME_SYNC) > 400000) { break; } } set_attr(0); /* just in case */ put_crlf(); if (trouble) { /* The terminal won't sync. Life is not good. */ return TRUE; } put_str(" -- sync -- "); trouble = TRUE; } } /* ** flush_input() ** ** Throw away any output. */ void flush_input(void) { if (tty_can_sync == SYNC_TESTED && ACK_terminator >= 0) { (void) tty_sync_error(); } else { spin_flush(); } } /* ** probe_enq_ok() ** ** does the terminal do enq/ack handshaking? */ static void probe_enq_ok(void) { int len; put_str("Testing ENQ/ACK, standby..."); fflush(stdout); can_test("u8 u9", FLAG_TESTED); #ifdef user9 tty_ENQ = user9 ? user9 : "\005"; #else tty_ENQ = "\005"; #endif tc_putp(tty_ENQ); event_start(TIME_SYNC); /* start the timer */ read_key(tty_ACK, (size_t) (TTY_ACK_SIZE - 1)); if (event_time(TIME_SYNC) > 400000 || tty_ACK[0] == '\0') { /* These characters came from the user. Sigh. */ tty_can_sync = SYNC_FAILED; ptext("\nThis program expects the ENQ sequence to be"); ptext(" answered with the ACK character. This will help"); ptext(" the program reestablish synchronization when"); ptextln(" the terminal is overrun with data."); ptext("\nENQ sequence from (u9): "); putln(expand(tty_ENQ)); ptext("ACK received: "); putln(expand(tty_ACK)); #ifdef user8 len = user8 ? (int) strlen(user8) : 0; #else len = 0; #endif sprintf(temp, "Length of ACK %d. Expected length of ACK %d.", (int) strlen(tty_ACK), len); ptextln(temp); #ifdef user8 if (len) { temp[0] = user8[len - 1]; temp[1] = '\0'; ptext("Terminating character found in (u8): "); putln(expand(temp)); } #endif return; } tty_can_sync = SYNC_TESTED; if ((len = (int) strlen(tty_ACK)) == 1) { /* single character acknowledge string */ ACK_terminator = tty_ACK[0]; ACK_length = 4096; return; } #ifdef user8 if (user8) { int ulen = (int) strlen(user8); int tc = tty_ACK[len - 1]; if (tc == user8[ulen - 1]) { /* ANSI style acknowledge string */ ACK_terminator = tc; ACK_length = 4096; return; } } #endif /* fixed length acknowledge string */ ACK_length = len; ACK_terminator = -2; } /* ** verify_time() ** ** verify that the time tests are ready to run. ** If the baud rate is not set then compute it. */ void verify_time(void) { int status, ch; if (tty_can_sync == SYNC_FAILED) { return; } probe_enq_ok(); put_crlf(); if (tty_can_sync == SYNC_TESTED) { put_crlf(); if (ACK_terminator >= 0) { ptext("ACK terminating character: "); temp[0] = (char) ACK_terminator; temp[1] = '\0'; ptextln(expand(temp)); } else { sprintf(temp, "Fixed length ACK, %d characters", ACK_length); ptextln(temp); } } if (tty_baud_rate == 0) { sync_home(&sync_test_list[0], &status, &ch); } } /***************************************************************************** * * Terminal performance tests * * Find out how fast the terminal can: * 1) accept characters * 2) scroll the screen * 3) clear the screen * *****************************************************************************/ /* ** sync_home(test_list, status, ch) ** ** Baudrate test */ static void sync_home( TestList * t, int *state, int *ch) { int j, k; unsigned long rate; if (!cursor_home && !cursor_address && !row_address) { ptext("Terminal can not home cursor. "); generic_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(home) Start baudrate search")) { return; } pad_test_startup(1); do { go_home(); for (j = 1; j < lines; j++) { for (k = 0; k < columns; k++) { if (k & 0xF) { put_this(letter); } else { put_this('.'); } } SLOW_TERMINAL_EXIT; } NEXT_LETTER; } while (still_testing()); pad_test_shutdown(t, auto_right_margin == 0); /* note: tty_frame_size is the real framesize times two. This takes care of half bits. */ rate = ((tx_cps * (unsigned long) tty_frame_size) >> 1); if (rate > tty_baud_rate) { tty_baud_rate = (unsigned) rate; } if (tx_cps > tty_cps) { tty_cps = tx_cps; } sprintf(temp, "%lu characters per second. Baudrate %d ", tx_cps, j); ptext(temp); generic_done_message(t, state, ch); } /* ** sync_lines(test_list, status, ch) ** ** How many newlines/second? */ static void sync_lines( TestList * t, int *state, int *ch) { int j; if (skip_pad_test(t, state, ch, "(nel) Start scroll performance test")) { return; } pad_test_startup(0); repeats = 100; do { sprintf(temp, "%d", test_complete); put_str(temp); put_newlines(repeats); } while (still_testing()); pad_test_shutdown(t, 0); j = sliding_scale(tx_count[0], 1000000, usec_run_time); if (j > tty_newline_rate) { tty_newline_rate = j; } sprintf(temp, "%d linefeeds per second. ", j); ptext(temp); generic_done_message(t, state, ch); } /* ** sync_clear(test_list, status, ch) ** ** How many clear-screens/second? */ static void sync_clear( TestList * t, int *state, int *ch) { int j; if (!clear_screen) { ptext("Terminal can not clear-screen. "); generic_done_message(t, state, ch); return; } if (skip_pad_test(t, state, ch, "(clear) Start clear-screen performance test")) { return; } pad_test_startup(0); repeats = 20; do { sprintf(temp, "%d", test_complete); put_str(temp); for (j = 0; j < repeats; j++) { put_clear(); } } while (still_testing()); pad_test_shutdown(t, 0); j = sliding_scale(tx_count[0], 1000000, usec_run_time); if (j > tty_clear_rate) { tty_clear_rate = j; } sprintf(temp, "%d clear-screens per second. ", j); ptext(temp); generic_done_message(t, state, ch); } /* ** sync_summary(test_list, status, ch) ** ** Print out the test results. */ static void sync_summary( TestList * t, int *state, int *ch) { char size[32]; put_crlf(); ptextln("Terminal size characters/sec linefeeds/sec clears/sec"); sprintf(size, "%dx%d", columns, lines); sprintf(temp, "%-10s%-11s%11lu %11d %11d", tty_basename, size, tty_cps, tty_newline_rate, tty_clear_rate); ptextln(temp); generic_done_message(t, state, ch); } /* ** sync_test(menu) ** ** Run at the beginning of the pad tests and function key tests */ void sync_test( TestMenu * menu) { control_init(); if (tty_can_sync == SYNC_NOT_TESTED) { verify_time(); } if (menu->menu_title) { put_crlf(); ptextln(menu->menu_title); } } /* ** sync_handshake(test_list, status, ch) ** ** Test or retest the ENQ/ACK handshake */ void sync_handshake( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch GCC_UNUSED) { tty_can_sync = SYNC_NOT_TESTED; verify_time(); } tack-1.09-20230201/scan.wy1500000644000000000000000000000162411601664044013512 0ustar rootroot01 81 02 82 1 03 83 2 04 84 3 05 85 4 06 86 5 07 87 6 08 88 7 09 89 8 0a 8a 9 0b 8b 0 0c 8c - 0d 8d = 0e 8e 0f 8f 10 90 q 11 91 w 12 92 e 13 93 r 14 94 t 15 95 y 16 96 u 17 97 i 18 98 o 19 99 p 1a 9a [ 1b 9b ] 1c 9c 1d 9d 1e 9e a 1f 9f s 20 a0 d 21 a1 f 22 a2 g 23 a3 h 24 a4 j 25 a5 k 26 a6 l 27 a7 ; 28 a8 ' 29 a9 <29> 2a aa 2b ab \ 2c ac z 2d ad x 2e ae c 2f af v 30 b0 b 31 b1 n 32 b2 m 33 b3 , 34 b4 . 35 b5 / 36 b6 37 b7 38 b8 39 b9 3a ba 3b bb 3c bc 3d bd 3e be 3f bf 40 c0 41 c1 42 c2 43 c3 44 c4 45 c5 46 c6 47 c7 48 c8 49 c9 4a ca 4b cb 4c cc 4d cd 4e ce 4f cf 50 d0 51 d1 52 d2 53 d3 tack-1.09-20230201/color.c0000644000000000000000000004675413615560366013267 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: color.c,v 1.17 2020/02/02 14:47:18 tom Exp $") /* * Color terminal tests. Has only one entry point: test_color(). */ static void color_check(TestList *, int *, int *); static void color_setf(TestList *, int *, int *); static void color_matrix(TestList *, int *, int *); static void color_ncv(TestList *, int *, int *); static void color_ccc(TestList *, int *, int *); static void color_bce(TestList *, int *, int *); /* *INDENT-OFF* */ TestList color_test_list[] = { MY_EDIT_MENU {MENU_NEXT, 2, "colors) (pairs", 0, 0, color_check, 0}, {MENU_NEXT, 12, "setf) (setb) (scp", 0, 0, color_setf, 0}, {MENU_NEXT, 24, "op", 0, 0, color_matrix, 0}, {MENU_NEXT, 16, "ncv", 0, 0, color_ncv, 0}, {MENU_NEXT, 0, "bce", 0, 0, color_bce, 0}, {MENU_NEXT | MENU_CLEAR, 0, "ccc) (initc) (initp", "hls op oc", 0, color_ccc, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ #ifndef COLOR_BLACK #define COLOR_BLACK 0 #define COLOR_BLUE 1 #define COLOR_GREEN 2 #define COLOR_CYAN 3 #define COLOR_RED 4 #define COLOR_MAGENTA 5 #define COLOR_YELLOW 6 #define COLOR_WHITE 7 #endif struct color_table { const char *name; int index; int r, g, b; int h, l, s; }; /* *INDENT-OFF* */ static struct color_table def_colors[8] = { {"black ", COLOR_BLACK, 0, 0, 0, 0, 0, 0}, {"blue ", COLOR_BLUE, 0, 0, 1000, 330, 50, 100}, {"green ", COLOR_GREEN, 0, 1000, 0, 240, 50, 100}, {"cyan ", COLOR_CYAN, 0, 1000, 1000, 300, 50, 100}, {"red ", COLOR_RED, 1000, 0, 0, 120, 50, 100}, {"magenta", COLOR_MAGENTA, 1000, 0, 1000, 60, 50, 100}, {"yellow ", COLOR_YELLOW, 1000, 1000, 0, 180, 50, 100}, {"white ", COLOR_WHITE, 1000, 1000, 1000, 0, 100, 0} }; /* *INDENT-ON* */ #define MAX_PAIR 256 static int fg_color[MAX_PAIR]; static int bg_color[MAX_PAIR]; static int pairs_used = 8; static int a_bright_color, bright_value; static int cookie_monster, color_step, colors_per_line; static int R, G, B; static void reset_colors(void) { tc_putp(orig_colors); tc_putp(TPARM_0(orig_pair)); } static int color_trans(int c) { /* translate or load the color */ int i; for (i = 0; i < pairs_used; i++) { if (fg_color[i] == c) { return i; } } if (!can_change) { return 0; } if (pairs_used > max_colors || pairs_used >= MAX_PAIR) { pairs_used = 0; ptextln("Ran out of colors"); } fg_color[pairs_used] = c; bg_color[pairs_used] = c; if (hue_lightness_saturation) { tc_putp(TPARM_4(initialize_color, pairs_used, def_colors[c].h, def_colors[c].l, def_colors[c].s)); } else { tc_putp(TPARM_4(initialize_color, pairs_used, def_colors[c].r, def_colors[c].g, def_colors[c].b)); } return pairs_used++; } static void new_color( int fg, int bg, int hungry) { /* change the color to fg and bg. */ int i; if (hungry) { eat_cookie(); } if (set_a_foreground) { /* set ANSI color (setaf) (setab) */ tc_putp(TPARM_1(set_a_foreground, fg)); tc_putp(TPARM_1(set_a_background, bg)); } else if (set_foreground) { /* make sure black is zero */ (void) color_trans(COLOR_BLACK); tc_putp(TPARM_1(set_foreground, color_trans(fg))); tc_putp(TPARM_1(set_background, color_trans(bg))); } else { /* set color pair */ for (i = 0; i < pairs_used; i++) { if (fg_color[i] == fg && bg_color[i] == bg) { tc_putp(TPARM_1(set_color_pair, i)); if (hungry) { eat_cookie(); } return; } } if (!can_change) { /* try to set just the foreground */ for (i = pairs_used - 1; i; i--) { if (fg_color[i] == fg) break; } tc_putp(TPARM_1(set_color_pair, i)); if (hungry) { eat_cookie(); } return; } if (pairs_used > max_pairs || pairs_used >= MAX_PAIR) { pairs_used = 0; ptextln("Ran out of color pairs"); } fg_color[pairs_used] = fg; bg_color[pairs_used] = bg; if (hue_lightness_saturation) { tc_putp(TPARM_7(initialize_pair, pairs_used, def_colors[fg].h, def_colors[fg].l, def_colors[fg].s, def_colors[bg].h, def_colors[bg].l, def_colors[bg].s)); } else { tc_putp(TPARM_7(initialize_pair, pairs_used, def_colors[fg].r, def_colors[fg].g, def_colors[fg].b, def_colors[bg].r, def_colors[bg].g, def_colors[bg].b)); } tc_putp(TPARM_1(set_color_pair, pairs_used)); pairs_used++; } if (hungry) { eat_cookie(); } } static void set_color_step(void) { /* set the color_step for the (ccc) display */ int i; for (i = 2; i < 1000; i++) { if ((i * i * i) >= max_colors) { break; } } color_step = 1000 / (i - 1); } static void rgb_2_hls(int r, int g, int b, int *h, int *l, int *s) { /* convert RGB to HLS system */ int min, max, t; if ((min = g < r ? g : r) > b) { min = b; } if ((max = g > r ? g : r) < b) { max = b; } /* calculate lightness */ *l = (min + max) / 20; if (min == max) { /* black, white and all shades of gray */ *h = 0; *s = 0; return; } /* calculate saturation */ if (*l < 50) { *s = ((max - min) * 100) / (max + min); } else { *s = ((max - min) * 100) / (2000 - max - min); } /* calculate hue */ if (r == max) { t = 120 + ((g - b) * 60) / (max - min); } else if (g == max) { t = 240 + ((b - r) * 60) / (max - min); } else { t = 360 + ((r - g) * 60) / (max - min); } *h = t % 360; } static void send_color(int p, int r, int g, int b) { /* send the initialize_color (initc) command */ int h, l, s; if (hue_lightness_saturation) { rgb_2_hls(r, g, b, &h, &l, &s); tc_putp(TPARM_4(initialize_color, p, h, l, s)); } else { tc_putp(TPARM_4(initialize_color, p, r, g, b)); } } static void send_pair(int p, int fr, int fg, int fb, int br, int bg, int bb) { /* send the initialize_pair (initp) command */ int fh, fl, fs, bh, bl, bs; if (hue_lightness_saturation) { rgb_2_hls(fr, fg, fb, &fh, &fl, &fs); rgb_2_hls(br, bg, bb, &bh, &bl, &bs); tc_putp(TPARM_7(initialize_pair, p, fh, fl, fs, bh, bl, bs)); } else { tc_putp(TPARM_7(initialize_pair, p, fr, fg, fb, bb, bg, bb)); } } /* * Initialize data used for palette; do not modify the terminal. */ static void init_palette(void) { static const int dft_fg_color[] = { COLOR_BLACK, COLOR_BLUE, COLOR_GREEN, COLOR_CYAN, COLOR_RED, COLOR_MAGENTA, COLOR_YELLOW, COLOR_WHITE }; int n; pairs_used = 0; R = G = B = 0; a_bright_color = 0; bright_value = 0; cookie_monster = 0; color_step = 0; colors_per_line = 0; for (n = 0; n < MAX_PAIR; ++n) { fg_color[n] = (n < 8) ? dft_fg_color[n] : COLOR_BLACK; bg_color[n] = COLOR_BLACK; } } static int load_palette(int n) { /* load the color palette */ int rgb; for (;;) { if (pairs_used >= n) { return FALSE; } if (set_a_foreground || set_foreground) { if (pairs_used >= max_colors) { return FALSE; } send_color(pairs_used, R, G, B); rgb = R + G + B; if (rgb > bright_value) { bright_value = rgb; a_bright_color = pairs_used; } } else { if (pairs_used >= max_pairs) { return FALSE; } if (pairs_used == 0) { send_pair(pairs_used, 1000, 1000, 1000, R, G, B); } else { send_pair(pairs_used, R, G, B, R, G, B); } } pairs_used++; if ((B += color_step) > 1000) { B = 0; if ((G += color_step) > 1000) { G = 0; if ((R += color_step) > 1000) { return TRUE; } } } } } static void reset_palette(void) { reset_colors(); init_palette(); if (set_a_foreground || set_foreground) { int n; /* * Reset the colors to a usable ANSI palette. Aside from xterm, none * of the other terminals have a way to determine what the original * colors actually were. */ for (n = 0; n < 8; ++n) { if (n < max_colors) { send_color(n, (n & 1) ? 800 : 0, (n & 2) ? 800 : 0, (n & 4) ? 800 : 0); } } } else { /* this is only a guess - revisit if we ever find a working terminal */ send_pair(0, 1000, 1000, 1000, 0, 0, 0); } } static int rainbow(int n) { /* print the programmable color display */ int i, d, palette_full, initial_pair; static const struct { const char *name; char ch; } splat[] = { { "Bg normal", ' ' }, { "Fg normal", ' ' }, { 0, 0 } }; if ((set_a_foreground || set_foreground) ? pairs_used >= max_colors : pairs_used >= max_pairs) { ptext("New palette: "); (void) wait_here(); initial_pair = pairs_used = 1; bright_value = 0; } else if (line_count + 3 >= lines) { ptext("Go: "); (void) wait_here(); put_clear(); initial_pair = pairs_used = 1; bright_value = 0; n++; } else { initial_pair = pairs_used; n += initial_pair; } palette_full = load_palette(n); for (d = 0; splat[d].name; d++) { int c = splat[d].ch; if (d == 1) { put_mode(enter_reverse_mode); } for (i = initial_pair; i < n; i++) { if (i >= pairs_used) { break; } if (set_a_foreground) { if (i >= max_colors) { break; } tc_putp(TPARM_1(set_a_foreground, i)); tc_putp(TPARM_1(set_a_background, i)); } else if (set_foreground) { if (i >= max_colors) { break; } tc_putp(TPARM_1(set_foreground, i)); tc_putp(TPARM_1(set_background, i)); } else { if (i >= max_pairs) { break; } tc_putp(TPARM_1(set_color_pair, i)); } putchp(c); } if (d == 1) { put_mode(exit_attribute_mode); } if (set_a_foreground) { tc_putp(TPARM_1(set_a_foreground, a_bright_color)); tc_putp(TPARM_1(set_a_background, 0)); } else if (set_foreground) { tc_putp(TPARM_1(set_foreground, a_bright_color)); tc_putp(TPARM_1(set_background, 0)); } else { tc_putp(TPARM_1(set_color_pair, 0)); } put_str(" "); put_str(splat[d].name); put_crlf(); } return palette_full; } static void ncv_display(int m) { /* print the no_color_video (ncv) test line */ putchp('0' + m); putchp(' '); eat_cookie(); set_attr(1 << m); sprintf(temp, "%-11s", alt_modes[m].name); put_str(temp); new_color(COLOR_BLUE, COLOR_BLACK, TRUE); put_str("blue"); new_color(COLOR_BLACK, COLOR_GREEN, TRUE); put_str("green"); new_color(COLOR_WHITE, COLOR_BLACK, TRUE); put_str(alt_modes[m].name); eat_cookie(); set_attr(0); reset_colors(); put_crlf(); } static void dump_colors(void) { /* display the colors in some esthetic pattern */ static int xmap[8] = {0, 3, 4, 7, 1, 2, 5, 6}; int xi, xj, width, p, cs; int found_one; cs = color_step <= 125 ? 125 : color_step; width = (1000 / cs) + 1; for (xi = 0; xi < 16; xi++) { int i = (xi & 8) ? xi ^ 15 : xi; R = i * cs; if (R <= 1000) { found_one = FALSE; for (xj = 0; xj < 32; xj++) { int j = ((xj & 8) ? xj ^ 15 : xj) & 7; int k = xmap[((xi >> 1) & 4) + (xj >> 3)]; G = j * cs; B = k * cs; if (G <= 1000 && B <= 1000) { p = (k * width + j) * width + i; if (set_a_background) { if (p >= max_colors) { continue; } send_color(p, R, G, B); tc_putp(TPARM_1(set_a_background, p)); } else if (set_background) { if (p >= max_colors) { continue; } send_color(p, R, G, B); tc_putp(TPARM_1(set_background, p)); } else { if (p >= max_pairs) { continue; } send_pair(p, R, G, B, R, G, B); tc_putp(TPARM_1(set_color_pair, p)); } found_one = TRUE; putchp(' '); putchp(' '); } } if (found_one) { put_crlf(); } } } } /* ** color_check(test_list, status, ch) ** ** test (colors) and (pairs) */ static void color_check( TestList * t, int *state, int *ch) { if (max_colors <= 0 && max_pairs <= 0) { ptext("This is not a color terminal; (colors) and (pairs) are missing. "); *state |= MENU_STOP; } else { sprintf(temp, "This terminal can display %d colors and %d color pairs. (colors) (pairs)", max_colors, max_pairs); ptextln(temp); } generic_done_message(t, state, ch); } /* ** color_setf(test_list, status, ch) ** ** test (setf) (setb) and (scp) */ static void color_setf( TestList * t, int *state, int *ch) { int i, j; if (max_colors <= 0 && max_pairs <= 0) { ptext("This is not a color terminal; (colors) and (pairs) are missing. "); generic_done_message(t, state, ch); *state |= MENU_STOP; return; } if ((set_a_foreground == NULL || set_a_background == NULL) && (set_foreground == NULL || set_background == NULL) && set_color_pair == NULL) { ptextln("Both set foreground (setaf/setf) and set color pair (scp) are not present."); if (!set_a_background || !set_background) { ptextln("(setab/setb) set background not present"); } ptext("These must be defined for color testing. "); generic_done_message(t, state, ch); *state |= MENU_STOP; return; } /* initialize the color palette */ pairs_used = max_colors >= 8 ? 8 : max_colors; reset_colors(); new_color(COLOR_WHITE, COLOR_BLACK, FALSE); ptextln("(setf) (setb) (scp) The following colors are predefined:"); ptextln("\n Foreground Background"); put_crlf(); j = max_colors > 8 ? 8 : max_colors; /* * the black on white test is the same as the white on black test. */ for (i = 1; i < j; i++) { putchp('0' + def_colors[i].index); putchp(' '); sprintf(temp, " %s ", def_colors[i].name); new_color(def_colors[i].index, COLOR_BLACK, TRUE); put_str(temp); new_color(COLOR_BLACK, COLOR_BLACK, TRUE); put_str(" "); new_color(COLOR_BLACK, def_colors[i].index, TRUE); put_str(temp); new_color(COLOR_WHITE, COLOR_BLACK, FALSE); put_crlf(); } reset_colors(); put_crlf(); generic_done_message(t, state, ch); } /* ** color_matrix(test_list, status, ch) ** ** test (pairs) (op) */ static void color_matrix( TestList * t, int *state, int *ch) { int i, j, matrix_size, matrix_area, brightness; matrix_size = max_colors > 8 ? 8 : max_colors; sprintf(temp, "(pairs) There are %d color pairs.", max_pairs); ptextln(temp); for (; matrix_size; matrix_size--) { if (matrix_size * matrix_size <= max_pairs) { break; } } if (max_colors <= 0 || matrix_size <= 0) return; matrix_area = matrix_size * matrix_size; for (brightness = 0; brightness < 2; brightness++) { put_crlf(); sprintf(temp, "%dx%d matrix of foreground/background colors, bright *o%s*", matrix_size, matrix_size, brightness ? "n" : "ff"); put_str(temp); put_str("\n "); for (i = 0; i < matrix_size; i++) { (void) sprintf(temp, "%-8s", def_colors[i].name); put_str(temp); } for (j = 0; j < matrix_area; j++) { if (j % matrix_size == 0) { reset_colors(); put_crlf(); if (brightness) { tc_putp(exit_attribute_mode); } (void) sprintf(temp, "%-8s", def_colors[j / matrix_size].name); put_str(temp); if (brightness) { put_mode(enter_bold_mode); } } new_color(def_colors[j % matrix_size].index, def_colors[j / matrix_size].index, FALSE); put_str(" Hello "); } reset_colors(); if (brightness) { tc_putp(exit_attribute_mode); } put_crlf(); } generic_done_message(t, state, ch); } /* ** color_ncv(test_list, status, ch) ** ** test (ncv) */ static void color_ncv( TestList * t, int *state, int *ch) { int i; sprintf(temp, "According to no_color_video (ncv) which is %d, the following attributes should work correctly with color.", no_color_video); ptextln(temp); put_crlf(); set_attr(0); ncv_display(0); for (i = 1; i <= 9; i++) { if (no_color_video < 0 || ((no_color_video >> (mode_map[i] - 1)) & 1) == 0) { ncv_display(mode_map[i]); } } if (no_color_video > 0 && (no_color_video & 0x3ff) != 0) { ptextln("\nThe following attributes should not work correctly with color. (ncv)\n"); for (i = 1; i <= 9; i++) { if ((no_color_video >> (mode_map[i] - 1)) & 1) { ncv_display(mode_map[i]); } } } reset_colors(); put_crlf(); generic_done_message(t, state, ch); } /* ** color_bce(test_list, status, ch) ** ** test (bce) background color erase */ static void color_bce( TestList * t, int *state, int *ch) { new_color(COLOR_CYAN, COLOR_BLUE, FALSE); put_clear(); put_newlines(2); reset_colors(); ptextln("If the two lines above are blue then back_color_erase (bce) should be true."); sprintf(temp, "(bce) is %s in the data base.", (back_color_erase ? "true" : "false")); ptextln(temp); generic_done_message(t, state, ch); } /* ** color_ccc(test_list, status, ch) ** ** test (ccc) color palette test (oc) (op) (initc) (initp) */ static void color_ccc( TestList * t, int *state, int *ch) { int i, j; if (!can_change) { ptextln("Terminal can not change colors (ccc)"); generic_done_message(t, state, ch); return; } reset_colors(); pairs_used = 0; new_color(COLOR_WHITE, COLOR_BLACK, FALSE); sprintf(temp, "Reloading colors (init%c) using %s method", set_foreground ? 'c' : 'p', hue_lightness_saturation ? "HLS" : "RGB"); ptextln(temp); put_crlf(); j = max_colors > 7 ? 7 : max_colors; /* redisplay the above test with reinitialized colors */ /* If these colors don't look right to you... */ for (i = 0; i < j; i++) { sprintf(temp, " %s ", def_colors[i ^ 7].name); new_color(i ^ 7, COLOR_BLACK, TRUE); put_str(temp); new_color(COLOR_BLACK, COLOR_BLACK, TRUE); put_str(" "); new_color(COLOR_BLACK, i ^ 7, TRUE); put_str(temp); new_color(COLOR_WHITE, COLOR_BLACK, FALSE); put_crlf(); } generic_done_message(t, state, ch); if (*ch != 0 && *ch != 'n') { reset_palette(); return; } init_palette(); if (magic_cookie_glitch > 0) { cookie_monster = ((set_a_foreground || set_foreground) ? magic_cookie_glitch : 0) + ((set_a_background || set_background) ? magic_cookie_glitch : 0) + (set_color_pair ? magic_cookie_glitch : 0); } set_color_step(); colors_per_line = ((max_colors > max_pairs) ? max_pairs : max_colors); j = (columns - 14) / (cookie_monster + 1); if (i == 0) { colors_per_line = 0; } else if (colors_per_line > j) { colors_per_line = (j / i) * i; } sprintf(temp, "RGB color step %d, cookies %d", color_step, cookie_monster); ptextln(temp); for (;;) { if (rainbow(colors_per_line)) { break; } } generic_done_message(t, state, ch); if (*ch != 0 && *ch != 'n') { reset_palette(); return; } dump_colors(); reset_palette(); generic_done_message(t, state, ch); } tack-1.09-20230201/README0000644000000000000000000000220413135221120012616 0ustar rootroot-- $Id: README,v 1.4 2017/07/23 22:25:20 tom Exp $ The 'tack' program is a diagnostic that is designed to create and verify the correctness of terminfo's. This program can be used to create new terminal descriptions that are not included in the standard release. Although 'tack' has been distributed with ncurses, it is not an integral part of ncurses. It may be removed from the release without limiting the usefulness of ncurses on those terminals described in the terminfo data base. The best way to remove 'tack' from the build is to delete or rename the 'tack' directory before running the configure script. Starting with ncurses 5.6 patch 20070113, this program can be built outside the ncurses source-tree, provided that ncurses is configured using the "--with-ticlib" option. That makes available the private interfaces used by tack, and eliminates the need to distribute tack as an optional part of ncurses. In July 2017, the issue of tic library dependencies was revisited. It is no longer necessary to specially configure ncurses to provide for building tack. Unlike ncurses, the 'tack' program is covered under the GNU Public License. tack-1.09-20230201/modules0000644000000000000000000000674513615560366013374 0ustar rootroot# $Id: modules,v 1.9 2020/02/02 14:47:18 tom Exp $ ############################################################################## # Copyright 2020 Thomas E. Dickey # # Copyright 1997-2006,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # # to deal in the Software without restriction, including without limitation # # the rights to use, copy, modify, merge, publish, distribute, distribute # # with modifications, sublicense, and/or sell copies of the Software, and to # # permit persons to whom the Software is furnished to do so, subject to the # # following conditions: # # # # The above copyright notice and this permission notice shall be included in # # all copies or substantial portions of the Software. # # # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # # DEALINGS IN THE SOFTWARE. # # # # Except as contained in this notice, the name(s) of the above copyright # # holders shall not be used in advertising or otherwise to promote the sale, # # use or other dealings in this Software without prior written # # authorization. # ############################################################################## # # Author: Thomas E. Dickey 1997-on # @ base ansi progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h charset progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h color progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h control progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h crum progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h edit progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h fun progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h init progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h menu progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h modes progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h output progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h pad progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h scan progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h sync progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h sysdep progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h tackgen progs $(srcdir) $(srcdir)/tack.h ../include/term.h tack progs $(srcdir) $(srcdir)/tack.h ../include/term.h tackgen.h # vile:makemode tack-1.09-20230201/CHANGES0000644000000000000000000021034014366605123012753 0ustar rootroot2023-02-01 Thomas E. Dickey * configure: regen * configure.in: initialize $ac_includes_default s/fgrep/$FGREP/ * aclocal.m4: resync with my-autoconf * package/debian/changelog, package/tack.spec, tack.h: bump 2022-12-29 Thomas E. Dickey * package/tack.spec: rpmlint fixes * package/tack.spec, package/debian/watch: update url * package/debian/compat, package/debian/control, package/debian/changelog, package/tack.spec, tack.h: bump 2022-12-02 Thomas E. Dickey * configure: regen * aclocal.m4: resync with my-autoconf 2022-08-01 Thomas E. Dickey * config.guess, config.sub: update to 2022-08-01 2022-05-28 Thomas E. Dickey * fun.c: gcc warning * configure: regen * aclocal.m4: add CF_APPEND_CFLAGS and CF_REMOVE_CFLAGS * tack.h: bump * aclocal.m4: resync with my-autoconf: CF_ADD_INCDIR CF_DISABLE_ECHO.log CF_MAKEFLAGS CF_NCURSES_LIBS CF_PKG_CONFIG fix errata in comments CF_FIX_WARNINGS package-fix for cdk-perl: suppress the fixup for -Werror=format, e.g., -Werror=format-security CF_NCURSES_CONFIG CF_TRY_XOPEN_SOURCE CF_XOPEN_SOURCE filter out redefinition, e.g., changing _XOPEN_SOURCE from 500 to 600 CF_XOPEN_SOURCE modify special-case for OpenBSD 6 (and up) to work around one of the places where the compile-time environment is broken. This was reported before OpenBSD 6.7: https://www.mail-archive.com/bugs@openbsd.org/msg13200.html but the ensuring discussion elicited no action. * package/debian/changelog, package/tack.spec, tack.h: bump 2022-05-08 Thomas E. Dickey * config.guess: 2022-05-08 From: Bruno Haible config.guess (x86_64:Linux:*:*): Detect 32-bit ABI. * config.guess (x86_64:Linux:*:*): Test for the 32-bit ABI. Don't assume that __ILP32__ is a certain indicator for the x32 ABI; for GCC ≥ 9 it no longer is. * doc/config.guess.1: Regenerate. 2022-01-09 Thomas E. Dickey * config.guess: 2022-01-09 From: Idan Horowitz config.guess: recognize SerenityOS * config.guess (*:SerenityOS:*:*): Recognize. (timestamp): Update. * doc/config.guess.1: Regenerate. * testsuite/config-guess.data: Add test case for SerenityOS. Signed-off-by: Dmitry V. Levin 2022-01-03 Thomas E. Dickey * config.guess, config.sub: 2022-01-03 From: Bernhard Voelker Fix GPLv3 license headers to use a comma instead of semicolon See: https://www.gnu.org/licenses/gpl-3.0.html#howto Update license headers automatically using the following script: $ git grep -l 'Foundation; either version 3' \ | xargs sed -i '/Foundation; either version 3/ s/n; e/n, e/' * config.guess: Adjust via the above command. (timestamp): Update. * config.sub: Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. Signed-off-by: Dmitry V. Levin 2022-01-01 Thomas E. Dickey * config.guess, config.sub: 2022-01-01 From: Dmitry V. Levin Update copyright years * config.guess: Update copyright years. * config.sub: Likewise. * testsuite/config-guess.sh: Likewise. * testsuite/config-sub.sh: Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. 2021-12-25 Thomas E. Dickey * config.sub: 2021-12-25 From: Dmitry V. Levin config.sub: alias armh to armv7l ALT uses armh as an alias for armv7l-alt-linux-gnueabihf since 2012. * config.sub (armh-unknown|armh-alt): Set cpu, vendor, and basic_os. (timestamp): Update. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data (armh, armh-alt-linux-gnueabihf): New tests. 2021-12-24 Thomas E. Dickey * config.sub: 2021-12-24 From: Dmitry V. Levin config.sub: alias aarch64le to aarch64 Apparently, QNX reports aarch64 as aarch64le on little-endian machines. * config.sub (aarch64le-*): Set cpu to aarch64. (timestamp): Update. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data (aarch64le-qnx): New test. Reported-by: Elad Lahav Link: https://lists.gnu.org/archive/html/config-patches/2021-12/msg00009.html 2021-12-13 Thomas E. Dickey * config.sub: 2021-10-27 From: Dmitry V. Levin config.sub: fix typo in timestamp * config.sub: Fix timestamp. * doc/config.sub.1: Regenerate. Reported-by: Jordi Sanfeliu Fixes: a013aac61edfa2a03727521508286480010e7bf3 Signed-off-by: Dmitry V. Levin 2021-11-30 Thomas E. Dickey * config.guess: 2021-11-30 From: Andreas F. Borchert config.guess: x86_64-pc-solaris2.11 is not properly recognized config.guess guesses Solaris 11 to run on a 32-bit platform despite Solaris 11 no longer supporting any 32-bit platform. See the following code at lines 434 to 445: | 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 -E - 2>/dev/null) | \ | grep IS_64BIT_ARCH >/dev/null | then | SUN_ARCH=x86_64 | fi | fi If "cc" is installed, i.e. the Oracle Studio compiler, this one is chosen for $CC_FOR_BUILD. This compiler, the gcc provided by Oracle and also gcc bootstrapped from sources on that platform with a default configuration will by default generate 32-bit binaries -- even on a 64-bit platform. And __amd64 will not be defined for compilations targeting a 32-bit platform. This is different from the corresponding behaviour on GNU/Linux systems where the local platform is targeted by default. Thus, as long as you do not add "-m64" or if you have a custom-built gcc which defaults to 64 bit, you will get 32-bit binaries on Solaris despite living on a 64-bit platform. * config.guess (i86pc:SunOS:5.*:* || i86xen:SunOS:5.*:*): Adapt the test by adding the "-m64" flag. This will work properly for Solaris 10 as well (the last Solaris release that supported x86 32-bit platforms). * doc/config.guess.1: Regenerate. Signed-off-by: Dmitry V. Levin 2021-10-27 Thomas E. Dickey * config.guess: 2021-10-27 From: Jordi Sanfeliu Recognize Fiwix $ make check cd testsuite && bash config-guess.sh && rm uname PASS: config.guess checks (137 tests) cd testsuite && bash config-sub.sh PASS: config.sub checks (882 tests) PASS: config.sub idempotency checks (819 tests) PASS: config.sub canonicalise each config.guess testcase (137 tests) * config.guess (i*86:Fiwix:*:*): Recognize. * config.sub (fiwix*): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add a test case for Fiwix. * testsuite/config-sub.data (i386-fiwix): New test. Signed-off-by: Dmitry V. Levin * config.sub: 2021-20-27 From: Jordi Sanfeliu Recognize Fiwix $ make check cd testsuite && bash config-guess.sh && rm uname PASS: config.guess checks (137 tests) cd testsuite && bash config-sub.sh PASS: config.sub checks (882 tests) PASS: config.sub idempotency checks (819 tests) PASS: config.sub canonicalise each config.guess testcase (137 tests) * config.guess (i*86:Fiwix:*:*): Recognize. * config.sub (fiwix*): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add a test case for Fiwix. * testsuite/config-sub.data (i386-fiwix): New test. Signed-off-by: Dmitry V. Levin 2021-10-18 Thomas E. Dickey * config.sub: 2021-08-14 From: Kinshuk Dua config.sub: Fix typo in comment Fixes: 5e531d391852a54e7fab2d8ff55625fca514b305 Signed-off-by: Dmitry V. Levin 2021-08-14 Thomas E. Dickey * config.sub: 2021-08-14 From: Nick Bowler config.sub: work around command assignment bug in some shells When combining variable assignments with a shell command, some older shells (notably heirloom-sh and presumably also Solaris 10 /bin/sh) have a bug which causes the assignment to alter the current execution environment whenever the command is a shell built-in. For example: % dash -c 'x=good; x=bad echo >/dev/null; echo $x' good % jsh -c 'x=good; x=bad echo >/dev/null; echo $x' bad The config.sub script contains a few commands of the form: IFS=- read ... which triggers this bug, causing the IFS assignment to persist for the remainder of the script. This can cause misbehaviour in certain cases, for example: % jsh config.sub i386-linux-gnu config.sub: test: unknown operator gnu % jsh config.sub i386-gnu/linux sed: can't read s|gnu/linux|gnu|: No such file or directory Invalid configuration `i386-gnu/linux': OS `' not recognized * config.sub: Save and restore IFS explicitly to avoid shell bugs. * doc/config.sub.1: Regenerate. Signed-off-by: Dmitry V. Levin 2021-08-04 Thomas E. Dickey * config.sub: 2021-08-04 From: Jeremy Soller config.sub: add Linux Relibc Target $ make check cd testsuite && bash config-guess.sh && rm uname PASS: config.guess checks (136 tests) cd testsuite && bash config-sub.sh PASS: config.sub checks (881 tests) PASS: config.sub idempotency checks (818 tests) PASS: config.sub canonicalise each config.guess testcase (136 tests) * config.sub (relibc*): Recognize. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data (x86_64-linux-relibc): New test. Signed-off-by: Dmitry V. Levin 2021-07-06 Thomas E. Dickey * config.sub: 2021-07-06 From: Stephanos Ioannidis config.sub: add Zephyr RTOS support This adds the Zephyr RTOS targets in preparation for implementing the Zephyr RTOS-specific toolchain support. $ make check cd testsuite && bash config-guess.sh && rm uname PASS: config.guess checks (136 tests) cd testsuite && bash config-sub.sh PASS: config.sub checks (880 tests) PASS: config.sub idempotency checks (817 tests) PASS: config.sub canonicalise each config.guess testcase (136 tests) * config.sub (zephyr*): Recognize. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data: Add testcases for *-zephyr. Signed-off-by: Stephanos Ioannidis Signed-off-by: Dmitry V. Levin 2021-07-03 Thomas E. Dickey * config.sub: 2021-07-03 From: Ozkan Sezer config.sub: disable shellcheck SC2006 / SC2268 warnings This is in line with the recent config.guess change in commit 12fcf67c9108f4c4b581eaa302088782f0ee40ea * config.sub (shellcheck disable): Add SC2006,SC2268. Suggested-by: Jacob Bachmeyer Signed-off-by: Ozkan Sezer Signed-off-by: Dmitry V. Levin * config.sub: 2021-07-03 From: Ozkan Sezer config.sub: normalize the quoting in the `echo FOO | sed ...` Some cases quote the argument to echo and some do not. At runtime it probably does not matter because the substituted values will never contain whitespace, but quoting them all would make shellcheck more useful. * config.sub: Consistently quote the argument of echo. * doc/config.sub.1: Regenerate. Suggested-by: Jacob Bachmeyer Signed-off-by: Ozkan Sezer Signed-off-by: Dmitry V. Levin 2021-07-02 Thomas E. Dickey * config.sub: 2021-06-03 From: Ozkan Sezer config.sub: replace POSIX $( ) with classic ` ` throughout This is in line with the recent config.guess change in commit d70c4fa934de164178054c3a60aaa0024ed07c91. The patch was generated using patch-6.gawk script introduced in that commit. * config.sub: Revert POSIX command substitutions to classic form. Signed-off-by: Ozkan Sezer Signed-off-by: Dmitry V. Levin 2021-06-19 Thomas E. Dickey * Makefile.in: update copyright * sysdep.c: scan-build warning about unused assignment * Makefile.in: adjust rules to work with --program-suffix * configure: regen * configure.in: add AC_ARG_PROGRAM to get --program-suffix, etc. * configure: regen * aclocal.m4: resync with my-autoconf * package/debian/changelog, package/tack.spec, tack.h: bump 2021-06-04 Thomas E. Dickey * config.guess: 2021-06-03 From: Vineet Gupta Recognize arc32 This is the 32-bit variant of ARCv3 ISA (which is not compatible with the 32-bit ARCv2 ISA) | make check | cd testsuite && bash config-guess.sh && rm uname | PASS: config.guess checks (136 tests) | cd testsuite && bash config-sub.sh | PASS: config.sub checks (864 tests) | PASS: config.sub idempotency checks (801 tests) | PASS: config.sub canonicalise each config.guess testcase (136 tests) * config.guess (arc32:Linux:*:*): Recognize. * config.sub (arc32): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add a test case for arc32. * testsuite/config-sub.data (arc32, arc*-elf): Add test cases. Signed-off-by: Vineet Gupta Signed-off-by: Dmitry V. Levin * config.sub: 2021-06-03 (repaired) From: Vineet Gupta Recognize arc32 This is the 32-bit variant of ARCv3 ISA (which is not compatible with the 32-bit ARCv2 ISA) | make check | cd testsuite && bash config-guess.sh && rm uname | PASS: config.guess checks (136 tests) | cd testsuite && bash config-sub.sh | PASS: config.sub checks (864 tests) | PASS: config.sub idempotency checks (801 tests) | PASS: config.sub canonicalise each config.guess testcase (136 tests) * config.guess (arc32:Linux:*:*): Recognize. * config.sub (arc32): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add a test case for arc32. * testsuite/config-sub.data (arc32, arc*-elf): Add test cases. Signed-off-by: Vineet Gupta Signed-off-by: Dmitry V. Levin 2021-05-26 Thomas E. Dickey * config.guess: 2021-05-24 From: Jacob Bachmeyer config.guess: manual fixups after previous automatic patch The tool could not handle command substitutions that span lines, but fortunately there were only two such substitutions in the script. The test for which universe is active on Pyramid is rewritten into a case block because it was the only use of a command substitution as an argument to the test command, which would require quoting. * config.guess: Rewrite "if" for Pyramid systems to "case". * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: replace POSIX $( ) with classic ` ` throughout The previous replacement of backticks with POSIX command substitutions was ill-considered and illogical: this script recognizes many archaic machine types that probably never had POSIX shells, therefore it needs to be able to run successfully under pre-POSIX shells. This patch was generated using the included GNU Awk program. * config.guess: Revert POSIX command substitutions to classic form. * patch-6.gawk: Store the tool that produced the automated patch. 2021-05-25 Thomas E. Dickey * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: manual fixup after previous automated patches This patch provides the special handling for the GNU system. As these were two small and unique edits, they were not included in the scripts. This patch also cleans up other minor issues that must be addressed before reverting to classic command substitutions and updates "shellcheck" directives to account for changes in this script and the change in "shellcheck" towards reporting individual portability issues. * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: automatic fixups after previous automated patch This patch was generated using the following command: sed -i config.guess \ -e '/="[^"]\+"\(-\|$\)/s/="\([^"([:space:])]\+\)"/=\1/' \ -e '/="[^"]\+"[[:alnum:]]/s/="\$\([^([:space:])]\+\)"/=${\1}/' \ -e \ '/\$(echo[^|]\+|/s/\([^[:space:]]\)[[:space:]]*|[[:space:]]*sed/\1 | sed/g' * config.guess: Remove unneeded quotes in other variable assignments, standardize spacing for "echo ... | sed" substitutions. * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: remove unneeded quotes and factor command substitutions This is further cleanup and simplifies some constructs that can confuse Emacs' syntax highlighting while generally reducing required quoting. This patch was generated using the included GNU Awk program. * config.guess: Remove unneeded variable quotes and factor out command substitutions when setting GUESS. * patch-3.gawk: Store the tool that produced the automated patch. * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: manual fixups after previous automatic patch * config.guess: Adjust a few "leftover" cases that the tool could not easily recognize and fixes comment indentation in a few other special cases. * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: introduce intermediate variable with uname results This will allow quoting to be significantly simplified in another pass through the file. * config.guess: Introduce GUESS variable to hold results of uname analysis. * config.guess: 2021-05-24 (repaired) From: Jacob Bachmeyer config.guess: use intermediate variable with uname results This will allow quoting to be significantly simplified in another pass through the file. This patch was generated using the included GNU Awk program. * config.guess: Use GUESS variable to hold results of uname analysis. * patch-1.gawk: Store the tool that produced the automated patch. 2021-05-24 Thomas E. Dickey * config.guess: 2021-05-24 (repaired) From: Dmitry V. Levin config.guess: fix shellcheck warning SC2154 While, according to Plan 9 documentation, the environment variable $cputype is set to the name of the kernel's CPU's architecture, shellcheck warns that cputype is referenced but not assigned. Be on the safe side and do not use cputype if it is not defined or empty. * config.guess (*:Plan9:*:*): Fix shellcheck warning SC2154. * config.guess: 2021-05-24 (repaired) From: Dmitry V. Levin config.guess: remove redundant quotes in case commands According to the GNU Autoconf Portable Shell Programming manual, the Bourne shell does not systematically split variables and back-quoted expressions, in particular on the right-hand side of assignments and in the argument of 'case'. The change is made automatically using the following command: $ sed -E -i 's/(\)/\1\2\3/' config.guess * config.guess: Simplify case commands by removing quotes around the argument. Suggested-by: Jacob Bachmeyer * config.guess: 2021-05-24 (repaired) From: Dmitry V. Levin config.guess: simplify exit status workaround on alphaev67-dec-osf5.1 Commit 29865ea8a5622cdd80b7a69a0afa78004b4cd311 introduced an exit trap reset before exiting to avoid a spurious non-zero exit status on alphaev67-dec-osf5.1. Simplify that code a bit by moving the exit trap reset around. * config.guess (alpha:OSF1:*:*): Reset exit trap earlier. * doc/config.guess.1: Regenerate. 2021-04-30 Thomas E. Dickey * config.sub: 2021-04-30 (repaired) From: Maciej W. Rozycki config.sub: Handle MIPS R3 and R5 ISA levels with CPU names Complement binutils commit ae52f4830604 ("Add MIPS r3 and r5 support.") and recognize MIPS CPU patterns for the R3 and R5 ISA levels, used by GAS to set defaults. * config.sub (mipsisa32r3, mipsisa32r3el, mipsisa32r5, mipsisa32r5el, mipsisa64r3, mipsisa64r3el, mipsisa64r5, mipsisa64r5el): Recognize. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data: Add test cases. Signed-off-by: Dmitry V. Levin 2021-04-29 Thomas E. Dickey * fun.c: rewrite the meta-key test to show the input character in readable form (from unctrl) in addition to hex. also, make a second pass with the meta-mode turned off. * package/debian/changelog, package/tack.spec, tack.h: bump 2021-04-21 Thomas E. Dickey * config.guess, config.sub: 2021-04-21 (repaired) From: Vineet Gupta Recognize arc64 This paves way for setting up arc64 software ecosystem. $ make check cd testsuite && bash config-guess.sh && rm uname PASS: config.guess checks (136 tests) cd testsuite && bash config-sub.sh PASS: config.sub checks (853 tests) PASS: config.sub idempotency checks (790 tests) PASS: config.sub canonicalise each config.guess testcase (136 tests) * config.guess (arc64:Linux:*:*): Recognize. * config.sub (arc64): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add a test case for arc64. * testsuite/config-sub.data (arc64, arc*-elf): Add test cases. Signed-off-by: Vineet Gupta Signed-off-by: Dmitry V. Levin 2021-04-16 Thomas E. Dickey * config.guess: 2021-04-16 (repaired) From: Purple Rain config.guess: add SecBSD support * config.guess (*:SecBSD:*:*): Recognize. * doc/config.guess.1: Regenerate. * testsuite/config-guess.data: Add a test case. Signed-off-by: Dmitry V. Levin * config.sub: 2021-04-16 (repaired) From: Purple Rain config.sub: add SecBSD support * config.sub (secbsd*): Recognize. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data: Add x86_64-secbsd. Signed-off-by: Dmitry V. Levin 2021-04-03 Thomas E. Dickey * configure: regen * aclocal.m4: resync with my-autoconf 2021-03-24 Thomas E. Dickey * configure: regen * configure.in: minor fixes, per shellcheck * package/debian/changelog, package/tack.spec, tack.h: bump * tack.h: updates to work with _Noreturn changes in ncurses 2021-03-22 Thomas E. Dickey * configure: regen * aclocal.m4: resync with my-autoconf 2021-03-10 Thomas E. Dickey * config.sub: 2021-03-10 (repaired) From: Idan Horo config.sub: Add support for SerenityOS * config.sub (serenity*): Recognize. * doc/config.sub.1: Regenerate. * testsuite/config-sub.data: Add i386-serenity. Signed-off-by: Dmitry V. Levin 2021-01-25 Thomas E. Dickey * config.guess: 2021-01-25 (repaired) From: Kalamatee config.guess: update AROS system detection * config.guess: Recognize *:AROS:*:*. * doc/config.guess.1: Regenerate. * testsuite/config-guess.data: Add test cases. Signed-off-by: Dmitry V. Levin 2021-01-19 Thomas E. Dickey * config.guess: 2021-01-19 (repaired) From: M. Levinson config.guess: fix shell variable quoting bug * config.guess (*:NetBSD:*:*): Spell out the full sysctl command twice instead of using a shell variable. * doc/config.guess.1: Regenerate. Fixes: 827c77253b396c07306927b2a4b794a3251c48eb Signed-off-by: Dmitry V. Levin 2021-01-07 Thomas E. Dickey * config.sub: 2021-01-08 (repaired) From: Peixing Xin config.sub: recognize four-part configuration name for VxWorks For example: armv7m-wrs-vxworks-eabihf armv7-wrs-vxworks-eabihf i686-wrs-vxworks-simlinux i686-wrs-vxworks-simwindows powerpc-wrs-vxworks-spe x86_64-wrs-vxworks-simlinux x86_64-wrs-vxworks-simwindows * config.sub: Recognize four-part configuration name for VxWorks. * doc/config.guess.1: Regenerate. * testsuite/config-sub.data: Add test cases. Co-authored-by: John Ericson Signed-off-by: Dmitry V. Levin 2021-01-06 Thomas E. Dickey * config.sub: 2021-01-07 (repaired) From: Alan Modra config.sub: accept OS of eabi* and gnueabi* Commit 5e531d391852 broke powerpc-eabivle: $ ./config.sub powerpc-eabivle Invalid configuration `powerpc-eabivle': OS `eabivle' not recognized Also powerpc-eabisim and probably some arm configurations. * config.sub: Accept OS of eabi* and gnueabi*. * testsuite/config-sub.data: Add powerpc-eabisim and powerpc-eabivle. Signed-off-by: Dmitry V. Levin 2021-01-01 Thomas E. Dickey * config.guess, config.sub: 2021-01-01 (repaired) From: Dmitry V. Levin Update copyright years * config.guess: Update copyright years. * config.sub: Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. 2020-12-31 Thomas E. Dickey * config.guess, config.sub: 2020-12-31 (repaired) From: Kito Cheng Recognize riscv32be and riscv64be Recently RISC-V community got patches big-endian support for binutils, and we'd like to accept that, however before accepting that I think it would be better to upstream config.sub and config.guess change here :) It's my check result on Ubuntu 18.04: $ make check cd testsuite && bash config-guess.sh && rm uname PASS: config.guess checks (131 tests) cd testsuite && bash config-sub.sh PASS: config.sub checks (830 tests) PASS: config.sub idempotency checks (767 tests) PASS: config.sub canonicalise each config.guess testcase (131 tests) * config.guess (riscv32be:Linux:*:*, riscv64be:Linux:*:*): Recognize. * config.sub (riscv32be, riscv64be): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add test cases for riscv32be, and riscv64be. * testsuite/config-sub.data (riscv32be, riscv64be): Add test cases. Signed-off-by: Dmitry V. Levin 2020-12-03 Thomas E. Dickey * config.guess, config.sub: 2020-12-22 (repaired) From: Xiaotian Wu Recognize loongarch32, loongarch64, and loongarchx32 * config.guess (loongarch32:Linux:*:*, loongarch64:Linux:*:*, loongarchx32:Linux:*:*): Recognize. * config.sub (loongarch32, loongarch64, loongarchx32): Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. * testsuite/config-guess.data: Add test cases for loongarch32, loongarch64, and loongarchx32. * testsuite/config-sub.data (loongarch32, loongarch64, loongarchx32): Add test cases. Signed-off-by: Dmitry V. Levin 2020-12-01 Thomas E. Dickey * config.sub: 2020-12-02 (repaired) From: Dmitry V. Levin config.sub: recognize thumbv7* * config.sub (thumbv7*): Recognize. * testsuite/config-sub.data (thumbv7): New test. Reported-by: Karl Berry Link: https://lists.gnu.org/archive/html/config-patches/2020-12/msg00001.html 2020-11-30 Thomas E. Dickey * install-sh: update to 2020-11-14 2020-11-28 Thomas E. Dickey * tack.h, pad.c: improve interaction in padding tests by ensuring a time-delay happens for the cases where the terminal itself has no delays * configure: regen * tackgen.c: fix a memory-leak * tack.c: prefer exit_terminfo to _nc_free_tinfo * configure.in: add check for exit_terminfo * configure: regen * aclocal.m4: resync with my-autoconf * package/debian/changelog, package/tack.spec, tack.h: bump 2020-11-21 Thomas E. Dickey * tack.1: cleanup using check-manpage * configure: regen * aclocal.m4: resync with my-autoconf * configure.in: suppress checks for X * package/debian/changelog, package/tack.spec, tack.h: bump 2020-11-19 Thomas E. Dickey * config.guess, config.sub: 2020-11-17 (repaired) From: Dmitry V. Levin .gitattributes: specify a custom git merge driver for the ChangeLog file * config.guess, config.sub: 2020-11-19 (repaired) From: Dmitry V. Levin Update URLs of the latest version of config.guess and config.sub scripts Prefer cgit URLs over gitweb as the former are usually served faster: $ time -f %e wget -q 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess' 1.06 $ time -f %e wget -q 'https://git.savannah.gnu.org/cgit/config.git/plain/config.guess' 0.73 * config.guess: Prefer cgit URLs over gitweb. (timestamp): Update. * config.sub: Likewise. * doc/config.guess.1: Regenerate. * doc/config.sub.1: Likewise. 2020-11-06 Thomas E. Dickey * config.guess, config.sub: 2020-11-07 (repaired) From: Ben Elliston Update timestamps. * config.sub: 2020-10-13 (repaired) From: Ben Elliston * config.sub, config.guess: Replace backtick `..` substitutions with POSIX $(..) command substitutions throughout. * Makefile (shellcheck): Don't exclude message SC2006. * config.guess: 2020-10-22 (repaired) From: Ben Elliston * config.sub, config.guess: Replace backtick `..` substitutions with POSIX $(..) command substitutions throughout. * Makefile (shellcheck): Don't exclude message SC2006. 2020-10-21 Thomas E. Dickey * config.guess: 2020-10-22 From: Rin Okuyama * config.guess (*:NetBSD:*:*): Handle aarch64eb. * testsuite/config-guess.data: Add test cases. Signed-off-by: Ben Elliston 2020-10-14 Thomas E. Dickey * config.sub: 2020-10-13 From: Ben Elliston Fix whitespace problem in config.sub. 2020-10-13 Thomas E. Dickey * config.sub: 2020-10-13 From: Ben Elliston * config.sub (i*86-pc-os2-emx): Recognise correctly. * testsuite/config-sub.data: Add OS/2 tests to avoid regressions. 2020-09-26 Thomas E. Dickey * config.sub: 2020-09-08 From: Fabrice Fontaine * config.sub (uclinux-uclibc*): Fix detection. * testsuite/config-sub.data: Add a test case to avoid regression. Signed-off-by: Ben Elliston 2020-09-20 Thomas E. Dickey * config.guess: 2020-09-19 From: Bruno Haible * config.guess: Don't use 'ldd --version' to determine the presence of musl libc, as this fails on Alpine Linux 3.10. Signed-off-by: Ben Elliston 2020-09-07 Thomas E. Dickey * config.sub: 2020-09-08 From: Elad Lahav * config.sub: Fix regression in QNX recognition. * testsuite/config-sub.data: Add some test cases. Signed-off-by: Ben Elliston 2020-08-16 Thomas E. Dickey * config.guess, config.sub: 2020-08-17 From: Issam E. Maghni * config.guess: Replace "if [ EXPR ]" with "if test EXPR". * config.sub: Likewise. * testsuite/config-guess.sh: Likewise. * testsuite/config-sub.sh: Likewise. Signed-off-by: Ben Elliston 2020-07-12 Thomas E. Dickey * config.guess: 2020-07-12 From: Ben Elliston * config.guess (arm64:Darwin:*:*): Recognise. * testsuite/config-guess.data: Add a test case. 2020-07-10 Thomas E. Dickey * config.sub: 2020-07-10 From: Ben Elliston * config.sub (case $cpu): Whitespace fix. * config.sub: 2020-06-28 From: Keno Fischer * config.sub (arm64-*): Canonicalise to aarch64-*. Signed-off-by: Ben Elliston 2020-06-28 Thomas E. Dickey * config.sub: 2020/06/28 2020-06-14 Thomas E. Dickey * config.guess: 2020/04/26 2020-02-20 Thomas E. Dickey * sysdep.c: gcc-warning * sysdep.c: two changes to allow most tests to work with mintty in Cygwin and MSYS2 (the meta-mode test is one case that does not work): a) change the VTIME value in tty_set() to 0, since interbyte timing does not work at all. Without this fix, getchar() returns immediately without error, whether or not data is available. b) in read_key(), do not exit from the loop as long as read() returns -1 (error). Without this fix, read_key() returns ^@'s (nulls) in the function-key test. These changes do not seem to break existing tests on other platforms, e.g., Unix (AIX, HPUX, Solaris). * tack.c: fix gcc warning for non-ncurses configuration * package/debian/changelog, package/tack.spec, tack.h: bump * init.c: zero-out the debug/log-pointers after closing them 2020-02-17 Thomas E. Dickey * tack.1: add -d option, for debug.log * output.c: use debug.log to record putp's and tput's which hint at the testing done * sysdep.c: use debug.log to record when the tty is set/reset * tack.h: split-out log_chr and log_str * tack.c: add -d option, for debug.log 2020-02-16 Thomas E. Dickey * tack.1, tack.c, tack.h: add -l option * tack.c: eliminate a confusing comparison for the logging-menu-entry state by using #define'd strings for that and the hex-output menu. 2020-02-14 Thomas E. Dickey * tack.c: use getopt * fun.c, crum.c, edit.c: fix coverity warning about copying into fixed-size buffer * tack.c: do a sanity-check on $TERM 2020-02-08 Thomas E. Dickey * package/debian/changelog, package/tack.spec, tack.h: bump * aclocal.m4: resync with my-autoconf * configure: regen * aclocal.m4: split-out CF__CURSES_DATA to simplify ifdef's 2020-02-07 Thomas E. Dickey * configure: regen * aclocal.m4: workaround for Cygwin broken-linker 2020-02-02 Thomas E. Dickey * tack.c: update copyright in version-message * package/tack.spec, tack.h, package/debian/changelog, HISTORY: bump to 1.09 * fun.c, init.c, output.c, tack.h: reduce some of the const/assignment and similar warnings seen in Unix builds * edit.c, scan.c, tack.h, output.c: cppcheck-warnings * package/debian/compat, package/debian/rules: fix build-warnings * package/debian/copyright: update copyright * Makefile.in, aclocal.m4, ansi.c, charset.c, color.c, configure.in, control.c, crum.c, edit.c, fun.c, init.c, menu.c, modes.c, modules, ncurses_tst.hin, output.c, pad.c, scan.c, sync.c, sysdep.c, tack.1, tack.c, tack.h, tackgen.c: update copyright notices using script which inspects commit-timestamps * ansi.c, charset.c, color.c, control.c, crum.c, edit.c, fun.c, init.c, menu.c, modes.c, output.c, pad.c, scan.c, sync.c, sysdep.c, tack.c, tack.h, tackgen.c: rescind permission implied or otherwise to relicense my work as GPL3 * aclocal.m4: resync with my-autoconf * configure: regen * package/debian/changelog, package/tack.spec, tack.h: bump 2019-12-20 Thomas E. Dickey * config.guess: 2019-12-21 2019-09-11 Thomas E. Dickey * config.sub: 2019-09-11 2019-07-21 Thomas E. Dickey * tack.c, edit.c, tack.h: gcc-8.x-warnings * init.c, edit.c: gcc 4.x warning * charset.c: update copyright 2019-07-21 Brad.Town * charset.c: rewrite of set_attr resulted in off-by-one loop limit 2019-07-21 Thomas E. Dickey * configure: regen * aclocal.m4: add CF_CURSES_TERM_H to get proper ifdef's for the boolnames arrays * configure.in: add CF_CURSES_TERM_H * aclocal.m4: add CF_TERMIOS_TYPES, from xterm * sysdep.c: use termios types such as tcflag_t * configure.in: use CF_TERMIOS_TYPES * configure: regen * tack.h: update copyright * configure: regen * aclocal.m4: resync with my-autoconf * package/debian/changelog, package/tack.spec, tack.h: bump 2019-06-30 Thomas E. Dickey * config.sub: 2019-06-30 2019-06-10 Thomas E. Dickey * config.guess: 2019-06-10 2017-08-18 Thomas E. Dickey * package/debian/changelog, package/tack.spec, tack.h: bump * charset.c, tack.h, tack.c, edit.c: improve ifdef's to recover if term_entry.h is missing * charset.c, init.c, tack.h: move italics to separate test from sgr, add test for crossed-out * output.c, edit.c, tack.h: move VALID_STRING, etc., to tack.h 2017-08-17 Thomas E. Dickey * charset.c: split charset_sgr into two, since it is really two screens * modes.c, pad.c: eliminate forward references * output.c: avoid having run-on entries in function-key list by putting a space when the preceding text on the line happens to end on a column-marker. 2017-08-16 Thomas E. Dickey * charset.c: eliminate forward references. add demo of italics (not in sgr of course) 2017-08-08 Thomas E. Dickey * config.guess: 2017-08-05 2017-07-28 Thomas E. Dickey * ansi.c: cppcheck reported an sprintf using output buffer as an input - fix * scan.c, ansi.c, charset.c, color.c, control.c, crum.c, edit.c, fun.c, init.c, menu.c, modes.c, output.c, pad.c, sync.c, sysdep.c: cppcheck:style-warnings * fun.c: quiet a bogus warning from clang --analyze * tackgen.c: avoid a zero-sized allocation * sysdep.c, tack.c, init.c, tack.h: help the compiler know how large temp[] is, for better warnings * aclocal.m4: resync with my-autoconf * package/debian/changelog: bump * configure: regen * init.c: build-fix * configure.in: AIX has acs_map renamed and optionally available as "acs32map" * init.c: workaround for AIX to turn on optional feature that declares acs32map[] * aclocal.m4: suppress the second loop-exit, to avoid making undeclared data match first * aclocal.m4: modify CF_CURSES_CHECK_DATA to accept a list of names to check * configure.in: add configure check for acs_map and the most common aliases * init.c: improve initial port for HPUX to use autoconf to find acs_map * sysdep.c: copyright-date * package/tack.spec, tack.h: bump * sysdep.c, edit.c, init.c, tackgen.c, tack.h: initial port to HPUX, which does not declare the name-arrays in its X/Open curses header. 2017-07-26 Thomas E. Dickey * package/tack.spec: disable debug-package * tack.1: typographic fixes prompted by lintian warning * Makefile.in: if built in-tree, we may need shlib to fixup shared library paths * edit.c: gcc warning * HISTORY, package/debian/changelog, package/tack.spec, tack.h: bump to 1.08 2017-07-25 Thomas E. Dickey * tack.h, tack.c: fix symbol conflict with TRACE * modules: fix dependencies for building in ncurses-tree * configure: regen * tack.c, tack.h, configure.in: check for _nc_free_tinfo, for memory-leaks * tack.c, init.c, edit.c, tack.h: memory-leaks * edit.c: initial version of "copy_termtype()", to replace call to ncurses internal _nc_copy_termtype() - not a derived function but rewrite. 2017-07-24 Thomas E. Dickey * init.c: gcc warnings * init.c: make "baudrate" work portably * init.c, edit.c, tackgen.c, tack.h: add configure-checks for "ar" and its flags, needed in configure-checks for data * init.c: changes to make NetBSD curses "work". This asks infocmp for the current terminal description, with the caveat that the type of cancelled capabilities cannot be determined. Also, it moves the acs initialization earlier to work with the incomplete tables. * tack.h: for NetBSD, use variables for the array maximums * edit.c: for NetBSD, use the arrays read via infocmp to construct a "good enough" name-table. Take out the warning for entries not found. 2017-07-23 Thomas E. Dickey * tackgen.c: for NetBSD workaround, declare maximums for the arrays * tack.h: NetBSD 6 also left out plab_norm * tack.c: NetBSD needs stdarg, since its curses.h isn't complete. * tack.h: there's no configure check (yet) for readonly terminfo. But only ncurses is viable -- simplify ifdef. * configure.in: no need to check for ttytype[] * init.c: provide alternative to ttytype[], using termname()+longname() * tackgen.c: build-fix * edit.c: NetBSD workaround won't support long-names * tackgen.c: for NetBSD, provide a workaround - start by stubbing out the data here * tack.h: stub for NetBSD will have strnames * aclocal.m4: resync with my-autoconf * configure: regen * README: update dependency notes * package/debian/changelog: bump * aclocal.m4: add check for term.h if pkg-config is used * aclocal.m4, configure.in: add configure-checks for "ar" and its flags, needed in configure-checks for data * edit.c, tackgen.c: gcc warnings * package/debian/rules: use "hardening" flags * package/debian/copyright, package/tack.spec, tack.h: bump * configure: regen * configure.in: fix tackgen dependencies * tackgen.c: stricter gcc warnings * tack.h: with gcc-stricter, "sun" is not defined * configure: regen * edit.c, configure.in, tack.h: move include of tackgen.h to tack.h to define BOOLCOUNT, etc., for Solaris * tack.h, tack.c: add Trace(), for debugging * init.c: fill in acs_map[] for Solaris curses (not done in setupterm) * edit.c: finish Solaris unused-warnings * edit.c: grouped editing functions (not supported with Solaris) * edit.c: start changes to make function-key test work with Solaris, using macros and functions to hide differences between the way capabilities are stored in the TERMINAL structure * tack.h, pad.c: const-tweaks * control.c, tack.h, ansi.c, charset.c, color.c, crum.c, edit.c, fun.c, menu.c, modes.c, pad.c, sync.c, tack.c: improve readability using typedefs * tack.h: typo * tack.h: help readability using typedef's add workaround to reduce compiler warnings when building with Solaris curses * output.c: use workaround to quiet compiler warnings with Solaris curses * tack.c: ifdef'd ncurses-specific menu-entry 2017-07-21 Thomas E. Dickey * init.c: Solaris (and other Unix) baudrate function uses SP, e.g., newterm. We're using setterm, and most of the baudrate logic here is ncurses-specific. * modes.c, crum.c, color.c: most of edit.c is ncurses-only since it relies upon using arrays of capabilities in TERMINAL - ifdef that and related menu-entries. * edit.c: partial reorganization/ifdef'ing to get this to compile with Solaris curses * tackgen.c, tack.h, pad.c, charset.c, fun.c, tack.c: most of edit.c is ncurses-only since it relies upon using arrays of capabilities in TERMINAL - ifdef that and related menu-entries. * Makefile.in: cleanup tackgen.o * aclocal.m4: resync with my-autoconf add macro for checking curses-data, e.g., boolnames * configure.in: drop checks for unused headers add checks for curses data (boolnames, boolfnames and ttytype) * output.c, control.c: const-fixes * fun.c, pad.c, tack.c: workaround in case terminfo is readonly * tack.h: work around several problems with NetBSD curses to compile most of tack... * charset.c: const-fixes * tack.h: omit nc_tparm.h, for portability 2017-07-20 Thomas E. Dickey * edit.c: eliminate dependency on tic.h * edit.c: replace calls to _nc_find_entry + _nc_get_hash_table with generated tackgen.h wrapper * tackgen.c: RCS_BASE * modules: add tackgen program, used to generate tackgen.h for edit.c * configure.in: add tackgen.h dependency for edit.o * Makefile.in: add rule for making tackgen.h * tack.c, init.c, tack.h: change tty_basename to a pointer * configure.in, tack.c, Makefile.in, tack.h: tack no longer uses tic library 2017-07-18 Thomas E. Dickey * edit.c: reduce calls to _nc_find_entry to single function, as a step toward rewrite. also, allocate the boolean- and numeric-flags arrays since those may have extensions. * tack.h: define MAX_BOOLEAN and MAX_NUMBERS for consistency * init.c: get the terminfo-entry's filename from infocmp * edit.c: eliminate calls to _nc_tic_expand * edit.c: eliminate calls to _nc_reset_input and _nc_trans_string * init.c: eliminate calls to _nc_read_entry and _nc_fallback, no longer needed. * charset.c: eliminate call to _nc_init_acs; tack does not use acs_map * output.c: modify tc_putp() to check for invalid string-pointer. 2017-04-29 Thomas E. Dickey * config.sub: 2017-04-02 2017-03-18 Thomas E. Dickey * init.c: use def_prog_mode() to eliminate two internal details from ncurses * edit.c, tack.h: accommodate opaque TERMINAL structure in ncurses * tack.h: update copyright to match version * configure: regen * aclocal.m4: resync with my-autoconf: + CF_ADD_CFLAGS improve formatting of generated lists using CF_APPEND_TEXT + CF_CC_ENV_FLAGS several fixes... + CF_GNU_SOURCE recent glibc (Debian 2.23-4 for example) has misordered ifdef/checks for new symbol _DEFAULT_SOURCE, producing warning messages when only _GNU_SOURCE is defined. Add a followup check to define _DEFAULT_SOURCE. + 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_LIB_PREFIX build-fixes for OS/2 + CF_LINK_DATAONLY quiet strict gcc warning + CF_MAKEFLAGS use $SHELL consistently + CF_NCURSES_CONFIG PKG_CONFIG may simply be unset - fix + CF_PROG_LINT add cpplint to programs to use; drop ad hoc tdlint and alint. + CF_WITH_MAN2HTML use configured shell + CF_WITH_NCURSES_ETC add check for ncurses pthreads + CF_XOPEN_SOURCE add "uclinux" to list of Linux's use _GNU_SOURCE for cygwin headers, tested with cygwin 2.3, 2.5 build-fixes for OS/2 * config.sub: 2017-02-07 * config.guess: 2017-03-05 * package/debian/changelog, package/tack.spec, tack.h: bump 2015-07-06 Thomas E. Dickey * package/debian/changelog, package/tack.spec, tack.h: bump * configure: regen * configure.in, Makefile.in: add --with-man2html * Makefile.in: fix copyright date * aclocal.m4: add --with-man2html 2015-06-03 Thomas E. Dickey * configure: regen * configure.in: tic functions may/may not be bundled with ncurses. Add a configure check which works with pkg-config, also handling renaming of library used in the test-packages for ncurses6 * package/debian/rules: use ncurses6 package * configure: regen * configure.in: fix order of evaluation for CF_PKG_CONFIG 2015-06-02 Thomas E. Dickey * configure.in: use CF_WITH_NCURSES_ETC, but disable the pdcurses flavor * configure: regen * aclocal.m4: use CF_WITH_NCURSES_ETC * control.c: workaround for glibc header defect * configure: regen * aclocal.m4: resync with my-autoconf * tack.h, package/debian/changelog, package/tack.spec: bump 2015-05-02 Thomas E. Dickey * config.guess: update to 2015-03-04 * config.sub: update to 2015-03-08 2013-07-13 Thomas E. Dickey * init.c: copyright-date * init.c: typo * fun.c: copyright-date * fun.c: fix warnings from clang 3.3 --analyze * scan.c: copyright-date * scan.c: fix warnings from clang 3.3 --analyze * init.c: add error check to setupterm call; ncurses does in fact allow hardcopy and generic terminal descriptions (Debian #716377). * configure: regen * aclocal.m4, configure.in: add/use CF_LIB_PREFIX, CF_MAKEFLAGS, CF_TOP_BUILDDIR and CF_WITH_LIB_PREFIX, to fix unexpanded variables in Makefile.in * package/debian/changelog, tack.h, package/tack.spec: bump * configure: regen * aclocal.m4: resync with my-autoconf: + add 3rd parameter to AC_DEFINE's to allow autoheader to run (several macros) + CF_MAKE_DOCS: apply workaround from xterm #288 for html output + CF_INTEL_COMPILER, CF_XOPEN_SOURCE: $host_os needs AC_CANONICAL_HOST + CF_ACVERSION_CHECK: change from byacc to work around long-ago breakage in autoconf + CF_GCC_VERSION: amend workarounds to accommodate Debian's modification of version-message + CF_CC_ENV_FLAGS: new macro + remove unused macros 2013-02-10 Thomas E. Dickey * config.sub, config.guess: update to 2013-02-04 2012-09-16 Thomas E. Dickey * configure, configure.in: add check for long filenames to define HAVE_LONG_FILE_NAMES, needed to choose larger limit for MAX_ALIAS (the actual length of a terminal description's name) * edit.c: fix Solaris compiler warning * tack.c: ensure that $TERM is set and is not too large * configure, configure.in, aclocal.m4: add --disable-rpath-hack to simplify ports to Solaris * edit.c: build-fix for g++ * configure, aclocal.m4: resync with my-autoconf: - add CF_CLANG_COMPILER to tune strict warnings for clang - modify CF_CURSES_LIBS to check for tinfo library - modify CF_PATH_SYNTAX to allow for variables such as ${datadir} * configure, configure.in: remove unused checks for header-files 2012-09-16 Adrian.Bunk * configure, configure.in, aclocal.m4, ncurses_tst.hin, sysdep.c, tack.h, Makefile.in: - remove fallback definitions for "const" and "inline" from ncurses_tst.hin - remove unused AC_HEADER_TIME configure check - remove the obsolete CF_SYS_TIME_SELECT configure check - change the autoconf prerequisite to "2.52" (noting that the patched 2.52 is actually required) - remove configure-checks for AWK and LN_S variables 2012-09-16 Thomas E. Dickey * Makefile.in: datarootdir is now needed for mandir remove unused includedir and datadir * package/debian/changelog, package/tack.spec, tack.h: bump * configure: regen (will support --datarootdir with this) 2012-04-29 Thomas E. Dickey * package/debian/changelog, package/tack.spec, tack.h: bump * configure: regen * aclocal.m4: add CF_MAKE_DOCS update CF_GCC_WARNINGS for old gcc's whose pointer-arithmetic warnings were bogus. * configure.in: use CF_MAKE_DOCS rule in makefile for generating html/pdf/txt versions of manpages. * color.c: copyright-date * color.c: corrected check for ncv (no_color_video), which did not handle the case when all video attributes should work. * color.c: add/use init_palette() and reset_palette() to restore the 0-7 ANSI colors to sane values after running the change-colors tests. Without some specific knowledge of the terminal (terminfo does not provide this), it is not possible to restore the original colors. 2012-04-28 Thomas E. Dickey * charset.c: add a test for "eslok" capability * charset.c: copyright-date * configure: regen * configure.in: the last change could produce unbalanced quote with certain shells - check for that and repair it (report by Samuel Bronson). 2012-03-03 Thomas E. Dickey * fun.c: gcc warning * configure: regen * configure.in: Solaris' "set" does not quote - fix with sed. * configure: regen * configure.in: substitution for --disable-echo feature did not work with FreeBSD 7.2; work around using output of shell's "set" command. Also remove CF_PRG_RULES which is not needed. * aclocal.m4: remove CF_PRG_RULES - unused * sysdep.c, scan.c, output.c, ansi.c, edit.c, control.c, fun.c, sync.c, tack.h: strict gcc 4.1.2 warnings with CentOS 5.7 64-bit * init.c, tack.c: quiet unnecessary warning about ignoring return-value from system() * configure: regen with ac252 20120303 to work with Intel 12.0.3 compiler * tack.h: quiet unnecessary warning about ignoring return-value from system() 2012-03-02 Thomas E. Dickey * configure: regen * output.c: icc9 warning * configure.in: LIBS_CURSES_symbol is redundant - remove * package/debian/changelog, package/tack.spec, tack.h: bump-version * tack.h: quiet gcc -Wundef warnings also quiet two no-return cases when configuring with no-leaks option. * configure.in: Add CF_ERRNO, CF_LINK_DATAONLY checks with supporting macros to address gcc -Wundef warnings about DECL_ERRNO and BROKEN_LINKER symbols. * configure.in: add EXTRA_CFLAGS to CFLAGS/CPPFLAGS (report by Samuel Bronson) * aclocal.m4: Add CF_ERRNO, CF_LINK_DATAONLY checks with supporting macros to address gcc -Wundef warnings about DECL_ERRNO and BROKEN_LINKER symbols. 2012-03-01 Thomas E. Dickey * Makefile.in: copyright date 2012-02-29 Werner.Fink * Makefile.in, configure.in: Update configure-script and makefile template to work with this post-5.9 change, allowing build of tack within the ncurses source-tree: 20110924 + modify configure script and makefiles to split TIC_ARGS and TINFO_ARGS into pieces corresponding to LDFLAGS and LIBS variables, to help separate searches for tic- and tinfo-libraries (patch by Nick Alcock aka "Nix"). The change is prompted by review of OpenSUSE package by Werner Fink, using a patch from the rpm source file: ncurses-5.9-tack-tinfo.dif (2011-11-18) and discarding ncurses-5.7-tack.dif (2010-01-12) because the latter breaks builds with libtool -TD 2012-02-26 Thomas E. Dickey * configure: regen * configure.in: add $ECHO_CC to AC_OUTPUT logic, overlooked in echo-fixes * tack.h, package/debian/changelog, package/tack.spec: bump * configure.in: add configure check to determine if we have tinfo library, and further if tack needs intermediate ncurses library to link. * configure.in: always check for _nc_tic_expand * configure.in: use CF_DISABLE_ECHO (prompted by patch by Samuel Bronson). * aclocal.m4: add CF_DISABLE_ECHO macro * aclocal.m4: resync with-my-autoconf: + add/use CF_ACVERSION_CHECK to support lookup with AC_CHECK_TOOLS vs AC_PATH_PROGS for ncurses*-config script in CF_NCURSES_CONFIG + modify CF_ANSI_CC_CHECK to check for environment variable $CC, which conflicts with usage for curses applications. + modify CF_CURSES_LIBS to check for OpenBSD "otermcap" library. + new macro CF_TRY_XOPEN_SOURCE + modify CF_XOPEN_SOURCE to omit Solaris-specific __EXTENSIONS__ definition where possible. This led to adding workarounds for Darwin, IRIX64, MirBSD, OpenBSD as well as configure check with CF_TRY_XOPEN_SOURCE. Also modify version pattern for newer AIX systems, 2012-02-25 Thomas E. Dickey * config.guess, config.sub: update to 2012-02-10 2011-06-26 Thomas E. Dickey * configure: regen * aclocal.m4: update CF_CURSES_HEADER, looking for ncurses.h ahead of curses.h for consistency with CF_NCURSES_HEADER * package/debian/changelog, package/tack.spec, tack.h: bump 2011-06-26 Daniel.Weaver * ansi.c: minor bug-fix to show "GR" label in appropriate ANSI character-sets. * tack.1: update email address * scan.wy150: New file. 2011-05-01 Thomas E. Dickey * configure: regen * aclocal.m4, configure.in: add check for lint program * output.c, fun.c: gcc warning * color.c: fix clang warnings * output.c: fix clang warnings ensure that EOF is tested properly on return from getchp() * fun.c: fix clang warning * crum.c: copyright-date * crum.c: fix clang warning * fun.c: ensure that EOF is checked for return-value from getchp() (report by Joachim Schmitz) * aclocal.m4: resync with my-autoconf, many fixes * package/debian/changelog, package/tack.spec, tack.h: bump 2011-04-01 Thomas E. Dickey * config.sub: update to 2011-04-01 2011-02-02 Thomas E. Dickey * config.guess: update to 2011-01-01 2010-09-04 Thomas E. Dickey * package/tack.spec, package/debian/rules, package/debian/docs, package/debian/copyright, package/debian/control, package/debian/watch, package/debian/changelog, package/debian/source/format: RCS_BASE * tack.c, tack.h: add patch-date to version message 2010-09-03 Thomas E. Dickey * AUTHORS: RCS_BASE * sysdep.c, sync.c, init.c, fun.c, output.c, scan.c, control.c: gcc-warnings * fun.c: indent * Makefile.in: add dummy for "make check". * tack.h, tack.c, sysdep.c, sync.c, scan.c: indent * pad.c: copyright-date * pad.c, output.c: indent * modes.c: copyright-date * modes.c: indent * menu.c: copyright-date * menu.c, init.c, fun.c, edit.c, crum.c, control.c, color.c, charset.c, ansi.c: indent 2010-04-20 Thomas E. Dickey * package/debian/compat: RCS_BASE 2009-12-26 Thomas E. Dickey * configure: regen to get new macros, as well as to use autoconf-252 (patched) * aclocal.m4: resync with my-autoconf (many changes) * Makefile.in: drop mkdirs.sh, just use mkdir -p * control.c, tack.c, sysdep.c, sync.c: strict gcc warnings * init.c: check if baudrate() returns ERR, use 1 if so. * fun.c, edit.c, pad.c, scan.c, charset.c: strict gcc warnings * tack.h: bump to 1.07 * HISTORY: reason for release * ansi.c, output.c, menu.c: strict gcc warnings * edit.c: fix an incorrect malloc-size in show_report(), which could cause core-dump when displaying long list of function-keys, e.g., for xterm-new 2009-11-19 Thomas E. Dickey * config.guess, config.sub: update to 2009-11-20 2007-08-12 Thomas E. Dickey * edit.c: as of 2007/8/12, ncurses no longer exports the data _nc_info_hash_table. Instead, use the function _nc_get_hash_table(), which is in ncurses 5.0 2007-08-11 Thomas E. Dickey * HISTORY: tweak to build with latest ncurses (does not rely on new api's) 2007-04-29 Thomas E. Dickey * HISTORY, tack.h: mark 1.05 * configure: regen'd * configure.in: update LIB_LINK symbol to match CF_WITH_LIBTOOL change * tack.h: use SIG_ATOMIC_T * sysdep.c: move include of to tack.h so SIG_ATOMIC_T definition works. * tack.c: use EXIT_FAILURE/EXIT_SUCCESS * sysdep.c: use EXIT_FAILURE/EXIT_SUCCESS use SIG_ATOMIC_T * output.c: add braces for readability * tack.h: trim whitespace * scan.c, init.c: use EXIT_FAILURE/EXIT_SUCCESS * configure.in, aclocal.m4: add CF_SIG_ATOMIC_T * control.c: use SIG_ATOMIC_T * Makefile.in: update $(LINK) to work with ncurses after importing CF_WITH_LIBTOOL change that moved $(CC) into $(LIBTOOL_LINK) symbol. 2007-04-08 Thomas E. Dickey * configure: regen'd * Makefile.in: define $(INCDIR) - needed for building in ncurses tree * tack.h: expand the ExitProgram() macro into a function which can call the ncurses- and tack-specific leak-auditing functions. * configure.in: check for _nc_free_tic() function, since that's what tack needs. * edit.c: add tack_edit_leaks(), to help audit memory leaks * tack.c: add ExitProgram() function, to free all application memory on exit to simplify leak-checking. * fun.c: add tack_fun_leaks(), to help audit memory leaks * init.c: free the TERMTYPE used just for error-checking (memory leak) * tack.h: define ExitProgram() macro to hide details of memory audit on exit(). * tack.c, init.c, sysdep.c: use ExitProgram() macro * configure.in: add "--disable-leaks" and related testing options. * aclocal.m4: add macros used for "--disable-leaks" and related testing options * configure.in: use CF_NCURSES_CONFIG to find ncurses5-config, etc., fixing rpath issues. add check for ticlib, if needed. remove check for pdcurses (this will never work with anything except for ncurses), and add checks for select() and gettimeofday(). * aclocal.m4: modify CF_XOPEN_SOURCE to add FreeBSD/GNU (kFreeBSD) pattern * Makefile.in: rename mkinstalldirs to mkdirs.sh * HISTORY: 1.04 2007-04-07 Thomas E. Dickey * ansi.c, output.c: fixes from Coverity report 2007-03-25 Thomas E. Dickey * mkdirs.sh: RCS_BASE 2007-01-28 Thomas E. Dickey * HISTORY: tack's out of ncurses now. * Makefile.in: make install rule work * tack.h: bump to 1.03 * Makefile.in: first cut of installing manpage * Makefile.in: tweaks to work after chopping out of ncurses tree 2007-01-27 Thomas E. Dickey * HISTORY: update to 1.03 * README: FROM_KEYS 2007-01-13 Thomas E. Dickey * Makefile.in: FROM_KEYS * configure: RCS_BASE * configure.in, aclocal.m4: FROM_KEYS 2006-12-23 Thomas E. Dickey * modules: FROM_KEYS 2006-12-22 Thomas E. Dickey * config.guess: RCS_BASE 2006-12-08 Thomas E. Dickey * config.sub: RCS_BASE 2006-11-25 Thomas E. Dickey * output.c: FROM_KEYS * modes.c: from ncurses * init.c, fun.c: FROM_KEYS * crum.c: from ncurses * color.c, charset.c, tack.h: FROM_KEYS 2006-06-24 Thomas E. Dickey * control.c, edit.c: FROM_KEYS 2006-05-06 Thomas E. Dickey * sync.c: FROM_KEYS 2006-04-22 Thomas E. Dickey * tack.1: FROM_KEYS 2005-09-17 Thomas E. Dickey * ansi.c, pad.c, sysdep.c: FROM_KEYS * menu.c, scan.c, tack.c: from ncurses * COPYING: fix address 2003-11-29 Thomas E. Dickey * install-sh: resync with my-autoconf 2002-06-29 Thomas E. Dickey * mkinstalldirs: RCS_BASE 2001-06-22 Thomas E. Dickey * install-sh: RCS_BASE 1999-02-07 Thomas E. Dickey * HISTORY: nit * init.c: tweak to make this build after renaming as per Alexander 1998-09-26 Thomas E. Dickey * edit.c: add param to _nc_tic_expand() 1998-03-28 Thomas E. Dickey * Makefile.in: updates to sync with ncurses 4.2 1998-02-11 Thomas E. Dickey * ncurses_tst.hin: FROM_KEYS 1998-01-09 Daniel.Weaver * tack.c, Makefile.in, tack.h, control.c, color.c, charset.c, ansi.c, sysdep.c, sync.c, scan.c, pad.c, output.c, modes.c, menu.c, init.c, fun.c, edit.c, crum.c, HISTORY, COPYING: tack-1.00 1998-01-03 Thomas E. Dickey * tack.h: moved ncurses' externs to tic.h * edit.c: split-out _nc_tic_expand(), as per DW's request. * sysdep.c: nits (we don't _need_ time.h?) * tack.h: SCO's compiler doesn't like array-of-const 1998-01-02 Thomas E. Dickey * control.c: work with no 'gettimeofday()' workaround for SCO 3.x compiler which gets confused by array of const. * output.c, edit.c, fun.c: SCO's compiler doesn't like array-of-const * ansi.c: SCO's compiler: parameter promotion warnings. 1997-12-28 Thomas E. Dickey * tack.h: first cut of fixes for AIX/SCO/CLIX * sysdep.c, control.c: first cut of fixes for AIX/CLIX/SCO 1997-12-27 Thomas E. Dickey * ansi.c, charset.c, control.c, crum.c, edit.c, fun.c, init.c, menu.c, modes.c, output.c, scan.c, sync.c, sysdep.c, tack.c: integration with ncurses: restructured includes, fix gcc warnings * pad.c: integration with ncurses: restructures includes, fix gcc warnings * color.c: typo * tack.h: integration with ncurses: reordered headers, provide fallback definitions for the stuff we get from ncurses_cfg.h, make some stuff const. * Makefile.in: use HAVE_SELECT from configure-script * color.c: integration with ncurses: move most headers into tack.h, fix gcc warnings * Makefile.in: we'll have a config.h (actually ncurses_cfg.h) * modules: set base-subset 1997-12-24 Daniel.Weaver * HISTORY: ncurses-4.1-971220 1997-12-22 Daniel.Weaver * ansi.c, tack.1: ncurses-4.1-971220 1997-12-02 Daniel.Weaver * tack.c, init.c: ncurses-4.1-971220 1997-11-30 Daniel.Weaver * edit.c: ncurses-4.1-971220 1997-11-29 Daniel.Weaver * charset.c, pad.c: ncurses-4.1-971220 1997-11-07 Daniel.Weaver * sync.c, fun.c, crum.c, modes.c, control.c, sysdep.c, output.c, tack.h: ncurses-4.1-971220 1997-11-04 Daniel.Weaver * Makefile.in, menu.c: ncurses-4.1-971220 1997-11-03 Daniel.Weaver * scan.c, color.c, modules: ncurses-4.1-971220 1997-10-29 Daniel.Weaver * control.c, fun.c: ncurses-4.1-971101 1997-10-26 Daniel.Weaver * makefile, edit.c, tack.h, sync.c: ncurses-4.1-971101 1997-10-25 Daniel.Weaver * pad.c, tack.1: ncurses-4.1-971101 1997-10-19 Daniel.Weaver * tack.c, sysdep.c, scan.c, output.c, modes.c, menu.c, init.c, crum.c, color.c, charset.c, ansi.c, HISTORY: ncurses-4.1-971101 1997-10-06 Daniel.Weaver * makefile, tac.h, tack.c: ncurses-4.1-971011 1997-10-04 Daniel.Weaver * control.c, fun.c, sync.c, init.c, pad.c, modes.c, sysdep.c: ncurses-4.1-971011 1997-10-03 Daniel.Weaver * charset.c, output.c, edit.c, crum.c: ncurses-4.1-971011 1997-10-02 Daniel.Weaver * menu.c: ncurses-4.1-971011 1997-09-29 Daniel.Weaver * color.c, ansi.c: ncurses-4.1-971011 1997-09-28 Daniel.Weaver * tic.h: ncurses-4.1-971011 1997-09-22 Daniel.Weaver * scan.c: ncurses-4.1-971011 tack-1.09-20230201/Makefile.in0000644000000000000000000001562514063473216014036 0ustar rootroot# $Id: Makefile.in,v 1.62 2021/06/19 22:58:22 tom Exp $ ############################################################################## # Copyright 2020,2021 Thomas E. Dickey # # Copyright 1997-2015,2017 Free Software Foundation, Inc. # # # # Permission is hereby granted, free of charge, to any person obtaining a # # copy of this software and associated documentation files (the "Software"), # # to deal in the Software without restriction, including without limitation # # the rights to use, copy, modify, merge, publish, distribute, distribute # # with modifications, sublicense, and/or sell copies of the Software, and to # # permit persons to whom the Software is furnished to do so, subject to the # # following conditions: # # # # The above copyright notice and this permission notice shall be included in # # all copies or substantial portions of the Software. # # # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL # # THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING # # FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER # # DEALINGS IN THE SOFTWARE. # # # # Except as contained in this notice, the name(s) of the above copyright # # holders shall not be used in advertising or otherwise to promote the sale, # # use or other dealings in this Software without prior written # # authorization. # ############################################################################## # Makefile for tack # # The variable 'srcdir' refers to the source-distribution, and can be set with # the configure script by "--srcdir=DIR". # # The rules are organized to produce the libraries for the configured models, # and the programs with the configured default model. # turn off _all_ suffix rules; we'll generate our own .SUFFIXES: SHELL = /bin/sh THIS = Makefile CF_MFLAGS = @cf_cv_makeflags@ @SET_MAKE@ x = @EXEEXT@ o = .@OBJEXT@ m = 1 DESTDIR = @DESTDIR@ top_srcdir = @top_srcdir@ srcdir = @srcdir@ prefix = @prefix@ exec_prefix = @exec_prefix@ datarootdir = @datarootdir@ bindir = @bindir@ mandir = @mandir@ MODEL = ../@DFT_OBJ_SUBDIR@ INCDIR = $(top_srcdir)/include LIBTOOL = @LIBTOOL@ LIBTOOL_CLEAN = @LIB_CLEAN@ LIBTOOL_COMPILE = @LIB_COMPILE@ LIBTOOL_LINK = @LIB_LINK@ LIBTOOL_INSTALL = @LIB_INSTALL@ LIBTOOL_UNINSTALL = @LIB_UNINSTALL@ INSTALL = @INSTALL@ INSTALL_PROG = @INSTALL_PROGRAM@ INSTALL_DATA = @INSTALL_DATA@ transform = @program_transform_name@ CC = @CC@ CPP = @CPP@ CFLAGS = @CFLAGS@ CPPFLAGS = -DHAVE_CONFIG_H -I. -I$(srcdir) @CPPFLAGS@ CCFLAGS = $(CPPFLAGS) $(CFLAGS) CFLAGS_LIBTOOL = $(CCFLAGS) CFLAGS_NORMAL = $(CCFLAGS) CFLAGS_DEBUG = $(CCFLAGS) @CC_G_OPT@ -DTRACE CFLAGS_PROFILE = $(CCFLAGS) -pg CFLAGS_SHARED = $(CCFLAGS) @CC_SHARED_OPTS@ CFLAGS_DEFAULT = $(CFLAGS_@DFT_UPR_MODEL@) REL_VERSION = @cf_cv_rel_version@ ABI_VERSION = @cf_cv_abi_version@ LOCAL_LIBDIR = @top_builddir@/lib LD = @LD@ LINK = @LINK_PROGS@ $(LIBTOOL_LINK) LDFLAGS = @EXTRA_LDFLAGS@ @TINFO_LDFLAGS@ \ @LDFLAGS@ @LD_MODEL@ @TINFO_LIBS@ @LIBS@ LDFLAGS_LIBTOOL = $(LDFLAGS) $(CFLAGS_LIBTOOL) LDFLAGS_NORMAL = $(LDFLAGS) $(CFLAGS_NORMAL) LDFLAGS_DEBUG = $(LDFLAGS) $(CFLAGS_DEBUG) LDFLAGS_PROFILE = $(LDFLAGS) $(CFLAGS_PROFILE) LDFLAGS_SHARED = $(LDFLAGS) $(CFLAGS_SHARED) @LD_SHARED_OPTS@ LDFLAGS_DEFAULT = $(LDFLAGS_@DFT_UPR_MODEL@) LINT = @LINT@ LINT_OPTS = @LINT_OPTS@ PROGS = tack$x mymandir = $(mandir)/man1 @NCURSES_TREE@# Default library, for linking applications @NCURSES_TREE@DEPS_CURSES = ../lib/@LIB_PREFIX@ncurses@DFT_DEP_SUFFIX@ ################################################################################ all: $(PROGS) sources: install: install.tack uninstall: uninstall.tack TRANSFORM = sed 's/$x$$//'|sed '$(transform)'|sed 's/$$/$x/' actual_program = `echo tack| $(TRANSFORM)`$x actual_manpage = `echo tack| $(TRANSFORM)`.$m # this line simplifies the configure-script libs \ install.libs \ uninstall.libs: install.tack: $(PROGS) \ $(DESTDIR)$(bindir) \ $(DESTDIR)$(mymandir) $(LIBTOOL_INSTALL) $(INSTALL_PROG) tack$x $(DESTDIR)$(bindir)/$(actual_program) $(INSTALL_DATA) tack.1 $(DESTDIR)$(mymandir)/$(actual_manpage) uninstall.tack: -@$(LIBTOOL_UNINSTALL) rm -f $(DESTDIR)$(bindir)/$(actual_program) rm -f $(DESTDIR)$(mymandir)/$(actual_manpage) $(DESTDIR)$(bindir) \ $(DESTDIR)$(mymandir) : mkdir -p $@ # # Rules for building tack # DEPS_TACK = \ $(MODEL)/ansi$o \ $(MODEL)/charset$o \ $(MODEL)/color$o \ $(MODEL)/control$o \ $(MODEL)/crum$o \ $(MODEL)/edit$o \ $(MODEL)/fun$o \ $(MODEL)/init$o \ $(MODEL)/menu$o \ $(MODEL)/modes$o \ $(MODEL)/output$o \ $(MODEL)/pad$o \ $(MODEL)/scan$o \ $(MODEL)/sync$o \ $(MODEL)/sysdep$o \ $(MODEL)/tack$o tack$x: $(DEPS_TACK) @NCURSES_TREE@$(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(DEPS_TACK) $(LDFLAGS_DEFAULT) -o $@ tackgen$x: $(MODEL)/tackgen$o @NCURSES_TREE@$(DEPS_CURSES) @ECHO_LINK@ $(LINK) $(MODEL)/tackgen$o $(LDFLAGS_DEFAULT) -o $@ tackgen.h: tackgen$x $(SHELL) -c "if test -f $(srcdir)/../misc/shlib; then\ $(srcdir)/../misc/shlib ./tackgen$x >$@; \ else \ ./tackgen$x >$@; \ fi" # # Utility productions start here # tags: ctags *.[ch] @MAKE_UPPER_TAGS@TAGS: @MAKE_UPPER_TAGS@ etags *.[ch] mostlyclean :: -rm -f core tags TAGS *~ *.bak *.i *.atac trace clean :: mostlyclean -sh -c "if test -n '$x' ; then $(MAKE) clean x=''; fi" -rm -f $(MODEL)/*$o -rm -f $(PROGS) tackgen$x tackgen.h -rm -rf .libs distclean :: clean -rm -f ncurses_cfg.h -rm -f config.cache config.status config.log *.out man2html.tmp -rm -f Makefile check: @echo "** no self-test available" realclean :: distclean # These rules are used to allow "make -n" to work on a clean directory-tree @NCURSES_TREE@../include/hashsize.h \ @NCURSES_TREE@../include/parametrized.h \ @NCURSES_TREE@../include/term.h : @NCURSES_TREE@ cd ../include; $(MAKE) $(CF_MFLAGS) @NCURSES_TREE@$(DEPS_CURSES) : @NCURSES_TREE@ cd ../ncurses; $(MAKE) $(CF_MFLAGS) lint: $(LINT) $(LINT_OPTS) $(CPPFLAGS) $(srcdir)/*.c ############################################################################### # The remainder of this file is automatically generated during configuration ############################################################################### tack-1.09-20230201/tackgen.c0000644000000000000000000001104513760453066013545 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include #include #include #include #include #include /* $Id: tackgen.c,v 1.13 2020/11/28 13:52:54 tom Exp $ */ #define DATA_FMT "DATA(\t%3d,\t\"%s\",%s%s%s),\t/* %s */\n" static const char * tabbed(const char *value, int extra) { int len = (int) strlen(value) + extra; return (len < 8) ? "\t\t" : "\t"; } #if defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES) #ifdef DECL_CURSES_DATA_BOOLNAMES #undef boolnames extern char *boolnames[]; extern size_t max_booleans; #undef numnames extern char *numnames[]; extern size_t max_numbers; #undef strnames extern char *strnames[]; extern size_t max_strings; #undef boolfnames extern char *boolfnames[]; #undef numfnames extern char *numfnames[]; #undef strfnames extern char *strfnames[]; #endif typedef struct { int name_index; const char *short_name; const char *type_name; const char *long_name; } DATA; static int compare_data(const void *a, const void *b) { const DATA *p = (const DATA *) a; const DATA *q = (const DATA *) b; return strcmp(p->short_name, q->short_name); } static void show_count(size_t num, const char *tag) { printf("#ifndef %sCOUNT\n", tag); printf("#define %sCOUNT %d\n", tag, (int) num); printf("#endif\n"); } int main(void) { size_t s, d; size_t num_b = 0; size_t num_n = 0; size_t num_s = 0; size_t num_values; DATA *values = 0; while (boolnames[num_b] != 0) ++num_b; while (numnames[num_n] != 0) ++num_n; while (strnames[num_s] != 0) ++num_s; show_count(num_b, "BOOL"); show_count(num_n, "NUM"); show_count(num_s, "STR"); printf("#ifdef NAME_ENTRY_DATA\n"); num_values = num_b + num_n + num_s; values = calloc(num_values + 1, sizeof(DATA)); d = 0; for (s = 0; boolnames[s] != 0; ++s) { values[d].name_index = (int) s; values[d].short_name = boolnames[s]; values[d].long_name = boolfnames[s]; values[d].type_name = "BOOLEAN"; ++d; } for (s = 0; numnames[s] != 0; ++s) { values[d].name_index = (int) s; values[d].short_name = numnames[s]; values[d].long_name = numfnames[s]; values[d].type_name = "NUMBER"; ++d; } for (s = 0; strnames[s] != 0; ++s) { values[d].name_index = (int) s; values[d].short_name = strnames[s]; values[d].long_name = strfnames[s]; values[d].type_name = "STRING"; ++d; } qsort(values, num_values, sizeof(DATA), compare_data); for (s = 0; s < num_values; ++s) { printf(DATA_FMT, values[s].name_index, values[s].short_name, tabbed(values[s].short_name, 3), values[s].type_name, tabbed(values[s].type_name, 0), values[s].long_name); } printf("#endif /* NAME_ENTRY_DATA */\n"); free(values); return EXIT_SUCCESS; } #else int main(void) { printf("/*\n"); printf(" * Your curses library does not support SVr4 curses-arrays\n"); printf(" * This is a stub to allow building a minimal set of tables\n"); printf(" * using infocmp.\n"); printf(" */\n"); printf("\n"); printf("#ifndef TACKGEN_H\n"); printf("#define TACKGEN_H 1\n"); printf("\n"); printf("#undef boolnames\n"); printf("extern char **boolnames;\n"); printf("extern size_t max_booleans;\n"); printf("\n"); printf("#undef numnames\n"); printf("extern char **numnames;\n"); printf("extern size_t max_numbers;\n"); printf("\n"); printf("#undef strnames\n"); printf("extern char **strnames;\n"); printf("extern size_t max_strings;\n"); printf("\n"); printf("#endif /* TACKGEN_H */\n"); printf("\n"); printf("#ifdef NAME_ENTRY_DATA\n"); printf(DATA_FMT, 0, "?", tabbed("?", 3), "0", tabbed("0", 1), "?"); printf("#endif /* NAME_ENTRY_DATA */\n"); return EXIT_SUCCESS; } #endif tack-1.09-20230201/AUTHORS0000644000000000000000000000027111440304210013007 0ustar rootroot-- $Id: AUTHORS,v 1.1 2010/09/03 23:45:12 tom Exp $ -- vile:txtmode -- this file is used by a script which collects metrics from the changelog weaver Daniel Weaver dickey Thomas Dickey tack-1.09-20230201/config.sub0000755000000000000000000010507714271704511013751 0ustar rootroot#! /bin/sh # Configuration validation subroutine script. # Copyright 1992-2022 Free Software Foundation, Inc. # shellcheck disable=SC2006,SC2268 # see below for rationale timestamp='2022-08-01' # 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-2022 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 # shellcheck disable=SC2162 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 nto-qnx* | linux-* | uclinux-uclibc* \ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \ | storm-chaos* | os2-emx* | rtmk-nova*) 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 ;; *-*) # A lone config we happen to match not fitting any pattern case $field1-$field2 in decstation-3100) basic_machine=mips-dec basic_os= ;; *-*) # Second component is usually, but not always the OS case $field2 in # Prevent following clause from handling this valid os sun*os*) basic_machine=$field1 basic_os=$field2 ;; zephyr*) basic_machine=$field1-unknown basic_os=$field2 ;; # Manufacturers dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \ | unicom* | ibm* | next | hp | isi* | apollo | altos* \ | convergent* | ncr* | news | 32* | 3600* | 3100* \ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \ | ultra | tti* | harris | dolphin | highlevel | gould \ | cbm | ns | masscomp | apple | axis | knuth | cray \ | microblaze* | sim | cisco \ | oki | wec | wrs | winbond) basic_machine=$field1-$field2 basic_os= ;; *) 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 ;; convex-c1) basic_machine=c1-convex basic_os=bsd ;; convex-c2) basic_machine=c2-convex basic_os=bsd ;; convex-c32) basic_machine=c32-convex basic_os=bsd ;; convex-c34) basic_machine=c34-convex basic_os=bsd ;; convex-c38) basic_machine=c38-convex basic_os=bsd ;; 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 | motorola-3300 | motorola-delta \ | 3300-motorola | delta-motorola) cpu=m68k vendor=motorola ;; dpx2*) cpu=m68k vendor=bull basic_os=sysv3 ;; 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 case $basic_os in openstep*) ;; nextstep*) ;; ns2*) basic_os=nextstep2 ;; *) basic_os=nextstep3 ;; esac ;; 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/-.*//'` ;; *-*) # shellcheck disable=SC2162 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. 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|'` ;; *-*) # shellcheck disable=SC2162 saved_IFS=$IFS IFS="-" read kernel os <&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 in linux-gnu* | linux-dietlibc* | linux-android* | linux-newlib* \ | linux-musl* | linux-relibc* | linux-uclibc* ) ;; uclinux-uclibc* ) ;; -dietlibc* | -newlib* | -musl* | -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 ;; kfreebsd*-gnu* | kopensolaris*-gnu*) ;; vxworks-simlinux | vxworks-simwindows | vxworks-spe) ;; nto-qnx*) ;; os2-emx) ;; *-eabi* | *-gnueabi*) ;; -*) # Blank kernel with real OS 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*) 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" 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: tack-1.09-20230201/install-sh0000755000000000000000000003577613761220263014002 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: tack-1.09-20230201/ncurses_tst.hin0000644000000000000000000000540113615560366015041 0ustar rootroot/**************************************************************************** * Copyright 2020 Thomas E. Dickey * * Copyright 1998,2012 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * * "Software"), to deal in the Software without restriction, including * * without limitation the rights to use, copy, modify, merge, publish, * * distribute, distribute with modifications, sublicense, and/or sell * * copies of the Software, and to permit persons to whom the Software is * * furnished to do so, subject to the following conditions: * * * * The above copyright notice and this permission notice shall be included * * in all copies or substantial portions of the Software. * * * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * * THE USE OR OTHER DEALINGS IN THE SOFTWARE. * * * * Except as contained in this notice, the name(s) of the above copyright * * holders shall not be used in advertising or otherwise to promote the * * sale, use or other dealings in this Software without prior written * * authorization. * ****************************************************************************/ /**************************************************************************** * Author: Thomas E. Dickey 1998 * ****************************************************************************/ /* * $Id: ncurses_tst.hin,v 1.3 2020/02/02 14:47:18 tom Exp $ * * This is a template-file used to generate the "ncurses_cfg.h" file. * * Rather than list every definition, the configuration script substitutes * the definitions that it finds using 'sed'. You need a patch (971222) * to autoconf 2.12 to do this. */ #ifndef NC_CONFIG_H #define NC_CONFIG_H @DEFS@ #endif /* NC_CONFIG_H */ tack-1.09-20230201/fun.c0000644000000000000000000005327114244423702012720 0ustar rootroot/* ** Copyright 2017-2021,2022 Thomas E. Dickey ** Copyright 1997-2013,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: fun.c,v 1.32 2022/05/28 13:46:42 tom Exp $") #define COPY_1(target, source) sprintf(target, "%.*s", (int)sizeof(target) - 1, source) /* * Test the function keys on the terminal. The code for echo tests * lives here too. */ static void funkey_keys(TestList *, int *, int *); static void funkey_meta(TestList *, int *, int *); static void funkey_label(TestList *, int *, int *); static void funkey_prog(TestList *, int *, int *); static void funkey_local(TestList *, int *, int *); /* *INDENT-OFF* */ TestList funkey_test_list[] = { MY_EDIT_MENU {MENU_CLEAR + FLAG_FUNCTION_KEY, 0, 0, 0, "f) show a list of function keys", show_report, 0}, {MENU_NEXT | MENU_CLEAR, 0, "smkx) (rmkx", 0, "k) test function keys", funkey_keys, 0}, {MENU_NEXT, 10, "km", "smm rmm", 0, funkey_meta, 0}, {MENU_NEXT, 8, "nlab) (smln) (pln) (rmln", "lw lh", 0, funkey_label, 0}, {MENU_NEXT, 2, "pfx", 0, 0, funkey_prog, 0}, {MENU_NEXT, 2, "pfloc", 0, 0, funkey_local, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ static void printer_on(TestList *, int *, int *); static void printer_mc0(TestList *, int *, int *); TestList printer_test_list[] = { MY_EDIT_MENU {MENU_NEXT | MENU_CLEAR, 0, "mc4) (mc5) (mc5i", 0, 0, printer_on, 0}, {MENU_NEXT | MENU_CLEAR, 0, "mc0", 0, 0, printer_mc0, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* local definitions */ static const char **fk_name; static char **fkval; static char **fk_label; /* function key labels (if any) */ static int *fk_tested; static size_t num_strings = 0; static size_t fkmax = 1; /* length of longest key */ static int got_labels = 0; /* true if we have some labels */ static int key_count = 0; static int end_state; /* unknown function keys */ #define MAX_FK_UNK 50 static char *fk_unknown[MAX_FK_UNK]; static int fk_length[MAX_FK_UNK]; static int funk; /* * Initialize arrays that depend on the actual number of strings. */ static void alloc_strings(void) { if (num_strings != MAX_STRINGS) { num_strings = MAX_STRINGS; fk_name = (const char **) calloc(num_strings, sizeof(const char *)); fkval = (char **) calloc(num_strings, sizeof(char *)); fk_label = (char **) calloc(num_strings, sizeof(char *)); fk_tested = (int *) calloc(num_strings, sizeof(int)); } } /* ** keys_tested(first-time, show-help, hex-output) ** ** Display a list of the keys not tested. */ static void keys_tested( int first_time, int show_help, int hex_output) { int i, l; char outbuf[256]; alloc_strings(); put_clear(); tty_set(); flush_input(); if (got_labels) { putln("Function key labels:"); for (i = 0; i < key_count; ++i) { if (fk_label[i]) { sprintf(outbuf, "%.80s %.80s", fk_name[i] ? fk_name[i] : "??", fk_label[i]); put_columns(outbuf, (int) strlen(outbuf), 16); } } put_newlines(2); } if (funk) { putln("The following keys are not defined:"); for (i = 0; i < funk; ++i) { put_columns(fk_unknown[i], fk_length[i], 16); } put_mode(exit_attribute_mode); put_newlines(2); } if (first_time) { putln("The following keys are defined:"); } else { putln("The following keys have not been tested:"); } if (scan_mode) { for (i = 0; scan_down[i]; i++) { if (!scan_tested[i]) { if (hex_output) { COPY_1(outbuf, hex_expand_to(scan_down[i], 3)); } else { COPY_1(outbuf, expand(scan_down[i])); } l = expand_chars; if (hex_output) { COPY_1(outbuf, hex_expand_to(scan_up[i], 3)); } else { COPY_1(outbuf, expand(scan_up[i])); } expand_chars += l; l = (int) strlen(scan_name[i]); if (((char_count + 16) & ~15) + ((expand_chars + 7) & ~7) + l >= columns) { put_crlf(); } else if (char_count + 24 > columns) { put_crlf(); } else if (char_count) { putchp(' '); } put_columns(outbuf, expand_chars, 16); put_columns(scan_name[i], l, 8); } } } else { for (i = 0; i < key_count; i++) { if (!fk_tested[i] && fk_name[i] != 0) { if (hex_output) { COPY_1(outbuf, hex_expand_to(fkval[i], 3)); } else { COPY_1(outbuf, expand(fkval[i])); } l = (int) strlen(fk_name[i]); if (((char_count + 16) & ~15) + ((expand_chars + 7) & ~7) + l >= columns) { put_crlf(); } else if (char_count + 24 > columns) { put_crlf(); } else if (char_count) { putchp(' '); } put_columns(outbuf, expand_chars, 16); put_columns(fk_name[i], l, 8); } } } put_newlines(2); if (show_help) { ptextln("Hit any function key. Type 'end' to quit. Type ? to update the display."); put_crlf(); } } /* ** enter_key(name, value, label) ** ** Enter a function key into the data base */ void enter_key( const char *name, char *value, char *lab) { alloc_strings(); if (value) { int found = 0; if (key_count != 0) { size_t j = strlen(value); fkmax = (fkmax > j) ? fkmax : j; /* do not permit duplicates */ for (j = 0; j < (size_t) key_count; j++) { if (fk_name[j] == 0) { break; } else if (!strcmp(fk_name[j], name)) { found = 1; break; } } } if (!found) { fkval[key_count] = value; fk_tested[key_count] = 0; fk_label[key_count] = lab; fk_name[key_count++] = name; if (lab) { got_labels = TRUE; } } } } static void fresh_line(void) { /* clear the line for a new function key line */ if (over_strike) { put_crlf(); } else { put_cr(); if (clr_eol) { tc_putp(clr_eol); } else { put_str(" \r"); } } } static int end_funky(int ch) { /* return true if this is the end */ switch (ch) { case 'e': case 'E': end_state = 'e'; break; case 'n': case 'N': if (end_state == 'e') { end_state = 'n'; } else { end_state = 0; } break; case 'd': case 'D': if (end_state == 'n') { end_state = 'd'; } else { end_state = 0; } break; case 'l': case 'L': if (end_state == 'l') { end_state = '?'; } else { end_state = 'l'; } break; default: end_state = 0; break; } return end_state == 'd'; } static int found_match(char *s, int hx, int cc) { /* return true if this string is a match */ int j, f; alloc_strings(); if (!*s) { return 0; } if (scan_mode) { for (j = f = 0; scan_down[j]; j++) { if (scan_length[j] == 0) { continue; } if (!strncmp(s, scan_down[j], scan_length[j])) { if (!f) { /* first match */ put_cr(); if (hx) { put_str(hex_expand_to(s, 10)); } else { put_str(expand_to(s, 10)); } f = 1; } (void) end_funky(scan_name[j][0]); put_str(" "); put_str(scan_name[j]); scan_tested[j] = 1; s += scan_length[j]; if (strncmp(s, scan_up[j], scan_length[j])) { put_str(" scan down"); } else { s += scan_length[j]; } if (!*s) { break; } j = -1; } if (!strncmp(s, scan_up[j], scan_length[j])) { if (!f) { /* first match */ put_cr(); if (hx) { put_str(hex_expand_to(s, 10)); } else { put_str(expand_to(s, 10)); } f = 1; } put_str(" "); put_str(scan_name[j]); put_str(" scan up"); s += scan_length[j]; if (!*s) { break; } j = -1; } } } else { for (j = f = 0; j < key_count; j++) { if (fkval[j] && !strcmp(s, fkval[j])) { char outbuf[256]; if (!f) { /* first match */ put_cr(); if (hx) { put_str(hex_expand_to(s, 10)); } else { put_str(expand_to(s, 10)); } f = 1; } sprintf(outbuf, " (%.80s)", fk_name[j]); put_str(outbuf); if (fk_label[j]) { sprintf(outbuf, " <%.80s>", fk_label[j]); put_str(outbuf); } fk_tested[j] = 1; } } } if (end_state == '?') { keys_tested(0, 1, hx); tty_raw(cc, char_mask); end_state = 0; } return f; } static int found_exit(char *keybuf, int hx, int cc) { /* return true if the user wants to exit */ int j; char *s; if (scan_mode) { if (*keybuf == '\0') { return TRUE; } } else { int k; /* break is a special case */ if (*keybuf == '\0') { fresh_line(); tty_set(); ptext("Hit X to exit: "); if (wait_here() == 'X') { return TRUE; } keys_tested(0, 1, hx); tty_raw(cc, char_mask); return FALSE; } /* is this the end? */ for (k = 0; (j = (keybuf[k] & STRIP_PARITY)); k++) { if (end_funky(j)) { return TRUE; } } j = TRUE; /* does he need an updated list? */ for (k = 0; keybuf[k]; k++) { j &= (keybuf[k] & STRIP_PARITY) == '?'; } if (j || end_state == '?') { keys_tested(0, 1, hx); tty_raw(cc, char_mask); end_state = 0; return FALSE; } } put_cr(); if (hx) { s = hex_expand_to(keybuf, 10); } else { s = expand_to(keybuf, 10); } sprintf(temp, "%.80s Unknown", s); put_str(temp); for (j = 0; j < MAX_FK_UNK; j++) { if (j == funk) { fk_length[funk] = expand_chars; if ((fk_unknown[funk] = (char *) malloc(strlen(s) + 1))) { strcpy(fk_unknown[funk++], s); } break; } if (fk_length[j] == expand_chars) { if (!strcmp(fk_unknown[j], s)) { break; } } } return FALSE; } /* ** funkey_keys(test_list, status, ch) ** ** Test function keys */ static void funkey_keys( TestList * t, int *state, int *ch) { char keybuf[256]; if (keypad_xmit) { tc_putp(keypad_xmit); } keys_tested(1, 1, hex_out); /* also clears screen */ keybuf[0] = '\0'; end_state = 0; if (scan_mode) { fkmax = scan_max; } tty_raw(0, char_mask); while (end_state != 'd') { read_key(keybuf, sizeof(keybuf)); fresh_line(); if (found_match(keybuf, hex_out, 0)) { continue; } if (found_exit(keybuf, hex_out, 0)) { break; } } if (keypad_local) { tc_putp(keypad_local); } keys_tested(0, 0, hex_out); ptext("Function key test "); generic_done_message(t, state, ch); } int tty_meta_prep(void) { /* print a warning before the meta key test */ if (not_a_tty) { return 0; } if (initial_stty_query(TTY_8_BIT)) { return 0; } ptext("The meta key test must be run with the"); ptext(" terminal set for 8 data bits. Two stop bits"); ptext(" may also be needed for correct display. I will"); ptext(" transmit 8 bit data but if the terminal is set for"); ptextln(" 7 bit data, garbage may appear on the screen."); return 1; } static int put_reply(int col, int limit, const char *reply) { int step = (int) strlen(reply); if ((col += step) >= limit) { put_crlf(); col = step; } put_str(reply); return col; } /* ** funkey_meta(test_list, status, ch) ** ** Test meta key (km) (smm) (rmm) */ static void funkey_meta( TestList * t, int *state, int *ch) { if (has_meta_key) { int i, j, k, len, pass; const char *s; char outbuf[256]; put_crlf(); if (char_mask != ALLOW_PARITY) { if (tty_meta_prep()) { ptext("\nHit any key to continue > "); (void) wait_here(); put_crlf(); } } for (pass = 0; pass < 2; ++pass) { if (pass) { ptext("Continue meta key test."); } else { ptext("Begin meta key test. (km) (smm) (rmm)"); } ptext(" Hit any key while pressing the meta key."); ptext(" The character will be displayed in hex."); if (pass) { ptext(" Meta mode is off;"); ptext(" the meta key should have no effect."); } else { ptext(" If the meta key is working,"); ptext(" then the most significant bit will be set."); } put_crlf(); ptextln("Type 'end' to exit."); tty_raw(1, ALLOW_PARITY); tc_putp(meta_on); for (i = j = k = len = 0; i != 'e' || j != 'n' || k != 'd';) { i = j; j = k; k = getchp(ALLOW_PARITY); if (k == EOF) { break; } sprintf(outbuf, "%02X ", k); len = put_reply(len, columns, outbuf); if ((s = unctrl((chtype) k)) != NULL) { sprintf(outbuf, "(%s) ", s); len = put_reply(len, columns, outbuf); } k &= STRIP_PARITY; } if (!pass) tc_putp(meta_off); put_crlf(); } tty_set(); put_crlf(); } else { ptext("(km) Has-meta-key is not set. "); } generic_done_message(t, state, ch); } /* ** funkey_label(test_list, status, ch) ** ** Test labels (nlab) (smln) (pln) (rmln) (lw) (lh) */ static void funkey_label( TestList * t, int *state, int *ch) { if (num_labels == -1) { ptextln("Your terminal has no labels. (nlab)"); } else { int i; int my_width = label_width; char outbuf[256]; sprintf(temp, "Your terminal has %d labels (nlab) that are %d characters wide (lw) and %d lines high (lh)", num_labels, my_width, label_height); ptext(temp); ptextln(" Testing (smln) (pln) (rmln)"); if (label_on) { tc_putp(label_on); } if (my_width <= 0) { my_width = sizeof(outbuf) - 1; } for (i = 1; i <= num_labels; i++) { sprintf(outbuf, "L%d..............................", i); outbuf[my_width] = '\0'; tc_putp(TPARM_2(plab_norm, i, outbuf)); } if (label_off) { ptext("Hit any key to remove the labels: "); (void) wait_here(); tc_putp(label_off); } } generic_done_message(t, state, ch); } /* ** funkey_prog(test_list, status, ch) ** ** Test program function keys (pfx) */ static void funkey_prog( TestList * t, int *state, int *ch) { if (pkey_xmit) { int i; int fk = 1; char mm[256]; /* test program function key */ sprintf(temp, "(pfx) Set function key %d to transmit abc\\n", fk); ptextln(temp); tc_putp(TPARM_2(pkey_xmit, fk, "abc\n")); sprintf(temp, "Hit function key %d\n", fk); ptextln(temp); memset(mm, 0, (size_t) 4); for (i = 0; i < 4; ++i) { int cc = getchp(STRIP_PARITY); if (cc == EOF) break; mm[i] = (char) cc; } mm[i] = '\0'; put_crlf(); if (mm[0] != 'a' || mm[1] != 'b' || mm[2] != 'c') { sprintf(temp, "Error string received was: %s", expand(mm)); ptextln(temp); } else { putln("Thank you\n"); } flush_input(); if (key_f1) { tc_putp(TPARM_2(pkey_xmit, fk, key_f1)); } } else { ptextln("Function key transmit (pfx), not present."); } generic_done_message(t, state, ch); } /* ** funkey_local(test_list, status, ch) ** ** Test program local function keys (pfloc) */ static void funkey_local( TestList * t, int *state, int *ch) { if (pkey_local) { int fk = 1; /* test local function key */ sprintf(temp, "(pfloc) Set function key %d to execute a clear and print \"Done!\"", fk); ptextln(temp); sprintf(temp, "%.*sDone!", TEMP_SIZE - 10, liberated(clear_screen)); tc_putp(TPARM_2(pkey_local, fk, temp)); sprintf(temp, "Hit function key %d. Then hit return.", fk); ptextln(temp); (void) wait_here(); flush_input(); if (key_f1 && pkey_xmit) { tc_putp(TPARM_2(pkey_xmit, fk, key_f1)); } } else { ptextln("Function key execute local (pfloc), not present."); } generic_done_message(t, state, ch); } /* ** printer_on(test_list, status, ch) ** ** Test printer on/off (mc4) (mc5) (mc5i) */ static void printer_on( TestList * t, int *state, int *ch) { if (!prtr_on || !prtr_off) { ptextln("Printer on/off missing. (mc5) (mc4)"); } else if (prtr_silent) { ptextln("Your printer is silent. (mc5i) is set."); tc_putp(prtr_on); ptextln("This line should be on the printer but not your screen. (mc5)"); tc_putp(prtr_off); ptextln("This line should be only on the screen. (mc4)"); } else { ptextln("Your printer is not silent. (mc5i) is reset."); tc_putp(prtr_on); ptextln("This line should be on the printer and the screen. (mc5)"); tc_putp(prtr_off); ptextln("This line should only be on the screen. (mc4)"); } generic_done_message(t, state, ch); } /* ** printer_mc0(test_list, status, ch) ** ** Test screen print (mc0) */ static void printer_mc0( TestList * t, int *state, int *ch) { if (print_screen) { ptext("I am going to send the contents of the screen to"); ptext(" the printer, then wait for a keystroke from you."); ptext(" All of the text that appears on the screen"); ptextln(" should be printed. (mc0)"); tc_putp(print_screen); } else { ptext("(mc0) Print-screen is not present. "); } generic_done_message(t, state, ch); } static void line_pattern(void) { /* put up a pattern that will help count the number of lines */ int i; put_clear(); if (over_strike) { for (i = 0; i < 100; i++) { int j; if (i) { put_crlf(); } for (j = i / 10; j; j--) { put_this(' '); } put_this('0' + ((i + 1) % 10)); } } else { /* I assume it will scroll */ for (i = 100; i; i--) { sprintf(temp, "\r\n%d", i); put_str(temp); } } } static void column_pattern(void) { /* put up a pattern that will help count the number of columns */ int i, j; put_clear(); for (i = 0; i < 20; i++) { for (j = 1; j < 10; j++) { put_this('0' + j); } put_this('.'); } } /* ** report_help() ** ** Print the help text for the echo tests */ static void report_help(int crx) { ptextln("The following commands may also be entered:"); ptextln(" clear clear screen."); ptextln(" columns print a test pattern to help count screen width."); ptextln(" lines print a test pattern to help count screen length."); ptextln(" end exit."); ptextln(" echo redisplay last report."); if (crx) { ptextln(" hex redisplay last report in hex."); } else { ptextln(" hex toggle hex display mode."); } ptextln(" help display this list."); ptextln(" high toggle forced high bit (0x80)."); ptextln(" scan toggle scan mode."); ptextln(" one echo one character after or as is. (report mode)"); ptextln(" two echo two characters after or as is."); ptextln(" all echo all characters after or as is. (echo mode)"); } /* ** tools_report(testlist, state, ch) ** ** Run the echo tool and report tool */ void tools_report( TestList * t, int *state GCC_UNUSED, int *pch GCC_UNUSED) { int i, j, crp, crx, high_bit, save_scan_mode, hex_display; char buf[1024]; char txt[8]; hex_display = hex_out; put_clear(); if ((crx = (t->flags & 255)) == 1) { ptext("Characters after a CR or LF will be echoed as"); ptextln(" is. All other characters will be expanded."); report_help(crx); } else { /* echo test */ ptextln("Begin echo test."); report_help(crx); } memset(txt, 0, sizeof(txt)); save_scan_mode = scan_mode; tty_raw(1, char_mask); for (i = crp = high_bit = 0;;) { int ch = getchp(char_mask); if (ch == EOF) { break; } if (i >= (int) sizeof(buf) - 1) { i = 0; } buf[i++] = (char) ch; buf[i] = '\0'; for (j = 0; j < (int) sizeof(txt) - 1; j++) { txt[j] = txt[j + 1]; } txt[sizeof(txt) - 1] = (char) (ch & STRIP_PARITY); if (crx == 0) { /* echo test */ if (hex_display) { ptext(hex_expand_to(&buf[i - 1], 3)); } else { tc_putch((TC_PUTCH) (ch | high_bit)); } } else if (ch == '\n' || ch == '\r') { /* status report test */ put_crlf(); crp = 0; } else if (crp++ < crx) { tc_putch((TC_PUTCH) (ch | high_bit)); } else { put_str(expand(&buf[i - 1])); } if (!strncmp(&txt[sizeof(txt) - 7], "columns", (size_t) 7)) { column_pattern(); buf[i = 0] = '\0'; crp = 0; } if (!strncmp(&txt[sizeof(txt) - 5], "lines", (size_t) 5)) { line_pattern(); buf[i = 0] = '\0'; crp = 0; } if (!strncmp(&txt[sizeof(txt) - 5], "clear", (size_t) 5)) { put_clear(); buf[i = 0] = '\0'; crp = 0; } if (!strncmp(&txt[sizeof(txt) - 4], "high", (size_t) 4)) { high_bit ^= 0x80; if (high_bit) { ptextln("\nParity bit set"); } else { ptextln("\nParity bit reset"); } } if (!strncmp(&txt[sizeof(txt) - 4], "help", (size_t) 4)) { put_crlf(); report_help(crx); } if (!strncmp(&txt[sizeof(txt) - 4], "echo", (size_t) 4)) { /* display the last status report */ /* clear bypass condition on Tek terminals */ put_crlf(); if (i >= 4) { buf[i -= 4] = '\0'; } put_str(expand(buf)); } if (save_scan_mode && !strncmp(&txt[sizeof(txt) - 4], "scan", (size_t) 4)) { /* toggle scan mode */ scan_mode = !scan_mode; } if (!strncmp(&txt[sizeof(txt) - 3], "end", (size_t) 3)) break; if (!strncmp(&txt[sizeof(txt) - 3], "hex", (size_t) 3)) { if (crx) { /* display the last status report in hex */ /* clear bypass condition on Tek terminals */ put_crlf(); if (i >= 3) { buf[i -= 3] = '\0'; } put_str(hex_expand_to(buf, 3)); } else { hex_display = !hex_display; } } if (!strncmp(&txt[sizeof(txt) - 3], "two", (size_t) 3)) crx = 2; if (!strncmp(&txt[sizeof(txt) - 3], "one", (size_t) 3)) crx = 1; if (!strncmp(&txt[sizeof(txt) - 3], "all", (size_t) 3)) crx = 0; } scan_mode = save_scan_mode; put_crlf(); tty_set(); if (crx) { ptextln("End of status report test."); } else { ptextln("End of echo test."); } } #if NO_LEAKS void tack_fun_leaks(void) { FreeIfNeeded(fk_name); FreeIfNeeded(fkval); FreeIfNeeded(fk_label); FreeIfNeeded(fk_tested); } #endif tack-1.09-20230201/edit.c0000644000000000000000000010730713621606572013063 0ustar rootroot/* ** Copyright 2017-2019,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include #include #include MODULE_ID("$Id: edit.c,v 1.48 2020/02/14 21:13:30 tom Exp $") /* * These are adapted from tic.h */ typedef struct { const char *nt_name; NAME_TYPE nt_type; int nt_index; } NAME_TABLE; #define NAME_ENTRY_DATA 1 /* * Terminfo edit features */ #if TACK_CAN_EDIT #define SHOW_VALUE 1 #define SHOW_EDIT 2 #define SHOW_DELETE 3 static char change_pad_text[MAX_CHANGES][80]; static TestList change_pad_list[MAX_CHANGES] = { {MENU_LAST, 0, 0, 0, 0, 0, 0} }; static TERMTYPE original_term; /* terminal type description */ #endif static char *flag_boolean; /* flags for booleans */ static char *flag_numbers; /* flags for numerics */ static char *flag_strings; /* flags for strings */ static int *label_strings; static int xon_index; /* Subscript for (xon) */ static int xon_shadow; #if TACK_CAN_EDIT static int start_display; /* the display has just started */ static int display_lines; /* number of lines displayed */ #endif static void alloc_arrays(void) { if (flag_boolean == 0) { flag_boolean = (char *) calloc((size_t) MAX_BOOLEAN, sizeof(char)); } if (flag_numbers == 0) { flag_numbers = (char *) calloc((size_t) MAX_NUMBERS, sizeof(char)); } if (flag_strings == 0) { label_strings = (int *) calloc((size_t) MAX_STRINGS, sizeof(int)); flag_strings = (char *) calloc((size_t) MAX_STRINGS, sizeof(char)); } } static int compare_capability(const void *a, const void *b) { const NAME_TABLE *p = (const NAME_TABLE *) a; const NAME_TABLE *q = (const NAME_TABLE *) b; return strcmp(p->nt_name, q->nt_name); } #if (defined(HAVE_CURSES_DATA_BOOLNAMES) || defined(DECL_CURSES_DATA_BOOLNAMES)) #define DATA(index,name,type) { name,type,index } static NAME_TABLE name_table[] = { #include }; #undef DATA #define SIZEOF_NAME_TABLE (sizeof(name_table) / sizeof(name_table[0])) #define alloc_name_table() /* nothing */ #else static NAME_TABLE *name_table; static size_t sizeof_name_table; #define SIZEOF_NAME_TABLE sizeof_name_table static int compare_data(const void *a, const void *b) { const NAME_TABLE *p = (const NAME_TABLE *) a; const NAME_TABLE *q = (const NAME_TABLE *) b; return strcmp(p->nt_name, q->nt_name); } static void alloc_name_table(void) { if (name_table == 0) { size_t s; size_t d = 0; sizeof_name_table = (size_t) (max_booleans + max_numbers + max_strings); name_table = calloc(sizeof_name_table, sizeof(NAME_TABLE)); for (s = 0; s < max_booleans; ++s) { name_table[d].nt_name = boolnames[s]; name_table[d].nt_type = BOOLEAN; name_table[d].nt_index = (int) s; ++d; } for (s = 0; s < max_numbers; ++s) { name_table[d].nt_name = numnames[s]; name_table[d].nt_type = NUMBER; name_table[d].nt_index = (int) s; ++d; } for (s = 0; s < max_strings; ++s) { name_table[d].nt_name = strnames[s]; name_table[d].nt_type = STRING; name_table[d].nt_index = (int) s; ++d; } qsort(name_table, sizeof_name_table, sizeof(NAME_TABLE), compare_data); } } #endif static NAME_TABLE const * find_capability(const char *name) { NAME_TABLE key; NAME_TABLE *lookup; alloc_name_table(); memset(&key, 0, sizeof(key)); key.nt_name = name; lookup = bsearch(&key, name_table, SIZEOF_NAME_TABLE, sizeof(name_table[0]), compare_capability); return lookup ? lookup : 0; } #if !TACK_CAN_EDIT /* * This is used to relate array-index to capability name/type. */ static NAME_TABLE const * find_cap_by_index(int capIndex, NAME_TYPE capType) { static NAME_TABLE const *result = 0; size_t n; alloc_name_table(); for (n = 0; n < SIZEOF_NAME_TABLE; ++n) { if (name_table[n].nt_index == capIndex && name_table[n].nt_type == capType) { result = &name_table[n]; break; } } return result; } #endif static NAME_TABLE const * find_string_cap_by_name(const char *name) { NAME_TABLE const *result = find_capability(name); if (result != 0 && result->nt_type != STRING) result = 0; return result; } #if TACK_CAN_EDIT #define set_saved_boolean(num, value) original_term.Booleans[num] = (char)value #define set_saved_number(num, value) original_term.Numbers[num] = (short)value #define set_saved_string(num, value) original_term.Strings[num] = value #define get_saved_boolean(num) original_term.Booleans[num] #define get_saved_number(num) original_term.Numbers[num] #define get_saved_string(num) original_term.Strings[num] #define set_newer_boolean(num, value) CUR Booleans[num] = (char)value #define set_newer_number(num, value) CUR Numbers[num] = (short)value #define set_newer_string(num, value) CUR Strings[num] = value #define get_newer_boolean(num) CUR Booleans[num] #define get_newer_number(num) CUR Numbers[num] #define get_newer_string(num) CUR Strings[num] #else #define set_saved_boolean(num, value) /* nothing */ #define set_saved_number(num, value) /* nothing */ #define set_saved_string(num, value) /* nothing */ #define set_newer_boolean(num, value) /* nothing */ #define set_newer_number(num, value) /* nothing */ #define set_newer_string(num, value) /* nothing */ #if 0 static int get_newer_boolean(int num) { int result = 0; const NAME_TABLE *p = find_cap_by_index(num, BOOLEAN); if (p != 0) result = tigetflag((char *) p->nt_name); return result; } static int get_newer_number(int num) { int result = 0; const NAME_TABLE *p = find_cap_by_index(num, NUMBER); if (p != 0) result = tigetnum((char *) p->nt_name); return result; } #endif static char * get_newer_string(int num) { char *result = 0; const NAME_TABLE *p = find_cap_by_index(num, STRING); if (p != 0) result = tigetstr((char *) p->nt_name); return result; } #endif /* ** get_string_cap_byname(name, long_name) ** ** Given a cap name, find the value ** Errors are quietly ignored. */ const char * get_string_cap_byname( const char *name, const char **long_name) { NAME_TABLE const *nt; if ((nt = find_string_cap_by_name(name)) != 0) { #ifdef HAVE_CURSES_DATA_BOOLFNAMES *long_name = strfnames[nt->nt_index]; #endif return (get_newer_string(nt->nt_index)); } *long_name = "??"; return (char *) 0; } /* ** get_string_cap_byvalue(value) ** ** Given a capability string, find its position in the data base. ** Return the index or -1 if not found. */ int get_string_cap_byvalue( const char *value) { if (value) { int i; for (i = 0; i < (int) MAX_STRINGS; i++) { /* FIXME - this implies ncurses... */ if (get_newer_string(i) == value) { return i; } } /* search for translated strings */ for (i = 0; i < TM_last; i++) { if (TM_string[i].value == value) { return TM_string[i].index; } } } return -1; } /* ** user_modified() ** ** Return TRUE if the user has modified the terminfo */ #if TACK_CAN_EDIT int user_modified(void) { int i; for (i = 0; i < MAX_BOOLEAN; i++) { int v = (i == xon_index) ? xon_shadow : get_newer_boolean(i); if (get_saved_boolean(i) != v) { return TRUE; } } for (i = 0; i < MAX_NUMBERS; i++) { if (get_saved_number(i) != get_newer_number(i)) { return TRUE; } } for (i = 0; i < (int) MAX_STRINGS; i++) { const char *a, *b; if ((a = get_saved_string(i)) == 0) a = ""; if ((b = get_newer_string(i)) == 0) b = ""; if (strcmp(a, b)) { return TRUE; } } return FALSE; } #endif /***************************************************************************** * * Maintain the list of capabilities that can be tested * *****************************************************************************/ /* ** mark_cap(name, flag) ** ** Mark the cap data base with the flag provided. */ static void mark_cap( char *name, int flag) { NAME_TABLE const *nt; alloc_arrays(); if ((nt = find_capability(name)) != 0) { switch (nt->nt_type) { case BOOLEAN: flag_boolean[nt->nt_index] = ((char) (flag_boolean[nt->nt_index] | flag)); break; case STRING: flag_strings[nt->nt_index] = ((char) (flag_strings[nt->nt_index] | flag)); break; case NUMBER: flag_numbers[nt->nt_index] = ((char) (flag_numbers[nt->nt_index] | flag)); break; default: sprintf(temp, "unknown cap type (%.*s)", NAME_SIZE, name); ptextln(temp); break; } } else { #ifdef HAVE_CURSES_DATA_BOOLNAMES sprintf(temp, "Cap not found: %.*s", NAME_SIZE, name); ptextln(temp); (void) wait_here(); #endif } } /* ** can_test(name-list, flags) ** ** Scan the name list and get the names. ** Enter each name into the can-test data base. ** ( and ) may be used as separators. */ void can_test( const char *s, int flags) { if (s) { int ch, j; char name[NAME_SIZE]; for (j = 0; (ch = name[j] = *s); s++) { if (ch == ' ' || ch == ')' || ch == '(') { if (j) { name[j] = '\0'; mark_cap(name, flags); } j = 0; } else { j++; } } if (j) { mark_cap(name, flags); } } } /* ** cap_index(name-list, index-list) ** ** Scan the name list and return a list of indexes. ** ( and ) may be used as separators. ** This list is terminated with -1. */ void cap_index( const char *s, int *inx) { if (s) { int j; char name[NAME_SIZE]; for (j = 0;; s++) { int ch = name[j] = *s; if (ch == ' ' || ch == ')' || ch == '(' || ch == 0) { if (j) { NAME_TABLE const *nt; name[j] = '\0'; if ((nt = find_string_cap_by_name(name)) != 0) { *inx++ = nt->nt_index; } } if (ch == 0) { break; } j = 0; } else { j++; } } } *inx = -1; } /* ** cap_match(name-list, cap) ** ** Scan the name list and see if the cap is in the list. ** Return TRUE if we find an exact match. ** ( and ) may be used as separators. */ int cap_match( const char *names, const char *cap) { if (names) { int l = (int) strlen(cap); const char *s; while ((s = strstr(names, cap))) { int c = (names == s) ? 0 : *(s - 1); int t = s[l]; if ((c == 0 || c == ' ' || c == '(') && (t == 0 || t == ' ' || t == ')')) { return TRUE; } if (t == 0) { break; } names = s + l; } } return FALSE; } /* ** show_report(test_list, status, ch) ** ** Display a list of caps that can be tested */ void show_report( TestList * t, int *state GCC_UNUSED, int *ch) { int i, j, nc, flag; const char *s; size_t count = (size_t) (MAX_BOOLEAN + MAX_NUMBERS + MAX_STRINGS); const char **nx = (const char **) calloc(sizeof(const char *), count); alloc_arrays(); flag = t->flags & 255; nc = 0; for (i = 0; i < MAX_BOOLEAN; i++) { if (flag_boolean[i] & flag) { nx[nc++] = boolnames[i]; } } for (i = 0; i < MAX_NUMBERS; i++) { if (flag_numbers[i] & flag) { nx[nc++] = numnames[i]; } } for (i = 0; i < (int) MAX_STRINGS; i++) { if (flag_strings[i] & flag) { nx[nc++] = STR_NAME(i); } } /* sort */ for (i = 0; i < nc - 1; i++) { for (j = i + 1; j < nc; j++) { if (strcmp(nx[i], nx[j]) > 0) { s = nx[i]; nx[i] = nx[j]; nx[j] = s; } } } if (flag & FLAG_FUNCTION_KEY) { ptextln("The following function keys can be tested:"); } else if (flag & FLAG_CAN_TEST) { ptextln("The following capabilities can be tested:"); } else if (flag & FLAG_TESTED) { ptextln("The following capabilities have been tested:"); } put_crlf(); for (i = 0; i < nc; i++) { sprintf(temp, "%s ", nx[i]); ptext(temp); } put_newlines(1); *ch = REQUEST_PROMPT; free(nx); } #ifdef NCURSES_VERSION #if TACK_CAN_EDIT static size_t safe_length(const char *value) { size_t result = 0; if (VALID_STRING(value)) result = strlen(value) + 1; return result; } static size_t safe_copy(char *target, const char *source) { size_t result = safe_length(source); if (result) { memcpy(target, source, result); } return result; } static void copy_termtype(TERMTYPE *target, TERMTYPE *source) { size_t need; int n; #if NCURSES_XNAMES int num_Names = (source->ext_Booleans + source->ext_Numbers + source->ext_Strings); #endif memset(target, 0, sizeof(*target)); #define copy_array(member,count) \ target->member = calloc((size_t)(count), sizeof(target->member[0])); \ memcpy(target->member, source->member, (size_t)(count) * sizeof(target->member[0])) copy_array(Booleans, MAX_BOOLEAN); copy_array(Numbers, MAX_NUMBERS); copy_array(Strings, MAX_STRINGS); need = safe_length(source->term_names); for (n = 0; n < STRCOUNT; ++n) { need += safe_length(source->Strings[n]); } if (need) { size_t have = 0; target->term_names = target->str_table = malloc(need); have = safe_copy(target->term_names, source->term_names); for (n = 0; n < STRCOUNT; ++n) { if (VALID_STRING(source->Strings[n])) { target->Strings[n] = target->str_table + have; have = safe_copy(target->Strings[n], source->Strings[n]); } } } #if NCURSES_XNAMES target->num_Booleans = source->num_Booleans; target->num_Numbers = source->num_Numbers; target->num_Strings = source->num_Strings; target->ext_Booleans = source->ext_Booleans; target->ext_Numbers = source->ext_Numbers; target->ext_Strings = source->ext_Strings; need = 0; for (n = 0; n < source->ext_Strings; ++n) { need += safe_length(source->ext_str_table + need); } for (n = 0; n < num_Names; ++n) { need += safe_length(source->ext_Names[n]); } if (need) { size_t have = 0; target->ext_Names = calloc((size_t) num_Names, sizeof(target->ext_Names[0])); target->ext_str_table = malloc(need); for (n = STRCOUNT; n < source->num_Strings; ++n) { if (safe_length(source->Strings[n])) { target->Strings[n] = target->ext_str_table + have; have += safe_copy(target->Strings[n], source->Strings[n]); } } for (n = 0; n < num_Names; ++n) { target->ext_Names[n] = target->ext_str_table + have; have += safe_copy(target->ext_Names[n], source->ext_Names[n]); } } #endif /* NCURSES_XNAMES */ } #endif /* TACK_CAN_EDIT */ #if NO_LEAKS static void free_termtype(TERMTYPE *tp) { free(tp->Booleans); free(tp->Numbers); free(tp->Strings); free(tp->str_table); #if NCURSES_XNAMES free(tp->ext_str_table); free(tp->ext_Names); #endif memset(tp, 0, sizeof(*tp)); } #endif /* NO_LEAKS */ #endif /* NCURSES_VERSION */ /* ** edit_init() ** ** Initialize the function key data base */ void edit_init(void) { int i, j, lc; char *lab; NAME_TABLE const *nt; alloc_arrays(); #if TACK_CAN_EDIT copy_termtype(&original_term, CUR_TP); for (i = 0; i < MAX_BOOLEAN; i++) { set_saved_boolean(i, get_newer_boolean(i)); } for (i = 0; i < MAX_NUMBERS; i++) { set_saved_number(i, get_newer_number(i)); } #endif /* scan for labels */ for (i = lc = 0; i < (int) MAX_STRINGS; i++) { set_saved_string(i, get_newer_string(i)); if (strncmp(STR_NAME(i), "lf", (size_t) 2) == 0) { flag_strings[i] |= FLAG_LABEL; if (get_newer_string(i)) { label_strings[lc++] = i; } } } /* scan for function keys */ for (i = 0; i < (int) MAX_STRINGS; i++) { const char *this_name = STR_NAME(i); if ((this_name[0] == 'k') && strcmp(this_name, "kmous")) { flag_strings[i] |= FLAG_FUNCTION_KEY; lab = (char *) 0; for (j = 0; j < lc; j++) { if (!strcmp(this_name, STR_NAME(label_strings[j]))) { lab = get_newer_string(label_strings[j]); break; } } enter_key(this_name, get_newer_string(i), lab); } } /* Lookup the translated strings */ for (i = 0; i < TM_last; i++) { if ((nt = find_string_cap_by_name(TM_string[i].name)) != 0) { TM_string[i].index = nt->nt_index; } else { sprintf(temp, "TM_string lookup failed for: %s", TM_string[i].name); ptextln(temp); } } if ((nt = find_capability("xon")) != 0) { xon_index = nt->nt_index; } xon_shadow = xon_xoff; FreeIfNeeded(label_strings); } #if TACK_CAN_EDIT /* ** save_info_string(str, fp) ** ** Write the terminfo string prefixed by the correct separator */ static void save_info_string( const char *str, FILE *fp) { int len; len = (int) strlen(str); if (len + display_lines >= 77) { if (display_lines > 0) { (void) fprintf(fp, "\n\t"); } display_lines = 8; } else if (display_lines > 0) { (void) fprintf(fp, " "); display_lines++; } else { (void) fprintf(fp, "\t"); display_lines = 8; } (void) fprintf(fp, "%s,", str); display_lines += len + 1; } /* * This is adapted (and reduced) from ncurses' _nc_tic_expand function. */ /* this deals with differences over whether 0x7f and 0x80..0x9f are controls */ #define REALPRINT(s) (UChar(*(s)) < 127 && isprint(UChar(*(s)))) #define P_LIMIT(p) (length - (size_t)(p)) #define L_BRACE '{' #define S_QUOTE '\'' #define R_BRACE '}' static char * form_terminfo(const char *srcp) { static char *buffer; static size_t length; int bufp; const char *str = VALID_STRING(srcp) ? srcp : "\0\0"; size_t need = (2 + strlen(str)) * 4; int ch; if (srcp == 0) { #if NO_LEAKS if (buffer != 0) { free(buffer); buffer = 0; length = 0; } #endif return 0; } if (buffer == 0 || need > length) { char *tofree = buffer; if ((buffer = (char *) realloc(buffer, length = need)) == 0) { free(tofree); return 0; } } bufp = 0; while ((ch = UChar(*str)) != 0) { if (ch == '%' && REALPRINT(str + 1)) { buffer[bufp++] = *str++; /* * If we have a "%{number}", try to translate it into a "%'char'" * form, since that will run a little faster when we are * interpreting it. Having one form for the constant makes it * simpler to compare terminal descriptions. */ if (str[0] == L_BRACE && isdigit(UChar(str[1]))) { char *dst = 0; long value = strtol(str + 1, &dst, 0); if (dst != 0 && *dst == R_BRACE && value < 127 && value != '\\' && isprint((int) value)) { ch = (int) value; buffer[bufp++] = S_QUOTE; if (ch == S_QUOTE) buffer[bufp++] = '\\'; buffer[bufp++] = (char) ch; buffer[bufp++] = S_QUOTE; str = dst; } else { buffer[bufp++] = *str; } } else { buffer[bufp++] = *str; } } else if (ch == 128) { buffer[bufp++] = '\\'; buffer[bufp++] = '0'; } else if (ch == '\033') { buffer[bufp++] = '\\'; buffer[bufp++] = 'E'; } else if (ch == '\\' && (str == srcp || str[-1] != '^')) { buffer[bufp++] = '\\'; buffer[bufp++] = '\\'; } else if (ch == ' ' && (str == srcp || strcspn(str, " \t") == 0)) { buffer[bufp++] = '\\'; buffer[bufp++] = 's'; } else if (ch == ',' || ch == ':' || ch == '^') { buffer[bufp++] = '\\'; buffer[bufp++] = (char) ch; } else if (REALPRINT(str) && (ch != ',' && ch != ':' && ch != '^')) { buffer[bufp++] = (char) ch; } else if (ch == '\r') { buffer[bufp++] = '\\'; buffer[bufp++] = 'r'; } else if (ch == '\n') { buffer[bufp++] = '\\'; buffer[bufp++] = 'n'; } else if (UChar(ch) < 32 && isdigit(UChar(str[1]))) { sprintf(&buffer[bufp], "^%c", ch + '@'); bufp += 2; } else { sprintf(&buffer[bufp], "\\%03o", ch); bufp += 4; } str++; } buffer[bufp] = '\0'; return (buffer); } /* ** save_info(test_list, status, ch) ** ** Write the current terminfo to a file */ void save_info( TestList * t, int *state, int *ch) { int i; FILE *fp; time_t now; char buf[TEMP_SIZE]; if ((fp = fopen(tty_basename, "w")) == (FILE *) NULL) { (void) sprintf(temp, "can't open: %s", tty_basename); ptextln(temp); generic_done_message(t, state, ch); return; } time(&now); /* Note: ctime() returns a newline at the end of the string */ (void) fprintf(fp, "# Terminfo created by TACK for TERM=%s on %s", tty_basename, ctime(&now)); (void) fprintf(fp, "%s|%s,\n", tty_basename, longname()); display_lines = 0; for (i = 0; i < MAX_BOOLEAN; i++) { if (i == xon_index ? xon_shadow : get_newer_boolean(i)) { save_info_string(boolnames[i], fp); } } for (i = 0; i < MAX_NUMBERS; i++) { if (get_newer_number(i) >= 0) { sprintf(buf, "%s#%d", numnames[i], get_newer_number(i)); save_info_string(buf, fp); } } for (i = 0; i < (int) MAX_STRINGS; i++) { const char *value = get_newer_string(i); if (value) { sprintf(buf, "%s=%s", STR_NAME(i), form_terminfo(value)); save_info_string(buf, fp); } } (void) fprintf(fp, "\n"); (void) fclose(fp); sprintf(temp, "Terminfo saved as file: %s", tty_basename); ptextln(temp); } /* ** send_info_string(str) ** ** Return the terminfo string prefixed by the correct separator */ static void send_info_string( const char *str, int *ch) { int len; if (display_lines == -1) { return; } len = (int) strlen(str); if (len + char_count + 3 >= columns) { if (start_display == 0) { put_str(","); } put_crlf(); if (++display_lines > lines) { ptext("-- more -- "); *ch = wait_here(); if (*ch == 'q') { display_lines = -1; return; } display_lines = 0; } if (len >= columns) { /* if the terminal does not (am) then this loses */ if (columns) { display_lines += (((int) strlen(str) + 3) / columns) + 1; } put_str(" "); put_str(str); start_display = 0; return; } ptext(" "); } else if (start_display == 0) { ptext(", "); } else { ptext(" "); } ptext(str); start_display = 0; } /* ** show_info(test_list, status, ch) ** ** Display the current terminfo */ static void show_info( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { int i; char buf[TEMP_SIZE]; display_lines = 1; start_display = 1; for (i = 0; i < MAX_BOOLEAN; i++) { if ((i == xon_index) ? xon_shadow : get_newer_boolean(i)) { send_info_string(boolnames[i], ch); } } for (i = 0; i < MAX_NUMBERS; i++) { if (get_newer_number(i) >= 0) { sprintf(buf, "%s#%d", numnames[i], get_newer_number(i)); send_info_string(buf, ch); } } for (i = 0; i < (int) MAX_STRINGS; i++) { char *value = get_newer_string(i); if (value) { sprintf(buf, "%s=%s", STR_NAME(i), print_expand(value)); send_info_string(buf, ch); } } put_newlines(2); *ch = REQUEST_PROMPT; } /* * This is adapted (and reduced) from ncurses' _nc_trans_string function. * * Reads characters using next_char() until encountering a separator, nl, * or end-of-file. The returned value is the character which caused * reading to stop. The following translations are done on the input: * * ^X goes to ctrl-X (i.e. X & 037) * {\E,\n,\r,\b,\t,\f} go to * {ESCAPE,newline,carriage-return,backspace,tab,formfeed} * {\^,\\} go to {carat,backslash} * \ddd (for ddd = up to three octal digits) goes to the character ddd * * \e == \E * \0 == \200 * */ #define next_char() UChar(*source++) static void scan_terminfo(const char *source, char *target, char *last) { int number = 0; int i, c; int last_ch = '\0'; while ((c = next_char()) != '\0') { if (target >= (last - 1)) { if (c != '\0') { while ((c = next_char()) != ',' && c != '\0') { ; } } break; } if (c == '^' && last_ch != '%') { c = next_char(); if (c == '\0') goto error; if (!(c <= 126 && isprint(c))) { fprintf(stderr, "Illegal ^ character - '%s'\n", unctrl(UChar(c))); } if (c == '?') { *(target++) = '\177'; } else { if ((c &= 037) == 0) c = 128; *(target++) = (char) (c); } } else if (c == '\\') { c = next_char(); if (c == '\0') goto error; if ((c >= '0') && (c <= '7')) { number = c - '0'; for (i = 0; i < 2; i++) { c = next_char(); if (c == '\0') goto error; if ((c < '0') || (c > '7')) { if (isdigit(c)) { fprintf(stderr, "Non-octal digit `%c' in \\ sequence\n", c); /* allow the digit; it'll do less harm */ } else { --source; break; } } number = (number * 8) + (c - '0'); } number = UChar(number); if (number == 0) number = 0200; *(target++) = (char) number; } else { switch (c) { case 'e': /* FALLTHRU */ case 'E': c = '\033'; break; case 'n': c = '\n'; break; case 'r': c = '\r'; break; case 'b': c = '\010'; break; case 'f': c = '\014'; break; case 't': c = '\t'; break; case 'a': c = '\007'; break; case 'l': c = '\n'; break; case 's': c = ' '; break; default: if (strchr("^,|:\\", c) != 0) break; fprintf(stderr, "Illegal character '%s' in \\ sequence\n", unctrl(UChar(c))); /* FALLTHRU */ case '\n': /* ignored */ continue; } /* endswitch (c) */ *(target++) = (char) c; } /* endelse (c < '0' || c > '7') */ } else { *(target++) = (char) c; } last_ch = c; } /* end while */ *target = '\0'; return; error: fprintf(stderr, "Expected more input\n"); *target = '\0'; return; } /* ** show_value(test_list, status, ch) ** ** Display the value of a selected cap */ static void show_value( TestList * t, int *state GCC_UNUSED, int *ch) { NAME_TABLE const *nt; char *s; int n, op; char buf[TEMP_SIZE]; char tmp[TEMP_SIZE]; ptext("enter name: "); read_string(buf, (size_t) 80); if (buf[0] == '\0' || buf[1] == '\0') { *ch = buf[0]; return; } if (line_count + 2 >= lines) { put_clear(); } op = t->flags & 255; if ((nt = find_capability(buf)) != 0) { int b; switch (nt->nt_type) { case BOOLEAN: if (op == SHOW_DELETE) { if (nt->nt_index == xon_index) { xon_shadow = 0; } else { set_newer_boolean(nt->nt_index, 0); } return; } b = ((nt->nt_index == xon_index) ? xon_shadow : get_newer_boolean(nt->nt_index)); sprintf(temp, "boolean %.*s %s", (TEMP_SIZE - 30), buf, b ? "True" : "False"); break; case STRING: if (op == SHOW_DELETE) { set_newer_string(nt->nt_index, 0); return; } if (get_newer_string(nt->nt_index)) { sprintf(temp, "string %.*s %s", NAME_SIZE, buf, expand(get_newer_string(nt->nt_index))); } else { sprintf(temp, "undefined string %.*s", NAME_SIZE, buf); } break; case NUMBER: if (op == SHOW_DELETE) { set_newer_number(nt->nt_index, -1); return; } sprintf(temp, "numeric %.*s %d", NAME_SIZE, buf, get_newer_number(nt->nt_index)); break; default: sprintf(temp, "unknown"); break; } ptextln(temp); } else { sprintf(temp, "Cap not found: %.*s", NAME_SIZE, buf); ptextln(temp); return; } if (op != SHOW_EDIT) { return; } if (nt->nt_type == BOOLEAN) { ptextln("Value flipped"); if (nt->nt_index == xon_index) { xon_shadow = !xon_shadow; } else { set_newer_boolean(nt->nt_index, !get_newer_boolean(nt->nt_index)); } return; } ptextln("Enter new value"); read_string(buf, sizeof(buf)); switch (nt->nt_type) { case STRING: scan_terminfo(buf, tmp, tmp + sizeof(tmp)); s = (char *) malloc(strlen(tmp) + 1); strcpy(s, tmp); set_newer_string(nt->nt_index, s); sprintf(temp, "new string value %s", nt->nt_name); ptextln(temp); ptextln(expand(get_newer_string(nt->nt_index))); break; case NUMBER: if (sscanf(buf, "%d", &n) == 1) { set_newer_number(nt->nt_index, n); sprintf(temp, "new numeric value %s %d", nt->nt_name, n); ptextln(temp); } else { sprintf(temp, "Illegal number: %.*s", (TEMP_SIZE - 20), buf); ptextln(temp); } break; case BOOLEAN: default: break; } } /* ** show_untested(test_list, status, ch) ** ** Display a list of caps that are defined but cannot be tested. ** Don't bother to sort this list. */ static void show_untested( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { int i; alloc_arrays(); ptextln("Caps that are defined but cannot be tested:"); for (i = 0; i < MAX_BOOLEAN; i++) { if (flag_boolean[i] == 0 && get_newer_boolean(i)) { sprintf(temp, "%s ", boolnames[i]); ptext(temp); } } for (i = 0; i < MAX_NUMBERS; i++) { if (flag_numbers[i] == 0 && get_newer_number(i) >= 0) { sprintf(temp, "%s ", numnames[i]); ptext(temp); } } for (i = 0; i < (int) MAX_STRINGS; i++) { if (flag_strings[i] == 0 && get_newer_string(i)) { sprintf(temp, "%s ", STR_NAME(i)); ptext(temp); } } put_newlines(1); *ch = REQUEST_PROMPT; } /* ** show_changed(test_list, status, ch) ** ** Display a list of caps that have been changed. */ static void show_changed( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { int i, header = 1; static char title[] = " old value cap new value"; char abuf[TEMP_SIZE]; for (i = 0; i < MAX_BOOLEAN; i++) { int v = (i == xon_index) ? xon_shadow : get_newer_boolean(i); if (get_saved_boolean(i) != v) { if (header) { ptextln(title); header = 0; } sprintf(temp, "%30d %6s %d", get_saved_boolean(i), boolnames[i], v); ptextln(temp); } } for (i = 0; i < MAX_NUMBERS; i++) { if (get_saved_number(i) != get_newer_number(i)) { if (header) { ptextln(title); header = 0; } sprintf(temp, "%30d %6s %d", get_saved_number(i), numnames[i], get_newer_number(i)); ptextln(temp); } } for (i = 0; i < (int) MAX_STRINGS; i++) { const char *a; const char *b; if ((a = get_saved_string(i)) == 0) a = ""; if ((b = get_newer_string(i)) == 0) b = ""; if (strcmp(a, b)) { if (header) { ptextln(title); header = 0; } sprintf(abuf, "%.*s", (int) sizeof(abuf) - 1, form_terminfo(a)); sprintf(temp, "%.30s %6s %.30s", abuf, STR_NAME(i), form_terminfo(b)); putln(temp); } } if (header) { ptextln("No changes"); } put_crlf(); *ch = REQUEST_PROMPT; } /* ** change_one_entry(test_list, status, ch) ** ** Change the padding on the selected cap */ static void change_one_entry( TestList * test, int *state, int *chp) { NAME_TABLE const *nt; int i, j, x, star, slash, v, dot, ch; const char *s; char *t, *p; const char *current_string; char buf[TEMP_SIZE]; char pad[TEMP_SIZE]; i = test->flags & 255; if (i == 255) { /* read the cap name from the user */ ptext("enter name: "); read_string(pad, (size_t) NAME_SIZE); if (pad[0] == '\0' || pad[1] == '\0') { *chp = pad[0]; return; } if ((nt = find_string_cap_by_name(pad)) != 0) { x = nt->nt_index; current_string = get_newer_string(x); } else { sprintf(temp, "%.*s is not a string capability", NAME_SIZE, pad); ptext(temp); generic_done_message(test, state, chp); return; } } else { x = tx_index[i]; current_string = tx_cap[i]; sprintf(pad, "%.*s", (int) sizeof(pad) - 1, STR_NAME(x)); } if (!current_string) { ptextln("That string is not currently defined. Please enter a new value, including the padding delay:"); read_string(buf, sizeof(buf)); scan_terminfo(buf, pad, pad + sizeof(pad)); t = (char *) malloc(strlen(pad) + 1); strcpy(t, pad); set_newer_string(x, t); sprintf(temp, "new string value %s", STR_NAME(x)); ptextln(temp); ptextln(expand(t)); return; } sprintf(buf, "Current value: (%.*s) %s", NAME_SIZE, pad, form_terminfo(current_string)); putln(buf); ptextln("Enter new pad. 0 for no pad. CR for no change."); read_string(buf, (size_t) NAME_SIZE); if (buf[0] == '\0' || (buf[1] == '\0' && isalpha(UChar(buf[0])))) { *chp = buf[0]; return; } star = slash = FALSE; for (j = v = dot = 0; (ch = buf[j]); j++) { if (ch >= '0' && ch <= '9') { v = ch - '0' + v * 10; if (dot) { dot++; } } else if (ch == '*') { star = TRUE; } else if (ch == '/') { slash = TRUE; } else if (ch == '.') { dot = 1; } else { sprintf(temp, "Illegal character: %c", ch); ptextln(temp); ptext("General format: 99.9*/ "); generic_done_message(test, state, chp); return; } } while (dot > 2) { v /= 10; dot--; } if (dot == 2) { sprintf(pad, "%d.%d%s%s", v / 10, v % 10, star ? "*" : "", slash ? "/" : ""); } else { sprintf(pad, "%d%s%s", v, star ? "*" : "", slash ? "/" : ""); } s = current_string; t = buf; for (v = 0; (ch = *t = *s++); t++) { if (v == '$' && ch == '<') { while ((ch = *s++) && (ch != '>')) ; for (p = pad; (*++t = *p++);) ; *t++ = '>'; while ((*t++ = *s++)) ; pad[0] = '\0'; break; } v = ch; } if (pad[0]) { sprintf(t, "$<%.*s>", 20, pad); } if ((t = (char *) malloc(strlen(buf) + 1))) { strcpy(t, buf); set_newer_string(x, t); if (i != 255) { tx_cap[i] = t; } } generic_done_message(test, state, chp); } /* ** build_change_menu(menu_list) ** ** Build the change pad menu list */ static void build_change_menu( TestMenu * m) { int i, j; char *s; for (i = j = 0; i < txp; i++) { int k; if ((k = tx_index[i]) >= 0) { s = form_terminfo(tx_cap[i]); s[40] = '\0'; sprintf(change_pad_text[j], "%c) (%s) %s", 'a' + j, STR_NAME(k), s); change_pad_list[j].flags = i; change_pad_list[j].lines_needed = 4; change_pad_list[j].menu_entry = change_pad_text[j]; change_pad_list[j].test_procedure = change_one_entry; j++; } } strcpy(change_pad_text[j], "z) enter name"); change_pad_list[j].flags = 255; change_pad_list[j].lines_needed = 4; change_pad_list[j].menu_entry = change_pad_text[j]; change_pad_list[j].test_procedure = change_one_entry; j++; change_pad_list[j].flags = MENU_LAST; if (m->menu_title) { put_crlf(); ptextln(m->menu_title); } } /* *INDENT-OFF* */ TestList edit_test_list[] = { {MENU_CLEAR, 0, 0, 0, "i) display current terminfo", show_info, 0}, {0, 0, 0, 0, "w) write the current terminfo to a file", save_info, 0}, {SHOW_VALUE, 3, 0, 0, "v) show value of a selected cap", show_value, 0}, {SHOW_EDIT, 4, 0, 0, "e) edit value of a selected cap", show_value, 0}, {SHOW_DELETE, 3, 0, 0, "d) delete string", show_value, 0}, {0, 3, 0, 0, "m) show caps that have been modified", show_changed, 0}, {MENU_CLEAR + FLAG_CAN_TEST, 0, 0, 0, "c) show caps that can be tested", show_report, 0}, {MENU_CLEAR + FLAG_TESTED, 0, 0, 0, "t) show caps that have been tested", show_report, 0}, {MENU_CLEAR + FLAG_FUNCTION_KEY, 0, 0, 0, "f) show a list of function keys", show_report, 0}, {MENU_CLEAR, 0, 0, 0, "u) show caps defined that can not be tested", show_untested, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* *INDENT-ON* */ TestMenu change_pad_menu = { 0, 'q', 0, "Select cap name", "change", 0, build_change_menu, change_pad_list, 0, 0, 0 }; #else #endif /* TACK_CAN_EDIT */ #if NO_LEAKS void tack_edit_leaks(void) { free_termtype(&original_term); FreeIfNeeded(label_strings); FreeIfNeeded(flag_boolean); FreeIfNeeded(flag_numbers); FreeIfNeeded(flag_strings); } #endif tack-1.09-20230201/tack.h0000644000000000000000000004377314366602345013074 0ustar rootroot/* ** Copyright 2017-2022,2023 Thomas E. Dickey ** Copyright 1997-2015,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ /* $Id: tack.h,v 1.95 2023/02/02 00:33:41 tom Exp $ */ #ifndef NCURSES_TACK_H_incl #define NCURSES_TACK_H_incl 1 /* terminfo action checker include file */ #define MAJOR_VERSION 1 #define MINOR_VERSION 9 #define PATCH_VERSION 20230201 #ifdef HAVE_CONFIG_H #include #else #define HAVE_GETTIMEOFDAY 1 #define HAVE_SELECT 1 #define HAVE_SYS_TIME_H 1 #endif #ifndef BROKEN_LINKER #define BROKEN_LINKER 0 #endif #ifndef GCC_NORETURN #define GCC_NORETURN /*nothing */ #endif #ifndef GCC_UNUSED #define GCC_UNUSED /*nothing */ #endif #ifndef HAVE_LONG_FILE_NAMES #define HAVE_LONG_FILE_NAMES 0 #endif #ifndef NCURSES_CONST #ifdef NCURSES_VERSION #define NCURSES_CONST const #else #define NCURSES_CONST /*nothing */ #endif #endif #ifndef NO_LEAKS #define NO_LEAKS 0 #endif #ifndef USE_DATABASE #define USE_DATABASE 0 #endif #ifndef USE_TERMCAP #define USE_TERMCAP 0 #endif #ifndef USE_RCS_IDS #define USE_RCS_IDS 0 #endif #include #include #include #include #include #include /* include before curses.h to work around glibc bug */ #include #if defined(NCURSES_VERSION) && defined(HAVE_TERM_ENTRY_H) #include #define TACK_CAN_EDIT 1 #else #define TACK_CAN_EDIT 0 #include #include #define TTY struct termios #define TERMIOS 1 #define GET_TTY(fd, buf) tcgetattr(fd, buf) #endif #if USE_RCS_IDS #define MODULE_ID(id) static const char Ident[] = id; #else #define MODULE_ID(id) /*nothing */ #endif #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) #define IGNORE_RC(func) ignore_unused = (int) func #else #define IGNORE_RC(func) (void) func #endif /* gcc workarounds */ #ifndef down_half_line #define down_half_line 0 /* NetBSD bug */ #endif #ifndef hue_lightness_saturation #define hue_lightness_saturation 0 /* NetBSD bug */ #endif #ifndef plab_norm #define plab_norm 0 /* NetBSD bug */ #endif #ifndef prtr_off #define prtr_off 0 /* NetBSD bug */ #endif #ifndef prtr_on #define prtr_on 0 /* NetBSD bug */ #endif #if NO_LEAKS extern void tack_edit_leaks(void); extern void tack_fun_leaks(void); #ifdef HAVE__NC_FREE_TINFO extern GCC_NORETURN void _nc_free_tinfo(int); #endif #ifndef ExitProgram extern GCC_NORETURN void ExitProgram(int); #endif #else #define ExitProgram(code) exit(code) #undef NO_LEAKS #define NO_LEAKS 0 #endif #ifdef NCURSES_VERSION #define ChangeTermInfo(name,value) name = value #else #define ChangeTermInfo(name,value) /* nothing */ #endif #define FreeIfNeeded(p) if (p) { free(p); p = 0; } #include #ifdef DECL_CURSES_DATA_BOOLNAMES #undef boolnames extern char *boolnames[]; extern size_t max_booleans; #undef numnames extern char *numnames[]; extern size_t max_numbers; #undef strnames extern char *strnames[]; extern size_t max_strings; #undef boolfnames extern char *boolfnames[]; #undef numfnames extern char *numfnames[]; #undef strfnames extern char *strfnames[]; #endif #define ABSENT_STRING (char *)0 #define CANCELLED_STRING (char *)(-1) #define VALID_STRING(s) ((s) != CANCELLED_STRING && (s) != ABSENT_STRING) #if TACK_CAN_EDIT #define CUR_TP ((TERMTYPE *)(cur_term)) #define MAX_BOOLEAN BOOLCOUNT /* NUM_BOOLEANS(CUR_TP) */ #define MAX_NUMBERS NUMCOUNT /* NUM_NUMBERS(CUR_TP) */ #define MAX_STRINGS NUM_STRINGS(CUR_TP) #define STR_NAME(n) ExtStrname(CUR_TP,n,strnames) #elif defined(BOOLCOUNT) #define MAX_BOOLEAN BOOLCOUNT #define MAX_NUMBERS NUMCOUNT #define MAX_STRINGS STRCOUNT #define STR_NAME(n) strnames[n] #else #define MAX_BOOLEAN max_booleans #define MAX_NUMBERS max_numbers #define MAX_STRINGS max_strings #define STR_NAME(n) strnames[n] #endif typedef enum { BOOLEAN, NUMBER, STRING } NAME_TYPE; /* see ncurses' nc_tparm.h */ #define TPARM_FMT NCURSES_CONST char * #define TPARM_ARG long #define TPARM_N(n) (TPARM_ARG)(n) #define TPARM_9(a,b,c,d,e,f,g,h,i,j) tparm((TPARM_FMT)a,TPARM_N(b),TPARM_N(c),TPARM_N(d),TPARM_N(e),TPARM_N(f),TPARM_N(g),TPARM_N(h),TPARM_N(i),TPARM_N(j)) #define TPARM_8(a,b,c,d,e,f,g,h,i) TPARM_9(a,b,c,d,e,f,g,h,i,0) #define TPARM_7(a,b,c,d,e,f,g,h) TPARM_8(a,b,c,d,e,f,g,h,0) #define TPARM_6(a,b,c,d,e,f,g) TPARM_7(a,b,c,d,e,f,g,0) #define TPARM_5(a,b,c,d,e,f) TPARM_6(a,b,c,d,e,f,0) #define TPARM_4(a,b,c,d,e) TPARM_5(a,b,c,d,e,0) #define TPARM_3(a,b,c,d) TPARM_4(a,b,c,d,0) #define TPARM_2(a,b,c) TPARM_3(a,b,c,0) #define TPARM_1(a,b) TPARM_2(a,b,0) #define TPARM_0(a) TPARM_1(a,0) #define UChar(c) ((unsigned char)(c)) #define NAME_SIZE 32 #define TEMP_SIZE 1024 #define LOG_FILENAME "tack.log" #define DBG_FILENAME "debug.log" extern FILE *log_fp; extern FILE *debug_fp; extern int debug_level; extern char temp[TEMP_SIZE]; extern char *tty_basename; extern char tty_shortname[]; #if defined(__GNUC__) && defined(_FORTIFY_SOURCE) extern int ignore_unused; #endif #define SYNC_FAILED 0 #define SYNC_TESTED 1 #define SYNC_NOT_TESTED 2 #define SYNC_NEEDED 3 extern int tty_can_sync; extern int total_pads_sent; /* count pad characters sent */ extern int total_caps_sent; /* count caps sent */ extern int total_printing_characters; /* count printing characters sent */ extern SIG_ATOMIC_T no_alarm_event; /* TRUE if the alarm has not gone off yet */ extern unsigned long usec_run_time; /* length of last test in microseconds */ extern int raw_characters_sent; /* Total output characters */ /* Stopwatch event timers */ #define TIME_TEST 0 #define TIME_SYNC 1 #define TIME_FLUSH 2 #define MAX_TIMERS 3 /* definitions for pad.c */ #define ENSURE_DELAY if (!tt_delay_used) napms(10) #define EXIT_CONDITION (no_alarm_event && (tt_delay_used < tt_delay_max)) #define SLOW_TERMINAL_EXIT if (!test_complete && !EXIT_CONDITION) { break; } #define CAP_NOT_FOUND if (auto_pad_mode) return extern char letters[26 + 1]; #define NEXT_LETTER letter = letters[letter_number =\ letters[letter_number + 1] ? letter_number + 1 : 0] extern int test_complete; /* counts number of tests completed */ extern char letter; extern int letter_number; extern int augment, repeats; extern long char_sent; extern const char *pad_repeat_test; /* commands that force repeat */ extern int replace_mode; extern int char_count, line_count, expand_chars; extern int can_go_home, can_clear_screen; extern int translate_mode, scan_mode; extern int auto_pad_mode; /* TRUE for auto time tests */ extern int char_mask; extern int hex_out; /* Display output in hex */ /* Parity bit macros */ #define STRIP_PARITY 0x7f #define ALLOW_PARITY 0xff /* select_delay_type: 0 -> reset all delays 1 -> force long delays 2 -> do not change the delays */ extern int select_delay_type; /* select_xon_xoff: 0 -> reset xon/xoff 1 -> set xon/xoff 2 -> do not change xon/xoff */ extern int select_xon_xoff; extern int tty_frame_size; extern unsigned tty_baud_rate; extern unsigned long tty_cps; /* The number of characters per second */ extern SIG_ATOMIC_T not_a_tty; extern int nodelay_read; extern int send_reset_init; /* definitions for stty_query() and initial_stty_query() */ #define TTY_CHAR_MODE 0 #define TTY_NOECHO 1 #define TTY_OUT_TRANS 2 #define TTY_8_BIT 3 #define TTY_XON_XOFF 4 /* scan code definitions */ #define MAX_SCAN 256 /* translate mode default strings */ typedef struct default_string_list { const char *name; /* terminfo name */ const char *value; /* value of default string */ int index; /* index into the strfname[] array */ } DefaultStringList; #define TM_last 8 extern struct default_string_list TM_string[TM_last]; /* attribute structure definition */ typedef struct mode_list { const char *name; const char *begin_mode; const char *end_mode; int number; } ModeList; extern const struct mode_list alt_modes[]; extern const int mode_map[]; /* Test data base */ #define FLAG_CAN_TEST 1 #define FLAG_TESTED 2 #define FLAG_LABEL 4 #define FLAG_FUNCTION_KEY 8 /* caps under test data base */ #define TT_MAX 8 #define MAX_CHANGES (TT_MAX+2) extern int tt_delay_max; /* max number of milliseconds we can delay */ extern int tt_delay_used; /* number of milliseconds consumed in delay */ extern const char *tt_cap[TT_MAX]; /* value of string */ extern int tt_affected[TT_MAX]; /* lines or columns effected (repetition factor) */ extern int tt_count[TT_MAX]; /* Number of times sent */ extern int tt_delay[TT_MAX]; /* Number of milliseconds delay */ extern int ttp; /* number of entries used */ extern const char *tx_cap[TT_MAX]; /* value of string */ extern int tx_affected[TT_MAX]; /* lines or columns effected (repetition factor) */ extern int tx_count[TT_MAX]; /* Number of times sent */ extern int tx_delay[TT_MAX]; /* Number of milliseconds delay */ extern int tx_index[TT_MAX]; /* String index */ extern int txp; /* number of entries used */ extern int tx_characters; /* printing characters sent by test */ extern unsigned long tx_cps; /* characters per second */ /* Menu control for tack. */ struct test_list; typedef void (TestFunc) (struct test_list * t, int *state, int *ch); struct test_menu; typedef void (MenuFunc) (struct test_menu *); typedef struct test_results { struct test_results *next; /* point to next entry */ struct test_list *test; /* Test which got these results */ int reps; /* repeat count */ int delay; /* delay times 10 */ } TestResults; typedef struct test_list { int flags; /* Test description flags */ int lines_needed; /* Lines needed for test (0->no action) */ const char *caps_done; /* Caps shown in Done message */ const char *caps_tested; /* Other caps also being tested */ const char *menu_entry; /* Menu entry text (optional) */ TestFunc *test_procedure; /* Function that does testing */ struct test_menu *sub_menu; /* Nested sub-menu */ } TestList; typedef struct test_menu { int flags; /* Menu feature flag */ int default_action; /* Default command if entered */ const char *menu_text; /* Describe this test_menu */ const char *menu_title; /* Title for the menu */ const char *ident; /* short menu name */ const char *standard_tests; /* Standard test text */ MenuFunc *menu_function; /* print current settings (optional) */ TestList *tests; /* Pointer to the menu/function pairs */ TestList *resume_tests; /* Standard test resume point */ int resume_state; /* resume state of test group */ int resume_char; /* resume ch of test group */ } TestMenu; /* menu flags */ #define MENU_100c 0x00001a00 /* Augment 100% of columns */ #define MENU_90c 0x00001900 /* Augment 90% of columns */ #define MENU_80c 0x00001800 /* Augment 80% of columns */ #define MENU_70c 0x00001700 /* Augment 70% of columns */ #define MENU_60c 0x00001600 /* Augment 60% of columns */ #define MENU_50c 0x00001500 /* Augment 50% of columns */ #define MENU_40c 0x00001400 /* Augment 40% of columns */ #define MENU_30c 0x00001300 /* Augment 30% of columns */ #define MENU_20c 0x00001200 /* Augment 20% of columns */ #define MENU_10c 0x00001100 /* Augment 10% of columns */ #define MENU_LM1 0x00002e00 /* Augment lines - 1 */ #define MENU_100l 0x00002a00 /* Augment 100% of lines */ #define MENU_90l 0x00002900 /* Augment 90% of lines */ #define MENU_50l 0x00002500 /* Augment 50% of lines */ #define MENU_lines 0x00002000 /* Augment of lines */ #define MENU_columns 0x00001000 /* Augment of columns */ #define MENU_LC_MASK 0x00003000 /* Augment mask for lines and columns */ #define MENU_1L 0x00002f00 /* Augment == one */ #define MENU_1C 0x00001f00 /* Augment == one */ #define MENU_ONE 0x00000f00 /* Augment == one */ #define MENU_ONE_MASK 0x00000f00 /* Augment == one mask */ #define MENU_REP_MASK 0x00003f00 /* Augment mask */ #define MENU_CLEAR 0x00010000 /* clear screen */ #define MENU_INIT 0x00020000 /* Initialization function */ #define MENU_NEXT 0x00040000 /* Next test in sequence */ #define MENU_LAST 0x00080000 /* End of menu list */ #define MENU_STOP 0x00100000 /* Stop testing next-in-sequence */ #define MENU_COMPLETE 0x00200000 /* Test complete after this */ #define MENU_MENU 0x00400000 /* Pass the menu name not test name */ #define REQUEST_PROMPT 256 /* tack.c */ #if TACK_CAN_EDIT extern TestMenu edit_menu; #define MY_EDIT_MENU {0, 0, 0, 0, "e) edit terminfo", 0, &edit_menu}, #else #define MY_EDIT_MENU /* nothing */ #endif #ifdef DEBUG #define TACKMSG(p) p extern void TackMsg(const char *, ...) GCC_PRINTFLIKE(1,2); #else #define TACKMSG(p) /* nothing */ #endif extern void show_usage(char *); extern void print_version(void); /* output.c */ extern char *expand(const char *); extern char *expand_command(const char *); extern char *expand_to(char *, int); extern char *hex_expand_to(char *, int); extern char *print_expand(char *); extern int getchp(int); extern int getnext(int); extern int log_chr(FILE *, int, int); extern int tc_putp(const char *); extern int wait_here(void); extern void go_home(void); extern void home_down(void); extern void log_str(FILE *, const char *); extern void maybe_wait(int); extern void ptext(const char *); extern void ptextln(const char *); extern void put_clear(void); extern void put_columns(const char *, int, int); extern void put_cr(void); extern void put_crlf(void); extern void put_ind(void); extern void put_lf(void); extern void put_newlines(int); extern void put_str(const char *); extern void put_this(int); extern void putchp(int); extern void putln(const char *); extern void read_string(char *, size_t); extern void tt_putp(const char *); extern void tt_putparm(NCURSES_CONST char *, int, int, int); extern void tt_tputs(const char *, int); /* Solaris is out of step - humor it */ #if defined(__EXTENSIONS__) && !defined(NCURSES_VERSION) #define TC_PUTCH char #else #define TC_PUTCH int #endif extern int tc_putch(TC_PUTCH); #define put_that(n) put_this((int) (n)) /* control.c */ extern TestList color_test_list[]; extern char *liberated(const char *); extern char txt_longer_augment[80]; extern char txt_longer_test_time[80]; extern char txt_shorter_augment[80]; extern char txt_shorter_test_time[80]; extern int msec_cost(const char *const, int); extern int skip_pad_test(TestList *, int *, int *, const char *); extern int sliding_scale(int, int, unsigned long); extern int still_testing(void); extern long event_time(int); extern void control_init(void); extern void dump_test_stats(TestList *, int *, int *); extern void event_start(int); extern void longer_augment(TestList *, int *, int *); extern void longer_test_time(TestList *, int *, int *); extern void pad_test_shutdown(TestList *, int); extern void pad_test_startup(int); extern void page_loop(void); extern void set_augment_txt(void); extern void shorter_augment(TestList *, int *, int *); extern void shorter_test_time(TestList *, int *, int *); /* charset.c */ extern TestList acs_test_list[]; extern void set_attr(int); extern void eat_cookie(void); extern void put_mode(const char *); /* crum.c */ extern TestList crum_test_list[]; /* ansi.c */ extern void tools_status(TestList *, int *, int *); extern void tools_charset(TestList *, int *, int *); extern void tools_sgr(TestList *, int *, int *); /* edit.c */ #if TACK_CAN_EDIT extern TestMenu change_pad_menu; extern TestList edit_test_list[]; #define MY_PADS_MENU {0, 0, 0, 0, "p) change padding", 0, &change_pad_menu}, #else #define MY_PADS_MENU /* nothing */ #endif extern const char *get_string_cap_byname(const char *, const char **); extern int cap_match(const char *names, const char *cap); extern int get_string_cap_byvalue(const char *); extern int user_modified(void); extern void can_test(const char *, int); extern void cap_index(const char *, int *); extern void edit_init(void); extern void save_info(TestList *, int *, int *); extern void show_report(TestList *, int *, int *); /* fun.c */ extern TestList funkey_test_list[]; extern TestList printer_test_list[]; extern void enter_key(const char *, char *, char *); extern int tty_meta_prep(void); extern void tools_report(TestList *, int *, int *); /* init.c */ extern const char *safe_tgets(NCURSES_CONST char *); extern void reset_init(void); extern void display_basic(void); extern void charset_can_test(void); extern void curses_setup(char *); extern void bye_kids(int); /* scan.c */ extern char **scan_up, **scan_down, **scan_name; extern int scan_key(void); extern size_t scan_max; /* length of longest scan code */ extern size_t *scan_tested, *scan_length; extern void scan_init(char *fn); /* sysdep.c */ extern int initial_stty_query(int); extern int stty_query(int); extern void ignoresig(void); extern void read_key(char *, size_t); extern void set_alarm_clock(int); extern void spin_flush(void); extern void tty_init(void); extern void tty_raw(int, int); extern void tty_reset(void); extern void tty_set(void); /* menu.c */ extern char prompt_string[80]; /* menu prompt storage */ extern int subtest_menu(TestList *, int *, int *); extern TestList *augment_test; extern void generic_done_message(TestList *, int *, int *); extern void menu_can_scan(const TestMenu *); extern void menu_clear_screen(TestList *, int *, int *); extern void menu_display(TestMenu *, int *); extern void menu_prompt(void); extern void menu_reset_init(TestList *, int *, int *); extern void pad_done_message(TestList *, int *, int *); /* modes.c */ extern TestList mode_test_list[]; /* pad.c */ extern TestList pad_test_list[]; /* sync.c */ extern TestMenu sync_menu; extern int tty_sync_error(void); extern void flush_input(void); extern void sync_handshake(TestList *, int *, int *); extern void sync_test(TestMenu *); extern void verify_time(void); #endif /* NCURSES_TACK_H_incl */ tack-1.09-20230201/crum.c0000644000000000000000000002215113621607465013077 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2011,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: crum.c,v 1.15 2020/02/14 21:20:53 tom Exp $") /* * Test cursor movement. */ static void crum_clear(TestList * t, int *state, int *ch); static void crum_home(TestList * t, int *state, int *ch); static void crum_ll(TestList * t, int *state, int *ch); static void crum_move(TestList * t, int *state, int *ch); static void crum_os(TestList * t, int *state, int *ch); #define CRUM_SIZE 80 static char crum_text[5][CRUM_SIZE]; TestList crum_test_list[] = { MY_EDIT_MENU {MENU_NEXT, 0, "clear", 0, 0, crum_clear, 0}, {MENU_NEXT, 0, "home", 0, 0, crum_home, 0}, {MENU_NEXT, 0, "ll", 0, 0, crum_ll, 0}, {MENU_NEXT, 0, crum_text[0], "home cuu1", 0, crum_move, 0}, {MENU_NEXT + 1, 0, crum_text[1], "cub1 cud1 cuf1 cuu1", 0, crum_move, 0}, {MENU_NEXT + 2, 0, crum_text[2], "cub cud cuf cuu", 0, crum_move, 0}, {MENU_NEXT + 3, 0, crum_text[3], "vpa hpa", 0, crum_move, 0}, {MENU_NEXT + 4, 0, crum_text[4], "cup", 0, crum_move, 0}, {MENU_NEXT, 0, "cup", "os", 0, crum_os, 0}, {MENU_LAST, 0, 0, 0, 0, 0, 0} }; /* ** move_to(from-row, from-column, to-row, to-column, selection) ** ** move the cursor from (rf, cf) to (rt, ct) using sel */ static void move_to( int rf, int cf, int rt, int ct, int sel) { char *s; if (sel & 16) { /* use (cup) */ s = TPARM_2(cursor_address, rt, ct); tputs(s, lines, tc_putch); return; } if (sel & 8) { /* use (hpa) (vpa) */ if (column_address) { s = TPARM_1(column_address, ct); tputs(s, 1, tc_putch); cf = ct; } if (row_address) { s = TPARM_1(row_address, rt); tputs(s, 1, tc_putch); rf = rt; } } if (sel & 4) { /* parameterized relative cursor movement */ if (parm_right_cursor) if (cf < ct) { s = TPARM_1(parm_right_cursor, ct - cf); tputs(s, ct - cf, tc_putch); cf = ct; } if (parm_left_cursor) if (cf > ct) { s = TPARM_1(parm_left_cursor, cf - ct); tputs(s, cf - ct, tc_putch); cf = ct; } if (parm_down_cursor) if (rf < rt) { s = TPARM_1(parm_down_cursor, rt - rf); tputs(s, rt - rf, tc_putch); rf = rt; } if (parm_up_cursor) if (rf > rt) { s = TPARM_1(parm_up_cursor, rf - rt); tputs(s, rf - rt, tc_putch); rf = rt; } } if (sel & 2) { if (cursor_left) while (cf > ct) { tc_putp(cursor_left); cf--; } /* do vertical motion next. Just in case cursor_down has a side effect of changing the column. This could happen if the tty handler translates NL to CRNL. */ if (cursor_down) while (rf < rt) { tc_putp(cursor_down); rf++; } if (cursor_up) while (rf > rt) { tc_putp(cursor_up); rf--; } if (cursor_right) while (cf < ct) { tc_putp(cursor_right); cf++; } } /* last chance */ if (rf > rt) { if (can_go_home) { /* a bit drastic but ... */ go_home(); cf = 0; rf = 0; } else if (cursor_up) { while (rf > rt) { tc_putp(cursor_up); rf--; } } } if (ct == 0 && rt > rf) { put_crlf(); cf = 0; rf++; } if (ct == 0 && cf != 0) { put_cr(); cf = 0; } while (rf < rt) { put_lf(); rf++; } while (cf > ct) { put_str("\b"); cf--; } if (cursor_right) { while (cf < ct) { tc_putp(cursor_right); cf++; } } else { /* go ahead and trash my display */ while (cf < ct) { putchp(' '); cf++; } } } /* ** display_it(selection, text) ** ** print the display using sel */ static void display_it( int sel, char *txt) { int i, done_line; put_clear(); go_home(); put_newlines(2); ptextln(" The top line should be alternating <'s and >'s"); ptextln(" The left side should be alternating A's and V's"); ptext(" Testing "); ptext(txt); put_cr(); /* horizontal */ move_to(done_line = line_count, 0, 0, 2, sel); for (i = 4; i < columns - 2; i += 2) { putchp('>'); move_to(0, i - 1, 0, i, sel); } putchp('>'); i -= 2; move_to(0, i + 1, 0, i - 1, sel); for (; i > 2; i -= 2) { putchp('<'); move_to(0, i, 0, i - 3, sel); } putchp('<'); /* vertical */ move_to(0, 2, 0, 0, sel); for (i = 2; i < lines - 1; i += 2) { putchp('V'); move_to(i - 2, 1, i, 0, sel); } putchp('V'); i -= 2; move_to(i, 1, i + 1, 0, sel); for (; i > 0; i -= 2) { putchp('A'); move_to(i + 1, 1, i - 1, 0, sel); } putchp('A'); move_to(i + 1, 1, 0, 0, sel); /* go home first */ move_to(0, 0, done_line + 1, 3, sel); put_str(txt); put_str(" Done. "); } /* ** crum_clear(test_list, status, ch) ** ** (clear) test Clear screen */ static void crum_clear( TestList * t, int *state, int *ch) { if (clear_screen) { int i; for (i = lines; i > 1; i--) { putln("garbage"); } put_clear(); ptextln("This line should start in the home position."); ptext("The rest of the screen should be clear. "); } else { ptextln("(clear) Clear screen is not defined. "); } generic_done_message(t, state, ch); } /* ** crum_home(test_list, status, ch) ** ** (home) test Home cursor */ static void crum_home( TestList * t, int *state, int *ch) { if (cursor_home) { put_clear(); put_newlines(lines / 2); go_home(); put_crlf(); ptext("The bottom line should have text."); go_home(); put_newlines(lines - 1); ptext("This line is on the bottom."); go_home(); ptextln("This line starts in the home position."); put_crlf(); } else { ptextln("(home) Home cursor is not defined. "); } generic_done_message(t, state, ch); } /* ** crum_ll(test_list, status, ch) ** ** (ll) test Last line */ static void crum_ll( TestList * t, int *state, int *ch) { /* (ll) may be simulated with (cup). Don't complain if (cup) is present. */ if (cursor_to_ll) { put_clear(); put_str("This line could be anywhere."); tc_putp(cursor_to_ll); ptext("This line should be on the bottom"); go_home(); put_crlf(); } else if (cursor_address) { return; } else { ptextln("(ll) Move to last line is not defined. "); } generic_done_message(t, state, ch); } /* ** crum_move(test_list, status, ch) ** ** (*) test all cursor move commands */ static void crum_move( TestList * t, int *state, int *ch) { char buf[80]; int n; switch (n = (t->flags & 15)) { case 0: sprintf(buf, " (cr) (nel) (cub1)%s", cursor_home ? " (home)" : (cursor_up ? " (cuu1)" : "")); break; case 1: sprintf(buf, "%s%s%s%s", cursor_left ? " (cub1)" : "", cursor_down ? " (cud1)" : "", cursor_right ? " (cuf1)" : "", cursor_up ? " (cuu1)" : ""); if (buf[0] == '\0') { ptext(" (cub1) (cud1) (cuf1) (cuu1) not defined."); } break; case 2: sprintf(buf, "%s%s%s%s", parm_left_cursor ? " (cub)" : "", parm_down_cursor ? " (cud)" : "", parm_right_cursor ? " (cuf)" : "", parm_up_cursor ? " (cuu)" : ""); if (buf[0] == '\0') { ptext(" (cub) (cud) (cuf) (cuu) not defined."); } break; case 3: sprintf(buf, "%s%s", row_address ? " (vpa)" : "", column_address ? " (hpa)" : ""); if (buf[0] == '\0') { ptext(" (vpa) (hpa) not defined."); } break; case 4: if (!cursor_address) { ptext(" (cup) not defined. "); generic_done_message(t, state, ch); return; } strcpy(buf, " (cup)"); break; default: buf[0] = '\0'; break; } if (buf[0] == '\0') { put_str(" Done. "); } else { can_test(buf, FLAG_TESTED); sprintf(crum_text[n], "%.*s", CRUM_SIZE - 1, &buf[2]); crum_text[n][strlen(buf) - 3] = '\0'; display_it(1 << n, buf); } *ch = wait_here(); if (*ch != 'r') { put_clear(); } } /* ** crum_os(test_list, status, ch) ** ** (cup) test Cursor position on overstrike terminals */ static void crum_os( TestList * t, int *state, int *ch) { if (cursor_address && over_strike) { int i; put_clear(); for (i = 0; i < columns - 2; i++) { tc_putch('|'); } for (i = 1; i < lines - 2; i++) { put_crlf(); tc_putch('_'); } for (i = 0; i < columns - 2; i++) { tputs(TPARM_2(cursor_address, 0, i), lines, tc_putch); tc_putch('+'); } for (i = 0; i < lines - 2; i++) { tputs(TPARM_2(cursor_address, i, 0), lines, tc_putch); tc_putch(']'); tc_putch('_'); } go_home(); put_newlines(3); ptext(" All the characters should look the same. "); generic_done_message(t, state, ch); put_clear(); } } tack-1.09-20230201/ansi.c0000644000000000000000000005002713615560366013067 0ustar rootroot/* ** Copyright 2017,2020 Thomas E. Dickey ** Copyright 1997-2012,2017 Free Software Foundation, Inc. ** ** This file is part of TACK. ** ** TACK 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, version 2. ** ** TACK 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 TACK; see the file COPYING. If not, write to ** the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, ** Boston, MA 02110-1301, USA */ #include MODULE_ID("$Id: ansi.c,v 1.20 2020/02/02 14:47:18 tom Exp $") /* * Standalone tests for ANSI terminals. Three entry points: * test_ansi_graphics(), test_ansi_reports() and test_ansi_sgr(). */ /***************************************************************************** * * Test ANSI status reports * *****************************************************************************/ /* ASCII control characters */ #define A_DC1 0x11 /* Control Q */ #define A_DC3 0x13 /* Control S */ #define A_ESC 0x1b #define A_DCS 0x90 #define A_CSI 0x9b #define A_ST 0x9c #define MAX_MODES 256 static char default_bank[] = "\033(B\017"; static int private_use, ape, terminal_class; static short ansi_value[256]; static unsigned char ansi_buf[512], pack_buf[512]; struct ansi_reports { int lvl, final; const char *text; const char *request; }; static struct ansi_reports report_list[] = { {0, 'c', "(DA) Primary device attributes", "\033[0c"}, {1, 0, "(DSR) Terminal status", "\033[5n"}, {1, 'R', "(DSR) Cursor position", "\033[6n"}, {62, 0, "(DA) Secondary device attributes", "\033[>0c"}, {62, 0, "(DSR) Printer status", "\033[?15n"}, {62, 0, "(DSR) Function key definition", "\033[?25n"}, {62, 0, "(DSR) Keyboard language", "\033[?26n"}, {63, 0, "(DECRQSS) Data destination", "\033P$q$}\033\\"}, {63, 0, "(DECRQSS) Status line type", "\033P$q$~\033\\"}, {63, 0, "(DECRQSS) Erase attribute", "\033P$q\"q\033\\"}, {63, 0, "(DECRQSS) Personality", "\033P$q\"p\033\\"}, {63, 0, "(DECRQSS) Top and bottom margins", "\033P$qr\033\\"}, {63, 0, "(DECRQSS) Character attributes", "\033P$qm\033\\"}, {63, 0, "(DECRQSS) Illegal request", "\033P$q@\033\\"}, {63, 0, "(DECRQUPSS) User pref supplemental set", "\033[&u"}, {63, 0, "(DECRQPSR) Cursor information", "\033[1$w"}, {63, 0, "(DECRQPSR) Tab stop information", "\033[2$w"}, {64, 0, "(DA) Tertiary device attributes", "\033[=0c"}, {64, 0, "(DSR) Extended cursor position", "\033[?6n"}, {64, 0, "(DSR) Macro space", "\033[?62n"}, {64, 0, "(DSR) Memory checksum", "\033[?63n"}, {64, 0, "(DSR) Data integrity", "\033[?75n"}, {64, 0, "(DSR) Multiple session status", "\033[?85n"}, {64, 0, "(DECRQSS) Attribute change extent", "\033P$q*x\033\\"}, {64, 0, "(DECRQSS) Columns per page", "\033P$q$|\033\\"}, {64, 0, "(DECRQSS) Lines per page", "\033P$qt\033\\"}, {64, 0, "(DECRQSS) Lines per screen", "\033P$q*|\033\\"}, {64, 0, "(DECRQSS) Left and right margins", "\033P$qs\033\\"}, {64, 0, "(DECRQSS) Local functions", "\033P$q+q\033\\"}, {64, 0, "(DECRQSS) Local function key control", "\033P$q=}\033\\"}, {64, 0, "(DECRQSS) Select modifier key reporting", "\033P$q+r\033\\"}, {64, 0, "(DECRQDE) Window report", "\033[\"v"}, {0, 0, 0, 0} }; struct request_control { const char *text; const char *expect; const char *request; const char *set_mode; const char *reset_mode; }; /* Request control function selection or setting */ static const struct request_control rqss[] = { {"Data sent to screen", "0", "$}", "\033[0$}", 0}, {"Data sent to disabled status line", "0", "$}", 0, 0}, {"\033[0$~\033[1$}", "\033[0$}", 0, 0, 0}, {"Data sent to enabled status line", "1", "$}", 0, 0}, {"\033[2$~\033[1$}", "\033[0$}", 0, 0, 0}, {"Disable status line", "0", "$~", "\033[0$~", 0}, {"Top status line", "1", "$~", "\033[1$~", 0}, {"Bottom status line", "2", "$~", "\033[2$~", 0}, {"Erasable character", "0", "\"q", "\033[0\"q", 0}, {"Nonerasable character", "1", "\"q", "\033[1\"q", "\033[0\"q"}, {"Top and bottom margins", "3;10", "r", "\0337\033[3;10r", 0}, {"\033[r\0338", 0, 0, 0, 0}, {"Top and bottom margins", "default", "r", "\0337\033[r", "\0338"}, {"Character attributes, dim, bold", "1", "m", "\033[2;1m", "\033[m"}, {"Character attributes, bold, dim", "2", "m", "\033[1;2m", "\033[m"}, {"Character attributes, under, rev", "4;7", "m", "\033[4;7m", "\033[m"}, {"Character attributes, color", "35;42", "m", "\033[35;42m", "\033[m"}, {"All character attributes", "", "m", "\033[1;2;3;4;5;6;7;8;9m", 0}, {"\033[m", 0, 0, 0, 0}, {0, 0, 0, 0, 0} }; /* ** read_ansi() ** ** read an ANSI status report from terminal */ static void read_ansi(void) { int ch, i, j, last_escape; fflush(stdout); read_key((char *) ansi_buf, sizeof(ansi_buf)); /* Throw away control characters inside CSI sequences. Convert two character 7-bit sequences into 8-bit sequences. */ for (i = j = last_escape = 0; (ch = ansi_buf[i]) != 0; i++) { if (ch == A_ESC) { if (last_escape == A_ESC) { pack_buf[j++] = A_ESC; } last_escape = A_ESC; } else if (last_escape == A_ESC && ch >= '@' && ch <= '_') { last_escape = ch + 0x40; pack_buf[j++] = (unsigned char) last_escape; } else if (last_escape != A_CSI || (ch > 0x20 && ch != 0x80)) { if (last_escape == A_ESC) { pack_buf[j++] = A_ESC; } if (ch > 0x80 && ch < 0xa0) { last_escape = ch; } pack_buf[j++] = (unsigned char) ch; } } if (last_escape == A_ESC) { pack_buf[j++] = A_ESC; } pack_buf[j] = '\0'; return; } /* ** valid_mode(expected) ** ** read a terminal mode status report and parse the result ** Return TRUE if we got the expected terminating character. */ static int valid_mode(int expected) { unsigned char *s; int ch, terminator; read_ansi(); ape = 0; ch = UChar(pack_buf[0]); ansi_value[0] = 0; if (ch != A_CSI && ch != A_DCS) return FALSE; s = pack_buf + 1; private_use = 0; if ((*s >= '<') & (*s <= '?')) { private_use = *s++; } terminator = 0; for (; (ch = *s); s++) { if (ch >= '0' && ch <= '9') ansi_value[ape] = (short) (ansi_value[ape] * 10 + ch - '0'); else if (ch == ';' || ch == ':') ansi_value[++ape] = 0; else if (ch >= '<' && ch <= '?') private_use = ch; else if (ch >= ' ') terminator = (terminator << 8) | ch; else break; } return terminator == expected; } /* ** read_reports() ** ** read all the reports in the ANSI report structure */ static int read_reports(void) { int i, tc, lc; lc = 5; terminal_class = tc = 0; for (i = 0; report_list[i].text; i++, lc++) { int j, vcr; char *s; if (terminal_class < report_list[i].lvl && tc < report_list[i].lvl) { put_crlf(); menu_prompt(); ptext("/status [q] > "); j = wait_here(); if (j != 'n' && j != 'N') return 0; tc = report_list[i].lvl; lc = 1; } else if (lc + 2 >= lines) { put_crlf(); ptext("Hit any key to continue "); (void) wait_here(); lc = 1; } sprintf(temp, "%s (%s) ", report_list[i].text, expand_command(report_list[i].request)); ptext(temp); for (j = (int) strlen(temp); j < 49; j++) putchp(' '); tc_putp(report_list[i].request); vcr = 0; if (report_list[i].final == 0) { read_ansi(); } else if (valid_mode(report_list[i].final)) switch (report_list[i].final) { case 'c': terminal_class = ansi_value[0]; break; case 'R': vcr = TRUE; break; } j = UChar(pack_buf[0]); if (j != A_CSI && j != A_DCS) { const char *t; put_crlf(); t = "*** The above request gives illegal response ***"; ptext(t); for (j = (int) strlen(t); j < 49; j++) putchp(' '); } s = expand((const char *) ansi_buf); if (char_count + expand_chars >= columns) { put_str("\r\n "); lc++; } putln(s); if (vcr) { /* find out how big the screen is */ int k; tc_putp(report_list[i].request); if (!valid_mode('R')) continue; j = ansi_value[0]; k = ansi_value[1]; tc_putp("\033[255B\033[255C\033[6n"); if (!valid_mode('R')) continue; sprintf(temp, "\033[%d;%dH", j, k); tc_putp(temp); ptext("(DSR) Screen size (CSI 6 n)"); for (j = char_count; j < 50; j++) putchp(' '); sprintf(temp, "%d x %d", ansi_value[1], ansi_value[0]); ptextln(temp); } } menu_prompt(); ptext("/status r->repeat test, to continue > "); return wait_here(); } /* ** request_cfss() ** ** Request Control function selection or settings */ static int request_cfss(void) { int i, j, k, l, ch; char *s; put_clear(); ptextln("Request Expected Received"); put_crlf(); for (i = 0; rqss[i].text; i++) { ptext(rqss[i].text); if (rqss[i].expect == 0) continue; j = (int) (strlen(rqss[i].text) + strlen(rqss[i].expect)); putchp(' '); for (j++; j < 40; j++) putchp(' '); ptext(rqss[i].expect); putchp(' '); tc_putp(rqss[i].set_mode); sprintf(temp, "\033P$q%s\033\\", rqss[i].request); tc_putp(temp); read_ansi(); tc_putp(rqss[i].reset_mode); putchp(' '); for (j = 0; ansi_buf[j]; j++) { if (ansi_buf[j] == 'r') { for (k = j++; (ch = UChar(ansi_buf[k])) != 0; k++) if (ch == A_ESC) { break; } else if (ch == A_ST) { break; } ansi_buf[k] = '\0'; s = expand((const char *) &ansi_buf[j]); if (char_count + expand_chars >= columns) put_str("\r\n "); put_str(s); } } put_crlf(); } /* calculate the valid attributes */ ptext("Valid attributes: 0"); j = 0; for (i = 1; i < 20; i++) { sprintf(temp, "\033[0;%dm\033P$qm\033\\", i); tc_putp(temp); (void) valid_mode('m'); if (ape > 0) { j = i; sprintf(temp, "\033[0m; %d", i); tc_putp(temp); } } put_crlf(); /* calculate how many parameters can be sent */ ptext("Max number of parameters: "); sprintf(temp, "%dm\033P$qm\033\\", j); l = -1; if (j > 0) for (l = 1; l < 33; l++) { tc_putp("\033[0"); for (ch = 1; ch <= l; ch++) put_this(';'); tc_putp(temp); (void) valid_mode('m'); if (ape == 0) break; } tc_putp("\033[m"); if (l >= 0) { sprintf(temp, "%d", l); ptext(temp); } else ptext("unknown"); put_crlf(); return wait_here(); } /* ** mode_display(puc, mode, initial, set, reset) ** ** print the mode display entry */ static void mode_display(const char *p, int n, int c, int s, int r) { int k; sprintf(temp, "%s%d (%c, %c, %c)", p, n, c, s, r); k = (int) strlen(temp); if (char_count + k >= columns) put_crlf(); for (; k < 14; k++) putchp(' '); put_str(temp); } /* ** terminal_state() ** ** test DECRQM status reports */ static void terminal_state(void) { int modes_found; char tms[256]; ptext("Testing terminal mode status. (CSI 0 $ p)"); tc_putp("\033[0$p"); modes_found = 0; tms[0] = '\0'; if (valid_mode(('$' << 8) | 'y')) { static const char *puc[] = {"", "<", "=", ">", "?", 0}; int i, j, k, l; char *s; char buf[256]; int mode_puc[MAX_MODES]; int mode_number[MAX_MODES]; char set_value[MAX_MODES]; char reset_value[MAX_MODES]; char current_value[MAX_MODES]; for (i = 0; puc[i]; i++) { put_crlf(); if (i) { sprintf(temp, "Private use: %c", puc[i][0]); } else { strcpy(temp, "Standard modes:"); } k = (int) strlen(temp); ptext(temp); for (j = 0; j < (int) sizeof(buf); buf[j++] = ' ') ; for (j = l = 0; j < 255 && j - l < 50; j++) { sprintf(temp, "\033[%s%d$p", puc[i], j); tc_putp(temp); if (!valid_mode(('$' << 8) | 'y')) { /* not valid, save terminating value */ s = expand((const char *) ansi_buf); sprintf(tms + strlen(tms), "%s%d %s ", puc[i], j, s); break; } if (private_use != puc[i][0]) break; if (ansi_value[0] != j) break; if (ansi_value[1]) { l = j; if (k > 70) { buf[k] = '\0'; put_crlf(); ptextln(buf); for (k = 0; k < (int) sizeof(buf);) { buf[k++] = ' '; } k = 0; } sprintf(temp, " %d", j); ptext(temp); k += (int) strlen(temp); buf[k - 1] = (char) (ansi_value[1] + '0'); if (modes_found >= MAX_MODES) continue; current_value[modes_found] = (char) (ansi_value[1] + '0'); /* some modes never return */ if ((i == 0 && j == 13) /* control execution */ ||(puc[i][0] == '?' && j == 2)) /* VT52 */ set_value[modes_found] = reset_value[modes_found] = '-'; else set_value[modes_found] = reset_value[modes_found] = ' '; mode_puc[modes_found] = i; mode_number[modes_found++] = j; } } buf[k] = '\0'; if (buf[k - 1] != ' ') { put_crlf(); ptext(buf); } } if ((i = modes_found) != 0) { put_crlf(); put_crlf(); if (tms[0]) { ptextln(tms); } ptext("Hit 'Y' to test mode set/reset states: "); i = wait_here(); } if (i == 'y' || i == 'Y') while (1) { #ifdef STATUSFIX FILE *fp; #ifdef TEDANSI fp = fopen("ted.ansi", "w"); #else fp = fopen("/dev/console", "w"); #endif #endif for (i = j = 0; j < modes_found; j = ++i >> 1) { if (set_value[j] == '-') continue; k = (current_value[j] ^ i) & 1; sprintf(temp, "\033[%s%d%c\033[%s%d$p", puc[mode_puc[j]], mode_number[j], k ? 'l' : 'h', puc[mode_puc[j]], mode_number[j]); #ifdef STATUSFIX if (fp) { fprintf(fp, "%s\n", expand(temp)); fflush(fp); } #endif tc_putp(temp); if (!valid_mode(('$' << 8) | 'y')) continue; if (k) { reset_value[j] = (char) (ansi_value[1] + '0'); } else { set_value[j] = (char) (ansi_value[1] + '0'); } } put_str("\033[30l"); /* added for GORT bug (WY-185) */ #ifdef STATUSFIX if (fp) fclose(fp); #endif tty_set(); /* print the results */ put_clear(); putln("mode (initial, set, reset)"); for (j = 0; j < modes_found; j++) { mode_display(puc[mode_puc[j]], mode_number[j], current_value[j], set_value[j], reset_value[j]); } ptext("\n\nHit 'R' to repeat test. 'S' to sort results: "); i = wait_here(); if (i == 's' || i == 'S') { /* print the same stuff, sorted by current_value */ put_crlf(); for (i = '1'; i <= '4'; i++) { for (j = 0; j < modes_found; j++) { if (current_value[j] == i) mode_display(puc[mode_puc[j]], mode_number[j], current_value[j], set_value[j], reset_value[j]); } } ptext("\n\nHit 'R' to repeat test: "); i = wait_here(); } if (i != 'r' && i != 'R') break; tty_raw(1, char_mask); } } else { tty_set(); } } /* ** ansi_report_help() ** ** Display the informational data for the ANSI report test. */ static void ansi_report_help(void) { ptext("Begin ANSI status report testing. "); ptext(" Parity bit set will be displayed in reverse video. "); ptext(" If the terminal hangs, hit any alphabetic key. "); ptextln(" Use n to continue testing. Use q to quit."); put_crlf(); } /* ** test_ansi_reports() ** ** Test the ANSI status report functions */ void tools_status( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { int i; put_clear(); ansi_report_help(); tty_raw(1, char_mask); do { i = read_reports(); if (i != 'r' && i != 'R') { *ch = i; break; } } while (i); /* VT320, VT420, etc. */ if (terminal_class >= 63) { do { i = request_cfss(); } while (i == 'r' || i == 'R'); *ch = i; terminal_state(); } else { tty_set(); } } /* ** display_sgr() ** ** Test a range of ANSI sgr attributes ** puc -> Private Use Character */ static void display_sgr(int puc) { int k; temp[0] = (char) puc; temp[1] = '\0'; for (k = 0; k < 80; k++) { if (char_count + 8 > 80) put_crlf(); else if (char_count + 8 > columns) put_crlf(); else if (k > 0) printf(" "); printf("\033[%s%dmMode %2d\033[0m", temp, k, k); char_count += 8; if (puc == '\0') { if (k == 19) printf("\033[10m"); if (k == 39) printf("\033[37m"); if (k == 49) printf("\033[40m"); } } put_crlf(); if (puc == '<') printf("\033[<1m"); else if (puc) printf("\033[%s0m", temp); set_attr(0); } /* ** print_sgr20(on, off) ** ** print the sgr line for sgr20() */ static void print_sgr20(int on, int off) { if (char_count > columns - 13) { put_crlf(); } else if (char_count) { put_str(" "); } char_count += 11; printf("%d/%d \033[%dmon\033[%dm off\033[0m", on, off, on, off); } /* ** sgr20(void) ** ** display the enter/exit attributes 1-9 and 20-29 */ static void sgr20(void) { int k; put_crlf(); ptextln("Test enter/exit attributes 1-9 and 21-29."); for (k = 1; k < 10; k++) { print_sgr20(k, k + 20); } print_sgr20(1, 22); /* bold */ print_sgr20(2, 22); /* dim */ print_sgr20(8, 22); /* blank */ printf("\033[0m"); set_attr(0); } /* ** tools_sgr(testlist, state, ch) ** ** Run the ANSI graphics rendition mode tool ** Return the last character typed. */ void tools_sgr( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *ch) { int k; put_clear(); for (k = 0;;) { display_sgr(k); put_crlf(); menu_prompt(); ptext("/sgr Enter =>] > "); k = wait_here(); if ((k == 'r') || (k == 'R')) { k = 0; } else if ((k < '<') || (k > '?')) { break; } } sgr20(); put_newlines(2); *ch = REQUEST_PROMPT; } /***************************************************************************** * * Test ANSI graphics * *****************************************************************************/ /* ** select_bank(bank) ** ** select a graphics character set for ANSI terminals */ static void select_bank(char *bank) { tc_putp(bank); switch (bank[1] & 3) { case 0: putchp('O' & 0x1f); /* control O */ break; case 1: putchp('N' & 0x1f); /* control N */ tc_putp("\033~"); break; case 2: tc_putp("\033n\033}"); break; case 3: tc_putp("\033o\033|"); break; } } /* ** show_characters(bank, bias) ** ** print the ANSI graphics characters */ static void show_characters(char *bank, int bias) { int i; sprintf(temp, "G%d G%c ", bank[1] & 3, bias ? 'R' : 'L'); ptext(temp); select_bank(bank); for (i = ' '; i < 0x80; i++) { if (char_count >= columns || (i != ' ' && (i & 31) == 0)) put_str("\n "); putchp(i + bias); } select_bank(default_bank); put_str(" DEL <"); select_bank(bank); putchp(0x7f + bias); select_bank(default_bank); putchp('>'); put_crlf(); put_crlf(); } /* ANSI graphics test 94 96 character sets G0 ( , G1 ) - G2 * . G3 + / Standard Definitions A UK B US ASCII Dec extended definitions 0 Special graphics */ /* ** tools_charset(testlist, state, ch) ** ** Run the ANSI alt-charset mode tool */ void tools_charset( TestList * t GCC_UNUSED, int *state GCC_UNUSED, int *chp GCC_UNUSED) { int j, ch; char bank[32]; put_clear(); ptext("Enter the bank ()*+,-./ followed by the character set"); ptext(" 0123456789:;<=>? for private use, and"); ptextln(" @A...Z[\\]^_`a...z{|}~ for standard sets."); strcpy(bank, "\033)0"); for (; bank[0];) { put_crlf(); show_characters(bank, 0); /* G0 will not print in GR */ if (bank[1] & 3) { show_characters(bank, 0x80); } ptext("bank+set> "); for (j = 1; (ch = getchp(char_mask)); j++) { if (ch == EOF) break; putchp(ch); if (j == 1 && ch > '/') j++; bank[j] = (char) ch; if (ch < ' ' || ch > '/') break; if (j + 2 >= (int) sizeof(bank)) break; } if (j == 1) break; if (bank[j] < '0' || bank[j] > '~') break; bank[j + 1] = '\0'; } put_crlf(); } tack-1.09-20230201/COPYING0000644000000000000000000004313510313071260013004 0ustar rootroot GNU GENERAL PUBLIC LICENSE Version 2, June 1991 Copyright (C) 1989, 1991 Free Software Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public License is intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This General Public License applies to most of the Free Software Foundation's software and to any other program whose authors commit to using it. (Some other Free Software Foundation software is covered by the GNU Library General Public License instead.) You can apply it to your programs, too. When we speak of free software, we are referring to freedom, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish), that you receive source code or can get it if you want it, that you can change the software or use pieces of it in new free programs; and that you know you can do these things. To protect your rights, we need to make restrictions that forbid anyone to deny you these rights or to ask you to surrender the rights. These restrictions translate to certain responsibilities for you if you distribute copies of the software, or if you modify it. For example, if you distribute copies of such a program, whether gratis or for a fee, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must show them these terms so they know their rights. We protect your rights with two steps: (1) copyright the software, and (2) offer you this license which gives you legal permission to copy, distribute and/or modify the software. Also, for each author's protection and ours, we want to make certain that everyone understands that there is no warranty for this free software. If the software is modified by someone else and passed on, we want its recipients to know that what they have is not the original, so that any problems introduced by others will not reflect on the original authors' reputations. Finally, any free program is threatened constantly by software patents. We wish to avoid the danger that redistributors of a free program will individually obtain patent licenses, in effect making the program proprietary. To prevent this, we have made it clear that any patent must be licensed for everyone's free use or not licensed at all. The precise terms and conditions for copying, distribution and modification follow. GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License applies to any program or other work which contains a notice placed by the copyright holder saying it may be distributed under the terms of this General Public License. The "Program", below, refers to any such program or work, and a "work based on the Program" means either the Program or any derivative work under copyright law: that is to say, a work containing the Program or a portion of it, either verbatim or with modifications and/or translated into another language. (Hereinafter, translation is included without limitation in the term "modification".) Each licensee is addressed as "you". Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running the Program is not restricted, and the output from the Program is covered only if its contents constitute a work based on the Program (independent of having been made by running the Program). Whether that is true depends on what the Program does. 1. You may copy and distribute verbatim copies of the Program's source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and give any other recipients of the Program a copy of this License along with the Program. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Program or any portion of it, thus forming a work based on the Program, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) You must cause the modified files to carry prominent notices stating that you changed the files and the date of any change. b) You must cause any work that you distribute or publish, that in whole or in part contains or is derived from the Program or any part thereof, to be licensed as a whole at no charge to all third parties under the terms of this License. c) If the modified program normally reads commands interactively when run, you must cause it, when started running for such interactive use in the most ordinary way, to print or display an announcement including an appropriate copyright notice and a notice that there is no warranty (or else, saying that you provide a warranty) and that users may redistribute the program under these conditions, and telling the user how to view a copy of this License. (Exception: if the Program itself is interactive but does not normally print such an announcement, your work based on the Program is not required to print an announcement.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Program, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Program, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Program. In addition, mere aggregation of another work not based on the Program with the Program (or with a work based on the Program) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may copy and distribute the Program (or a work based on it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you also do one of the following: a) Accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, b) Accompany it with a written offer, valid for at least three years, to give any third party, for a charge no more than your cost of physically performing source distribution, a complete machine-readable copy of the corresponding source code, to be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange; or, c) Accompany it with the information you received as to the offer to distribute corresponding source code. (This alternative is allowed only for noncommercial distribution and only if you received the program in object code or executable form with such an offer, in accord with Subsection b above.) The source code for a work means the preferred form of the work for making modifications to it. For an executable work, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the executable. However, as a special exception, the source code distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. If distribution of executable or object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place counts as distribution of the source code, even though third parties are not compelled to copy the source along with the object code. 4. You may not copy, modify, sublicense, or distribute the Program except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense or distribute the Program is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 5. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Program or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Program (or any work based on the Program), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Program or works based on it. 6. Each time you redistribute the Program (or any work based on the Program), the recipient automatically receives a license from the original licensor to copy, distribute or modify the Program subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties to this License. 7. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Program at all. For example, if a patent license would not permit royalty-free redistribution of the Program by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Program. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system, which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 8. If the distribution and/or use of the Program is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Program under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 9. The Free Software Foundation may publish revised and/or new versions of the General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Program specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Program does not specify a version number of this License, you may choose any version ever published by the Free Software Foundation. 10. If you wish to incorporate parts of the Program into other free programs whose distribution conditions are different, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Programs If you develop a new program, and you want it to be of the greatest possible use to the public, the best way to achieve this is to make it free software which everyone can redistribute and change under these terms. To do so, attach the following notices to the program. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA Also add information on how to contact you by electronic and paper mail. If the program is interactive, make it output a short notice like this when it starts in an interactive mode: Gnomovision version 69, Copyright (C) year name of author Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. This is free software, and you are welcome to redistribute it under certain conditions; type `show c' for details. The hypothetical commands `show w' and `show c' should show the appropriate parts of the General Public License. Of course, the commands you use may be called something other than `show w' and `show c'; they could even be mouse-clicks or menu items--whatever suits your program. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the program, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovision' (which makes passes at compilers) written by James Hacker. , 1 April 1989 Ty Coon, President of Vice This General Public License does not permit incorporating your program into proprietary programs. If your program is a subroutine library, you may consider it more useful to permit linking proprietary applications with the library. If this is what you want to do, use the GNU Library General Public License instead of this License. tack-1.09-20230201/aclocal.m40000644000000000000000000035344614366602417013642 0ustar rootrootdnl*************************************************************************** dnl Copyright 2017-2022,2023 Thomas E. Dickey * dnl Copyright 2007-2015,2017 Free Software Foundation, Inc. * dnl * dnl Permission is hereby granted, free of charge, to any person obtaining a * dnl copy of this software and associated documentation files (the * dnl "Software"), to deal in the Software without restriction, including * dnl without limitation the rights to use, copy, modify, merge, publish, * dnl distribute, distribute with modifications, sublicense, and/or sell * dnl copies of the Software, and to permit persons to whom the Software is * dnl furnished to do so, subject to the following conditions: * dnl * dnl The above copyright notice and this permission notice shall be included * dnl in all copies or substantial portions of the Software. * dnl * dnl THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS * dnl OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF * dnl MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. * dnl IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, * dnl DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR * dnl OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR * dnl THE USE OR OTHER DEALINGS IN THE SOFTWARE. * dnl * dnl Except as contained in this notice, the name(s) of the above copyright * dnl holders shall not be used in advertising or otherwise to promote the * dnl sale, use or other dealings in this Software without prior written * dnl authorization. * dnl*************************************************************************** dnl dnl $Id: aclocal.m4,v 1.47 2023/02/02 00:34:23 tom Exp $ dnl dnl Author: Thomas E. Dickey dnl dnl Macros used in TACK test program auto-configuration script. dnl dnl These macros are maintained separately from NCURSES. The copyright on dnl this file applies to the aggregation of macros and does not affect use of dnl these macros in other applications. dnl dnl See https://invisible-island.net/autoconf/ for additional information. dnl 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_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: 13 updated: 2012/10/06 11:17:15 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 CF_ADD_CFLAGS($cf_arg) AC_TRY_COMPILE( [ #ifndef CC_HAS_PROTOS #if !defined(__STDC__) || (__STDC__ != 1) choke me #endif #endif ],[ 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_AR_FLAGS version: 9 updated: 2021/01/01 13:31:04 dnl ----------- dnl Check for suitable "ar" (archiver) options for updating an archive. dnl dnl In particular, handle some obsolete cases where the "-" might be omitted, dnl as well as a workaround for breakage of make's archive rules by the GNU dnl binutils "ar" program. AC_DEFUN([CF_AR_FLAGS],[ AC_REQUIRE([CF_PROG_AR]) AC_CACHE_CHECK(for options to update archives, cf_cv_ar_flags,[ case "$cf_cv_system_name" in (*-msvc*) cf_cv_ar_flags='' cat >mk_static_lib.sh <<-EOF #!$SHELL MSVC_BIN="[$]AR" out="\[$]1" shift exec \[$]MSVC_BIN -out:"\[$]out" \[$]@ EOF chmod +x mk_static_lib.sh AR=`pwd`/mk_static_lib.sh ;; (*) cf_cv_ar_flags=unknown for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv do # check if $ARFLAGS already contains this choice if test "x$ARFLAGS" != "x" ; then cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then cf_cv_ar_flags= break fi fi rm -f "conftest.$ac_cv_objext" rm -f conftest.a cat >"conftest.$ac_ext" <&AC_FD_CC $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&AC_FD_CC 1>/dev/null if test -f conftest.a ; then cf_cv_ar_flags="$cf_ar_flags" break fi else CF_VERBOSE(cannot compile test-program) break fi done rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext" ;; esac ]) if test -n "$ARFLAGS" ; then if test -n "$cf_cv_ar_flags" ; then ARFLAGS="$ARFLAGS $cf_cv_ar_flags" fi else ARFLAGS=$cf_cv_ar_flags fi AC_SUBST(ARFLAGS) ]) dnl --------------------------------------------------------------------------- dnl CF_C11_NORETURN version: 3 updated: 2021/03/28 11:36:23 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([ #include #include #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: 10 updated: 2020/12/31 18:40:20 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" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", [substr]([$]0,1+length(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_CLANG_COMPILER version: 8 updated: 2021/01/01 13:31:04 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 make an error #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_CONST_X_STRING version: 7 updated: 2021/06/07 17:39:17 dnl ----------------- dnl The X11R4-X11R6 Xt specification uses an ambiguous String type for most dnl character-strings. dnl dnl It is ambiguous because the specification accommodated the pre-ANSI dnl compilers bundled by more than one vendor in lieu of providing a standard C dnl compiler other than by costly add-ons. Because of this, the specification dnl did not take into account the use of const for telling the compiler that dnl string literals would be in readonly memory. dnl dnl As a workaround, one could (starting with X11R5) define XTSTRINGDEFINES, to dnl let the compiler decide how to represent Xt's strings which were #define'd. dnl That does not solve the problem of using the block of Xt's strings which dnl are compiled into the library (and is less efficient than one might want). dnl dnl Xt specification 7 introduces the _CONST_X_STRING symbol which is used both dnl when compiling the library and compiling using the library, to tell the dnl compiler that String is const. AC_DEFUN([CF_CONST_X_STRING], [ AC_REQUIRE([AC_PATH_XTRA]) CF_SAVE_XTRA_FLAGS([CF_CONST_X_STRING]) AC_TRY_COMPILE( [ #include #include ], [String foo = malloc(1); free((void*)foo)],[ AC_CACHE_CHECK(for X11/Xt const-feature,cf_cv_const_x_string,[ AC_TRY_COMPILE( [ #define _CONST_X_STRING /* X11R7.8 (perhaps) */ #undef XTSTRINGDEFINES /* X11R5 and later */ #include #include ],[String foo = malloc(1); *foo = 0],[ cf_cv_const_x_string=no ],[ cf_cv_const_x_string=yes ]) ]) CF_RESTORE_XTRA_FLAGS([CF_CONST_X_STRING]) case "$cf_cv_const_x_string" in (no) CF_APPEND_TEXT(CPPFLAGS,-DXTSTRINGDEFINES) ;; (*) CF_APPEND_TEXT(CPPFLAGS,-D_CONST_X_STRING) ;; esac ]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_CHECK_DATA version: 10 updated: 2021/01/04 19:45:09 dnl -------------------- dnl Check if curses.h defines the given data/variable. dnl Use this after CF_NCURSES_CONFIG or CF_CURSES_CONFIG. dnl dnl $1 = data item(s) to check for dnl $2 = action on success, e.g., "break" to quit checking a series of choices AC_DEFUN([CF_CURSES_CHECK_DATA], [ for cf_data in $1 do AC_MSG_CHECKING(for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}) AC_TRY_COMPILE(CF__CURSES_HEAD, CF__CURSES_DATA(foo,$cf_data) ,[cf_result=yes ],[cf_result=no]) AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then CF_UPPER(cf_result,have_curses_data_$cf_data) AC_DEFINE_UNQUOTED($cf_result) ifelse($2,,,[$2]) else AC_MSG_CHECKING(for data $cf_data in library) # BSD linkers insist on making weak linkage, but resolve at runtime. AC_TRY_RUN(CF__CURSES_HEAD [ extern char $cf_data; int main(void) { ]CF__CURSES_DATA(foo,$cf_data)[ ${cf_cv_main_return:-return}(foo == 0); }],[cf_result=yes ],[cf_result=no],[ # cross-compiling AC_TRY_LINK(CF__CURSES_HEAD [extern char $cf_data;],[ do { ]CF__CURSES_DATA(foo,$cf_data)[ ${cf_cv_main_return:-return}(foo == 0); } while (0) ],[cf_result=yes],[cf_result=no]) ]) AC_MSG_RESULT($cf_result) if test "$cf_result" = yes ; then CF_UPPER(cf_result,decl_curses_data_$cf_data) AC_DEFINE_UNQUOTED($cf_result) # do not exit loop here, since we prefer system's declarations fi fi done ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_CONFIG version: 2 updated: 2006/10/29 11:06:27 dnl ---------------- dnl Tie together the configure-script macros for curses. It may be ncurses, dnl but unless asked, we do not make a special search for ncurses. However, dnl still check for the ncurses version number, for use in other macros. AC_DEFUN([CF_CURSES_CONFIG], [ CF_CURSES_CPPFLAGS CF_NCURSES_VERSION CF_CURSES_LIBS ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_CPPFLAGS version: 14 updated: 2021/01/02 09:31:20 dnl ------------------ dnl Look for the curses headers. AC_DEFUN([CF_CURSES_CPPFLAGS],[ AC_CACHE_CHECK(for extra include directories,cf_cv_curses_incdir,[ cf_cv_curses_incdir=no case "$host_os" in (hpux10.*) if test "x$cf_cv_screen" = "xcurses_colr" then test -d /usr/include/curses_colr && \ cf_cv_curses_incdir="-I/usr/include/curses_colr" fi ;; (sunos3*|sunos4*) if test "x$cf_cv_screen" = "xcurses_5lib" then test -d /usr/5lib && \ test -d /usr/5include && \ cf_cv_curses_incdir="-I/usr/5include" fi ;; esac ]) if test "$cf_cv_curses_incdir" != no then CF_APPEND_TEXT(CPPFLAGS,$cf_cv_curses_incdir) fi CF_CURSES_HEADER CF_TERM_HEADER ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_HEADER version: 6 updated: 2022/12/02 20:06:52 dnl ---------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. dnl dnl $1 = ncurses when looking for ncurses, or is empty AC_DEFUN([CF_CURSES_HEADER],[ AC_CACHE_CHECK(if we have identified curses headers,cf_cv_ncurses_header,[ cf_cv_ncurses_header=none for cf_header in \ ncurses.h ifelse($1,,,[$1/ncurses.h]) \ curses.h ifelse($1,,,[$1/curses.h]) ifelse($1,,[ncurses/ncurses.h ncurses/curses.h]) do AC_TRY_COMPILE([#include <${cf_header}>], [initscr(); endwin()], [cf_cv_ncurses_header=$cf_header; break],[]) done ]) if test "$cf_cv_ncurses_header" = none ; then AC_MSG_ERROR(No curses header-files found) fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. AC_CHECK_HEADERS($cf_cv_ncurses_header) ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_LIBS version: 45 updated: 2022/12/02 20:06:52 dnl -------------- dnl Look for the curses libraries. Older curses implementations may require dnl termcap/termlib to be linked as well. Call CF_CURSES_CPPFLAGS first. AC_DEFUN([CF_CURSES_LIBS],[ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_MSG_CHECKING(if we have identified curses libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); endwin()], cf_result=yes, cf_result=no) AC_MSG_RESULT($cf_result) if test "$cf_result" = no ; then case "$host_os" in (freebsd*) AC_CHECK_LIB(mytinfo,tgoto,[CF_ADD_LIBS(-lmytinfo)]) ;; (hpux10.*) # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr # next (1998), and xcurses "newer" (2000). There is no header file for # Hcurses; the subdirectory curses_colr has the headers (curses.h and # term.h) for cur_colr if test "x$cf_cv_screen" = "xcurses_colr" then AC_CHECK_LIB(cur_colr,initscr,[ CF_ADD_LIBS(-lcur_colr) ac_cv_func_initscr=yes ],[ AC_CHECK_LIB(Hcurses,initscr,[ # HP's header uses __HP_CURSES, but user claims _HP_CURSES. CF_ADD_LIBS(-lHcurses) CF_APPEND_TEXT(CPPFLAGS,-D__HP_CURSES -D_HP_CURSES) ac_cv_func_initscr=yes ])]) fi ;; (linux*) case `arch 2>/dev/null` in (x86_64) if test -d /lib64 then CF_ADD_LIBDIR(/lib64) else CF_ADD_LIBDIR(/lib) fi ;; (*) CF_ADD_LIBDIR(/lib) ;; esac ;; (sunos3*|sunos4*) if test "x$cf_cv_screen" = "xcurses_5lib" then if test -d /usr/5lib ; then CF_ADD_LIBDIR(/usr/5lib) CF_ADD_LIBS(-lcurses -ltermcap) fi fi ac_cv_func_initscr=yes ;; esac if test ".$ac_cv_func_initscr" != .yes ; then cf_save_LIBS="$LIBS" if test ".${cf_cv_ncurses_version:-no}" != .no then cf_check_list="ncurses curses cursesX" else cf_check_list="cursesX curses ncurses" fi # Check for library containing tgoto. Do this before curses library # because it may be needed to link the test-case for initscr. if test "x$cf_term_lib" = x then AC_CHECK_FUNC(tgoto,[cf_term_lib=predefined],[ for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown do AC_CHECK_LIB($cf_term_lib,tgoto,[ : "${cf_nculib_root:=$cf_term_lib}" break ]) done ]) fi # Check for library containing initscr test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" if test "x$cf_curs_lib" = x then for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown do LIBS="-l$cf_curs_lib $cf_save_LIBS" if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then AC_MSG_CHECKING(if we can link with $cf_curs_lib library) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr()], [cf_result=yes], [cf_result=no]) AC_MSG_RESULT($cf_result) test "$cf_result" = yes && break elif test "$cf_curs_lib" = "$cf_term_lib" ; then cf_result=no elif test "$cf_term_lib" != predefined ; then AC_MSG_CHECKING(if we need both $cf_curs_lib and $cf_term_lib libraries) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); endwin();], [cf_result=no], [ LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr()], [cf_result=yes], [cf_result=error]) ]) AC_MSG_RESULT($cf_result) test "$cf_result" != error && break fi done fi test "$cf_curs_lib" = unknown && AC_MSG_ERROR(no curses library found) fi fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_CURSES_TERM_H version: 15 updated: 2021/01/02 09:31:20 dnl ---------------- dnl SVr4 curses should have term.h as well (where it puts the definitions of dnl the low-level interface). This may not be true in old/broken implementations, dnl as well as in misconfigured systems (e.g., gcc configured for Solaris 2.4 dnl running with Solaris 2.5.1). AC_DEFUN([CF_CURSES_TERM_H], [ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_CACHE_CHECK(for term.h, cf_cv_term_header,[ # If we found , look for , but always look # for if we do not find the variant. cf_header_list="term.h ncurses/term.h ncursesw/term.h" case "${cf_cv_ncurses_header:-curses.h}" in (*/*) cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h cf_header_list="$cf_header_item $cf_header_list" ;; esac for cf_header in $cf_header_list do AC_TRY_COMPILE([ #include <${cf_cv_ncurses_header:-curses.h}> #include <${cf_header}>], [WINDOW *x; (void)x], [cf_cv_term_header=$cf_header break], [cf_cv_term_header=no]) done case "$cf_cv_term_header" in (no) # If curses is ncurses, some packagers still mess it up by trying to make # us use GNU termcap. This handles the most common case. for cf_header in ncurses/term.h ncursesw/term.h do AC_TRY_COMPILE([ #include <${cf_cv_ncurses_header:-curses.h}> #ifdef NCURSES_VERSION #include <${cf_header}> #else make an error #endif], [WINDOW *x; (void)x], [cf_cv_term_header=$cf_header break], [cf_cv_term_header=no]) done ;; esac ]) case "$cf_cv_term_header" in (term.h) AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h]) ;; (ncurses/term.h) AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h]) ;; (ncursesw/term.h) AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_DIRNAME version: 5 updated: 2020/12/31 20:19:42 dnl ---------- dnl "dirname" is not portable, so we fake it with a shell script. AC_DEFUN([CF_DIRNAME],[$1=`echo "$2" | sed -e 's%/[[^/]]*$%%'`])dnl 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_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_LIBRARY version: 11 updated: 2021/01/02 09:31:20 dnl --------------- dnl Look for a non-standard library, given parameters for AC_TRY_LINK. We dnl prefer a standard location, and use -L options only if we do not find the dnl library in the standard library location(s). dnl $1 = library name dnl $2 = library class, usually the same as library name dnl $3 = includes dnl $4 = code fragment to compile/link dnl $5 = corresponding function-name dnl $6 = flag, nonnull if failure should not cause an error-exit dnl dnl Sets the variable "$cf_libdir" as a side-effect, so we can see if we had dnl to use a -L option. AC_DEFUN([CF_FIND_LIBRARY], [ eval 'cf_cv_have_lib_'"$1"'=no' cf_libdir="" AC_CHECK_FUNC($5, eval 'cf_cv_have_lib_'"$1"'=yes',[ cf_save_LIBS="$LIBS" AC_MSG_CHECKING(for $5 in -l$1) LIBS="-l$1 $LIBS" AC_TRY_LINK([$3],[$4], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'"$1"'=yes' ], [AC_MSG_RESULT(no) CF_LIBRARY_PATH(cf_search,$2) for cf_libdir in $cf_search do AC_MSG_CHECKING(for -l$1 in $cf_libdir) LIBS="-L$cf_libdir -l$1 $cf_save_LIBS" AC_TRY_LINK([$3],[$4], [AC_MSG_RESULT(yes) eval 'cf_cv_have_lib_'"$1"'=yes' break], [AC_MSG_RESULT(no) LIBS="$cf_save_LIBS"]) done ]) ]) eval 'cf_found_library="[$]cf_cv_have_lib_'"$1"\" ifelse($6,,[ if test "$cf_found_library" = no ; then AC_MSG_ERROR(Cannot link $1 library) 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_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: 8 updated: 2019/09/07 13:38:36 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/^.*(GCC[[^)]]*) //' -e 's/^.*(Debian[[^)]]*) //' -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_INHERIT_SCRIPT version: 2 updated: 2003/03/01 23:50:42 dnl ----------------- dnl If we do not have a given script, look for it in the parent directory. AC_DEFUN([CF_INHERIT_SCRIPT], [ test -f $1 || ( test -f ../$1 && cp ../$1 ./ ) ])dnl dnl --------------------------------------------------------------------------- dnl CF_INTEL_COMPILER version: 8 updated: 2021/01/01 16:53:59 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 make an error #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_LIB_PREFIX version: 14 updated: 2021/01/01 13:31:04 dnl ------------- dnl Compute the library-prefix for the given host system dnl $1 = variable to set define([CF_LIB_PREFIX], [ case "$cf_cv_system_name" in (OS/2*|os2*) if test "$DFT_LWR_MODEL" = libtool; then LIB_PREFIX='lib' else LIB_PREFIX='' fi ;; (*-msvc*) LIB_PREFIX='' ;; (*) LIB_PREFIX='lib' ;; esac ifelse($1,,,[$1=$LIB_PREFIX]) AC_SUBST(LIB_PREFIX) ])dnl dnl --------------------------------------------------------------------------- dnl CF_LINK_DATAONLY version: 13 updated: 2020/02/08 15:59:30 dnl ---------------- dnl Some systems have a non-ANSI linker that doesn't pull in modules that have dnl only data (i.e., no functions), for example NeXT. On those systems we'll dnl have to provide wrappers for global tables to ensure they're linked dnl properly. AC_DEFUN([CF_LINK_DATAONLY], [ AC_MSG_CHECKING([if data-only library module links]) AC_CACHE_VAL(cf_cv_link_dataonly,[ rm -f conftest.a cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&AC_FD_CC 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&AC_FD_CC >/dev/null cf_saveLIBS="$LIBS" LIBS="conftest.a $LIBS" AC_TRY_RUN([ int main(void) { extern int testfunc(); ${cf_cv_main_return:-return} (!testfunc()); } ], [cf_cv_link_dataonly=yes], [cf_cv_link_dataonly=no], [cf_cv_link_dataonly=unknown]) LIBS="$cf_saveLIBS" ]) AC_MSG_RESULT($cf_cv_link_dataonly) if test "$cf_cv_link_dataonly" = no ; then AC_DEFINE(BROKEN_LINKER,1,[if data-only library module does not link]) BROKEN_LINKER=1 fi AC_SUBST(BROKEN_LINKER) ])dnl dnl --------------------------------------------------------------------------- dnl CF_MAKEFLAGS version: 21 updated: 2021/09/04 06:47:34 dnl ------------ dnl Some 'make' programs support ${MAKEFLAGS}, some ${MFLAGS}, to pass 'make' dnl options to lower-levels. It is very useful for "make -n" -- if we have it. dnl (GNU 'make' does both, something POSIX 'make', which happens to make the dnl ${MAKEFLAGS} variable incompatible because it adds the assignments :-) AC_DEFUN([CF_MAKEFLAGS], [AC_REQUIRE([AC_PROG_FGREP])dnl AC_CACHE_CHECK(for makeflags variable, cf_cv_makeflags,[ cf_cv_makeflags='' for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp </dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[[ ]]*$,,'` case "$cf_result" in (.*k|.*kw) cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`" case "$cf_result" in (.*CC=*) cf_cv_makeflags= ;; (*) cf_cv_makeflags=$cf_option ;; esac break ;; (.-) ;; (*) CF_MSG_LOG(given option \"$cf_option\", no match \"$cf_result\") ;; esac done rm -f cf_makeflags.tmp ]) AC_SUBST(cf_cv_makeflags) ])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_NCURSES_CC_CHECK version: 5 updated: 2020/12/31 20:19:42 dnl ------------------- dnl Check if we can compile with ncurses' header file dnl $1 is the cache variable to set dnl $2 is the header-file to include dnl $3 is the root name (ncurses or ncursesw) AC_DEFUN([CF_NCURSES_CC_CHECK],[ AC_TRY_COMPILE([ ]ifelse($3,ncursesw,[ #define _XOPEN_SOURCE_EXTENDED #undef HAVE_LIBUTF8_H /* in case we used CF_UTF8_LIB */ #define HAVE_LIBUTF8_H /* to force ncurses' header file to use cchar_t */ ])[ #include <$2>],[ #ifdef NCURSES_VERSION ]ifelse($3,ncursesw,[ #ifndef WACS_BSSB make an error #endif ])[ printf("%s\\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\\n"); #else make an error #endif #endif ] ,[$1=$2] ,[$1=no]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CONFIG version: 28 updated: 2021/08/28 15:20:37 dnl ----------------- dnl Tie together the configure-script macros for ncurses, preferring these in dnl order: dnl a) ".pc" files for pkg-config, using $NCURSES_CONFIG_PKG dnl b) the "-config" script from ncurses, using $NCURSES_CONFIG dnl c) just plain libraries dnl dnl $1 is the root library name (default: "ncurses") AC_DEFUN([CF_NCURSES_CONFIG],[ AC_REQUIRE([CF_PKG_CONFIG]) cf_ncuconfig_root=ifelse($1,,ncurses,$1) cf_have_ncuconfig=no if test "x${PKG_CONFIG:=none}" != xnone; then AC_MSG_CHECKING(pkg-config for $cf_ncuconfig_root) if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then AC_MSG_RESULT(yes) AC_MSG_CHECKING(if the $cf_ncuconfig_root package files work) cf_have_ncuconfig=unknown cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`" cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`" # while -W for passing linker flags is prevalent, it is not "standard". # At least one wrapper for c89/c99 (in Apple's xcode) has its own # incompatible _and_ non-standard -W option which gives an error. Work # around that pitfall. case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in (x*c[[89]]9@@*-W*) CF_ADD_CFLAGS($cf_pkg_cflags) CF_ADD_LIBS($cf_pkg_libs) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); mousemask(0,0); tigetstr((char *)0);], [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); }], [cf_test_ncuconfig=yes], [cf_test_ncuconfig=no], [cf_test_ncuconfig=maybe])], [cf_test_ncuconfig=no]) CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" if test "x$cf_test_ncuconfig" != xyes; then cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[[^ ]]*//g'` cf_pkg_cflags="$cf_temp" cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[[^ ]]*//g'` cf_pkg_libs="$cf_temp" fi ;; esac CF_APPEND_CFLAGS($cf_pkg_cflags) CF_ADD_LIBS($cf_pkg_libs) AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); mousemask(0,0); tigetstr((char *)0);], [AC_TRY_RUN([#include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); }], [cf_have_ncuconfig=yes], [cf_have_ncuconfig=no], [cf_have_ncuconfig=maybe])], [cf_have_ncuconfig=no]) AC_MSG_RESULT($cf_have_ncuconfig) test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) NCURSES_CONFIG_PKG=$cf_ncuconfig_root CF_TERM_HEADER fi else AC_MSG_RESULT(no) NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}" CF_ACVERSION_CHECK(2.52, [AC_CHECK_TOOLS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)], [AC_PATH_PROGS(NCURSES_CONFIG, ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config, none)]) if test "$NCURSES_CONFIG" != none ; then CF_APPEND_CFLAGS(`$NCURSES_CONFIG --cflags`) CF_ADD_LIBS(`$NCURSES_CONFIG --libs`) # even with config script, some packages use no-override for curses.h CF_CURSES_HEADER(ifelse($1,,ncurses,$1)) dnl like CF_NCURSES_CPPFLAGS AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) dnl like CF_NCURSES_LIBS CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_ncuconfig_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) dnl like CF_NCURSES_VERSION cf_cv_ncurses_version="`$NCURSES_CONFIG --version`" else CF_NCURSES_CPPFLAGS(ifelse($1,,ncurses,$1)) CF_NCURSES_LIBS(ifelse($1,,ncurses,$1)) fi else NCURSES_CONFIG=none fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_CPPFLAGS version: 22 updated: 2021/01/02 09:31:20 dnl ------------------- dnl Look for the SVr4 curses clone 'ncurses' in the standard places, adjusting dnl the CPPFLAGS variable so we can include its header. dnl dnl The header files may be installed as either curses.h, or ncurses.h (would dnl be obsolete, except that some packagers prefer this name to distinguish it dnl from a "native" curses implementation). If not installed for overwrite, dnl the curses.h file would be in an ncurses subdirectory (e.g., dnl /usr/include/ncurses), but someone may have installed overwriting the dnl vendor's curses. Only very old versions (pre-1.9.2d, the first autoconf'd dnl version) of ncurses don't define either __NCURSES_H or NCURSES_VERSION in dnl the header. dnl dnl If the installer has set $CFLAGS or $CPPFLAGS so that the ncurses header dnl is already in the include-path, don't even bother with this, since we cannot dnl easily determine which file it is. In this case, it has to be . dnl dnl The optional parameter gives the root name of the library, in case it is dnl not installed as the default curses library. That is how the dnl wide-character version of ncurses is installed. AC_DEFUN([CF_NCURSES_CPPFLAGS], [AC_REQUIRE([CF_WITH_CURSES_DIR]) AC_PROVIDE([CF_CURSES_CPPFLAGS])dnl cf_ncuhdr_root=ifelse($1,,ncurses,$1) test -n "$cf_cv_curses_dir" && \ test "$cf_cv_curses_dir" != "no" && { \ CF_ADD_INCDIR($cf_cv_curses_dir/include/$cf_ncuhdr_root) } AC_CACHE_CHECK(for $cf_ncuhdr_root header in include-path, cf_cv_ncurses_h,[ cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h,$cf_header,$1) test "$cf_cv_ncurses_h" != no && break done ]) CF_NCURSES_HEADER CF_TERM_HEADER # some applications need this, but should check for NCURSES_VERSION AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) CF_NCURSES_VERSION ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_HEADER version: 7 updated: 2021/01/04 19:33:05 dnl ----------------- dnl Find a "curses" header file, e.g,. "curses.h", or one of the more common dnl variations of ncurses' installs. dnl dnl See also CF_CURSES_HEADER, which sets the same cache variable. AC_DEFUN([CF_NCURSES_HEADER],[ if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else AC_CACHE_CHECK(for $cf_ncuhdr_root include-path, cf_cv_ncurses_h2,[ test -n "$verbose" && echo CF_HEADER_PATH(cf_search,$cf_ncuhdr_root) test -n "$verbose" && echo "search path $cf_search" cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do CF_ADD_INCDIR($cf_incdir) for cf_header in \ ncurses.h \ curses.h do CF_NCURSES_CC_CHECK(cf_cv_ncurses_h2,$cf_header,$1) if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&AC_FD_MSG break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&AC_FD_MSG done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && AC_MSG_ERROR(not found) ]) CF_DIRNAME(cf_1st_incdir,$cf_cv_ncurses_h2) cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`" if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header" fi CF_ADD_INCDIR($cf_1st_incdir) fi # Set definitions to allow ifdef'ing for ncurses.h case "$cf_cv_ncurses_header" in (*ncurses.h) AC_DEFINE(HAVE_NCURSES_H,1,[Define to 1 if we have ncurses.h]) ;; esac case "$cf_cv_ncurses_header" in (ncurses/curses.h|ncurses/ncurses.h) AC_DEFINE(HAVE_NCURSES_NCURSES_H,1,[Define to 1 if we have ncurses/ncurses.h]) ;; (ncursesw/curses.h|ncursesw/ncurses.h) AC_DEFINE(HAVE_NCURSESW_NCURSES_H,1,[Define to 1 if we have ncursesw/ncurses.h]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_LIBS version: 21 updated: 2021/09/04 06:37:12 dnl --------------- dnl Look for the ncurses library. This is a little complicated on Linux, dnl because it may be linked with the gpm (general purpose mouse) library. dnl Some distributions have gpm linked with (bsd) curses, which makes it dnl unusable with ncurses. However, we don't want to link with gpm unless dnl ncurses has a dependency, since gpm is normally set up as a shared library, dnl and the linker will record a dependency. dnl dnl The optional parameter gives the root name of the library, in case it is dnl not installed as the default curses library. That is how the dnl wide-character version of ncurses is installed. AC_DEFUN([CF_NCURSES_LIBS], [AC_REQUIRE([CF_NCURSES_CPPFLAGS]) cf_nculib_root=ifelse($1,,ncurses,$1) # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" AC_CHECK_LIB(gpm,Gpm_Open, [AC_CHECK_LIB(gpm,initscr, [LIBS="$cf_ncurses_SAVE"], [cf_ncurses_LIBS="-lgpm"])]) case "$host_os" in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it is static). if test "$cf_nculib_root" = ncurses ; then AC_CHECK_LIB(mytinfo,tgoto,[cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS"]) fi ;; esac CF_ADD_LIBS($cf_ncurses_LIBS) if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" then CF_ADD_LIBS(-l$cf_nculib_root) else CF_FIND_LIBRARY($cf_nculib_root,$cf_nculib_root, [#include <${cf_cv_ncurses_header:-curses.h}>], [initscr()], initscr) fi if test -n "$cf_ncurses_LIBS" ; then AC_MSG_CHECKING(if we can link $cf_nculib_root without $cf_ncurses_LIBS) cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done AC_TRY_LINK([#include <${cf_cv_ncurses_header:-curses.h}>], [initscr(); mousemask(0,0); tigetstr((char *)0);], [AC_MSG_RESULT(yes)], [AC_MSG_RESULT(no) LIBS="$cf_ncurses_SAVE"]) fi CF_UPPER(cf_nculib_ROOT,HAVE_LIB$cf_nculib_root) AC_DEFINE_UNQUOTED($cf_nculib_ROOT) ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_PTHREADS version: 2 updated: 2016/04/22 05:07:41 dnl ------------------- dnl Use this followup check to ensure that we link with pthreads if ncurses dnl uses it. AC_DEFUN([CF_NCURSES_PTHREADS],[ : ${cf_nculib_root:=ifelse($1,,ncurses,$1)} AC_CHECK_LIB($cf_nculib_root,_nc_init_pthreads, cf_cv_ncurses_pthreads=yes, cf_cv_ncurses_pthreads=no) if test "$cf_cv_ncurses_pthreads" = yes then CF_ADD_LIBS(-lpthread) fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_NCURSES_VERSION version: 17 updated: 2023/01/05 18:54:02 dnl ------------------ dnl Check for the version of ncurses, to aid in reporting bugs, etc. dnl Call CF_CURSES_CPPFLAGS first, or CF_NCURSES_CPPFLAGS. We don't use dnl AC_REQUIRE since that does not work with the shell's if/then/else/fi. AC_DEFUN([CF_NCURSES_VERSION], [ AC_REQUIRE([CF_CURSES_CPPFLAGS])dnl AC_CACHE_CHECK(for ncurses version, cf_cv_ncurses_version,[ cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f "$cf_tempfile" AC_TRY_RUN([ $ac_includes_default #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); }],[ cf_cv_ncurses_version=`cat $cf_tempfile`],,[ # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > "conftest.$ac_ext" < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&AC_FD_CC | grep '^Autoconf ' >conftest.out" AC_TRY_EVAL(cf_try) if test -f conftest.out ; then cf_out=`sed -e 's%^Autoconf %%' -e 's%^[[^"]]*"%%' -e 's%".*%%' conftest.out` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi ]) rm -f "$cf_tempfile" ]) test "$cf_cv_ncurses_version" = no || AC_DEFINE(NCURSES,1,[Define to 1 if we are using ncurses headers/libraries]) ])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_PATH_SYNTAX version: 18 updated: 2020/12/31 18:40:20 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],[ if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".[$]$1" in (.\[$]\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[[a-zA-Z]]:[[\\/]]*) # OS/2 EMX ;; (.\[$]\{*prefix\}*|.\[$]\{*dir\}*) eval $1="[$]$1" case ".[$]$1" in (.NONE/*) $1=`echo "[$]$1" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) $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: 12 updated: 2021/10/10 20:18:09 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{=path} enable/disable use of pkg-config], [cf_pkg_config=$withval], [cf_pkg_config=yes]) AC_MSG_RESULT($cf_pkg_config) case "$cf_pkg_config" in (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: 11 updated: 2018/12/31 20:46:17 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 make an error #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 make an error #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 make an error #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_AR version: 1 updated: 2009/01/01 20:15:22 dnl ---------- dnl Check for archiver "ar". AC_DEFUN([CF_PROG_AR],[ AC_CHECK_TOOL(AR, ar, ar) ]) dnl --------------------------------------------------------------------------- dnl CF_PROG_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_INSTALL version: 10 updated: 2021/01/04 19:33:05 dnl --------------- dnl Force $INSTALL to be an absolute-path. Otherwise, edit_man.sh and the dnl misc/tabset install won't work properly. Usually this happens only when dnl using the fallback mkinstalldirs script AC_DEFUN([CF_PROG_INSTALL], [AC_PROG_INSTALL case $INSTALL in (/*) ;; (*) CF_DIRNAME(cf_dir,$INSTALL) test -z "$cf_dir" && cf_dir=. INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`" ;; esac ])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_SIG_ATOMIC_T version: 5 updated: 2020/03/10 18:53:47 dnl --------------- dnl signal handler, but there are some gcc dependencies in that recommendation. dnl Try anyway. AC_DEFUN([CF_SIG_ATOMIC_T], [ AC_MSG_CHECKING(for signal global datatype) AC_CACHE_VAL(cf_cv_sig_atomic_t,[ for cf_type in \ "volatile sig_atomic_t" \ "sig_atomic_t" \ "int" do AC_TRY_COMPILE([ #include #include #include extern $cf_type x; $cf_type x; static void handler(int sig) { (void)sig; x = 5; }], [signal(SIGINT, handler); x = 1], [cf_cv_sig_atomic_t=$cf_type], [cf_cv_sig_atomic_t=no]) test "$cf_cv_sig_atomic_t" != no && break done ]) AC_MSG_RESULT($cf_cv_sig_atomic_t) test "$cf_cv_sig_atomic_t" != no && AC_DEFINE_UNQUOTED(SIG_ATOMIC_T, $cf_cv_sig_atomic_t,[Define to signal global datatype]) ])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_TERMIOS_TYPES version: 2 updated: 2020/03/10 18:53:47 dnl ---------------- dnl https://pubs.opengroup.org/onlinepubs/009695399/basedefs/termios.h.html dnl says that tcflag_t, speed_t and cc_t are typedef'd. If they are not, dnl fallback to historical values. AC_DEFUN([CF_TERMIOS_TYPES],[ AC_CACHE_CHECK(for termios type tcflag_t, cf_cv_havetype_tcflag_t,[ AC_TRY_COMPILE([#include ],[ tcflag_t x = 0; (void)x], [cf_cv_havetype_tcflag_t=yes], [cf_cv_havetype_tcflag_t=no]) ]) test "$cf_cv_havetype_tcflag_t" = no && AC_DEFINE(tcflag_t,unsigned long,[Define usable value of tcflag_t if not declared]) AC_CACHE_CHECK(for termios type speed_t, cf_cv_havetype_speed_t,[ AC_TRY_COMPILE([#include ],[ speed_t x = 0; (void)x], [cf_cv_havetype_speed_t=yes], [cf_cv_havetype_speed_t=no]) ]) test "$cf_cv_havetype_speed_t" = no && AC_DEFINE(speed_t,unsigned short,[Define usable value of speed_t if not declared]) AC_CACHE_CHECK(for termios type cc_t, cf_cv_havetype_cc_t,[ AC_TRY_COMPILE([#include ],[ cc_t x = 0; (void)x], [cf_cv_havetype_cc_t=yes], [cf_cv_havetype_cc_t=no]) ]) test "$cf_cv_havetype_cc_t" = no && AC_DEFINE(cc_t,unsigned char,[Define usable value of cc_t if not declared]) ])dnl dnl --------------------------------------------------------------------------- dnl CF_TERM_HEADER version: 6 updated: 2021/01/02 09:31:20 dnl -------------- dnl Look for term.h, which is part of X/Open curses. It defines the interface dnl to terminfo database. Usually it is in the same include-path as curses.h, dnl but some packagers change this, breaking various applications. AC_DEFUN([CF_TERM_HEADER],[ AC_CACHE_CHECK(for terminfo header, cf_cv_term_header,[ case "${cf_cv_ncurses_header}" in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[[^.]]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do AC_TRY_COMPILE([#include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> ],[int x = auto_left_margin; (void)x],[ cf_cv_term_header="$cf_test"],[ cf_cv_term_header=unknown ]) test "$cf_cv_term_header" != unknown && break done ]) # Set definitions to allow ifdef'ing to accommodate subdirectories case "$cf_cv_term_header" in (*term.h) AC_DEFINE(HAVE_TERM_H,1,[Define to 1 if we have term.h]) ;; esac case "$cf_cv_term_header" in (ncurses/term.h) AC_DEFINE(HAVE_NCURSES_TERM_H,1,[Define to 1 if we have ncurses/term.h]) ;; (ncursesw/term.h) AC_DEFINE(HAVE_NCURSESW_TERM_H,1,[Define to 1 if we have ncursesw/term.h]) ;; esac ])dnl dnl --------------------------------------------------------------------------- dnl CF_TOP_BUILDDIR version: 2 updated: 2013/07/27 17:38:32 dnl --------------- dnl Define a top_builddir symbol, for applications that need an absolute path. AC_DEFUN([CF_TOP_BUILDDIR], [ top_builddir=ifelse($1,,`pwd`,$1) AC_SUBST(top_builddir) ])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_UTF8_LIB version: 10 updated: 2023/01/11 04:05:23 dnl ----------- dnl Check for multibyte support, and if not found, utf8 compatibility library AC_DEFUN([CF_UTF8_LIB], [ AC_HAVE_HEADERS(wchar.h) AC_CACHE_CHECK(for multibyte character support,cf_cv_utf8_lib,[ cf_save_LIBS="$LIBS" AC_TRY_LINK([ $ac_includes_default #ifdef HAVE_WCHAR_H #include #endif ],[putwc(0,0);], [cf_cv_utf8_lib=yes], [CF_FIND_LINKAGE([ #include ],[putwc(0,0);],utf8, [cf_cv_utf8_lib=add-on], [cf_cv_utf8_lib=no]) ])]) # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between # ncurses/ncursesw: if test "$cf_cv_utf8_lib" = "add-on" ; then AC_DEFINE(HAVE_LIBUTF8_H,1,[Define to 1 if we should include libutf8.h]) CF_ADD_INCDIR($cf_cv_header_path_utf8) CF_ADD_LIBDIR($cf_cv_library_path_utf8) CF_ADD_LIBS($cf_cv_library_file_utf8) fi ])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_CURSES_DIR version: 4 updated: 2021/01/02 19:22:58 dnl ------------------ dnl Wrapper for AC_ARG_WITH to specify directory under which to look for curses dnl libraries. AC_DEFUN([CF_WITH_CURSES_DIR],[ AC_MSG_CHECKING(for specific curses-directory) AC_ARG_WITH(curses-dir, [ --with-curses-dir=DIR directory in which (n)curses is installed], [cf_cv_curses_dir=$withval], [cf_cv_curses_dir=no]) AC_MSG_RESULT($cf_cv_curses_dir) if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" then CF_PATH_SYNTAX(withval) if test -d "$cf_cv_curses_dir" then CF_ADD_INCDIR($cf_cv_curses_dir/include) CF_ADD_LIBDIR($cf_cv_curses_dir/lib) fi fi ])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_LIB_PREFIX version: 2 updated: 2021/01/01 16:53:59 dnl ------------------ dnl Allow the library-prefix to be overridden. OS/2 EMX originally had no dnl "lib" prefix, e.g., because it used the dll naming convention. dnl dnl $1 = variable to set AC_DEFUN([CF_WITH_LIB_PREFIX], [ AC_MSG_CHECKING(if you want to have a library-prefix) AC_ARG_WITH(lib-prefix, [ --with-lib-prefix override library-prefix], [with_lib_prefix=$withval], [with_lib_prefix=auto]) AC_MSG_RESULT($with_lib_prefix) if test "$with_lib_prefix" = auto then CF_LIB_PREFIX($1) elif test "$with_lib_prefix" = no then LIB_PREFIX= else LIB_PREFIX=$with_lib_prefix fi ])dnl dnl --------------------------------------------------------------------------- dnl CF_WITH_MAN2HTML version: 12 updated: 2021/01/03 18:30:50 dnl ---------------- dnl Check for man2html and groff. Prefer man2html over groff, but use groff dnl as a fallback. See dnl dnl http://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 < 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 inteferes) 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 make an error #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 make an error #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__CURSES_DATA version: 3 updated: 2021/01/04 19:45:09 dnl --------------- dnl Attempt to make a copy of a curses data item. This is needed in the dnl check-data configure tests when using ncurses, because the symbol may be dnl actually a function return-value. That could happen if the linker is dnl broken (does not resolve data-only references), or if ncurses is configured dnl to support re-entrant code. dnl $1 = target dnl $2 = source define([CF__CURSES_DATA],[ #if defined($2) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *$1 = (const void *)($2); #else const void *$1 = &($2); #endif fprintf(stderr, "testing linkage of $2:%p\\n", (const void *)$1); ])dnl dnl --------------------------------------------------------------------------- dnl CF__CURSES_HEAD version: 2 updated: 2010/10/23 15:54:49 dnl --------------- dnl Define a reusable chunk which includes and when they dnl are both available. define([CF__CURSES_HEAD],[ #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif ]) dnl --------------------------------------------------------------------------- dnl CF__XOPEN_SOURCE_BODY version: 1 updated: 2022/09/10 15:17:35 dnl --------------------- dnl body of test when test-compiling for _XOPEN_SOURCE check define([CF__XOPEN_SOURCE_BODY], [ #ifndef _XOPEN_SOURCE make an error #endif ]) dnl --------------------------------------------------------------------------- dnl CF__XOPEN_SOURCE_HEAD version: 1 updated: 2022/09/10 15:17:03 dnl --------------------- dnl headers to include when test-compiling for _XOPEN_SOURCE check define([CF__XOPEN_SOURCE_HEAD], [ #include #include #include ]) tack-1.09-20230201/configure0000755000000000000000000155053314366605123013703 0ustar rootroot#! /bin/sh # Guess values for system-dependent variables and create Makefiles. # Generated by Autoconf 2.52.20230114. # # 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="tack.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 ;; -*) { 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:914: 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:925: 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:933: 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:949: 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:953: 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:959: 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:961: former value: $ac_old_val" >&5 echo "$as_me: former value: $ac_old_val" >&2;} { echo "$as_me:963: 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:982: 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:984: 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:1013: PATH=\".;.\"; conftest.sh") >&5 (PATH=".;."; conftest.sh) 2>&5 ac_status=$? echo "$as_me:1016: \$? = $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 ncurses_cfg.h:ncurses_tst.hin" test -f config.guess || ( test -f ../config.guess && cp ../config.guess ./ ) test -f config.sub || ( test -f ../config.sub && cp ../config.sub ./ ) 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:1048: 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:1058: error: cannot run $ac_config_sub" >&5 echo "$as_me: error: cannot run $ac_config_sub" >&2;} { (exit 1); exit 1; }; } echo "$as_me:1062: 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:1071: 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:1075: 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:1080: 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:1088: 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:1097: 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:1102: 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:1128: 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:1132: 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:1134: 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 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 echo "$as_me:1152: checking whether ${MAKE-make} sets \${MAKE}" >&5 echo $ECHO_N "checking whether ${MAKE-make} sets \${MAKE}... $ECHO_C" >&6 set dummy ${MAKE-make}; ac_make=`echo "$2" | sed 'y,./+-,__p_,'` if eval "test \"\${ac_cv_prog_make_${ac_make}_set+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >conftest.make <<\EOF all: @echo 'ac_maketemp="${MAKE}"' EOF # GNU make sometimes prints "make[1]: Entering...", which would confuse us. eval `${MAKE-make} -f conftest.make 2>/dev/null | grep temp=` if test -n "$ac_maketemp"; then eval ac_cv_prog_make_${ac_make}_set=yes else eval ac_cv_prog_make_${ac_make}_set=no fi rm -f conftest.make fi if eval "test \"`echo '$ac_cv_prog_make_'${ac_make}_set`\" = yes"; then echo "$as_me:1172: result: yes" >&5 echo "${ECHO_T}yes" >&6 SET_MAKE= else echo "$as_me:1176: result: no" >&5 echo "${ECHO_T}no" >&6 SET_MAKE="MAKE=${MAKE-make}" fi ac_ext=c ac_cpp='$CPP $CPPFLAGS' ac_compile='$CC -c $CFLAGS $CPPFLAGS "conftest.$ac_ext" >&5' ac_link='$CC -o "conftest$ac_exeext" $CFLAGS $CPPFLAGS $LDFLAGS "conftest.$ac_ext" $LIBS >&5' ac_compiler_gnu=$ac_cv_c_compiler_gnu 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:1190: 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:1205: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1213: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1216: 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:1225: 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:1240: 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:1248: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1251: 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:1264: 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:1279: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1287: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1290: 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:1299: 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:1314: 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:1322: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1325: 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:1338: 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:1358: 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:1380: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1383: 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:1394: 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:1409: found $ac_dir/$ac_word" >&5 break done fi fi CC=$ac_cv_prog_CC if test -n "$CC"; then echo "$as_me:1417: result: $CC" >&5 echo "${ECHO_T}$CC" >&6 else echo "$as_me:1420: 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:1433: 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:1448: 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:1456: result: $ac_ct_CC" >&5 echo "${ECHO_T}$ac_ct_CC" >&6 else echo "$as_me:1459: 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:1471: 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:1476:" \ "checking for C compiler version" >&5 ac_compiler=`set X $ac_compile; echo "$2"` { (eval echo "$as_me:1479: \"$ac_compiler --version &5\"") >&5 (eval $ac_compiler --version &5) 2>&5 ac_status=$? echo "$as_me:1482: \$? = $ac_status" >&5 (exit "$ac_status"); } { (eval echo "$as_me:1484: \"$ac_compiler -v &5\"") >&5 (eval $ac_compiler -v &5) 2>&5 ac_status=$? echo "$as_me:1487: \$? = $ac_status" >&5 (exit "$ac_status"); } { (eval echo "$as_me:1489: \"$ac_compiler -V &5\"") >&5 (eval $ac_compiler -V &5) 2>&5 ac_status=$? echo "$as_me:1492: \$? = $ac_status" >&5 (exit "$ac_status"); } cat >"conftest.$ac_ext" <<_ACEOF #line 1496 "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:1512: 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:1515: \"$ac_link_default\"") >&5 (eval $ac_link_default) 2>&5 ac_status=$? echo "$as_me:1518: \$? = $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:1541: 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:1547: 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:1552: 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:1558: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1561: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cross_compiling=no else if test "$cross_compiling" = maybe; then cross_compiling=yes else { { echo "$as_me:1568: 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:1576: 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:1583: checking whether we are cross compiling" >&5 echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 echo "$as_me:1585: result: $cross_compiling" >&5 echo "${ECHO_T}$cross_compiling" >&6 echo "$as_me:1588: checking for executable suffix" >&5 echo $ECHO_N "checking for executable suffix... $ECHO_C" >&6 if { (eval echo "$as_me:1590: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:1593: \$? = $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:1609: 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:1615: 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:1621: 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 1627 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f conftest.o conftest.obj if { (eval echo "$as_me:1639: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1642: \$? = $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:1654: 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:1661: result: $ac_cv_objext" >&5 echo "${ECHO_T}$ac_cv_objext" >&6 OBJEXT=$ac_cv_objext ac_objext=$OBJEXT echo "$as_me:1665: 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 1671 "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:1686: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1689: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1692: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1695: \$? = $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:1707: 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:1713: 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 1719 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1731: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1734: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1737: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1740: \$? = $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:1750: 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:1777: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1780: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1783: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1786: \$? = $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 1798 "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:1811: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1814: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1817: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1820: \$? = $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 1830 "configure" #include "confdefs.h" $ac_declaration int main (void) { exit (42); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:1842: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:1845: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:1848: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:1851: \$? = $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" 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:1883: 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:1898: found $ac_dir/$ac_word" >&5 break done fi fi GREP=$ac_cv_prog_GREP if test -n "$GREP"; then echo "$as_me:1906: result: $GREP" >&5 echo "${ECHO_T}$GREP" >&6 else echo "$as_me:1909: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$GREP" && break done test -n "$GREP" || GREP=": " echo "$as_me:1917: 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:1929: 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:1946: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi EGREP=$ac_cv_path_EGREP if test -n "$EGREP"; then echo "$as_me:1957: result: $EGREP" >&5 echo "${ECHO_T}$EGREP" >&6 else echo "$as_me:1960: 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:1968: error: cannot find workable egrep" >&5 echo "$as_me: error: cannot find workable egrep" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:1973: 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:1983: 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 2004 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2009: \"$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:2015: \$? = $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 2038 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2042: \"$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:2048: \$? = $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:2085: 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 2095 "configure" #include "confdefs.h" #include Syntax error _ACEOF if { (eval echo "$as_me:2100: \"$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:2106: \$? = $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 2129 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:2133: \"$ac_cpp "conftest.$ac_ext"\"") >&5 (eval $ac_cpp "conftest.$ac_ext") 2>conftest.er1 ac_status=$? $EGREP -v '^ *\+' conftest.er1 >conftest.err rm -f conftest.er1 cat conftest.err >&5 echo "$as_me:2139: \$? = $ac_status" >&5 (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:2167: 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:2191: 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:2240: 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' case $INSTALL in (/*) ;; (*) cf_dir=`echo "$INSTALL" | sed -e 's%/[^/]*$%%'` test -z "$cf_dir" && cf_dir=. INSTALL="`cd \"$cf_dir\" && pwd`"/"`echo "$INSTALL" | sed -e 's%^.*/%%'`" ;; esac 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:2265: 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:2280: found $ac_dir/$ac_word" >&5 break done fi fi LINT=$ac_cv_prog_LINT if test -n "$LINT"; then echo "$as_me:2288: result: $LINT" >&5 echo "${ECHO_T}$LINT" >&6 else echo "$as_me:2291: 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:2304: 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:2316: 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:2333: found $ac_dir/$ac_word" >&5 break fi done ;; esac fi FGREP=$ac_cv_path_FGREP if test -n "$FGREP"; then echo "$as_me:2344: result: $FGREP" >&5 echo "${ECHO_T}$FGREP" >&6 else echo "$as_me:2347: 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:2355: error: cannot find workable fgrep" >&5 echo "$as_me: error: cannot find workable fgrep" >&2;} { (exit 1); exit 1; }; } fi fi echo "$as_me:2360: result: $ac_cv_path_FGREP" >&5 echo "${ECHO_T}$ac_cv_path_FGREP" >&6 FGREP="$ac_cv_path_FGREP" echo "$as_me:2364: checking for makeflags variable" >&5 echo $ECHO_N "checking for makeflags variable... $ECHO_C" >&6 if test "${cf_cv_makeflags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_makeflags='' for cf_option in '-${MAKEFLAGS}' '${MFLAGS}' do cat >cf_makeflags.tmp </dev/null | ${FGREP-fgrep} -v "ing directory" | sed -e 's,[ ]*$,,'` case "$cf_result" in (.*k|.*kw) cf_result="`${MAKE:-make} -k -f cf_makeflags.tmp CC=cc 2>/dev/null`" case "$cf_result" in (.*CC=*) cf_cv_makeflags= ;; (*) cf_cv_makeflags=$cf_option ;; esac break ;; (.-) ;; (*) echo "${as_me:-configure}:2394: testing given option \"$cf_option\",no match \"$cf_result\" ..." 1>&5 ;; esac done rm -f cf_makeflags.tmp fi echo "$as_me:2402: result: $cf_cv_makeflags" >&5 echo "${ECHO_T}$cf_cv_makeflags" >&6 echo "$as_me:2405: 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:2432: 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:2443: 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:2458: found $ac_dir/$ac_word" >&5 break done fi fi CTAGS=$ac_cv_prog_CTAGS if test -n "$CTAGS"; then echo "$as_me:2466: result: $CTAGS" >&5 echo "${ECHO_T}$CTAGS" >&6 else echo "$as_me:2469: 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:2480: 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:2495: found $ac_dir/$ac_word" >&5 break done fi fi ETAGS=$ac_cv_prog_ETAGS if test -n "$ETAGS"; then echo "$as_me:2503: result: $ETAGS" >&5 echo "${ECHO_T}$ETAGS" >&6 else echo "$as_me:2506: 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:2515: 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:2530: 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:2539: result: $MAKE_LOWER_TAGS" >&5 echo "${ECHO_T}$MAKE_LOWER_TAGS" >&6 else echo "$as_me:2542: 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:2549: 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:2564: 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:2573: result: $MAKE_UPPER_TAGS" >&5 echo "${ECHO_T}$MAKE_UPPER_TAGS" >&6 else echo "$as_me:2576: 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 if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ranlib", so it can be a program name with args. set dummy ${ac_tool_prefix}ranlib; ac_word=$2 echo "$as_me:2599: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$RANLIB"; then ac_cv_prog_RANLIB="$RANLIB" # Let the user override the test. else 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_RANLIB="${ac_tool_prefix}ranlib" echo "$as_me:2614: found $ac_dir/$ac_word" >&5 break done fi fi RANLIB=$ac_cv_prog_RANLIB if test -n "$RANLIB"; then echo "$as_me:2622: result: $RANLIB" >&5 echo "${ECHO_T}$RANLIB" >&6 else echo "$as_me:2625: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_RANLIB"; then ac_ct_RANLIB=$RANLIB # Extract the first word of "ranlib", so it can be a program name with args. set dummy ranlib; ac_word=$2 echo "$as_me:2634: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_RANLIB+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_RANLIB"; then ac_cv_prog_ac_ct_RANLIB="$ac_ct_RANLIB" # Let the user override the test. else 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_RANLIB="ranlib" echo "$as_me:2649: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_RANLIB" && ac_cv_prog_ac_ct_RANLIB="':'" fi fi ac_ct_RANLIB=$ac_cv_prog_ac_ct_RANLIB if test -n "$ac_ct_RANLIB"; then echo "$as_me:2658: result: $ac_ct_RANLIB" >&5 echo "${ECHO_T}$ac_ct_RANLIB" >&6 else echo "$as_me:2661: result: no" >&5 echo "${ECHO_T}no" >&6 fi RANLIB=$ac_ct_RANLIB else RANLIB="$ac_cv_prog_RANLIB" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ld", so it can be a program name with args. set dummy ${ac_tool_prefix}ld; ac_word=$2 echo "$as_me:2673: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$LD"; then ac_cv_prog_LD="$LD" # 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_LD="${ac_tool_prefix}ld" echo "$as_me:2688: found $ac_dir/$ac_word" >&5 break done fi fi LD=$ac_cv_prog_LD if test -n "$LD"; then echo "$as_me:2696: result: $LD" >&5 echo "${ECHO_T}$LD" >&6 else echo "$as_me:2699: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_LD"; then ac_ct_LD=$LD # Extract the first word of "ld", so it can be a program name with args. set dummy ld; ac_word=$2 echo "$as_me:2708: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_LD+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_LD"; then ac_cv_prog_ac_ct_LD="$ac_ct_LD" # 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_LD="ld" echo "$as_me:2723: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_LD" && ac_cv_prog_ac_ct_LD="ld" fi fi ac_ct_LD=$ac_cv_prog_ac_ct_LD if test -n "$ac_ct_LD"; then echo "$as_me:2732: result: $ac_ct_LD" >&5 echo "${ECHO_T}$ac_ct_LD" >&6 else echo "$as_me:2735: result: no" >&5 echo "${ECHO_T}no" >&6 fi LD=$ac_ct_LD else LD="$ac_cv_prog_LD" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:2747: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:2762: found $ac_dir/$ac_word" >&5 break done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:2770: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:2773: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:2782: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_AR="ar" echo "$as_me:2797: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:2806: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:2809: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}nm", so it can be a program name with args. set dummy ${ac_tool_prefix}nm; ac_word=$2 echo "$as_me:2821: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NM"; then ac_cv_prog_NM="$NM" # 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_NM="${ac_tool_prefix}nm" echo "$as_me:2836: found $ac_dir/$ac_word" >&5 break done fi fi NM=$ac_cv_prog_NM if test -n "$NM"; then echo "$as_me:2844: result: $NM" >&5 echo "${ECHO_T}$NM" >&6 else echo "$as_me:2847: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_NM"; then ac_ct_NM=$NM # Extract the first word of "nm", so it can be a program name with args. set dummy nm; ac_word=$2 echo "$as_me:2856: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NM+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NM"; then ac_cv_prog_ac_ct_NM="$ac_ct_NM" # 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_NM="nm" echo "$as_me:2871: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_NM" && ac_cv_prog_ac_ct_NM="nm" fi fi ac_ct_NM=$ac_cv_prog_ac_ct_NM if test -n "$ac_ct_NM"; then echo "$as_me:2880: result: $ac_ct_NM" >&5 echo "${ECHO_T}$ac_ct_NM" >&6 else echo "$as_me:2883: result: no" >&5 echo "${ECHO_T}no" >&6 fi NM=$ac_ct_NM else NM="$ac_cv_prog_NM" fi if test -n "$ac_tool_prefix"; then # Extract the first word of "${ac_tool_prefix}ar", so it can be a program name with args. set dummy ${ac_tool_prefix}ar; ac_word=$2 echo "$as_me:2895: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$AR"; then ac_cv_prog_AR="$AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_AR="${ac_tool_prefix}ar" echo "$as_me:2910: found $ac_dir/$ac_word" >&5 break done fi fi AR=$ac_cv_prog_AR if test -n "$AR"; then echo "$as_me:2918: result: $AR" >&5 echo "${ECHO_T}$AR" >&6 else echo "$as_me:2921: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi if test -z "$ac_cv_prog_AR"; then ac_ct_AR=$AR # Extract the first word of "ar", so it can be a program name with args. set dummy ar; ac_word=$2 echo "$as_me:2930: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_AR+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_AR"; then ac_cv_prog_ac_ct_AR="$ac_ct_AR" # Let the user override the test. else ac_save_IFS=$IFS; IFS=$ac_path_separator ac_dummy="$PATH" for ac_dir in $ac_dummy; do IFS=$ac_save_IFS test -z "$ac_dir" && ac_dir=. $as_executable_p "$ac_dir/$ac_word" || continue ac_cv_prog_ac_ct_AR="ar" echo "$as_me:2945: found $ac_dir/$ac_word" >&5 break done test -z "$ac_cv_prog_ac_ct_AR" && ac_cv_prog_ac_ct_AR="ar" fi fi ac_ct_AR=$ac_cv_prog_ac_ct_AR if test -n "$ac_ct_AR"; then echo "$as_me:2954: result: $ac_ct_AR" >&5 echo "${ECHO_T}$ac_ct_AR" >&6 else echo "$as_me:2957: result: no" >&5 echo "${ECHO_T}no" >&6 fi AR=$ac_ct_AR else AR="$ac_cv_prog_AR" fi echo "$as_me:2966: checking for options to update archives" >&5 echo $ECHO_N "checking for options to update archives... $ECHO_C" >&6 if test "${cf_cv_ar_flags+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "$cf_cv_system_name" in (*-msvc*) cf_cv_ar_flags='' cat >mk_static_lib.sh <<-EOF #!$SHELL MSVC_BIN="$AR" out="\$1" shift exec \$MSVC_BIN -out:"\$out" \$@ EOF chmod +x mk_static_lib.sh AR=`pwd`/mk_static_lib.sh ;; (*) cf_cv_ar_flags=unknown for cf_ar_flags in -curvU -curv curv -crv crv -cqv cqv -rv rv do # check if $ARFLAGS already contains this choice if test "x$ARFLAGS" != "x" ; then cf_check_ar_flags=`echo "x$ARFLAGS" | sed -e "s/$cf_ar_flags\$//" -e "s/$cf_ar_flags / /"` if test "x$ARFLAGS" != "$cf_check_ar_flags" ; then cf_cv_ar_flags= break fi fi rm -f "conftest.$ac_cv_objext" rm -f conftest.a cat >"conftest.$ac_ext" <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3009: \$? = $ac_status" >&5 (exit "$ac_status"); } ; then echo "$AR $ARFLAGS $cf_ar_flags conftest.a conftest.$ac_cv_objext" >&5 $AR $ARFLAGS "$cf_ar_flags" conftest.a "conftest.$ac_cv_objext" 2>&5 1>/dev/null if test -f conftest.a ; then cf_cv_ar_flags="$cf_ar_flags" break fi else test -n "$verbose" && echo " cannot compile test-program" 1>&6 echo "${as_me:-configure}:3020: testing cannot compile test-program ..." 1>&5 break fi done rm -f conftest.a "conftest.$ac_ext" "conftest.$ac_cv_objext" ;; esac fi echo "$as_me:3030: result: $cf_cv_ar_flags" >&5 echo "${ECHO_T}$cf_cv_ar_flags" >&6 if test -n "$ARFLAGS" ; then if test -n "$cf_cv_ar_flags" ; then ARFLAGS="$ARFLAGS $cf_cv_ar_flags" fi else ARFLAGS=$cf_cv_ar_flags fi CC_G_OPT="-g" CC_SHARED_OPTS=unknown DESTDIR="" DFT_DEP_SUFFIX="" DFT_OBJ_SUBDIR=`pwd|sed -e's:.*/::'` DFT_LWR_MODEL="normal" DFT_UPR_MODEL="NORMAL" EXTRA_LDFLAGS="" LDFLAGS_SHARED="" LD_MODEL="" LD_SHARED_OPTS="" LIBTOOL="" LIB_CLEAN="" LIB_COMPILE="" LIB_INSTALL="" LIB_LINK='$(CC)' LIB_SUFFIX="" LIB_UNINSTALL="" LINK_PROGS="" LOCAL_LDFLAGS="" TINFO_LDFLAGS="" TINFO_LIBS="" cf_cv_abi_version="" cf_cv_rel_version="" NCURSES_TREE="#" top_builddir=`pwd` cf_cv_screen=ncurses cf_cv_libtype= echo "$as_me:3073: checking for long file names" >&5 echo $ECHO_N "checking for long file names... $ECHO_C" >&6 if test "${ac_cv_sys_long_file_names+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_cv_sys_long_file_names=yes # Test for long file names in all the places we know might matter: # . the current directory, where building will happen # $prefix/lib where we will be installing things # $exec_prefix/lib likewise # eval it to expand exec_prefix. # $TMPDIR if set, where it might want to write temporary files # if $TMPDIR is not set: # /tmp where it might want to write temporary files # /var/tmp likewise # /usr/tmp likewise if test -n "$TMPDIR" && test -d "$TMPDIR" && test -w "$TMPDIR"; then ac_tmpdirs=$TMPDIR else ac_tmpdirs='/tmp /var/tmp /usr/tmp' fi for ac_dir in . $ac_tmpdirs `eval echo "$prefix/lib" "$exec_prefix/lib"` ; do test -d "$ac_dir" || continue test -w "$ac_dir" || continue # It is less confusing to not echo anything here. ac_xdir=$ac_dir/cf$$ (umask 077 && mkdir "$ac_xdir" 2>/dev/null) || continue ac_tf1=$ac_xdir/conftest9012345 ac_tf2=$ac_xdir/conftest9012346 (echo 1 >"$ac_tf1") 2>/dev/null (echo 2 >"$ac_tf2") 2>/dev/null ac_val=`cat "$ac_tf1" 2>/dev/null` if test ! -f "$ac_tf1" || test "$ac_val" != 1; then ac_cv_sys_long_file_names=no rm -rf "$ac_xdir" 2>/dev/null break fi rm -rf "$ac_xdir" 2>/dev/null done fi echo "$as_me:3112: result: $ac_cv_sys_long_file_names" >&5 echo "${ECHO_T}$ac_cv_sys_long_file_names" >&6 if test "$ac_cv_sys_long_file_names" = yes; then cat >>confdefs.h <<\EOF #define HAVE_LONG_FILE_NAMES 1 EOF fi echo "$as_me:3122: checking if you want to have a library-prefix" >&5 echo $ECHO_N "checking if you want to have a library-prefix... $ECHO_C" >&6 # Check whether --with-lib-prefix or --without-lib-prefix was given. if test "${with_lib_prefix+set}" = set; then withval="$with_lib_prefix" with_lib_prefix=$withval else with_lib_prefix=auto fi; echo "$as_me:3132: result: $with_lib_prefix" >&5 echo "${ECHO_T}$with_lib_prefix" >&6 if test "$with_lib_prefix" = auto then case "$cf_cv_system_name" in (OS/2*|os2*) if test "$DFT_LWR_MODEL" = libtool; then LIB_PREFIX='lib' else LIB_PREFIX='' fi ;; (*-msvc*) LIB_PREFIX='' ;; (*) LIB_PREFIX='lib' ;; esac elif test "$with_lib_prefix" = no then LIB_PREFIX= else LIB_PREFIX=$with_lib_prefix fi # This should have been defined by AC_PROG_CC : "${CC:=cc}" echo "$as_me:3163: checking \$CFLAGS variable" >&5 echo $ECHO_N "checking \$CFLAGS variable... $ECHO_C" >&6 case "x$CFLAGS" in (*-[IUD]*) echo "$as_me:3167: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:3169: 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:3277: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac echo "$as_me:3282: checking \$CC variable" >&5 echo $ECHO_N "checking \$CC variable... $ECHO_C" >&6 case "$CC" in (*[\ \ ]-*) echo "$as_me:3286: result: broken" >&5 echo "${ECHO_T}broken" >&6 { echo "$as_me:3288: 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" | ${AWK:-awk} -v prog="$cf_prog" '{ printf("%s", substr($0,1+length(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}:3405: testing resulting CC: '$CC' ..." 1>&5 test -n "$verbose" && echo " resulting CFLAGS: '$CFLAGS'" 1>&6 echo "${as_me:-configure}:3409: testing resulting CFLAGS: '$CFLAGS' ..." 1>&5 test -n "$verbose" && echo " resulting CPPFLAGS: '$CPPFLAGS'" 1>&6 echo "${as_me:-configure}:3413: testing resulting CPPFLAGS: '$CPPFLAGS' ..." 1>&5 ;; (*) echo "$as_me:3417: result: ok" >&5 echo "${ECHO_T}ok" >&6 ;; esac echo "$as_me:3422: checking for ${CC:-cc} option to accept ANSI C" >&5 echo $ECHO_N "checking for ${CC:-cc} option to accept ANSI C... $ECHO_C" >&6 if test "${cf_cv_ansi_cc+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else 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 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 cat >"conftest.$ac_ext" <<_ACEOF #line 3546 "configure" #include "confdefs.h" #ifndef CC_HAS_PROTOS #if !defined(__STDC__) || (__STDC__ != 1) choke me #endif #endif int main (void) { int test (int i, double x); struct s1 {int (*f) (int a);}; struct s2 {int (*f) (double a);}; ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3567: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3570: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3573: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3576: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ansi_cc="$cf_arg"; break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" done CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" fi echo "$as_me:3589: result: $cf_cv_ansi_cc" >&5 echo "${ECHO_T}$cf_cv_ansi_cc" >&6 if test "$cf_cv_ansi_cc" != "no"; then if test ".$cf_cv_ansi_cc" != ".-DCC_HAS_PROTOS"; then cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_cv_ansi_cc 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 cat >>confdefs.h <<\EOF #define CC_HAS_PROTOS 1 EOF fi fi if test "$cf_cv_ansi_cc" = "no"; then { { echo "$as_me:3703: 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" >&5 echo "$as_me: 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" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:3716: 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:3750: result: $enableval" >&5 echo "${ECHO_T}$enableval" >&6 # ncurses uses a different symbol as of 2012/02/26 (workaround) ECHO_LINK="$ECHO_LD" echo "$as_me:3756: 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:3773: result: $enable_stdnoreturn" >&5 echo "${ECHO_T}$enable_stdnoreturn" >&6 if test $enable_stdnoreturn = yes; then echo "$as_me:3777: 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 3783 "configure" #include "confdefs.h" #include #include #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:3800: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3803: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3806: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3809: \$? = $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:3820: 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 <&5 echo $ECHO_N "checking version of $CC... $ECHO_C" >&6 GCC_VERSION="`${CC} --version 2>/dev/null | sed -e '2,$d' -e 's/^.*(GCC[^)]*) //' -e 's/^.*(Debian[^)]*) //' -e 's/^[^0-9.]*//' -e 's/[^0-9.].*//'`" test -z "$GCC_VERSION" && GCC_VERSION=unknown echo "$as_me:3847: 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:3856: 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 3861 "configure" #include "confdefs.h" int main (void) { #ifdef __INTEL_COMPILER #else make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3878: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3881: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3884: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3887: \$? = $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:3898: result: $INTEL_COMPILER" >&5 echo "${ECHO_T}$INTEL_COMPILER" >&6 ;; esac fi CLANG_COMPILER=no if test "$GCC" = yes ; then echo "$as_me:3907: 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 3911 "configure" #include "confdefs.h" int main (void) { #ifdef __clang__ #else make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:3928: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:3931: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:3934: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:3937: \$? = $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:3947: 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:3956: 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:3963: 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:3967: 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:3974: 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 3979 "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:3993: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:3996: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:3999: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4002: \$? = $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:4013: 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}:4019: testing adding option $cf_clang_opt ..." 1>&5 test -n "$CFLAGS" && CFLAGS="$CFLAGS " CFLAGS="${CFLAGS}$cf_clang_opt" fi done fi if test "$GCC" = yes || test "$GXX" = yes then if test "$GCC" = yes || test "$GXX" = yes then case $CFLAGS in (*-Werror=*) cf_temp_flags= for cf_temp_scan in $CFLAGS 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$CFLAGS" != "x$cf_temp_flags" then test -n "$verbose" && echo " repairing CFLAGS: $CFLAGS" 1>&6 echo "${as_me:-configure}:4063: testing repairing CFLAGS: $CFLAGS ..." 1>&5 CFLAGS="$cf_temp_flags" test -n "$verbose" && echo " ... fixed $CFLAGS" 1>&6 echo "${as_me:-configure}:4068: testing ... fixed $CFLAGS ..." 1>&5 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 echo "${as_me:-configure}:4072: 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}:4111: testing repairing CPPFLAGS: $CPPFLAGS ..." 1>&5 CPPFLAGS="$cf_temp_flags" test -n "$verbose" && echo " ... fixed $CPPFLAGS" 1>&6 echo "${as_me:-configure}:4116: testing ... fixed $CPPFLAGS ..." 1>&5 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 echo "${as_me:-configure}:4120: 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}:4159: testing repairing LDFLAGS: $LDFLAGS ..." 1>&5 LDFLAGS="$cf_temp_flags" test -n "$verbose" && echo " ... fixed $LDFLAGS" 1>&6 echo "${as_me:-configure}:4164: testing ... fixed $LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ... extra $EXTRA_CFLAGS" 1>&6 echo "${as_me:-configure}:4168: testing ... extra $EXTRA_CFLAGS ..." 1>&5 fi ;; esac fi echo "$as_me:4175: 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:4192: 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:4271: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:4273: 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:4366: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4369: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:4371: 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:4379: 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 do CFLAGS="$cf_save_CFLAGS $EXTRA_CFLAGS -$cf_opt" if { (eval echo "$as_me:4402: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4405: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:4407: 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}:4415: 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}:4425: 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 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:4516: \$? = $ac_status" >&5 (exit "$ac_status"); }; then test -n "$verbose" && echo "$as_me:4518: 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 echo "$as_me:4577: 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 4584 "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:4603: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4606: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4609: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4612: \$? = $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:4623: 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=500 cf_POSIX_C_SOURCE=199506L cf_xopen_source= case "$host_os" in (aix[4-7]*) cf_xopen_source="-D_ALL_SOURCE" ;; (msys) cf_XOPEN_SOURCE=600 ;; (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) cf_gnu_xopen_source=$cf_XOPEN_SOURCE echo "$as_me:4668: 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 4675 "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:4694: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4697: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4700: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4703: \$? = $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:4714: 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:4722: 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 4734 "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:4753: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4756: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4759: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4762: \$? = $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:4774: 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:4779: 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 4884 "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:4904: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4907: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4910: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4913: \$? = $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:4924: 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:4933: 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 4940 "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:4955: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:4958: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:4961: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:4964: \$? = $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 5071 "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:5086: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5089: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5092: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5095: \$? = $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:5110: 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:5115: 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 5125 "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:5140: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5143: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5146: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5149: \$? = $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:5160: 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:5197: 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}:5203: testing if the symbol is already defined go no further ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 5206 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5221: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5224: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5227: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5230: \$? = $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 5251 "configure" #include "confdefs.h" #include int main (void) { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5266: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5269: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5272: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5275: \$? = $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}:5286: 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}:5294: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 5297 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5312: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5315: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5318: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5321: \$? = $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:5337: 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:5454: 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:5486: 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 5493 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5513: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5516: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5519: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5522: \$? = $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 5534 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5554: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5557: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5560: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5563: \$? = $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:5578: 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:5738: 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}:5744: testing if the symbol is already defined go no further ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 5747 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5762: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5765: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5768: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5771: \$? = $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 5792 "configure" #include "confdefs.h" #include int main (void) { #ifdef _POSIX_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5807: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5810: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5813: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5816: \$? = $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}:5827: 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}:5835: testing if the second compile does not leave our definition intact error ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 5838 "configure" #include "confdefs.h" #include int main (void) { #ifndef _POSIX_C_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:5853: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:5856: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:5859: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:5862: \$? = $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:5878: 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 inteferes" 1>&6 echo "${as_me:-configure}:5991: testing checking if _POSIX_C_SOURCE inteferes ..." 1>&5 cat >"conftest.$ac_ext" <<_ACEOF #line 5994 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6014: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6017: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6020: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6023: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then : else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 { echo "$as_me:6030: 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}:6053: 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}:6065: 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}:6153: 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}:6163: 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}:6173: 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:6185: 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 6188 "configure" #include "confdefs.h" #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6203: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6206: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6209: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6212: \$? = $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:6221: 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 6226 "configure" #include "confdefs.h" #include int main (void) { #if (_XOPEN_SOURCE - 0) < $cf_XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6241: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6244: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6247: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6250: \$? = $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:6261: WARNING: _XOPEN_SOURCE is lower than requested" >&5 echo "$as_me: WARNING: _XOPEN_SOURCE is lower than requested" >&2;} fi else echo "$as_me:6266: 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 6273 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6293: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6296: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6299: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6302: \$? = $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 6314 "configure" #include "confdefs.h" #include #include #include int main (void) { #ifndef _XOPEN_SOURCE make an error #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6334: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6337: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6340: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6343: \$? = $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:6358: 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:6505: 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 6511 "configure" #include "confdefs.h" #include #include #include #include _ACEOF if { (eval echo "$as_me:6519: \"$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:6525: \$? = $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 6547 "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 6565 "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 6586 "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:6612: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6615: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:6617: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6620: \$? = $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:6633: 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:6649: 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 6655 "configure" #include "confdefs.h" $ac_includes_default #include <$ac_header> _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6661: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6664: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6667: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6670: \$? = $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:6680: 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 6696 "configure" #include "confdefs.h" $ac_includes_default int main (void) { #ifndef exit char *p = (char *) exit; (void) p; #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:6711: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6714: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:6717: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6720: \$? = $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:6730: result: $ac_cv_have_decl_exit" >&5 echo "${ECHO_T}$ac_cv_have_decl_exit" >&6 ### Checks for external-data echo "$as_me:6735: checking if data-only library module links" >&5 echo $ECHO_N "checking if data-only library module links... $ECHO_C" >&6 if test "${cf_cv_link_dataonly+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else rm -f conftest.a cat >conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6749: \$? = $ac_status" >&5 (exit "$ac_status"); } ; then mv conftest.o data.o && \ ( $AR $ARFLAGS conftest.a data.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext data.o cat >conftest.$ac_ext <&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:6772: \$? = $ac_status" >&5 (exit "$ac_status"); }; then mv conftest.o func.o && \ ( $AR $ARFLAGS conftest.a func.o ) 2>&5 1>/dev/null fi rm -f conftest.$ac_ext func.o ( eval $RANLIB conftest.a ) 2>&5 >/dev/null cf_saveLIBS="$LIBS" LIBS="conftest.a $LIBS" if test "$cross_compiling" = yes; then cf_cv_link_dataonly=unknown else cat >"conftest.$ac_ext" <<_ACEOF #line 6785 "configure" #include "confdefs.h" int main(void) { extern int testfunc(); ${cf_cv_main_return:-return} (!testfunc()); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:6796: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:6799: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:6801: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:6804: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_link_dataonly=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_link_dataonly=no fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi LIBS="$cf_saveLIBS" fi echo "$as_me:6819: result: $cf_cv_link_dataonly" >&5 echo "${ECHO_T}$cf_cv_link_dataonly" >&6 if test "$cf_cv_link_dataonly" = no ; then cat >>confdefs.h <<\EOF #define BROKEN_LINKER 1 EOF BROKEN_LINKER=1 fi echo "$as_me:6831: 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:6841: 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:6853: 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:6870: 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:6881: result: $PKG_CONFIG" >&5 echo "${ECHO_T}$PKG_CONFIG" >&6 else echo "$as_me:6884: 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:6893: 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:6910: 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:6922: result: $ac_pt_PKG_CONFIG" >&5 echo "${ECHO_T}$ac_pt_PKG_CONFIG" >&6 else echo "$as_me:6925: result: no" >&5 echo "${ECHO_T}no" >&6 fi PKG_CONFIG=$ac_pt_PKG_CONFIG else PKG_CONFIG="$ac_cv_path_PKG_CONFIG" fi ;; (*) PKG_CONFIG=$withval ;; esac test -z "$PKG_CONFIG" && PKG_CONFIG=none if test "$PKG_CONFIG" != none ; then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$PKG_CONFIG" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\$\{*prefix\}*|.\$\{*dir\}*) eval PKG_CONFIG="$PKG_CONFIG" case ".$PKG_CONFIG" in (.NONE/*) PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) PKG_CONFIG=`echo "$PKG_CONFIG" | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:6968: 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:6975: WARNING: pkg-config is not installed" >&5 echo "$as_me: WARNING: pkg-config is not installed" >&2;} fi echo "$as_me:6979: checking for specific curses-directory" >&5 echo $ECHO_N "checking for specific curses-directory... $ECHO_C" >&6 # Check whether --with-curses-dir or --without-curses-dir was given. if test "${with_curses_dir+set}" = set; then withval="$with_curses_dir" cf_cv_curses_dir=$withval else cf_cv_curses_dir=no fi; echo "$as_me:6989: result: $cf_cv_curses_dir" >&5 echo "${ECHO_T}$cf_cv_curses_dir" >&6 if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" then if test "x$prefix" != xNONE; then cf_path_syntax="$prefix" else cf_path_syntax="$ac_default_prefix" fi case ".$withval" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\$\{*prefix\}*|.\$\{*dir\}*) eval withval="$withval" case ".$withval" in (.NONE/*) withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) withval=`echo "$withval" | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:7020: error: expected a pathname, not \"$withval\"" >&5 echo "$as_me: error: expected a pathname, not \"$withval\"" >&2;} { (exit 1); exit 1; }; } ;; esac if test -d "$cf_cv_curses_dir" then if test -n "$cf_cv_curses_dir/include" ; then for cf_add_incdir in $cf_cv_curses_dir/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 7056 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:7068: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7071: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:7074: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7077: \$? = $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}:7094: 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_curses_dir/lib" ; then for cf_add_libdir in $cf_cv_curses_dir/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}:7130: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi fi fi cf_cv_screen=curses echo "$as_me:7143: checking for specified curses library type" >&5 echo $ECHO_N "checking for specified curses library type... $ECHO_C" >&6 # Check whether --with-screen or --without-screen was given. if test "${with_screen+set}" = set; then withval="$with_screen" cf_cv_screen=$withval else # Check whether --with-ncursesw or --without-ncursesw was given. if test "${with_ncursesw+set}" = set; then withval="$with_ncursesw" cf_cv_screen=ncursesw else # Check whether --with-ncurses or --without-ncurses was given. if test "${with_ncurses+set}" = set; then withval="$with_ncurses" cf_cv_screen=ncurses else # Check whether --with-pdcurses or --without-pdcurses was given. if test "${with_pdcurses+set}" = set; then withval="$with_pdcurses" cf_cv_screen=pdcurses else # Check whether --with-curses-colr or --without-curses-colr was given. if test "${with_curses_colr+set}" = set; then withval="$with_curses_colr" cf_cv_screen=curses_colr else # Check whether --with-curses-5lib or --without-curses-5lib was given. if test "${with_curses_5lib+set}" = set; then withval="$with_curses_5lib" cf_cv_screen=curses_5lib fi; fi; fi; fi; fi; fi; echo "$as_me:7187: result: $cf_cv_screen" >&5 echo "${ECHO_T}$cf_cv_screen" >&6 case $cf_cv_screen in (curses|curses_*) echo "$as_me:7193: checking for extra include directories" >&5 echo $ECHO_N "checking for extra include directories... $ECHO_C" >&6 if test "${cf_cv_curses_incdir+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_curses_incdir=no case "$host_os" in (hpux10.*) if test "x$cf_cv_screen" = "xcurses_colr" then test -d /usr/include/curses_colr && \ cf_cv_curses_incdir="-I/usr/include/curses_colr" fi ;; (sunos3*|sunos4*) if test "x$cf_cv_screen" = "xcurses_5lib" then test -d /usr/5lib && \ test -d /usr/5include && \ cf_cv_curses_incdir="-I/usr/5include" fi ;; esac fi echo "$as_me:7219: result: $cf_cv_curses_incdir" >&5 echo "${ECHO_T}$cf_cv_curses_incdir" >&6 if test "$cf_cv_curses_incdir" != no then test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}$cf_cv_curses_incdir" fi echo "$as_me:7229: checking if we have identified curses headers" >&5 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6 if test "${cf_cv_ncurses_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_header=none for cf_header in \ ncurses.h \ curses.h ncurses/ncurses.h ncurses/curses.h do cat >"conftest.$ac_ext" <<_ACEOF #line 7241 "configure" #include "confdefs.h" #include <${cf_header}> int main (void) { initscr(); endwin() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:7253: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7256: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:7259: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7262: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_header=$cf_header; break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" done fi echo "$as_me:7273: result: $cf_cv_ncurses_header" >&5 echo "${ECHO_T}$cf_cv_ncurses_header" >&6 if test "$cf_cv_ncurses_header" = none ; then { { echo "$as_me:7277: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. for ac_header in $cf_cv_ncurses_header do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:7287: 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 7293 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:7297: \"$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:7303: \$? = $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:7322: 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 terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "${cf_cv_ncurses_header}" in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >"conftest.$ac_ext" <<_ACEOF #line 7350 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main (void) { int x = auto_left_margin; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:7365: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:7368: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:7371: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7374: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=unknown fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:7390: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case "$cf_cv_term_header" in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case "$cf_cv_term_header" in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac echo "$as_me:7422: checking for ncurses version" >&5 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 if test "${cf_cv_ncurses_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f "$cf_tempfile" if test "$cross_compiling" = yes; then # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > "conftest.$ac_ext" < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" { (eval echo "$as_me:7448: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:7451: \$? = $ac_status" >&5 (exit "$ac_status"); } if test -f conftest.out ; then cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi else cat >"conftest.$ac_ext" <<_ACEOF #line 7461 "configure" #include "confdefs.h" $ac_includes_default #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:7488: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7491: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:7493: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7496: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi rm -f "$cf_tempfile" fi echo "$as_me:7510: result: $cf_cv_ncurses_version" >&5 echo "${ECHO_T}$cf_cv_ncurses_version" >&6 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF #define NCURSES 1 EOF echo "$as_me:7517: checking if we have identified curses libraries" >&5 echo $ECHO_N "checking if we have identified curses libraries... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 7520 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); endwin() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7532: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7535: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7538: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7541: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:7550: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = no ; then case "$host_os" in (freebsd*) echo "$as_me:7556: checking for tgoto in -lmytinfo" >&5 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 7564 "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 tgoto (); int main (void) { tgoto (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7583: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7586: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7589: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7592: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_mytinfo_tgoto=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_mytinfo_tgoto=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7603: result: $ac_cv_lib_mytinfo_tgoto" >&5 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -lmytinfo; 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" fi ;; (hpux10.*) # Looking at HPUX 10.20, the Hcurses library is the oldest (1997), cur_colr # next (1998), and xcurses "newer" (2000). There is no header file for # Hcurses; the subdirectory curses_colr has the headers (curses.h and # term.h) for cur_colr if test "x$cf_cv_screen" = "xcurses_colr" then echo "$as_me:7633: checking for initscr in -lcur_colr" >&5 echo $ECHO_N "checking for initscr in -lcur_colr... $ECHO_C" >&6 if test "${ac_cv_lib_cur_colr_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lcur_colr $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 7641 "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 initscr (); int main (void) { initscr (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7660: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7663: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7666: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7669: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_cur_colr_initscr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_cur_colr_initscr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7680: result: $ac_cv_lib_cur_colr_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_cur_colr_initscr" >&6 if test "$ac_cv_lib_cur_colr_initscr" = yes; then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -lcur_colr; 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" ac_cv_func_initscr=yes else echo "$as_me:7704: checking for initscr in -lHcurses" >&5 echo $ECHO_N "checking for initscr in -lHcurses... $ECHO_C" >&6 if test "${ac_cv_lib_Hcurses_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lHcurses $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 7712 "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 initscr (); int main (void) { initscr (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7731: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7734: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7737: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7740: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_Hcurses_initscr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_Hcurses_initscr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:7751: result: $ac_cv_lib_Hcurses_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_Hcurses_initscr" >&6 if test "$ac_cv_lib_Hcurses_initscr" = yes; then # HP's header uses __HP_CURSES, but user claims _HP_CURSES. cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -lHcurses; 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" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-D__HP_CURSES -D_HP_CURSES" ac_cv_func_initscr=yes fi fi fi ;; (linux*) case `arch 2>/dev/null` in (x86_64) if test -d /lib64 then if test -n "/lib64" ; then for cf_add_libdir in /lib64 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}:7809: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi else if test -n "/lib" ; then for cf_add_libdir in /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}:7838: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi fi ;; (*) if test -n "/lib" ; then for cf_add_libdir in /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}:7869: testing adding $cf_add_libdir to library-path ..." 1>&5 LDFLAGS="-L$cf_add_libdir $LDFLAGS" fi fi done fi ;; esac ;; (sunos3*|sunos4*) if test "x$cf_cv_screen" = "xcurses_5lib" then if test -d /usr/5lib ; then if test -n "/usr/5lib" ; then for cf_add_libdir in /usr/5lib 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}:7904: 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 -lcurses -ltermcap; 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" fi fi ac_cv_func_initscr=yes ;; esac if test ".$ac_cv_func_initscr" != .yes ; then cf_save_LIBS="$LIBS" if test ".${cf_cv_ncurses_version:-no}" != .no then cf_check_list="ncurses curses cursesX" else cf_check_list="cursesX curses ncurses" fi # Check for library containing tgoto. Do this before curses library # because it may be needed to link the test-case for initscr. if test "x$cf_term_lib" = x then echo "$as_me:7948: checking for tgoto" >&5 echo $ECHO_N "checking for tgoto... $ECHO_C" >&6 if test "${ac_cv_func_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 7954 "configure" #include "confdefs.h" #define tgoto autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef tgoto #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 tgoto (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_tgoto) || defined (__stub___tgoto) #error found stub for tgoto #endif return tgoto (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:7985: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:7988: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:7991: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:7994: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_func_tgoto=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_func_tgoto=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:8004: result: $ac_cv_func_tgoto" >&5 echo "${ECHO_T}$ac_cv_func_tgoto" >&6 if test "$ac_cv_func_tgoto" = yes; then cf_term_lib=predefined else for cf_term_lib in $cf_check_list otermcap termcap tinfo termlib unknown do as_ac_Lib=`echo "ac_cv_lib_$cf_term_lib''_tgoto" | $as_tr_sh` echo "$as_me:8013: checking for tgoto in -l$cf_term_lib" >&5 echo $ECHO_N "checking for tgoto in -l$cf_term_lib... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_term_lib $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 8021 "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 tgoto (); int main (void) { tgoto (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8040: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8043: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8046: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8049: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Lib=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:8060: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then : "${cf_nculib_root:=$cf_term_lib}" break fi done fi fi # Check for library containing initscr test "$cf_term_lib" != predefined && test "$cf_term_lib" != unknown && LIBS="-l$cf_term_lib $cf_save_LIBS" if test "x$cf_curs_lib" = x then for cf_curs_lib in $cf_check_list xcurses jcurses pdcurses unknown do LIBS="-l$cf_curs_lib $cf_save_LIBS" if test "$cf_term_lib" = unknown || test "$cf_term_lib" = "$cf_curs_lib" ; then echo "$as_me:8083: checking if we can link with $cf_curs_lib library" >&5 echo $ECHO_N "checking if we can link with $cf_curs_lib library... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 8086 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8098: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8101: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8104: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8107: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:8116: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 test "$cf_result" = yes && break elif test "$cf_curs_lib" = "$cf_term_lib" ; then cf_result=no elif test "$cf_term_lib" != predefined ; then echo "$as_me:8122: checking if we need both $cf_curs_lib and $cf_term_lib libraries" >&5 echo $ECHO_N "checking if we need both $cf_curs_lib and $cf_term_lib libraries... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 8125 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); endwin(); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8137: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8140: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8143: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8146: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=no else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 LIBS="-l$cf_curs_lib -l$cf_term_lib $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 8155 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8167: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8170: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8173: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8176: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=error fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:8188: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 test "$cf_result" != error && break fi done fi test "$cf_curs_lib" = unknown && { { echo "$as_me:8194: error: no curses library found" >&5 echo "$as_me: error: no curses library found" >&2;} { (exit 1); exit 1; }; } fi fi ;; (ncursesw*) for ac_header in wchar.h do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:8206: 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 8212 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:8216: \"$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:8222: \$? = $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:8241: 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 multibyte character support... $ECHO_C" >&6 if test "${cf_cv_utf8_lib+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_save_LIBS="$LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 8259 "configure" #include "confdefs.h" $ac_includes_default #ifdef HAVE_WCHAR_H #include #endif int main (void) { putwc(0,0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8276: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8279: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8282: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8285: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_utf8_lib=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 # 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_utf8= cf_cv_library_path_utf8= echo "${as_me:-configure}:8297: testing Starting FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 8302 "configure" #include "confdefs.h" #include int main (void) { putwc(0,0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8315: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8318: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8321: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8324: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_find_linkage_utf8=yes cf_cv_header_path_utf8=/usr/include cf_cv_library_path_utf8=/usr/lib else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 LIBS="-lutf8 $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 8338 "configure" #include "confdefs.h" #include int main (void) { putwc(0,0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8351: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8354: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8357: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8360: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_find_linkage_utf8=yes cf_cv_header_path_utf8=/usr/include cf_cv_library_path_utf8=/usr/lib cf_cv_library_file_utf8="-lutf8" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_find_linkage_utf8=no LIBS="$cf_save_LIBS" test -n "$verbose" && echo " find linkage for utf8 library" 1>&6 echo "${as_me:-configure}:8377: testing find linkage for utf8 library ..." 1>&5 echo "${as_me:-configure}:8379: testing Searching for headers in FIND_LINKAGE(utf8,) ..." 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/utf8" && cf_search="$cf_search $cf_header_path/include/utf8" test -d "$cf_header_path/include/utf8/include" && cf_search="$cf_search $cf_header_path/include/utf8/include" test -d "$cf_header_path/utf8/include" && cf_search="$cf_search $cf_header_path/utf8/include" test -d "$cf_header_path/utf8/include/utf8" && cf_search="$cf_search $cf_header_path/utf8/include/utf8" } cf_header_path_list="$cf_header_path_list $cf_search" ;; esac done fi # add the variations for the package we are looking for cf_search= test "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/utf8" && cf_search="$cf_search $prefix/include/utf8" test -d "$prefix/include/utf8/include" && cf_search="$cf_search $prefix/include/utf8/include" test -d "$prefix/utf8/include" && cf_search="$cf_search $prefix/utf8/include" test -d "$prefix/utf8/include/utf8" && cf_search="$cf_search $prefix/utf8/include/utf8" } 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/utf8" && cf_search="$cf_search $cf_subdir_prefix/include/utf8" test -d "$cf_subdir_prefix/include/utf8/include" && cf_search="$cf_search $cf_subdir_prefix/include/utf8/include" test -d "$cf_subdir_prefix/utf8/include" && cf_search="$cf_search $cf_subdir_prefix/utf8/include" test -d "$cf_subdir_prefix/utf8/include/utf8" && cf_search="$cf_search $cf_subdir_prefix/utf8/include/utf8" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d "$includedir" && cf_search="$cf_search $includedir" test -d "$includedir/utf8" && cf_search="$cf_search $includedir/utf8" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir" test -d "$oldincludedir/utf8" && cf_search="$cf_search $oldincludedir/utf8" } cf_search="$cf_search $cf_header_path_list" for cf_cv_header_path_utf8 in $cf_search do if test -d "$cf_cv_header_path_utf8" ; then test -n "$verbose" && echo " ... testing $cf_cv_header_path_utf8" 1>&6 echo "${as_me:-configure}:8470: testing ... testing $cf_cv_header_path_utf8 ..." 1>&5 CPPFLAGS="$cf_save_CPPFLAGS" test -n "$CPPFLAGS" && CPPFLAGS="$CPPFLAGS " CPPFLAGS="${CPPFLAGS}-I$cf_cv_header_path_utf8" cat >"conftest.$ac_ext" <<_ACEOF #line 8478 "configure" #include "confdefs.h" #include int main (void) { putwc(0,0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:8491: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8494: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:8497: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8500: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found utf8 headers in $cf_cv_header_path_utf8" 1>&6 echo "${as_me:-configure}:8505: testing ... found utf8 headers in $cf_cv_header_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=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_utf8" = maybe ; then echo "${as_me:-configure}:8523: testing Searching for utf8 library in FIND_LINKAGE(utf8,) ..." 1>&5 cf_save_LIBS="$LIBS" cf_save_LDFLAGS="$LDFLAGS" if test "$cf_cv_find_linkage_utf8" != yes ; then cf_search= cf_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/utf8" && cf_search="$cf_search $cf_library_path/lib/utf8" test -d "$cf_library_path/lib/utf8/lib" && cf_search="$cf_search $cf_library_path/lib/utf8/lib" test -d "$cf_library_path/utf8/lib" && cf_search="$cf_search $cf_library_path/utf8/lib" test -d "$cf_library_path/utf8/lib/utf8" && cf_search="$cf_search $cf_library_path/utf8/lib/utf8" } cf_library_path_list="$cf_library_path_list $cf_search" ;; esac done fi cf_search= test "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/utf8" && cf_search="$cf_search $prefix/lib/utf8" test -d "$prefix/lib/utf8/lib" && cf_search="$cf_search $prefix/lib/utf8/lib" test -d "$prefix/utf8/lib" && cf_search="$cf_search $prefix/utf8/lib" test -d "$prefix/utf8/lib/utf8" && cf_search="$cf_search $prefix/utf8/lib/utf8" } 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/utf8" && cf_search="$cf_search $cf_subdir_prefix/lib/utf8" test -d "$cf_subdir_prefix/lib/utf8/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/utf8/lib" test -d "$cf_subdir_prefix/utf8/lib" && cf_search="$cf_search $cf_subdir_prefix/utf8/lib" test -d "$cf_subdir_prefix/utf8/lib/utf8" && cf_search="$cf_search $cf_subdir_prefix/utf8/lib/utf8" } done cf_search="$cf_library_path_list $cf_search" for cf_cv_library_path_utf8 in $cf_search do if test -d "$cf_cv_library_path_utf8" ; then test -n "$verbose" && echo " ... testing $cf_cv_library_path_utf8" 1>&6 echo "${as_me:-configure}:8598: testing ... testing $cf_cv_library_path_utf8 ..." 1>&5 CPPFLAGS="$cf_test_CPPFLAGS" LIBS="-lutf8 $cf_save_LIBS" LDFLAGS="$cf_save_LDFLAGS -L$cf_cv_library_path_utf8" cat >"conftest.$ac_ext" <<_ACEOF #line 8604 "configure" #include "confdefs.h" #include int main (void) { putwc(0,0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8617: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8620: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8623: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8626: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then test -n "$verbose" && echo " ... found utf8 library in $cf_cv_library_path_utf8" 1>&6 echo "${as_me:-configure}:8631: testing ... found utf8 library in $cf_cv_library_path_utf8 ..." 1>&5 cf_cv_find_linkage_utf8=yes cf_cv_library_file_utf8="-lutf8" 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_utf8=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_utf8" = yes ; then cf_cv_utf8_lib=add-on else cf_cv_utf8_lib=no fi fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:8673: result: $cf_cv_utf8_lib" >&5 echo "${ECHO_T}$cf_cv_utf8_lib" >&6 # HAVE_LIBUTF8_H is used by ncurses if curses.h is shared between # ncurses/ncursesw: if test "$cf_cv_utf8_lib" = "add-on" ; then cat >>confdefs.h <<\EOF #define HAVE_LIBUTF8_H 1 EOF if test -n "$cf_cv_header_path_utf8" ; then for cf_add_incdir in $cf_cv_header_path_utf8 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 8711 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:8723: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:8726: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:8729: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8732: \$? = $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}:8749: 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_utf8" ; then for cf_add_libdir in $cf_cv_library_path_utf8 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}:8785: 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 $cf_cv_library_file_utf8; 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" fi cf_ncuconfig_root=$cf_cv_screen cf_have_ncuconfig=no if test "x${PKG_CONFIG:=none}" != xnone; then echo "$as_me:8815: checking pkg-config for $cf_ncuconfig_root" >&5 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then echo "$as_me:8818: result: yes" >&5 echo "${ECHO_T}yes" >&6 echo "$as_me:8821: checking if the $cf_ncuconfig_root package files work" >&5 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6 cf_have_ncuconfig=unknown cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`" cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`" # while -W for passing linker flags is prevalent, it is not "standard". # At least one wrapper for c89/c99 (in Apple's xcode) has its own # incompatible _and_ non-standard -W option which gives an error. Work # around that pitfall. case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in (x*c[89]9@@*-W*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_pkg_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 cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $cf_pkg_libs; 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 8954 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); mousemask(0,0); tigetstr((char *)0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:8966: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8969: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:8972: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8975: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then if test "$cross_compiling" = yes; then cf_test_ncuconfig=maybe else cat >"conftest.$ac_ext" <<_ACEOF #line 8981 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:8988: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:8991: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:8993: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:8996: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_test_ncuconfig=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_test_ncuconfig=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 cf_test_ncuconfig=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" if test "x$cf_test_ncuconfig" != xyes; then cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'` cf_pkg_cflags="$cf_temp" cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'` cf_pkg_libs="$cf_temp" fi ;; esac for cf_add_cflags in $cf_pkg_cflags 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 cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $cf_pkg_libs; 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 9170 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); mousemask(0,0); tigetstr((char *)0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:9182: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9185: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:9188: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9191: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then if test "$cross_compiling" = yes; then cf_have_ncuconfig=maybe else cat >"conftest.$ac_ext" <<_ACEOF #line 9197 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:9204: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:9207: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:9209: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9212: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_have_ncuconfig=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_have_ncuconfig=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 cf_have_ncuconfig=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:9229: result: $cf_have_ncuconfig" >&5 echo "${ECHO_T}$cf_have_ncuconfig" >&6 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else cat >>confdefs.h <<\EOF #define NCURSES 1 EOF NCURSES_CONFIG_PKG=$cf_ncuconfig_root echo "$as_me:9245: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "${cf_cv_ncurses_header}" in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >"conftest.$ac_ext" <<_ACEOF #line 9263 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main (void) { int x = auto_left_margin; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9278: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9281: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9284: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9287: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=unknown fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:9303: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case "$cf_cv_term_header" in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case "$cf_cv_term_header" in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac fi else echo "$as_me:9338: result: no" >&5 echo "${ECHO_T}no" >&6 NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}" if test -n "$ac_tool_prefix"; then for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config 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:9354: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NCURSES_CONFIG"; then ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # 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_NCURSES_CONFIG="$ac_tool_prefix$ac_prog" echo "$as_me:9369: found $ac_dir/$ac_word" >&5 break done fi fi NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then echo "$as_me:9377: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else echo "$as_me:9380: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NCURSES_CONFIG" && break done fi if test -z "$NCURSES_CONFIG"; then ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config 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:9393: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NCURSES_CONFIG"; then ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # 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_NCURSES_CONFIG="$ac_prog" echo "$as_me:9408: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG if test -n "$ac_ct_NCURSES_CONFIG"; then echo "$as_me:9416: result: $ac_ct_NCURSES_CONFIG" >&5 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6 else echo "$as_me:9419: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_NCURSES_CONFIG" && break done test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none" NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG fi if test "$NCURSES_CONFIG" != none ; then for cf_add_cflags in `$NCURSES_CONFIG --cflags` 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 cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in `$NCURSES_CONFIG --libs`; 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" # even with config script, some packages use no-override for curses.h echo "$as_me:9576: checking if we have identified curses headers" >&5 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6 if test "${cf_cv_ncurses_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_header=none for cf_header in \ ncurses.h $cf_cv_screen/ncurses.h \ curses.h $cf_cv_screen/curses.h do cat >"conftest.$ac_ext" <<_ACEOF #line 9588 "configure" #include "confdefs.h" #include <${cf_header}> int main (void) { initscr(); endwin() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9600: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9603: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9606: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9609: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_header=$cf_header; break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" done fi echo "$as_me:9620: result: $cf_cv_ncurses_header" >&5 echo "${ECHO_T}$cf_cv_ncurses_header" >&6 if test "$cf_cv_ncurses_header" = none ; then { { echo "$as_me:9624: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. for ac_header in $cf_cv_ncurses_header do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:9634: 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 9640 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:9644: \"$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:9650: \$? = $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:9669: 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 <>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <"conftest.$ac_ext" <<_ACEOF #line 9725 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9737: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9740: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9743: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9746: \$? = $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}:9763: 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 } echo "$as_me:9782: checking for $cf_ncuhdr_root header in include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do cat >"conftest.$ac_ext" <<_ACEOF #line 9794 "configure" #include "confdefs.h" #include <$cf_header> int main (void) { #ifdef NCURSES_VERSION printf("%s\\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9818: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9821: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9824: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9827: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_h=$cf_header else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_ncurses_h=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_ncurses_h" != no && break done fi echo "$as_me:9842: result: $cf_cv_ncurses_h" >&5 echo "${ECHO_T}$cf_cv_ncurses_h" >&6 if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else echo "$as_me:9849: checking for $cf_ncuhdr_root include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$verbose" && echo 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/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" test -d "$cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } 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/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } 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/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root" test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include" test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include" test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d "$includedir" && cf_search="$cf_search $includedir" test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir" test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" } cf_search="$cf_search $cf_header_path_list" test -n "$verbose" && echo "search path $cf_search" cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do if test -n "$cf_incdir" ; then for cf_add_incdir in $cf_incdir 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 9970 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:9982: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:9985: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:9988: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:9991: \$? = $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}:10008: 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 for cf_header in \ ncurses.h \ curses.h do cat >"conftest.$ac_ext" <<_ACEOF #line 10031 "configure" #include "confdefs.h" #include <$cf_header> int main (void) { #ifdef NCURSES_VERSION printf("%s\\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:10055: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10058: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:10061: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10064: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_h2=$cf_header else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_ncurses_h2=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6 break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:10085: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:10090: result: $cf_cv_ncurses_h2" >&5 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'` cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`" if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header" fi if test -n "$cf_1st_incdir" ; then for cf_add_incdir in $cf_1st_incdir 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 10126 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:10138: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10141: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:10144: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10147: \$? = $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}:10164: 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 fi # Set definitions to allow ifdef'ing for ncurses.h case "$cf_cv_ncurses_header" in (*ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_H 1 EOF ;; esac case "$cf_cv_ncurses_header" in (ncurses/curses.h|ncurses/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_NCURSES_H 1 EOF ;; (ncursesw/curses.h|ncursesw/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_NCURSES_H 1 EOF ;; esac echo "$as_me:10212: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "${cf_cv_ncurses_header}" in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >"conftest.$ac_ext" <<_ACEOF #line 10230 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main (void) { int x = auto_left_margin; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:10245: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:10248: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:10251: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10254: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=unknown fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:10270: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case "$cf_cv_term_header" in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case "$cf_cv_term_header" in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac # some applications need this, but should check for NCURSES_VERSION cat >>confdefs.h <<\EOF #define NCURSES 1 EOF echo "$as_me:10308: checking for ncurses version" >&5 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 if test "${cf_cv_ncurses_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f "$cf_tempfile" if test "$cross_compiling" = yes; then # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > "conftest.$ac_ext" < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" { (eval echo "$as_me:10334: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:10337: \$? = $ac_status" >&5 (exit "$ac_status"); } if test -f conftest.out ; then cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi else cat >"conftest.$ac_ext" <<_ACEOF #line 10347 "configure" #include "confdefs.h" $ac_includes_default #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:10374: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10377: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:10379: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10382: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi rm -f "$cf_tempfile" fi echo "$as_me:10396: result: $cf_cv_ncurses_version" >&5 echo "${ECHO_T}$cf_cv_ncurses_version" >&6 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_root=$cf_cv_screen # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo "$as_me:10409: checking for Gpm_Open in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10417 "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 Gpm_Open (); int main (void) { Gpm_Open (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10436: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10439: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10442: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10445: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_gpm_Gpm_Open=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:10456: result: $ac_cv_lib_gpm_Gpm_Open" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then echo "$as_me:10459: checking for initscr in -lgpm" >&5 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10467 "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 initscr (); int main (void) { initscr (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10486: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10489: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10492: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10495: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_gpm_initscr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_gpm_initscr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:10506: result: $ac_cv_lib_gpm_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6 if test "$ac_cv_lib_gpm_initscr" = yes; then LIBS="$cf_ncurses_SAVE" else cf_ncurses_LIBS="-lgpm" fi fi case "$host_os" in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it is static). if test "$cf_nculib_root" = ncurses ; then echo "$as_me:10521: checking for tgoto in -lmytinfo" >&5 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10529 "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 tgoto (); int main (void) { tgoto (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10548: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10551: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10554: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10557: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_mytinfo_tgoto=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_mytinfo_tgoto=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:10568: result: $ac_cv_lib_mytinfo_tgoto" >&5 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS" fi fi ;; esac cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $cf_ncurses_LIBS; 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" if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -l$cf_nculib_root; 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 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no' cf_libdir="" echo "$as_me:10617: checking for initscr" >&5 echo $ECHO_N "checking for initscr... $ECHO_C" >&6 if test "${ac_cv_func_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 10623 "configure" #include "confdefs.h" #define initscr autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef initscr #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 initscr (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_initscr) || defined (__stub___initscr) #error found stub for initscr #endif return initscr (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10654: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10657: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10660: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10663: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_func_initscr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_func_initscr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:10673: result: $ac_cv_func_initscr" >&5 echo "${ECHO_T}$ac_cv_func_initscr" >&6 if test "$ac_cv_func_initscr" = yes; then eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes' else cf_save_LIBS="$LIBS" echo "$as_me:10680: checking for initscr in -l$cf_nculib_root" >&5 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6 LIBS="-l$cf_nculib_root $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10684 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10696: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10699: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10702: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10705: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then echo "$as_me:10707: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes' else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 echo "$as_me:10714: result: no" >&5 echo "${ECHO_T}no" >&6 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/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" test -d "$cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" } 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/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib" test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } 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/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root" test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib" test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib" test -d "$cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" } done cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do echo "$as_me:10782: checking for -l$cf_nculib_root in $cf_libdir" >&5 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 10786 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10798: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10801: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10804: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10807: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then echo "$as_me:10809: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes' break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 echo "$as_me:10816: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_save_LIBS" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" done fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\" if test "$cf_found_library" = no ; then { { echo "$as_me:10831: error: Cannot link $cf_nculib_root library" >&5 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} { (exit 1); exit 1; }; } fi fi if test -n "$cf_ncurses_LIBS" ; then echo "$as_me:10839: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done cat >"conftest.$ac_ext" <<_ACEOF #line 10849 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); mousemask(0,0); tigetstr((char *)0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:10861: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:10864: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:10867: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:10870: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then echo "$as_me:10872: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 echo "$as_me:10877: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking pkg-config for $cf_ncuconfig_root... $ECHO_C" >&6 if "$PKG_CONFIG" --exists $cf_ncuconfig_root ; then echo "$as_me:10905: result: yes" >&5 echo "${ECHO_T}yes" >&6 echo "$as_me:10908: checking if the $cf_ncuconfig_root package files work" >&5 echo $ECHO_N "checking if the $cf_ncuconfig_root package files work... $ECHO_C" >&6 cf_have_ncuconfig=unknown cf_save_CFLAGS="$CFLAGS" cf_save_CPPFLAGS="$CPPFLAGS" cf_save_LIBS="$LIBS" cf_pkg_cflags="`$PKG_CONFIG --cflags $cf_ncuconfig_root`" cf_pkg_libs="`$PKG_CONFIG --libs $cf_ncuconfig_root`" # while -W for passing linker flags is prevalent, it is not "standard". # At least one wrapper for c89/c99 (in Apple's xcode) has its own # incompatible _and_ non-standard -W option which gives an error. Work # around that pitfall. case "x${CC}@@${cf_pkg_libs}@${cf_pkg_cflags}" in (x*c[89]9@@*-W*) cf_fix_cppflags=no cf_new_cflags= cf_new_cppflags= cf_new_extra_cppflags= for cf_add_cflags in $cf_pkg_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 cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $cf_pkg_libs; 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 11041 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); mousemask(0,0); tigetstr((char *)0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:11053: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11056: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:11059: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11062: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then if test "$cross_compiling" = yes; then cf_test_ncuconfig=maybe else cat >"conftest.$ac_ext" <<_ACEOF #line 11068 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:11075: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11078: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:11080: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11083: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_test_ncuconfig=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_test_ncuconfig=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 cf_test_ncuconfig=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" CFLAGS="$cf_save_CFLAGS" CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" if test "x$cf_test_ncuconfig" != xyes; then cf_temp=`echo "x$cf_pkg_cflags" | sed -e s/^x// -e 's/-W[^ ]*//g'` cf_pkg_cflags="$cf_temp" cf_temp=`echo "x$cf_pkg_libs" | sed -e s/^x// -e 's/-W[^ ]*//g'` cf_pkg_libs="$cf_temp" fi ;; esac for cf_add_cflags in $cf_pkg_cflags 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 cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $cf_pkg_libs; 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 11257 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); mousemask(0,0); tigetstr((char *)0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:11269: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11272: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:11275: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11278: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then if test "$cross_compiling" = yes; then cf_have_ncuconfig=maybe else cat >"conftest.$ac_ext" <<_ACEOF #line 11284 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { const char *xx = curses_version(); return (xx == 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:11291: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:11294: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:11296: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11299: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_have_ncuconfig=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_have_ncuconfig=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 cf_have_ncuconfig=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" echo "$as_me:11316: result: $cf_have_ncuconfig" >&5 echo "${ECHO_T}$cf_have_ncuconfig" >&6 test "$cf_have_ncuconfig" = maybe && cf_have_ncuconfig=yes if test "$cf_have_ncuconfig" != "yes" then CPPFLAGS="$cf_save_CPPFLAGS" LIBS="$cf_save_LIBS" NCURSES_CONFIG_PKG=none else cat >>confdefs.h <<\EOF #define NCURSES 1 EOF NCURSES_CONFIG_PKG=$cf_ncuconfig_root echo "$as_me:11332: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "${cf_cv_ncurses_header}" in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >"conftest.$ac_ext" <<_ACEOF #line 11350 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main (void) { int x = auto_left_margin; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:11365: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11368: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:11371: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11374: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=unknown fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:11390: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case "$cf_cv_term_header" in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case "$cf_cv_term_header" in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac fi else echo "$as_me:11425: result: no" >&5 echo "${ECHO_T}no" >&6 NCURSES_CONFIG_PKG=none fi else NCURSES_CONFIG_PKG=none fi if test "x$cf_have_ncuconfig" = "xno"; then cf_ncurses_config="${cf_ncuconfig_root}${NCURSES_CONFIG_SUFFIX}-config"; echo "Looking for ${cf_ncurses_config}" if test -n "$ac_tool_prefix"; then for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config 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:11441: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$NCURSES_CONFIG"; then ac_cv_prog_NCURSES_CONFIG="$NCURSES_CONFIG" # 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_NCURSES_CONFIG="$ac_tool_prefix$ac_prog" echo "$as_me:11456: found $ac_dir/$ac_word" >&5 break done fi fi NCURSES_CONFIG=$ac_cv_prog_NCURSES_CONFIG if test -n "$NCURSES_CONFIG"; then echo "$as_me:11464: result: $NCURSES_CONFIG" >&5 echo "${ECHO_T}$NCURSES_CONFIG" >&6 else echo "$as_me:11467: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$NCURSES_CONFIG" && break done fi if test -z "$NCURSES_CONFIG"; then ac_ct_NCURSES_CONFIG=$NCURSES_CONFIG for ac_prog in ${cf_ncurses_config} ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}6-config ${cf_ncuconfig_root}5-config 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:11480: checking for $ac_word" >&5 echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 if test "${ac_cv_prog_ac_ct_NCURSES_CONFIG+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else if test -n "$ac_ct_NCURSES_CONFIG"; then ac_cv_prog_ac_ct_NCURSES_CONFIG="$ac_ct_NCURSES_CONFIG" # 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_NCURSES_CONFIG="$ac_prog" echo "$as_me:11495: found $ac_dir/$ac_word" >&5 break done fi fi ac_ct_NCURSES_CONFIG=$ac_cv_prog_ac_ct_NCURSES_CONFIG if test -n "$ac_ct_NCURSES_CONFIG"; then echo "$as_me:11503: result: $ac_ct_NCURSES_CONFIG" >&5 echo "${ECHO_T}$ac_ct_NCURSES_CONFIG" >&6 else echo "$as_me:11506: result: no" >&5 echo "${ECHO_T}no" >&6 fi test -n "$ac_ct_NCURSES_CONFIG" && break done test -n "$ac_ct_NCURSES_CONFIG" || ac_ct_NCURSES_CONFIG="none" NCURSES_CONFIG=$ac_ct_NCURSES_CONFIG fi if test "$NCURSES_CONFIG" != none ; then for cf_add_cflags in `$NCURSES_CONFIG --cflags` 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 cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in `$NCURSES_CONFIG --libs`; 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" # even with config script, some packages use no-override for curses.h echo "$as_me:11663: checking if we have identified curses headers" >&5 echo $ECHO_N "checking if we have identified curses headers... $ECHO_C" >&6 if test "${cf_cv_ncurses_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_header=none for cf_header in \ ncurses.h $cf_cv_screen/ncurses.h \ curses.h $cf_cv_screen/curses.h do cat >"conftest.$ac_ext" <<_ACEOF #line 11675 "configure" #include "confdefs.h" #include <${cf_header}> int main (void) { initscr(); endwin() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:11687: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11690: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:11693: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11696: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_header=$cf_header; break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" done fi echo "$as_me:11707: result: $cf_cv_ncurses_header" >&5 echo "${ECHO_T}$cf_cv_ncurses_header" >&6 if test "$cf_cv_ncurses_header" = none ; then { { echo "$as_me:11711: error: No curses header-files found" >&5 echo "$as_me: error: No curses header-files found" >&2;} { (exit 1); exit 1; }; } fi # cheat, to get the right #define's for HAVE_NCURSES_H, etc. for ac_header in $cf_cv_ncurses_header do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:11721: 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 11727 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:11731: \"$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:11737: \$? = $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:11756: 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 <>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_ROOT=`echo "HAVE_LIB$cf_ncuconfig_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <"conftest.$ac_ext" <<_ACEOF #line 11812 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:11824: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11827: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:11830: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11833: \$? = $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}:11850: 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 } echo "$as_me:11869: checking for $cf_ncuhdr_root header in include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root header in include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_header_list="$cf_ncuhdr_root/curses.h $cf_ncuhdr_root/ncurses.h" { test "$cf_ncuhdr_root" = ncurses || test "$cf_ncuhdr_root" = ncursesw; } && cf_header_list="$cf_header_list curses.h ncurses.h" for cf_header in $cf_header_list do cat >"conftest.$ac_ext" <<_ACEOF #line 11881 "configure" #include "confdefs.h" #include <$cf_header> int main (void) { #ifdef NCURSES_VERSION printf("%s\\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:11905: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:11908: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:11911: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:11914: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_h=$cf_header else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_ncurses_h=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_ncurses_h" != no && break done fi echo "$as_me:11929: result: $cf_cv_ncurses_h" >&5 echo "${ECHO_T}$cf_cv_ncurses_h" >&6 if test "$cf_cv_ncurses_h" != no ; then cf_cv_ncurses_header=$cf_cv_ncurses_h else echo "$as_me:11936: checking for $cf_ncuhdr_root include-path" >&5 echo $ECHO_N "checking for $cf_ncuhdr_root include-path... $ECHO_C" >&6 if test "${cf_cv_ncurses_h2+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else test -n "$verbose" && echo 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/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root" test -d "$cf_header_path/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/include/$cf_ncuhdr_root/include" test -d "$cf_header_path/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include" test -d "$cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_header_path/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } 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/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root" test -d "$prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/include/$cf_ncuhdr_root/include" test -d "$prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include" test -d "$prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } 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/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root" test -d "$cf_subdir_prefix/include/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/include/$cf_ncuhdr_root/include" test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include" test -d "$cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_ncuhdr_root/include/$cf_ncuhdr_root" } done test "$includedir" != NONE && \ test "$includedir" != "/usr/include" && \ test -d "$includedir" && { test -d "$includedir" && cf_search="$cf_search $includedir" test -d "$includedir/$cf_ncuhdr_root" && cf_search="$cf_search $includedir/$cf_ncuhdr_root" } test "$oldincludedir" != NONE && \ test "$oldincludedir" != "/usr/include" && \ test -d "$oldincludedir" && { test -d "$oldincludedir" && cf_search="$cf_search $oldincludedir" test -d "$oldincludedir/$cf_ncuhdr_root" && cf_search="$cf_search $oldincludedir/$cf_ncuhdr_root" } cf_search="$cf_search $cf_header_path_list" test -n "$verbose" && echo "search path $cf_search" cf_save2_CPPFLAGS="$CPPFLAGS" for cf_incdir in $cf_search do if test -n "$cf_incdir" ; then for cf_add_incdir in $cf_incdir 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 12057 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:12069: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12072: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:12075: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12078: \$? = $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}:12095: 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 for cf_header in \ ncurses.h \ curses.h do cat >"conftest.$ac_ext" <<_ACEOF #line 12118 "configure" #include "confdefs.h" #include <$cf_header> int main (void) { #ifdef NCURSES_VERSION printf("%s\\n", NCURSES_VERSION); #else #ifdef __NCURSES_H printf("old\\n"); #else make an error #endif #endif ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:12142: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12145: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:12148: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12151: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_h2=$cf_header else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_ncurses_h2=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" if test "$cf_cv_ncurses_h2" != no ; then cf_cv_ncurses_h2=$cf_incdir/$cf_header test -n "$verbose" && echo $ECHO_N " ... found $ECHO_C" 1>&6 break fi test -n "$verbose" && echo " ... tested $cf_incdir/$cf_header" 1>&6 done CPPFLAGS="$cf_save2_CPPFLAGS" test "$cf_cv_ncurses_h2" != no && break done test "$cf_cv_ncurses_h2" = no && { { echo "$as_me:12172: error: not found" >&5 echo "$as_me: error: not found" >&2;} { (exit 1); exit 1; }; } fi echo "$as_me:12177: result: $cf_cv_ncurses_h2" >&5 echo "${ECHO_T}$cf_cv_ncurses_h2" >&6 cf_1st_incdir=`echo "$cf_cv_ncurses_h2" | sed -e 's%/[^/]*$%%'` cf_cv_ncurses_header="`basename "$cf_cv_ncurses_h2"`" if test "`basename "$cf_1st_incdir"`" = "$cf_ncuhdr_root" ; then cf_cv_ncurses_header="$cf_ncuhdr_root/$cf_cv_ncurses_header" fi if test -n "$cf_1st_incdir" ; then for cf_add_incdir in $cf_1st_incdir 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 12213 "configure" #include "confdefs.h" #include int main (void) { printf("Hello") ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:12225: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12228: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:12231: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12234: \$? = $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}:12251: 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 fi # Set definitions to allow ifdef'ing for ncurses.h case "$cf_cv_ncurses_header" in (*ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_H 1 EOF ;; esac case "$cf_cv_ncurses_header" in (ncurses/curses.h|ncurses/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_NCURSES_H 1 EOF ;; (ncursesw/curses.h|ncursesw/ncurses.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_NCURSES_H 1 EOF ;; esac echo "$as_me:12299: checking for terminfo header" >&5 echo $ECHO_N "checking for terminfo header... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else case "${cf_cv_ncurses_header}" in (*/ncurses.h|*/ncursesw.h) cf_term_header=`echo "$cf_cv_ncurses_header" | sed -e 's%ncurses[^.]*\.h$%term.h%'` ;; (*) cf_term_header=term.h ;; esac for cf_test in $cf_term_header "ncurses/term.h" "ncursesw/term.h" do cat >"conftest.$ac_ext" <<_ACEOF #line 12317 "configure" #include "confdefs.h" #include #include <${cf_cv_ncurses_header:-curses.h}> #include <$cf_test> int main (void) { int x = auto_left_margin; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:12332: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:12335: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:12338: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12341: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header="$cf_test" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=unknown fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_term_header" != unknown && break done fi echo "$as_me:12357: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 # Set definitions to allow ifdef'ing to accommodate subdirectories case "$cf_cv_term_header" in (*term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; esac case "$cf_cv_term_header" in (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac # some applications need this, but should check for NCURSES_VERSION cat >>confdefs.h <<\EOF #define NCURSES 1 EOF echo "$as_me:12395: checking for ncurses version" >&5 echo $ECHO_N "checking for ncurses version... $ECHO_C" >&6 if test "${cf_cv_ncurses_version+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cf_cv_ncurses_version=no cf_tempfile=out$$ rm -f "$cf_tempfile" if test "$cross_compiling" = yes; then # This will not work if the preprocessor splits the line after the # Autoconf token. The 'unproto' program does that. cat > "conftest.$ac_ext" < #undef Autoconf #ifdef NCURSES_VERSION Autoconf NCURSES_VERSION #else #ifdef __NCURSES_H Autoconf "old" #endif ; #endif EOF cf_try="$ac_cpp conftest.$ac_ext 2>&5 | grep '^Autoconf ' >conftest.out" { (eval echo "$as_me:12421: \"$cf_try\"") >&5 (eval $cf_try) 2>&5 ac_status=$? echo "$as_me:12424: \$? = $ac_status" >&5 (exit "$ac_status"); } if test -f conftest.out ; then cf_out=`sed -e 's%^Autoconf %%' -e 's%^[^"]*"%%' -e 's%".*%%' conftest.out` test -n "$cf_out" && cf_cv_ncurses_version="$cf_out" rm -f conftest.out fi else cat >"conftest.$ac_ext" <<_ACEOF #line 12434 "configure" #include "confdefs.h" $ac_includes_default #include <${cf_cv_ncurses_header:-curses.h}> int main(void) { FILE *fp = fopen("$cf_tempfile", "w"); #ifdef NCURSES_VERSION # ifdef NCURSES_VERSION_PATCH fprintf(fp, "%s.%d\\n", NCURSES_VERSION, NCURSES_VERSION_PATCH); # else fprintf(fp, "%s\\n", NCURSES_VERSION); # endif #else # ifdef __NCURSES_H fprintf(fp, "old\\n"); # else make an error # endif #endif ${cf_cv_main_return:-return}(0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:12461: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12464: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:12466: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12469: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_ncurses_version=`cat $cf_tempfile` else echo "$as_me: program exited with status $ac_status" >&5 echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi rm -f "$cf_tempfile" fi echo "$as_me:12483: result: $cf_cv_ncurses_version" >&5 echo "${ECHO_T}$cf_cv_ncurses_version" >&6 test "$cf_cv_ncurses_version" = no || cat >>confdefs.h <<\EOF #define NCURSES 1 EOF cf_nculib_root=$cf_cv_screen # This works, except for the special case where we find gpm, but # ncurses is in a nonstandard location via $LIBS, and we really want # to link gpm. cf_ncurses_LIBS="" cf_ncurses_SAVE="$LIBS" echo "$as_me:12496: checking for Gpm_Open in -lgpm" >&5 echo $ECHO_N "checking for Gpm_Open in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_Gpm_Open+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 12504 "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 Gpm_Open (); int main (void) { Gpm_Open (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12523: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12526: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12529: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12532: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_gpm_Gpm_Open=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_gpm_Gpm_Open=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:12543: result: $ac_cv_lib_gpm_Gpm_Open" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_Gpm_Open" >&6 if test "$ac_cv_lib_gpm_Gpm_Open" = yes; then echo "$as_me:12546: checking for initscr in -lgpm" >&5 echo $ECHO_N "checking for initscr in -lgpm... $ECHO_C" >&6 if test "${ac_cv_lib_gpm_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lgpm $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 12554 "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 initscr (); int main (void) { initscr (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12573: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12576: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12579: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12582: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_gpm_initscr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_gpm_initscr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:12593: result: $ac_cv_lib_gpm_initscr" >&5 echo "${ECHO_T}$ac_cv_lib_gpm_initscr" >&6 if test "$ac_cv_lib_gpm_initscr" = yes; then LIBS="$cf_ncurses_SAVE" else cf_ncurses_LIBS="-lgpm" fi fi case "$host_os" in (freebsd*) # This is only necessary if you are linking against an obsolete # version of ncurses (but it should do no harm, since it is static). if test "$cf_nculib_root" = ncurses ; then echo "$as_me:12608: checking for tgoto in -lmytinfo" >&5 echo $ECHO_N "checking for tgoto in -lmytinfo... $ECHO_C" >&6 if test "${ac_cv_lib_mytinfo_tgoto+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-lmytinfo $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 12616 "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 tgoto (); int main (void) { tgoto (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12635: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12638: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12641: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12644: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_lib_mytinfo_tgoto=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_lib_mytinfo_tgoto=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:12655: result: $ac_cv_lib_mytinfo_tgoto" >&5 echo "${ECHO_T}$ac_cv_lib_mytinfo_tgoto" >&6 if test "$ac_cv_lib_mytinfo_tgoto" = yes; then cf_ncurses_LIBS="-lmytinfo $cf_ncurses_LIBS" fi fi ;; esac cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in $cf_ncurses_LIBS; 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" if test -n "$cf_cv_curses_dir" && test "$cf_cv_curses_dir" != "no" then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -l$cf_nculib_root; 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 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=no' cf_libdir="" echo "$as_me:12704: checking for initscr" >&5 echo $ECHO_N "checking for initscr... $ECHO_C" >&6 if test "${ac_cv_func_initscr+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 12710 "configure" #include "confdefs.h" #define initscr autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef initscr #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 initscr (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_initscr) || defined (__stub___initscr) #error found stub for initscr #endif return initscr (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12741: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12744: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12747: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12750: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_func_initscr=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_func_initscr=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:12760: result: $ac_cv_func_initscr" >&5 echo "${ECHO_T}$ac_cv_func_initscr" >&6 if test "$ac_cv_func_initscr" = yes; then eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes' else cf_save_LIBS="$LIBS" echo "$as_me:12767: checking for initscr in -l$cf_nculib_root" >&5 echo $ECHO_N "checking for initscr in -l$cf_nculib_root... $ECHO_C" >&6 LIBS="-l$cf_nculib_root $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 12771 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12783: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12786: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12789: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12792: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then echo "$as_me:12794: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes' else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 echo "$as_me:12801: result: no" >&5 echo "${ECHO_T}no" >&6 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/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root" test -d "$cf_library_path/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/lib/$cf_nculib_root/lib" test -d "$cf_library_path/$cf_nculib_root/lib" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib" test -d "$cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_library_path/$cf_nculib_root/lib/$cf_nculib_root" } 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/$cf_nculib_root" && cf_search="$cf_search $prefix/lib/$cf_nculib_root" test -d "$prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/lib/$cf_nculib_root/lib" test -d "$prefix/$cf_nculib_root/lib" && cf_search="$cf_search $prefix/$cf_nculib_root/lib" test -d "$prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $prefix/$cf_nculib_root/lib/$cf_nculib_root" } 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/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root" test -d "$cf_subdir_prefix/lib/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/lib/$cf_nculib_root/lib" test -d "$cf_subdir_prefix/$cf_nculib_root/lib" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib" test -d "$cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" && cf_search="$cf_search $cf_subdir_prefix/$cf_nculib_root/lib/$cf_nculib_root" } done cf_search="$cf_library_path_list $cf_search" for cf_libdir in $cf_search do echo "$as_me:12869: checking for -l$cf_nculib_root in $cf_libdir" >&5 echo $ECHO_N "checking for -l$cf_nculib_root in $cf_libdir... $ECHO_C" >&6 LIBS="-L$cf_libdir -l$cf_nculib_root $cf_save_LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 12873 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr() ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12885: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12888: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12891: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12894: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then echo "$as_me:12896: result: yes" >&5 echo "${ECHO_T}yes" >&6 eval 'cf_cv_have_lib_'"$cf_nculib_root"'=yes' break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 echo "$as_me:12903: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_save_LIBS" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" done fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi eval 'cf_found_library="$cf_cv_have_lib_'"$cf_nculib_root"\" if test "$cf_found_library" = no ; then { { echo "$as_me:12918: error: Cannot link $cf_nculib_root library" >&5 echo "$as_me: error: Cannot link $cf_nculib_root library" >&2;} { (exit 1); exit 1; }; } fi fi if test -n "$cf_ncurses_LIBS" ; then echo "$as_me:12926: checking if we can link $cf_nculib_root without $cf_ncurses_LIBS" >&5 echo $ECHO_N "checking if we can link $cf_nculib_root without $cf_ncurses_LIBS... $ECHO_C" >&6 cf_ncurses_SAVE="$LIBS" for p in $cf_ncurses_LIBS ; do q=`echo "$LIBS" | sed -e "s%$p %%" -e "s%$p$%%"` if test "$q" != "$LIBS" ; then LIBS="$q" fi done cat >"conftest.$ac_ext" <<_ACEOF #line 12936 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> int main (void) { initscr(); mousemask(0,0); tigetstr((char *)0); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:12948: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:12951: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:12954: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:12957: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then echo "$as_me:12959: result: yes" >&5 echo "${ECHO_T}yes" >&6 else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 echo "$as_me:12964: result: no" >&5 echo "${ECHO_T}no" >&6 LIBS="$cf_ncurses_SAVE" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi cf_nculib_ROOT=`echo "HAVE_LIB$cf_nculib_root" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo "$as_me: error: tack cannot be built with PDCurses" >&2;} { (exit 1); exit 1; }; } ;; (*) { { echo "$as_me:12991: error: unexpected screen-value: $cf_cv_screen" >&5 echo "$as_me: error: unexpected screen-value: $cf_cv_screen" >&2;} { (exit 1); exit 1; }; } ;; esac : ${cf_nculib_root:=$cf_cv_screen} as_ac_Lib=`echo "ac_cv_lib_$cf_nculib_root''__nc_init_pthreads" | $as_tr_sh` echo "$as_me:12999: checking for _nc_init_pthreads in -l$cf_nculib_root" >&5 echo $ECHO_N "checking for _nc_init_pthreads in -l$cf_nculib_root... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_nculib_root $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 13007 "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 _nc_init_pthreads (); int main (void) { _nc_init_pthreads (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13026: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13029: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13032: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13035: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Lib=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:13046: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then cf_cv_ncurses_pthreads=yes else cf_cv_ncurses_pthreads=no fi if test "$cf_cv_ncurses_pthreads" = yes then cf_add_libs="$LIBS" # reverse order cf_add_0lib= for cf_add_1lib in -lpthread; 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" fi echo "$as_me:13075: checking for term.h" >&5 echo $ECHO_N "checking for term.h... $ECHO_C" >&6 if test "${cf_cv_term_header+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else # If we found , look for , but always look # for if we do not find the variant. cf_header_list="term.h ncurses/term.h ncursesw/term.h" case "${cf_cv_ncurses_header:-curses.h}" in (*/*) cf_header_item=`echo "${cf_cv_ncurses_header:-curses.h}" | sed -e 's%\..*%%' -e 's%/.*%/%'`term.h cf_header_list="$cf_header_item $cf_header_list" ;; esac for cf_header in $cf_header_list do cat >"conftest.$ac_ext" <<_ACEOF #line 13096 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> #include <${cf_header}> int main (void) { WINDOW *x; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:13110: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13113: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:13116: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13119: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header=$cf_header break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" done case "$cf_cv_term_header" in (no) # If curses is ncurses, some packagers still mess it up by trying to make # us use GNU termcap. This handles the most common case. for cf_header in ncurses/term.h ncursesw/term.h do cat >"conftest.$ac_ext" <<_ACEOF #line 13138 "configure" #include "confdefs.h" #include <${cf_cv_ncurses_header:-curses.h}> #ifdef NCURSES_VERSION #include <${cf_header}> #else make an error #endif int main (void) { WINDOW *x; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:13156: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13159: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:13162: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13165: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_term_header=$cf_header break else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_term_header=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" done ;; esac fi echo "$as_me:13180: result: $cf_cv_term_header" >&5 echo "${ECHO_T}$cf_cv_term_header" >&6 case "$cf_cv_term_header" in (term.h) cat >>confdefs.h <<\EOF #define HAVE_TERM_H 1 EOF ;; (ncurses/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSES_TERM_H 1 EOF ;; (ncursesw/term.h) cat >>confdefs.h <<\EOF #define HAVE_NCURSESW_TERM_H 1 EOF ;; esac for cf_data in boolnames boolfnames do echo "$as_me:13209: checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}" >&5 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 13213 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif int main (void) { #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *foo = (const void *)($cf_data); #else const void *foo = &($cf_data); #endif fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:13246: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13249: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:13252: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13255: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" echo "$as_me:13265: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 # BSD linkers insist on making weak linkage, but resolve at runtime. if test "$cross_compiling" = yes; then # cross-compiling cat >"conftest.$ac_ext" <<_ACEOF #line 13284 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif extern char $cf_data; int main (void) { do { #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *foo = (const void *)($cf_data); #else const void *foo = &($cf_data); #endif fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo); ${cf_cv_main_return:-return}(foo == 0); } while (0) ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13323: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13326: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13329: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13332: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" else cat >"conftest.$ac_ext" <<_ACEOF #line 13344 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif extern char $cf_data; int main(void) { #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *foo = (const void *)($cf_data); #else const void *foo = &($cf_data); #endif fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo); ${cf_cv_main_return:-return}(foo == 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:13376: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13379: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:13381: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13384: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=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_result=no fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:13396: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking for data $cf_data declaration in ${cf_cv_ncurses_header:-curses.h}... $ECHO_C" >&6 cat >"conftest.$ac_ext" <<_ACEOF #line 13417 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif int main (void) { #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *foo = (const void *)($cf_data); #else const void *foo = &($cf_data); #endif fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:13450: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:13453: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:13456: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13459: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" echo "$as_me:13469: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then cf_result=`echo "have_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking for data $cf_data in library... $ECHO_C" >&6 # BSD linkers insist on making weak linkage, but resolve at runtime. if test "$cross_compiling" = yes; then # cross-compiling cat >"conftest.$ac_ext" <<_ACEOF #line 13489 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif extern char $cf_data; int main (void) { do { #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *foo = (const void *)($cf_data); #else const void *foo = &($cf_data); #endif fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo); ${cf_cv_main_return:-return}(foo == 0); } while (0) ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13528: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13531: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13534: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13537: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_result=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" else cat >"conftest.$ac_ext" <<_ACEOF #line 13549 "configure" #include "confdefs.h" #ifdef HAVE_XCURSES #include char * XCursesProgramName = "test"; #else #include <${cf_cv_ncurses_header:-curses.h}> #if defined(NCURSES_VERSION) && defined(HAVE_NCURSESW_TERM_H) #include #elif defined(NCURSES_VERSION) && defined(HAVE_NCURSES_TERM_H) #include #elif defined(HAVE_TERM_H) #include #endif #endif extern char $cf_data; int main(void) { #if defined($cf_data) && ((defined(NCURSES_WRAPPED_VAR) && (NCURSES_VERSION_PATCH < 20200208)) || defined(NCURSES_BROKEN_LINKER) || defined(NCURSES_REENTRANT)) const void *foo = (const void *)($cf_data); #else const void *foo = &($cf_data); #endif fprintf(stderr, "testing linkage of $cf_data:%p\\n", (const void *)foo); ${cf_cv_main_return:-return}(foo == 0); } _ACEOF rm -f "conftest$ac_exeext" if { (eval echo "$as_me:13581: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13584: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='"./conftest$ac_exeext"' { (eval echo "$as_me:13586: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13589: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_result=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_result=no fi rm -f core ./core.* ./*.core "conftest$ac_exeext" "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:13601: result: $cf_result" >&5 echo "${ECHO_T}$cf_result" >&6 if test "$cf_result" = yes ; then cf_result=`echo "decl_curses_data_$cf_data" | sed y%abcdefghijklmnopqrstuvwxyz./-%ABCDEFGHIJKLMNOPQRSTUVWXYZ___%` cat >>confdefs.h <&5 echo $ECHO_N "checking for setupterm... $ECHO_C" >&6 if test "${ac_cv_func_setupterm+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 13629 "configure" #include "confdefs.h" #define setupterm autoconf_temporary #include /* least-intrusive standard header which defines gcc2 __stub macros */ #undef setupterm #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 setupterm (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_setupterm) || defined (__stub___setupterm) #error found stub for setupterm #endif return setupterm (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13660: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13663: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13666: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13669: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then ac_cv_func_setupterm=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 ac_cv_func_setupterm=no fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" fi echo "$as_me:13679: result: $ac_cv_func_setupterm" >&5 echo "${ECHO_T}$ac_cv_func_setupterm" >&6 if test "$ac_cv_func_setupterm" = yes; then case "x$LIBS" in #(vi *$cf_tinfo_lib*) #(vi ;; *) as_ac_Lib=`echo "ac_cv_lib_$cf_tinfo_lib''_reset_shell_mode" | $as_tr_sh` echo "$as_me:13688: checking for reset_shell_mode in -l$cf_tinfo_lib" >&5 echo $ECHO_N "checking for reset_shell_mode in -l$cf_tinfo_lib... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_tinfo_lib $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 13696 "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 reset_shell_mode (); int main (void) { reset_shell_mode (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13715: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13718: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13721: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13724: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Lib=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:13735: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then LIBS="-l$cf_tinfo_lib $LIBS" else cf_tinfo_lib='' fi ;; esac else as_ac_Lib=`echo "ac_cv_lib_$cf_tinfo_lib''_setupterm" | $as_tr_sh` echo "$as_me:13749: checking for setupterm in -l$cf_tinfo_lib" >&5 echo $ECHO_N "checking for setupterm in -l$cf_tinfo_lib... $ECHO_C" >&6 if eval "test \"\${$as_ac_Lib+set}\" = set"; then echo $ECHO_N "(cached) $ECHO_C" >&6 else ac_check_lib_save_LIBS=$LIBS LIBS="-l$cf_tinfo_lib $LIBS" cat >"conftest.$ac_ext" <<_ACEOF #line 13757 "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 setupterm (); int main (void) { setupterm (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13776: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13779: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13782: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13785: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then eval "$as_ac_Lib=yes" else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 eval "$as_ac_Lib=no" fi rm -f "conftest.$ac_objext" "conftest$ac_exeext" "conftest.$ac_ext" LIBS=$ac_check_lib_save_LIBS fi echo "$as_me:13796: result: `eval echo '${'"$as_ac_Lib"'}'`" >&5 echo "${ECHO_T}`eval echo '${'"$as_ac_Lib"'}'`" >&6 if test "`eval echo '${'"$as_ac_Lib"'}'`" = yes; then LIBS="-l$cf_tinfo_lib $LIBS" else cf_tinfo_lib='' fi fi LD_RPATH_OPT= if test "x$cf_cv_enable_rpath" != xno then echo "$as_me:13809: 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:13840: result: $LD_RPATH_OPT" >&5 echo "${ECHO_T}$LD_RPATH_OPT" >&6 case "x$LD_RPATH_OPT" in (x-R*) echo "$as_me:13845: 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 13866 "configure" #include "confdefs.h" int main (void) { ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:13878: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13881: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13884: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13887: \$? = $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:13897: 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:13904: 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:13922: result: $cf_disable_rpath_hack" >&5 echo "${ECHO_T}$cf_disable_rpath_hack" >&6 if test "$enable_rpath_hack" = yes ; then echo "$as_me:13927: 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:13930: 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:13937: 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:13952: 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:13960: result: $cf_ldd_prog" >&5 echo "${ECHO_T}$cf_ldd_prog" >&6 else echo "$as_me:13963: 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 13977 "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:13989: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:13992: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:13995: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:13998: \$? = $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}:14026: 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}:14038: testing ...checking EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LDFLAGS $LDFLAGS" 1>&6 echo "${as_me:-configure}:14042: 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}:14079: 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}:14092: testing ...checked LDFLAGS $LDFLAGS ..." 1>&5 test -n "$verbose" && echo " ...checking LIBS $LIBS" 1>&6 echo "${as_me:-configure}:14096: 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}:14133: 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}:14146: testing ...checked LIBS $LIBS ..." 1>&5 test -n "$verbose" && echo " ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS" 1>&6 echo "${as_me:-configure}:14150: testing ...checked EXTRA_LDFLAGS $EXTRA_LDFLAGS ..." 1>&5 else echo "$as_me:14153: result: no" >&5 echo "${ECHO_T}no" >&6 fi fi echo "$as_me:14159: checking if you want to use dmalloc for testing" >&5 echo $ECHO_N "checking if you want to use dmalloc for testing... $ECHO_C" >&6 # Check whether --with-dmalloc or --without-dmalloc was given. 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:14295: 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 14301 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:14305: \"$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:14311: \$? = $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:14330: 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:14334: 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 14342 "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 (); int main (void) { dmalloc_debug (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:14361: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:14364: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:14367: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:14370: \$? = $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:14381: 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:14532: 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 14538 "configure" #include "confdefs.h" #include _ACEOF if { (eval echo "$as_me:14542: \"$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:14548: \$? = $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:14567: 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:14571: 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 14579 "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 (); int main (void) { debug_malloc (); ; return 0; } _ACEOF rm -f "conftest.$ac_objext" "conftest$ac_exeext" if { (eval echo "$as_me:14598: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:14601: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:14604: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:14607: \$? = $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:14618: 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:14768: 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:14779: 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 # look for curses-related headers for ac_header in \ term_entry.h \ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:14801: 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 14807 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:14811: \"$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:14817: \$? = $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:14836: 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_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 14858 "configure" #include "confdefs.h" #include <$ac_header> _ACEOF if { (eval echo "$as_me:14862: \"$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:14868: \$? = $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:14887: 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 14911 "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:14942: \"$ac_link\"") >&5 (eval $ac_link) 2>&5 ac_status=$? echo "$as_me:14945: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest$ac_exeext"' { (eval echo "$as_me:14948: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:14951: \$? = $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:14961: 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 signal global datatype... $ECHO_C" >&6 if test "${cf_cv_sig_atomic_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else for cf_type in \ "volatile sig_atomic_t" \ "sig_atomic_t" \ "int" do cat >"conftest.$ac_ext" <<_ACEOF #line 14983 "configure" #include "confdefs.h" #include #include #include extern $cf_type x; $cf_type x; static void handler(int sig) { (void)sig; x = 5; } int main (void) { signal(SIGINT, handler); x = 1 ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:15007: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:15010: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:15013: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:15016: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_sig_atomic_t=$cf_type else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_sig_atomic_t=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" test "$cf_cv_sig_atomic_t" != no && break done fi echo "$as_me:15030: result: $cf_cv_sig_atomic_t" >&5 echo "${ECHO_T}$cf_cv_sig_atomic_t" >&6 test "$cf_cv_sig_atomic_t" != no && cat >>confdefs.h <&5 echo $ECHO_N "checking for termios type tcflag_t... $ECHO_C" >&6 if test "${cf_cv_havetype_tcflag_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 15044 "configure" #include "confdefs.h" #include int main (void) { tcflag_t x = 0; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:15057: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:15060: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:15063: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:15066: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_havetype_tcflag_t=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_havetype_tcflag_t=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:15077: result: $cf_cv_havetype_tcflag_t" >&5 echo "${ECHO_T}$cf_cv_havetype_tcflag_t" >&6 test "$cf_cv_havetype_tcflag_t" = no && cat >>confdefs.h <<\EOF #define tcflag_t unsigned long EOF echo "$as_me:15084: checking for termios type speed_t" >&5 echo $ECHO_N "checking for termios type speed_t... $ECHO_C" >&6 if test "${cf_cv_havetype_speed_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 15091 "configure" #include "confdefs.h" #include int main (void) { speed_t x = 0; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:15104: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:15107: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:15110: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:15113: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_havetype_speed_t=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_havetype_speed_t=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:15124: result: $cf_cv_havetype_speed_t" >&5 echo "${ECHO_T}$cf_cv_havetype_speed_t" >&6 test "$cf_cv_havetype_speed_t" = no && cat >>confdefs.h <<\EOF #define speed_t unsigned short EOF echo "$as_me:15131: checking for termios type cc_t" >&5 echo $ECHO_N "checking for termios type cc_t... $ECHO_C" >&6 if test "${cf_cv_havetype_cc_t+set}" = set; then echo $ECHO_N "(cached) $ECHO_C" >&6 else cat >"conftest.$ac_ext" <<_ACEOF #line 15138 "configure" #include "confdefs.h" #include int main (void) { cc_t x = 0; (void)x ; return 0; } _ACEOF rm -f "conftest.$ac_objext" if { (eval echo "$as_me:15151: \"$ac_compile\"") >&5 (eval $ac_compile) 2>&5 ac_status=$? echo "$as_me:15154: \$? = $ac_status" >&5 (exit "$ac_status"); } && { ac_try='test -s "conftest.$ac_objext"' { (eval echo "$as_me:15157: \"$ac_try\"") >&5 (eval $ac_try) 2>&5 ac_status=$? echo "$as_me:15160: \$? = $ac_status" >&5 (exit "$ac_status"); }; }; then cf_cv_havetype_cc_t=yes else echo "$as_me: failed program was:" >&5 cat "conftest.$ac_ext" >&5 cf_cv_havetype_cc_t=no fi rm -f "conftest.$ac_objext" "conftest.$ac_ext" fi echo "$as_me:15171: result: $cf_cv_havetype_cc_t" >&5 echo "${ECHO_T}$cf_cv_havetype_cc_t" >&6 test "$cf_cv_havetype_cc_t" = no && cat >>confdefs.h <<\EOF #define cc_t unsigned char EOF # Extract the first word of "groff", so it can be a program name with args. set dummy groff; ac_word=$2 echo "$as_me:15180: 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:15197: 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:15209: result: $GROFF_PATH" >&5 echo "${ECHO_T}$GROFF_PATH" >&6 else echo "$as_me:15212: 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:15220: 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:15237: 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:15248: result: $NROFF_PATH" >&5 echo "${ECHO_T}$NROFF_PATH" >&6 else echo "$as_me:15251: 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:15261: 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:15278: 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:15290: result: $TBL_PATH" >&5 echo "${ECHO_T}$TBL_PATH" >&6 else echo "$as_me:15293: 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:15313: 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:15330: 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:15342: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else echo "$as_me:15345: result: no" >&5 echo "${ECHO_T}no" >&6 fi case "x$cf_man2html" in (x/*) echo "$as_me:15351: 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:15360: result: $cf_man2html_ok" >&5 echo "${ECHO_T}$cf_man2html_ok" >&6 ;; (*) cf_man2html=no ;; esac esac echo "$as_me:15369: 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:15384: 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:15388: 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:15405: 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:15417: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 else echo "$as_me:15420: result: no" >&5 echo "${ECHO_T}no" >&6 fi ;; (no|groff|*/groff*) cf_with_groff=yes cf_man2html=$GROFF_PATH echo "$as_me:15428: result: $cf_man2html" >&5 echo "${ECHO_T}$cf_man2html" >&6 ;; (*) echo "$as_me:15432: 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:15478: 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 ".$cf_man2html" in (.\$\(*\)*|.\'*\'*) ;; (..|./*|.\\*) ;; (.[a-zA-Z]:[\\/]*) # OS/2 EMX ;; (.\$\{*prefix\}*|.\$\{*dir\}*) eval cf_man2html="$cf_man2html" case ".$cf_man2html" in (.NONE/*) cf_man2html=`echo "$cf_man2html" | sed -e s%NONE%$cf_path_syntax%` ;; esac ;; (.no|.NONE/*) cf_man2html=`echo "$cf_man2html" | sed -e s%NONE%$cf_path_syntax%` ;; (*) { { echo "$as_me:15509: 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:15516: 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:15534: result: $cf_man2html_top_bot" >&5 echo "${ECHO_T}$cf_man2html_top_bot" >&6 echo "$as_me:15537: 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:15562: result: $cf_man2html_page" >&5 echo "${ECHO_T}$cf_man2html_page" >&6 cat >>$MAN2HTML_TEMP <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 overriden 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:15762: 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:15943: 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:15962: 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.20230114, 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" ;; "ncurses_cfg.h" ) CONFIG_HEADERS="$CONFIG_HEADERS ncurses_cfg.h:ncurses_tst.hin" ;; *) { { echo "$as_me:16000: 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,@SET_MAKE@,$SET_MAKE,;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,@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,@FGREP@,$FGREP,;t t s,@cf_cv_makeflags@,$cf_cv_makeflags,;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,@RANLIB@,$RANLIB,;t t s,@ac_ct_RANLIB@,$ac_ct_RANLIB,;t t s,@LD@,$LD,;t t s,@ac_ct_LD@,$ac_ct_LD,;t t s,@AR@,$AR,;t t s,@ac_ct_AR@,$ac_ct_AR,;t t s,@NM@,$NM,;t t s,@ac_ct_NM@,$ac_ct_NM,;t t s,@ARFLAGS@,$ARFLAGS,;t t s,@CC_G_OPT@,$CC_G_OPT,;t t s,@CC_SHARED_OPTS@,$CC_SHARED_OPTS,;t t s,@DESTDIR@,$DESTDIR,;t t s,@DFT_DEP_SUFFIX@,$DFT_DEP_SUFFIX,;t t s,@DFT_OBJ_SUBDIR@,$DFT_OBJ_SUBDIR,;t t s,@DFT_LWR_MODEL@,$DFT_LWR_MODEL,;t t s,@DFT_UPR_MODEL@,$DFT_UPR_MODEL,;t t s,@EXTRA_LDFLAGS@,$EXTRA_LDFLAGS,;t t s,@LDFLAGS_SHARED@,$LDFLAGS_SHARED,;t t s,@LD_MODEL@,$LD_MODEL,;t t s,@LD_SHARED_OPTS@,$LD_SHARED_OPTS,;t t s,@LIBTOOL@,$LIBTOOL,;t t s,@LIB_CLEAN@,$LIB_CLEAN,;t t s,@LIB_COMPILE@,$LIB_COMPILE,;t t s,@LIB_INSTALL@,$LIB_INSTALL,;t t s,@LIB_LINK@,$LIB_LINK,;t t s,@LIB_SUFFIX@,$LIB_SUFFIX,;t t s,@LIB_UNINSTALL@,$LIB_UNINSTALL,;t t s,@LINK_PROGS@,$LINK_PROGS,;t t s,@LOCAL_LDFLAGS@,$LOCAL_LDFLAGS,;t t s,@TINFO_LDFLAGS@,$TINFO_LDFLAGS,;t t s,@TINFO_LIBS@,$TINFO_LIBS,;t t s,@cf_cv_abi_version@,$cf_cv_abi_version,;t t s,@cf_cv_rel_version@,$cf_cv_rel_version,;t t s,@NCURSES_TREE@,$NCURSES_TREE,;t t s,@top_builddir@,$top_builddir,;t t s,@LIB_PREFIX@,$LIB_PREFIX,;t t s,@EXTRA_CPPFLAGS@,$EXTRA_CPPFLAGS,;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,@ECHO_LINK@,$ECHO_LINK,;t t s,@EXTRA_CFLAGS@,$EXTRA_CFLAGS,;t t s,@HAVE_STDNORETURN_H@,$HAVE_STDNORETURN_H,;t t s,@STDC_NORETURN@,$STDC_NORETURN,;t t s,@BROKEN_LINKER@,$BROKEN_LINKER,;t t s,@PKG_CONFIG@,$PKG_CONFIG,;t t s,@ac_pt_PKG_CONFIG@,$ac_pt_PKG_CONFIG,;t t s,@NCURSES_CONFIG@,$NCURSES_CONFIG,;t t s,@ac_ct_NCURSES_CONFIG@,$ac_ct_NCURSES_CONFIG,;t t s,@cf_cv_screen@,$cf_cv_screen,;t t s,@cf_ldd_prog@,$cf_ldd_prog,;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 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' && cat "$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 >"$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:16311: 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:16329: 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:16342: 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:16358: 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:16367: 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 : "${FGREP:=grep -F}" : "${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:16412: 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:16423: 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:16472: 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:16483: 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:16496: 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'. set |${FGREP-fgrep} _CC= |sed -e s%=%=\'% -e s%\$%\'% -e s%\'\'%\'%g -e s%=\'\$%=\'\'% >>$CONFIG_STATUS 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:16555: $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 # # CONFIG_COMMANDS section. # for ac_file in : $CONFIG_COMMANDS; do test "x$ac_file" = x: && continue ac_dest=`echo "$ac_file" | sed 's,:.*,,'` ac_source=`echo "$ac_file" | sed 's,[^:]*:,,'` case "$ac_dest" in default ) cat >>Makefile <>Makefile <>"$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 # vi:ts=4 sw=4 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}.1.ps : ${GROFF_NOTE} \$(SHELL) -c "tbl \$*.1 | groff -man" >\$@ ${GROFF_NOTE} ${GROFF_NOTE}.1.txt : ${GROFF_NOTE} GROFF_NO_SGR=stupid \$(SHELL) -c "tbl \$*.1 | nroff -rHY=0 -Tascii -man | col -bx" >\$@ ${MAN2HTML_NOTE}.1.html : ${MAN2HTML_NOTE} ./${MAN2HTML_TEMP} \$* 1 man >\$@ CF_EOF cf_make_docs=1 fi for cf_name in tack do cat >>$cf_output < MODULE_ID("$Id: scan.c,v 1.17 2020/02/02 15:30:33 tom Exp $") size_t scan_max; /* length of longest scan code */ char **scan_up, **scan_down, **scan_name; size_t *scan_tested, *scan_length; static unsigned *scan_value; static unsigned shift_state; static int debug_char_count; #define SHIFT_KEY 0x100 #define CONTROL_KEY 0x200 #define META_KEY 0x400 #define CAPS_LOCK 0x800 int scan_key(void) { /* read a key and translate scan mode to ASCII */ unsigned i; char buf[64]; for (i = 1;; i++) { int j; int ch = getchar(); if (ch == EOF) return EOF; if (debug_fp) { fprintf(debug_fp, "%02X ", ch); debug_char_count += 3; if (debug_char_count > 72) { fprintf(debug_fp, "\n"); debug_char_count = 0; } } buf[i - 1] = (char) ch; buf[i] = '\0'; if (buf[0] & 0x80) { /* scan up */ for (j = 0; scan_up[j]; j++) { if (i == scan_length[j] && !strcmp(buf, scan_up[j])) { i = 0; shift_state &= ~scan_value[j]; break; } } continue; } for (j = 0; scan_down[j]; j++) { if (i == scan_length[j] && !strcmp(buf, scan_down[j])) { i = 0; shift_state |= scan_value[j]; ch = (int) scan_value[j]; if (ch == CAPS_LOCK) shift_state ^= SHIFT_KEY; if (ch >= 256) break; if (shift_state & SHIFT_KEY) { if (ch >= 0x60) ch -= 0x20; else if (ch >= 0x30 && ch <= 0x3f) ch -= 0x10; } if (shift_state & CONTROL_KEY) { if ((ch | 0x20) >= 0x60 && (ch | 0x20) <= 0x7f) ch = (ch | 0x20) - 0x60; } if (shift_state & META_KEY) ch |= 0x80; return ch; } } if (i > scan_max) i = 1; } }